@m3e/core 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/a11y.js CHANGED
@@ -18,33 +18,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
18
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
19
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
20
  PERFORMANCE OF THIS SOFTWARE.
21
- ***************************************************************************** */
22
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
-
24
-
25
- function __decorate(decorators, target, key, desc) {
26
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
27
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
28
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
29
- return c > 3 && r && Object.defineProperty(target, key, r), r;
30
- }
31
-
32
- function __classPrivateFieldGet(receiver, state, kind, f) {
33
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
34
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
35
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
36
- }
37
-
38
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
39
- if (kind === "m") throw new TypeError("Private method is not writable");
40
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
41
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
42
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
43
- }
44
-
45
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
46
- var e = new Error(message);
47
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
21
+ ***************************************************************************** */
22
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
+
24
+ function __decorate(decorators, target, key, desc) {
25
+ var c = arguments.length,
26
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
27
+ d;
28
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
29
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
30
+ }
31
+ function __classPrivateFieldGet(receiver, state, kind, f) {
32
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
33
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
34
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
+ }
36
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
37
+ if (kind === "m") throw new TypeError("Private method is not writable");
38
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
39
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
40
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
41
+ }
42
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
43
+ var e = new Error(message);
44
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
48
45
  };
49
46
 
50
47
  /** The modifier keys. */
@@ -53,120 +50,120 @@ const ModifierKeys = ["alt", "shift", "ctrl", "meta"];
53
50
  /** Specifies known key code values. */
54
51
  var KeyCode;
55
52
  (function (KeyCode) {
56
- KeyCode[KeyCode["Backspace"] = 8] = "Backspace";
57
- KeyCode[KeyCode["Tab"] = 9] = "Tab";
58
- KeyCode[KeyCode["Enter"] = 13] = "Enter";
59
- KeyCode[KeyCode["Shift"] = 16] = "Shift";
60
- KeyCode[KeyCode["Ctrl"] = 17] = "Ctrl";
61
- KeyCode[KeyCode["Alt"] = 18] = "Alt";
62
- KeyCode[KeyCode["PauseBreak"] = 19] = "PauseBreak";
63
- KeyCode[KeyCode["CapsLock"] = 20] = "CapsLock";
64
- KeyCode[KeyCode["Escape"] = 27] = "Escape";
65
- KeyCode[KeyCode["Space"] = 32] = "Space";
66
- KeyCode[KeyCode["PageUp"] = 33] = "PageUp";
67
- KeyCode[KeyCode["PageDown"] = 34] = "PageDown";
68
- KeyCode[KeyCode["End"] = 35] = "End";
69
- KeyCode[KeyCode["Home"] = 36] = "Home";
70
- KeyCode[KeyCode["LeftArrow"] = 37] = "LeftArrow";
71
- KeyCode[KeyCode["UpArrow"] = 38] = "UpArrow";
72
- KeyCode[KeyCode["RightArrow"] = 39] = "RightArrow";
73
- KeyCode[KeyCode["DownArrow"] = 40] = "DownArrow";
74
- KeyCode[KeyCode["Insert"] = 45] = "Insert";
75
- KeyCode[KeyCode["Delete"] = 46] = "Delete";
76
- KeyCode[KeyCode["Zero"] = 48] = "Zero";
77
- KeyCode[KeyCode["ClosedParen"] = 48] = "ClosedParen";
78
- KeyCode[KeyCode["One"] = 49] = "One";
79
- KeyCode[KeyCode["ExclamationMark"] = 49] = "ExclamationMark";
80
- KeyCode[KeyCode["Two"] = 50] = "Two";
81
- KeyCode[KeyCode["AtSign"] = 50] = "AtSign";
82
- KeyCode[KeyCode["Three"] = 51] = "Three";
83
- KeyCode[KeyCode["PoundSign"] = 51] = "PoundSign";
84
- KeyCode[KeyCode["Hash"] = 51] = "Hash";
85
- KeyCode[KeyCode["Four"] = 52] = "Four";
86
- KeyCode[KeyCode["DollarSign"] = 52] = "DollarSign";
87
- KeyCode[KeyCode["Five"] = 53] = "Five";
88
- KeyCode[KeyCode["PercentSign"] = 53] = "PercentSign";
89
- KeyCode[KeyCode["Six"] = 54] = "Six";
90
- KeyCode[KeyCode["Caret"] = 54] = "Caret";
91
- KeyCode[KeyCode["Hat"] = 54] = "Hat";
92
- KeyCode[KeyCode["Seven"] = 55] = "Seven";
93
- KeyCode[KeyCode["Ampersand"] = 55] = "Ampersand";
94
- KeyCode[KeyCode["Eight"] = 56] = "Eight";
95
- KeyCode[KeyCode["Star"] = 56] = "Star";
96
- KeyCode[KeyCode["Asterik"] = 56] = "Asterik";
97
- KeyCode[KeyCode["Nine"] = 57] = "Nine";
98
- KeyCode[KeyCode["OpenParen"] = 57] = "OpenParen";
99
- KeyCode[KeyCode["A"] = 65] = "A";
100
- KeyCode[KeyCode["B"] = 66] = "B";
101
- KeyCode[KeyCode["C"] = 67] = "C";
102
- KeyCode[KeyCode["D"] = 68] = "D";
103
- KeyCode[KeyCode["E"] = 69] = "E";
104
- KeyCode[KeyCode["F"] = 70] = "F";
105
- KeyCode[KeyCode["G"] = 71] = "G";
106
- KeyCode[KeyCode["H"] = 72] = "H";
107
- KeyCode[KeyCode["I"] = 73] = "I";
108
- KeyCode[KeyCode["J"] = 74] = "J";
109
- KeyCode[KeyCode["K"] = 75] = "K";
110
- KeyCode[KeyCode["L"] = 76] = "L";
111
- KeyCode[KeyCode["M"] = 77] = "M";
112
- KeyCode[KeyCode["N"] = 78] = "N";
113
- KeyCode[KeyCode["O"] = 79] = "O";
114
- KeyCode[KeyCode["P"] = 80] = "P";
115
- KeyCode[KeyCode["Q"] = 81] = "Q";
116
- KeyCode[KeyCode["R"] = 82] = "R";
117
- KeyCode[KeyCode["S"] = 83] = "S";
118
- KeyCode[KeyCode["T"] = 84] = "T";
119
- KeyCode[KeyCode["U"] = 85] = "U";
120
- KeyCode[KeyCode["V"] = 86] = "V";
121
- KeyCode[KeyCode["W"] = 87] = "W";
122
- KeyCode[KeyCode["X"] = 88] = "X";
123
- KeyCode[KeyCode["Y"] = 89] = "Y";
124
- KeyCode[KeyCode["Z"] = 90] = "Z";
125
- KeyCode[KeyCode["LeftWindowKey"] = 91] = "LeftWindowKey";
126
- KeyCode[KeyCode["RightWindowKey"] = 92] = "RightWindowKey";
127
- KeyCode[KeyCode["SelectKey"] = 93] = "SelectKey";
128
- KeyCode[KeyCode["Numpad0"] = 96] = "Numpad0";
129
- KeyCode[KeyCode["Numpad1"] = 97] = "Numpad1";
130
- KeyCode[KeyCode["Numpad2"] = 98] = "Numpad2";
131
- KeyCode[KeyCode["Numpad3"] = 99] = "Numpad3";
132
- KeyCode[KeyCode["Numpad4"] = 100] = "Numpad4";
133
- KeyCode[KeyCode["Numpad5"] = 101] = "Numpad5";
134
- KeyCode[KeyCode["Numpad6"] = 102] = "Numpad6";
135
- KeyCode[KeyCode["Numpad7"] = 103] = "Numpad7";
136
- KeyCode[KeyCode["Numpad8"] = 104] = "Numpad8";
137
- KeyCode[KeyCode["Numpad9"] = 105] = "Numpad9";
138
- KeyCode[KeyCode["Multiply"] = 106] = "Multiply";
139
- KeyCode[KeyCode["Add"] = 107] = "Add";
140
- KeyCode[KeyCode["Subtract"] = 109] = "Subtract";
141
- KeyCode[KeyCode["DecimalPoint"] = 110] = "DecimalPoint";
142
- KeyCode[KeyCode["Divide"] = 111] = "Divide";
143
- KeyCode[KeyCode["F1"] = 112] = "F1";
144
- KeyCode[KeyCode["F2"] = 113] = "F2";
145
- KeyCode[KeyCode["F3"] = 114] = "F3";
146
- KeyCode[KeyCode["F4"] = 115] = "F4";
147
- KeyCode[KeyCode["F5"] = 116] = "F5";
148
- KeyCode[KeyCode["F6"] = 117] = "F6";
149
- KeyCode[KeyCode["F7"] = 118] = "F7";
150
- KeyCode[KeyCode["F8"] = 119] = "F8";
151
- KeyCode[KeyCode["F9"] = 120] = "F9";
152
- KeyCode[KeyCode["F10"] = 121] = "F10";
153
- KeyCode[KeyCode["F11"] = 122] = "F11";
154
- KeyCode[KeyCode["F12"] = 123] = "F12";
155
- KeyCode[KeyCode["NumLock"] = 144] = "NumLock";
156
- KeyCode[KeyCode["ScrollLock"] = 145] = "ScrollLock";
157
- KeyCode[KeyCode["SemiColon"] = 186] = "SemiColon";
158
- KeyCode[KeyCode["Equals"] = 187] = "Equals";
159
- KeyCode[KeyCode["Comma"] = 188] = "Comma";
160
- KeyCode[KeyCode["Dash"] = 189] = "Dash";
161
- KeyCode[KeyCode["Period"] = 190] = "Period";
162
- KeyCode[KeyCode["UnderScore"] = 189] = "UnderScore";
163
- KeyCode[KeyCode["PlusSign"] = 187] = "PlusSign";
164
- KeyCode[KeyCode["ForwardSlash"] = 191] = "ForwardSlash";
165
- KeyCode[KeyCode["Tilde"] = 192] = "Tilde";
166
- KeyCode[KeyCode["GraveAccent"] = 192] = "GraveAccent";
167
- KeyCode[KeyCode["OpenBracket"] = 219] = "OpenBracket";
168
- KeyCode[KeyCode["ClosedBracket"] = 221] = "ClosedBracket";
169
- KeyCode[KeyCode["Quote"] = 222] = "Quote";
53
+ KeyCode[KeyCode["Backspace"] = 8] = "Backspace";
54
+ KeyCode[KeyCode["Tab"] = 9] = "Tab";
55
+ KeyCode[KeyCode["Enter"] = 13] = "Enter";
56
+ KeyCode[KeyCode["Shift"] = 16] = "Shift";
57
+ KeyCode[KeyCode["Ctrl"] = 17] = "Ctrl";
58
+ KeyCode[KeyCode["Alt"] = 18] = "Alt";
59
+ KeyCode[KeyCode["PauseBreak"] = 19] = "PauseBreak";
60
+ KeyCode[KeyCode["CapsLock"] = 20] = "CapsLock";
61
+ KeyCode[KeyCode["Escape"] = 27] = "Escape";
62
+ KeyCode[KeyCode["Space"] = 32] = "Space";
63
+ KeyCode[KeyCode["PageUp"] = 33] = "PageUp";
64
+ KeyCode[KeyCode["PageDown"] = 34] = "PageDown";
65
+ KeyCode[KeyCode["End"] = 35] = "End";
66
+ KeyCode[KeyCode["Home"] = 36] = "Home";
67
+ KeyCode[KeyCode["LeftArrow"] = 37] = "LeftArrow";
68
+ KeyCode[KeyCode["UpArrow"] = 38] = "UpArrow";
69
+ KeyCode[KeyCode["RightArrow"] = 39] = "RightArrow";
70
+ KeyCode[KeyCode["DownArrow"] = 40] = "DownArrow";
71
+ KeyCode[KeyCode["Insert"] = 45] = "Insert";
72
+ KeyCode[KeyCode["Delete"] = 46] = "Delete";
73
+ KeyCode[KeyCode["Zero"] = 48] = "Zero";
74
+ KeyCode[KeyCode["ClosedParen"] = 48] = "ClosedParen";
75
+ KeyCode[KeyCode["One"] = 49] = "One";
76
+ KeyCode[KeyCode["ExclamationMark"] = 49] = "ExclamationMark";
77
+ KeyCode[KeyCode["Two"] = 50] = "Two";
78
+ KeyCode[KeyCode["AtSign"] = 50] = "AtSign";
79
+ KeyCode[KeyCode["Three"] = 51] = "Three";
80
+ KeyCode[KeyCode["PoundSign"] = 51] = "PoundSign";
81
+ KeyCode[KeyCode["Hash"] = 51] = "Hash";
82
+ KeyCode[KeyCode["Four"] = 52] = "Four";
83
+ KeyCode[KeyCode["DollarSign"] = 52] = "DollarSign";
84
+ KeyCode[KeyCode["Five"] = 53] = "Five";
85
+ KeyCode[KeyCode["PercentSign"] = 53] = "PercentSign";
86
+ KeyCode[KeyCode["Six"] = 54] = "Six";
87
+ KeyCode[KeyCode["Caret"] = 54] = "Caret";
88
+ KeyCode[KeyCode["Hat"] = 54] = "Hat";
89
+ KeyCode[KeyCode["Seven"] = 55] = "Seven";
90
+ KeyCode[KeyCode["Ampersand"] = 55] = "Ampersand";
91
+ KeyCode[KeyCode["Eight"] = 56] = "Eight";
92
+ KeyCode[KeyCode["Star"] = 56] = "Star";
93
+ KeyCode[KeyCode["Asterik"] = 56] = "Asterik";
94
+ KeyCode[KeyCode["Nine"] = 57] = "Nine";
95
+ KeyCode[KeyCode["OpenParen"] = 57] = "OpenParen";
96
+ KeyCode[KeyCode["A"] = 65] = "A";
97
+ KeyCode[KeyCode["B"] = 66] = "B";
98
+ KeyCode[KeyCode["C"] = 67] = "C";
99
+ KeyCode[KeyCode["D"] = 68] = "D";
100
+ KeyCode[KeyCode["E"] = 69] = "E";
101
+ KeyCode[KeyCode["F"] = 70] = "F";
102
+ KeyCode[KeyCode["G"] = 71] = "G";
103
+ KeyCode[KeyCode["H"] = 72] = "H";
104
+ KeyCode[KeyCode["I"] = 73] = "I";
105
+ KeyCode[KeyCode["J"] = 74] = "J";
106
+ KeyCode[KeyCode["K"] = 75] = "K";
107
+ KeyCode[KeyCode["L"] = 76] = "L";
108
+ KeyCode[KeyCode["M"] = 77] = "M";
109
+ KeyCode[KeyCode["N"] = 78] = "N";
110
+ KeyCode[KeyCode["O"] = 79] = "O";
111
+ KeyCode[KeyCode["P"] = 80] = "P";
112
+ KeyCode[KeyCode["Q"] = 81] = "Q";
113
+ KeyCode[KeyCode["R"] = 82] = "R";
114
+ KeyCode[KeyCode["S"] = 83] = "S";
115
+ KeyCode[KeyCode["T"] = 84] = "T";
116
+ KeyCode[KeyCode["U"] = 85] = "U";
117
+ KeyCode[KeyCode["V"] = 86] = "V";
118
+ KeyCode[KeyCode["W"] = 87] = "W";
119
+ KeyCode[KeyCode["X"] = 88] = "X";
120
+ KeyCode[KeyCode["Y"] = 89] = "Y";
121
+ KeyCode[KeyCode["Z"] = 90] = "Z";
122
+ KeyCode[KeyCode["LeftWindowKey"] = 91] = "LeftWindowKey";
123
+ KeyCode[KeyCode["RightWindowKey"] = 92] = "RightWindowKey";
124
+ KeyCode[KeyCode["SelectKey"] = 93] = "SelectKey";
125
+ KeyCode[KeyCode["Numpad0"] = 96] = "Numpad0";
126
+ KeyCode[KeyCode["Numpad1"] = 97] = "Numpad1";
127
+ KeyCode[KeyCode["Numpad2"] = 98] = "Numpad2";
128
+ KeyCode[KeyCode["Numpad3"] = 99] = "Numpad3";
129
+ KeyCode[KeyCode["Numpad4"] = 100] = "Numpad4";
130
+ KeyCode[KeyCode["Numpad5"] = 101] = "Numpad5";
131
+ KeyCode[KeyCode["Numpad6"] = 102] = "Numpad6";
132
+ KeyCode[KeyCode["Numpad7"] = 103] = "Numpad7";
133
+ KeyCode[KeyCode["Numpad8"] = 104] = "Numpad8";
134
+ KeyCode[KeyCode["Numpad9"] = 105] = "Numpad9";
135
+ KeyCode[KeyCode["Multiply"] = 106] = "Multiply";
136
+ KeyCode[KeyCode["Add"] = 107] = "Add";
137
+ KeyCode[KeyCode["Subtract"] = 109] = "Subtract";
138
+ KeyCode[KeyCode["DecimalPoint"] = 110] = "DecimalPoint";
139
+ KeyCode[KeyCode["Divide"] = 111] = "Divide";
140
+ KeyCode[KeyCode["F1"] = 112] = "F1";
141
+ KeyCode[KeyCode["F2"] = 113] = "F2";
142
+ KeyCode[KeyCode["F3"] = 114] = "F3";
143
+ KeyCode[KeyCode["F4"] = 115] = "F4";
144
+ KeyCode[KeyCode["F5"] = 116] = "F5";
145
+ KeyCode[KeyCode["F6"] = 117] = "F6";
146
+ KeyCode[KeyCode["F7"] = 118] = "F7";
147
+ KeyCode[KeyCode["F8"] = 119] = "F8";
148
+ KeyCode[KeyCode["F9"] = 120] = "F9";
149
+ KeyCode[KeyCode["F10"] = 121] = "F10";
150
+ KeyCode[KeyCode["F11"] = 122] = "F11";
151
+ KeyCode[KeyCode["F12"] = 123] = "F12";
152
+ KeyCode[KeyCode["NumLock"] = 144] = "NumLock";
153
+ KeyCode[KeyCode["ScrollLock"] = 145] = "ScrollLock";
154
+ KeyCode[KeyCode["SemiColon"] = 186] = "SemiColon";
155
+ KeyCode[KeyCode["Equals"] = 187] = "Equals";
156
+ KeyCode[KeyCode["Comma"] = 188] = "Comma";
157
+ KeyCode[KeyCode["Dash"] = 189] = "Dash";
158
+ KeyCode[KeyCode["Period"] = 190] = "Period";
159
+ KeyCode[KeyCode["UnderScore"] = 189] = "UnderScore";
160
+ KeyCode[KeyCode["PlusSign"] = 187] = "PlusSign";
161
+ KeyCode[KeyCode["ForwardSlash"] = 191] = "ForwardSlash";
162
+ KeyCode[KeyCode["Tilde"] = 192] = "Tilde";
163
+ KeyCode[KeyCode["GraveAccent"] = 192] = "GraveAccent";
164
+ KeyCode[KeyCode["OpenBracket"] = 219] = "OpenBracket";
165
+ KeyCode[KeyCode["ClosedBracket"] = 221] = "ClosedBracket";
166
+ KeyCode[KeyCode["Quote"] = 222] = "Quote";
170
167
  })(KeyCode || (KeyCode = {}));
171
168
 
172
169
  /**
@@ -175,7 +172,7 @@ var KeyCode;
175
172
  * @returns {number} The key code for `e`.
176
173
  */
177
174
  function getKeyCode(e) {
178
- return e.which || e.charCode || e.keyCode;
175
+ return e.which || e.charCode || e.keyCode;
179
176
  }
180
177
 
181
178
  /**
@@ -185,7 +182,7 @@ function getKeyCode(e) {
185
182
  * @returns {boolean} A value indicating whether a modifier key is pressed.
186
183
  */
187
184
  function hasModifierKey(e, ...modifiers) {
188
- return modifiers.length ? modifiers.some((x) => e[`${x}Key`]) : e.altKey || e.shiftKey || e.ctrlKey || e.metaKey;
185
+ return modifiers.length ? modifiers.some(x => e[`${x}Key`]) : e.altKey || e.shiftKey || e.ctrlKey || e.metaKey;
189
186
  }
190
187
 
191
188
  /**
@@ -195,7 +192,7 @@ function hasModifierKey(e, ...modifiers) {
195
192
  * @returns {boolean} A value indicating whether `modifiers` are allowed.
196
193
  */
197
194
  function isModifierAllowed(e, ...modifiers) {
198
- return ModifierKeys.every((x) => !hasModifierKey(e, x) || modifiers.includes(x));
195
+ return ModifierKeys.every(x => !hasModifierKey(e, x) || modifiers.includes(x));
199
196
  }
200
197
 
201
198
  /**
@@ -203,39 +200,395 @@ function isModifierAllowed(e, ...modifiers) {
203
200
  * Copyright 2017 Google LLC
204
201
  * SPDX-License-Identifier: BSD-3-Clause
205
202
  */
206
- const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
203
+ const t$1 = t => (e, o) => {
204
+ void 0 !== o ? o.addInitializer(() => {
205
+ customElements.define(t, e);
206
+ }) : customElements.define(t, e);
207
+ };
207
208
 
208
209
  /**
209
210
  * @license
210
211
  * Copyright 2019 Google LLC
211
212
  * SPDX-License-Identifier: BSD-3-Clause
212
213
  */
213
- const t=globalThis,e$3=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$3&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s),S=(s,o)=>{if(e$3)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$1=e$3?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
214
+ const t = globalThis,
215
+ e$3 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
216
+ s = Symbol(),
217
+ o$2 = new WeakMap();
218
+ let n$2 = class n {
219
+ constructor(t, e, o) {
220
+ if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
221
+ this.cssText = t, this.t = e;
222
+ }
223
+ get styleSheet() {
224
+ let t = this.o;
225
+ const s = this.t;
226
+ if (e$3 && void 0 === t) {
227
+ const e = void 0 !== s && 1 === s.length;
228
+ e && (t = o$2.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$2.set(s, t));
229
+ }
230
+ return t;
231
+ }
232
+ toString() {
233
+ return this.cssText;
234
+ }
235
+ };
236
+ const r$2 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
237
+ S = (s, o) => {
238
+ if (e$3) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
239
+ const o = document.createElement("style"),
240
+ n = t.litNonce;
241
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
242
+ }
243
+ },
244
+ c$1 = e$3 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
245
+ let e = "";
246
+ for (const s of t.cssRules) e += s.cssText;
247
+ return r$2(e);
248
+ })(t) : t;
214
249
 
215
250
  /**
216
251
  * @license
217
252
  * Copyright 2017 Google LLC
218
253
  * SPDX-License-Identifier: BSD-3-Clause
219
- */const{is:i,defineProperty:e$2,getOwnPropertyDescriptor:h,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f=(t,s)=>!i(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$2(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$1(t),...o$1(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$1(s));}else void 0!==s&&i.push(c$1(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
254
+ */
255
+ const {
256
+ is: i,
257
+ defineProperty: e$2,
258
+ getOwnPropertyDescriptor: h,
259
+ getOwnPropertyNames: r$1,
260
+ getOwnPropertySymbols: o$1,
261
+ getPrototypeOf: n$1
262
+ } = Object,
263
+ a = globalThis,
264
+ c = a.trustedTypes,
265
+ l = c ? c.emptyScript : "",
266
+ p = a.reactiveElementPolyfillSupport,
267
+ d = (t, s) => t,
268
+ u = {
269
+ toAttribute(t, s) {
270
+ switch (s) {
271
+ case Boolean:
272
+ t = t ? l : null;
273
+ break;
274
+ case Object:
275
+ case Array:
276
+ t = null == t ? t : JSON.stringify(t);
277
+ }
278
+ return t;
279
+ },
280
+ fromAttribute(t, s) {
281
+ let i = t;
282
+ switch (s) {
283
+ case Boolean:
284
+ i = null !== t;
285
+ break;
286
+ case Number:
287
+ i = null === t ? null : Number(t);
288
+ break;
289
+ case Object:
290
+ case Array:
291
+ try {
292
+ i = JSON.parse(t);
293
+ } catch (t) {
294
+ i = null;
295
+ }
296
+ }
297
+ return i;
298
+ }
299
+ },
300
+ f = (t, s) => !i(t, s),
301
+ b = {
302
+ attribute: true,
303
+ type: String,
304
+ converter: u,
305
+ reflect: false,
306
+ useDefault: false,
307
+ hasChanged: f
308
+ };
309
+ Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
310
+ class y extends HTMLElement {
311
+ static addInitializer(t) {
312
+ this._$Ei(), (this.l ??= []).push(t);
313
+ }
314
+ static get observedAttributes() {
315
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
316
+ }
317
+ static createProperty(t, s = b) {
318
+ if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
319
+ const i = Symbol(),
320
+ h = this.getPropertyDescriptor(t, i, s);
321
+ void 0 !== h && e$2(this.prototype, t, h);
322
+ }
323
+ }
324
+ static getPropertyDescriptor(t, s, i) {
325
+ const {
326
+ get: e,
327
+ set: r
328
+ } = h(this.prototype, t) ?? {
329
+ get() {
330
+ return this[s];
331
+ },
332
+ set(t) {
333
+ this[s] = t;
334
+ }
335
+ };
336
+ return {
337
+ get: e,
338
+ set(s) {
339
+ const h = e?.call(this);
340
+ r?.call(this, s), this.requestUpdate(t, h, i);
341
+ },
342
+ configurable: true,
343
+ enumerable: true
344
+ };
345
+ }
346
+ static getPropertyOptions(t) {
347
+ return this.elementProperties.get(t) ?? b;
348
+ }
349
+ static _$Ei() {
350
+ if (this.hasOwnProperty(d("elementProperties"))) return;
351
+ const t = n$1(this);
352
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
353
+ }
354
+ static finalize() {
355
+ if (this.hasOwnProperty(d("finalized"))) return;
356
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
357
+ const t = this.properties,
358
+ s = [...r$1(t), ...o$1(t)];
359
+ for (const i of s) this.createProperty(i, t[i]);
360
+ }
361
+ const t = this[Symbol.metadata];
362
+ if (null !== t) {
363
+ const s = litPropertyMetadata.get(t);
364
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
365
+ }
366
+ this._$Eh = new Map();
367
+ for (const [t, s] of this.elementProperties) {
368
+ const i = this._$Eu(t, s);
369
+ void 0 !== i && this._$Eh.set(i, t);
370
+ }
371
+ this.elementStyles = this.finalizeStyles(this.styles);
372
+ }
373
+ static finalizeStyles(s) {
374
+ const i = [];
375
+ if (Array.isArray(s)) {
376
+ const e = new Set(s.flat(1 / 0).reverse());
377
+ for (const s of e) i.unshift(c$1(s));
378
+ } else void 0 !== s && i.push(c$1(s));
379
+ return i;
380
+ }
381
+ static _$Eu(t, s) {
382
+ const i = s.attribute;
383
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
384
+ }
385
+ constructor() {
386
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
387
+ }
388
+ _$Ev() {
389
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
390
+ }
391
+ addController(t) {
392
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
393
+ }
394
+ removeController(t) {
395
+ this._$EO?.delete(t);
396
+ }
397
+ _$E_() {
398
+ const t = new Map(),
399
+ s = this.constructor.elementProperties;
400
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
401
+ t.size > 0 && (this._$Ep = t);
402
+ }
403
+ createRenderRoot() {
404
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
405
+ return S(t, this.constructor.elementStyles), t;
406
+ }
407
+ connectedCallback() {
408
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
409
+ }
410
+ enableUpdating(t) {}
411
+ disconnectedCallback() {
412
+ this._$EO?.forEach(t => t.hostDisconnected?.());
413
+ }
414
+ attributeChangedCallback(t, s, i) {
415
+ this._$AK(t, i);
416
+ }
417
+ _$ET(t, s) {
418
+ const i = this.constructor.elementProperties.get(t),
419
+ e = this.constructor._$Eu(t, i);
420
+ if (void 0 !== e && true === i.reflect) {
421
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
422
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
423
+ }
424
+ }
425
+ _$AK(t, s) {
426
+ const i = this.constructor,
427
+ e = i._$Eh.get(t);
428
+ if (void 0 !== e && this._$Em !== e) {
429
+ const t = i.getPropertyOptions(e),
430
+ h = "function" == typeof t.converter ? {
431
+ fromAttribute: t.converter
432
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u;
433
+ this._$Em = e;
434
+ const r = h.fromAttribute(s, t.type);
435
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
436
+ }
437
+ }
438
+ requestUpdate(t, s, i) {
439
+ if (void 0 !== t) {
440
+ const e = this.constructor,
441
+ h = this[t];
442
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
443
+ this.C(t, s, i);
444
+ }
445
+ false === this.isUpdatePending && (this._$ES = this._$EP());
446
+ }
447
+ C(t, s, {
448
+ useDefault: i,
449
+ reflect: e,
450
+ wrapped: h
451
+ }, r) {
452
+ i && !(this._$Ej ??= new Map()).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), true !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), true === e && this._$Em !== t && (this._$Eq ??= new Set()).add(t));
453
+ }
454
+ async _$EP() {
455
+ this.isUpdatePending = true;
456
+ try {
457
+ await this._$ES;
458
+ } catch (t) {
459
+ Promise.reject(t);
460
+ }
461
+ const t = this.scheduleUpdate();
462
+ return null != t && (await t), !this.isUpdatePending;
463
+ }
464
+ scheduleUpdate() {
465
+ return this.performUpdate();
466
+ }
467
+ performUpdate() {
468
+ if (!this.isUpdatePending) return;
469
+ if (!this.hasUpdated) {
470
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
471
+ for (const [t, s] of this._$Ep) this[t] = s;
472
+ this._$Ep = void 0;
473
+ }
474
+ const t = this.constructor.elementProperties;
475
+ if (t.size > 0) for (const [s, i] of t) {
476
+ const {
477
+ wrapped: t
478
+ } = i,
479
+ e = this[s];
480
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
481
+ }
482
+ }
483
+ let t = false;
484
+ const s = this._$AL;
485
+ try {
486
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
487
+ } catch (s) {
488
+ throw t = false, this._$EM(), s;
489
+ }
490
+ t && this._$AE(s);
491
+ }
492
+ willUpdate(t) {}
493
+ _$AE(t) {
494
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
495
+ }
496
+ _$EM() {
497
+ this._$AL = new Map(), this.isUpdatePending = false;
498
+ }
499
+ get updateComplete() {
500
+ return this.getUpdateComplete();
501
+ }
502
+ getUpdateComplete() {
503
+ return this._$ES;
504
+ }
505
+ shouldUpdate(t) {
506
+ return true;
507
+ }
508
+ update(t) {
509
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
510
+ }
511
+ updated(t) {}
512
+ firstUpdated(t) {}
513
+ }
514
+ y.elementStyles = [], y.shadowRootOptions = {
515
+ mode: "open"
516
+ }, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
517
+ ReactiveElement: y
518
+ }), (a.reactiveElementVersions ??= []).push("2.1.1");
220
519
 
221
520
  /**
222
521
  * @license
223
522
  * Copyright 2017 Google LLC
224
523
  * SPDX-License-Identifier: BSD-3-Clause
225
- */const o={attribute:true,type:String,converter:u,reflect:false,hasChanged:f},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
524
+ */
525
+ const o = {
526
+ attribute: true,
527
+ type: String,
528
+ converter: u,
529
+ reflect: false,
530
+ hasChanged: f
531
+ },
532
+ r = (t = o, e, r) => {
533
+ const {
534
+ kind: n,
535
+ metadata: i
536
+ } = r;
537
+ let s = globalThis.litPropertyMetadata.get(i);
538
+ if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map()), "setter" === n && ((t = Object.create(t)).wrapped = true), s.set(r.name, t), "accessor" === n) {
539
+ const {
540
+ name: o
541
+ } = r;
542
+ return {
543
+ set(r) {
544
+ const n = e.get.call(this);
545
+ e.set.call(this, r), this.requestUpdate(o, n, t);
546
+ },
547
+ init(e) {
548
+ return void 0 !== e && this.C(o, void 0, t, e), e;
549
+ }
550
+ };
551
+ }
552
+ if ("setter" === n) {
553
+ const {
554
+ name: o
555
+ } = r;
556
+ return function (r) {
557
+ const n = this[o];
558
+ e.call(this, r), this.requestUpdate(o, n, t);
559
+ };
560
+ }
561
+ throw Error("Unsupported decorator location: " + n);
562
+ };
563
+ function n(t) {
564
+ return (e, o) => "object" == typeof o ? r(t, e, o) : ((t, e, o) => {
565
+ const r = e.hasOwnProperty(o);
566
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
567
+ })(t, e, o);
568
+ }
226
569
 
227
570
  /**
228
571
  * @license
229
572
  * Copyright 2017 Google LLC
230
573
  * SPDX-License-Identifier: BSD-3-Clause
231
574
  */
232
- const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
575
+ const e$1 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
233
576
 
234
577
  /**
235
578
  * @license
236
579
  * Copyright 2017 Google LLC
237
580
  * SPDX-License-Identifier: BSD-3-Clause
238
- */function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$1(n,s,{get(){return o(this)}})}}
581
+ */
582
+ function e(e, r) {
583
+ return (n, s, i) => {
584
+ const o = t => t.renderRoot?.querySelector(e) ?? null;
585
+ return e$1(n, s, {
586
+ get() {
587
+ return o(this);
588
+ }
589
+ });
590
+ };
591
+ }
239
592
 
240
593
  /**
241
594
  * Determines whether an object has keys for a given type.
@@ -245,7 +598,7 @@ const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"obj
245
598
  * @returns {boolean} Whether `value` has all `keys`.
246
599
  */
247
600
  function hasKeys(value, ...keys) {
248
- return typeof value === "object" && value !== null && keys.every((x) => x in value);
601
+ return typeof value === "object" && value !== null && keys.every(x => x in value);
249
602
  }
250
603
 
251
604
  /**
@@ -254,7 +607,7 @@ function hasKeys(value, ...keys) {
254
607
  * @returns {value is DisabledMixin} Whether `value` is a `DisabledMixin`.
255
608
  */
256
609
  function isDisabledMixin(value) {
257
- return hasKeys(value, "disabled");
610
+ return hasKeys(value, "disabled");
258
611
  }
259
612
  /**
260
613
  * Mixin to augment an element with behavior that supports a disabled state.
@@ -264,27 +617,28 @@ function isDisabledMixin(value) {
264
617
  * @returns {Constructor<DisabledMixin> & T} A constructor that implements `DisabledMixin`.
265
618
  */
266
619
  function Disabled(base, reflect = true) {
267
- class _DisabledMixin extends base {
268
- constructor() {
269
- super(...arguments);
270
- /**
271
- * Whether the element is disabled.
272
- * @default false
273
- */
274
- this.disabled = false;
275
- }
276
- /** @inheritdoc */
277
- update(changedProperties) {
278
- super.update(changedProperties);
279
- if (changedProperties.has("disabled") && this.role && this.role !== "none" && this.role !== "presentation") {
280
- this.ariaDisabled = this.disabled ? "true" : null;
281
- }
282
- }
620
+ class _DisabledMixin extends base {
621
+ constructor() {
622
+ super(...arguments);
623
+ /**
624
+ * Whether the element is disabled.
625
+ * @default false
626
+ */
627
+ this.disabled = false;
283
628
  }
284
- __decorate([
285
- n({ type: Boolean, reflect: reflect })
286
- ], _DisabledMixin.prototype, "disabled", void 0);
287
- return _DisabledMixin;
629
+ /** @inheritdoc */
630
+ update(changedProperties) {
631
+ super.update(changedProperties);
632
+ if (changedProperties.has("disabled") && this.role && this.role !== "none" && this.role !== "presentation") {
633
+ this.ariaDisabled = this.disabled ? "true" : null;
634
+ }
635
+ }
636
+ }
637
+ __decorate([n({
638
+ type: Boolean,
639
+ reflect: reflect
640
+ })], _DisabledMixin.prototype, "disabled", void 0);
641
+ return _DisabledMixin;
288
642
  }
289
643
 
290
644
  var _ListManager_items, _ListManager_activeItem, _ListManager_onActiveItemChangeCallback;
@@ -293,59 +647,64 @@ var _ListManager_items, _ListManager_activeItem, _ListManager_onActiveItemChange
293
647
  * @template T The type of managed item.
294
648
  */
295
649
  class ListManager {
296
- constructor() {
297
- /** @private */ _ListManager_items.set(this, new Array());
298
- /** @private */ _ListManager_activeItem.set(this, null);
299
- /** @private */ _ListManager_onActiveItemChangeCallback.set(this, void 0);
300
- }
301
- /** The items being managed. */
302
- get items() {
303
- return __classPrivateFieldGet(this, _ListManager_items, "f");
304
- }
305
- /** The active item. */
306
- get activeItem() {
307
- return __classPrivateFieldGet(this, _ListManager_activeItem, "f");
308
- }
309
- /**
310
- * Sets the items to manage.
311
- * @param {Array<T>} items The new items.
312
- * @returns {{ added: ReadonlyArray<T>; removed: ReadonlyArray<T> }} An object specifying added and removed items.
313
- */
314
- setItems(items) {
315
- const removed = this.items.filter((x) => !items.includes(x));
316
- const added = items.filter((x) => !this.items.includes(x));
317
- __classPrivateFieldSet(this, _ListManager_items, items, "f");
318
- if (this.activeItem && !this.items.includes(this.activeItem)) {
319
- this.updateActiveItem(null);
320
- }
321
- return { added, removed };
322
- }
323
- /**
324
- * Sets the active item.
325
- * @param {T | null | undefined} item The new active item.
326
- */
327
- setActiveItem(item) {
328
- if (this.activeItem !== item) {
329
- this.updateActiveItem(item);
330
- __classPrivateFieldGet(this, _ListManager_onActiveItemChangeCallback, "f")?.call(this);
331
- }
332
- }
333
- /**
334
- * Updates the active item.
335
- * @param {T | null | undefined} item The active item.
336
- */
337
- updateActiveItem(item) {
338
- __classPrivateFieldSet(this, _ListManager_activeItem, item ?? null, "f");
339
- }
340
- /**
341
- * Configures the list manager with a callback invoked when an item is activated.
342
- * @param {() => void} callback The callback invoked when an item is activated.
343
- * @returns {ListManager<T>} The configured list manager.
344
- */
345
- onActiveItemChange(callback) {
346
- __classPrivateFieldSet(this, _ListManager_onActiveItemChangeCallback, callback, "f");
347
- return this;
348
- }
650
+ constructor() {
651
+ /** @private */_ListManager_items.set(this, new Array());
652
+ /** @private */
653
+ _ListManager_activeItem.set(this, null);
654
+ /** @private */
655
+ _ListManager_onActiveItemChangeCallback.set(this, void 0);
656
+ }
657
+ /** The items being managed. */
658
+ get items() {
659
+ return __classPrivateFieldGet(this, _ListManager_items, "f");
660
+ }
661
+ /** The active item. */
662
+ get activeItem() {
663
+ return __classPrivateFieldGet(this, _ListManager_activeItem, "f");
664
+ }
665
+ /**
666
+ * Sets the items to manage.
667
+ * @param {Array<T>} items The new items.
668
+ * @returns {{ added: ReadonlyArray<T>; removed: ReadonlyArray<T> }} An object specifying added and removed items.
669
+ */
670
+ setItems(items) {
671
+ const removed = this.items.filter(x => !items.includes(x));
672
+ const added = items.filter(x => !this.items.includes(x));
673
+ __classPrivateFieldSet(this, _ListManager_items, items, "f");
674
+ if (this.activeItem && !this.items.includes(this.activeItem)) {
675
+ this.updateActiveItem(null);
676
+ }
677
+ return {
678
+ added,
679
+ removed
680
+ };
681
+ }
682
+ /**
683
+ * Sets the active item.
684
+ * @param {T | null | undefined} item The new active item.
685
+ */
686
+ setActiveItem(item) {
687
+ if (this.activeItem !== item) {
688
+ this.updateActiveItem(item);
689
+ __classPrivateFieldGet(this, _ListManager_onActiveItemChangeCallback, "f")?.call(this);
690
+ }
691
+ }
692
+ /**
693
+ * Updates the active item.
694
+ * @param {T | null | undefined} item The active item.
695
+ */
696
+ updateActiveItem(item) {
697
+ __classPrivateFieldSet(this, _ListManager_activeItem, item ?? null, "f");
698
+ }
699
+ /**
700
+ * Configures the list manager with a callback invoked when an item is activated.
701
+ * @param {() => void} callback The callback invoked when an item is activated.
702
+ * @returns {ListManager<T>} The configured list manager.
703
+ */
704
+ onActiveItemChange(callback) {
705
+ __classPrivateFieldSet(this, _ListManager_onActiveItemChangeCallback, callback, "f");
706
+ return this;
707
+ }
349
708
  }
350
709
  _ListManager_items = new WeakMap(), _ListManager_activeItem = new WeakMap(), _ListManager_onActiveItemChangeCallback = new WeakMap();
351
710
 
@@ -366,84 +725,90 @@ const typeaheadLabel = Symbol("typeaheadLabel");
366
725
  * @returns A value indicating whether `value` is an `TypeaheadItem`.
367
726
  */
368
727
  function isTypeaheadItem(value) {
369
- return hasKeys(value, typeaheadLabel);
728
+ return hasKeys(value, typeaheadLabel);
370
729
  }
371
730
  /**
372
731
  * Implements typeahead functionality which selects items based on keyboard input.
373
732
  * @template T The type of `TypeaheadItem`.
374
733
  */
375
734
  class Typeahead {
376
- /**
377
- * Initializes a new instance of this class.
378
- * @param {TypeaheadOptions<T>} options Options that control typeahead behavior.
379
- */
380
- constructor(options) {
381
- _Typeahead_instances.add(this);
382
- /** @private */ _Typeahead_debounceInterval.set(this, void 0);
383
- /** @private */ _Typeahead_timeoutId.set(this, -1);
384
- /** @private */ _Typeahead_callback.set(this, void 0);
385
- /** @private */ _Typeahead_skipPredicate.set(this, void 0);
386
- /** @private */ _Typeahead_pressedKeys.set(this, new Array());
387
- /** @private */ _Typeahead_selectedIndex.set(this, -1);
388
- /** @private */ _Typeahead_items.set(this, []);
389
- __classPrivateFieldSet(this, _Typeahead_debounceInterval, options.debounceInterval ?? 200, "f");
390
- __classPrivateFieldSet(this, _Typeahead_callback, options.callback, "f");
391
- __classPrivateFieldSet(this, _Typeahead_skipPredicate, options.skipPredicate, "f");
392
- }
393
- /** A value indicating whether the user is currently typing. */
394
- get isTyping() {
395
- return __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").length > 0;
396
- }
397
- /**
398
- * Sets the items to search.
399
- * @param {readonly T[]} items The items to search.
400
- */
401
- setItems(items) {
402
- __classPrivateFieldSet(this, _Typeahead_items, items, "f");
403
- }
404
- /**
405
- * Sets the index of the selected item.
406
- * @param {number} index The index of the selected item.
407
- */
408
- setSelectedIndex(index) {
409
- __classPrivateFieldSet(this, _Typeahead_selectedIndex, index, "f");
410
- }
411
- /** Resets the stored sequence of typed characters. */
412
- reset() {
413
- __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").length = 0;
414
- }
415
- /**
416
- * Sets the selected item depending on the key event passed in.
417
- * @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
418
- */
419
- onKeyDown(e) {
420
- if (e.key && e.key.length === 1) {
421
- __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_appendKey).call(this, e.key);
422
- }
423
- else {
424
- const keycode = getKeyCode(e);
425
- if ((keycode >= KeyCode.A && keycode <= KeyCode.Z) || (keycode >= KeyCode.Zero && keycode <= KeyCode.Nine)) {
426
- __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_appendKey).call(this, String.fromCharCode(keycode));
427
- }
428
- }
429
- }
735
+ /**
736
+ * Initializes a new instance of this class.
737
+ * @param {TypeaheadOptions<T>} options Options that control typeahead behavior.
738
+ */
739
+ constructor(options) {
740
+ _Typeahead_instances.add(this);
741
+ /** @private */
742
+ _Typeahead_debounceInterval.set(this, void 0);
743
+ /** @private */
744
+ _Typeahead_timeoutId.set(this, -1);
745
+ /** @private */
746
+ _Typeahead_callback.set(this, void 0);
747
+ /** @private */
748
+ _Typeahead_skipPredicate.set(this, void 0);
749
+ /** @private */
750
+ _Typeahead_pressedKeys.set(this, new Array());
751
+ /** @private */
752
+ _Typeahead_selectedIndex.set(this, -1);
753
+ /** @private */
754
+ _Typeahead_items.set(this, []);
755
+ __classPrivateFieldSet(this, _Typeahead_debounceInterval, options.debounceInterval ?? 200, "f");
756
+ __classPrivateFieldSet(this, _Typeahead_callback, options.callback, "f");
757
+ __classPrivateFieldSet(this, _Typeahead_skipPredicate, options.skipPredicate, "f");
758
+ }
759
+ /** A value indicating whether the user is currently typing. */
760
+ get isTyping() {
761
+ return __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").length > 0;
762
+ }
763
+ /**
764
+ * Sets the items to search.
765
+ * @param {readonly T[]} items The items to search.
766
+ */
767
+ setItems(items) {
768
+ __classPrivateFieldSet(this, _Typeahead_items, items, "f");
769
+ }
770
+ /**
771
+ * Sets the index of the selected item.
772
+ * @param {number} index The index of the selected item.
773
+ */
774
+ setSelectedIndex(index) {
775
+ __classPrivateFieldSet(this, _Typeahead_selectedIndex, index, "f");
776
+ }
777
+ /** Resets the stored sequence of typed characters. */
778
+ reset() {
779
+ __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").length = 0;
780
+ }
781
+ /**
782
+ * Sets the selected item depending on the key event passed in.
783
+ * @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
784
+ */
785
+ onKeyDown(e) {
786
+ if (e.key && e.key.length === 1) {
787
+ __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_appendKey).call(this, e.key);
788
+ } else {
789
+ const keycode = getKeyCode(e);
790
+ if (keycode >= KeyCode.A && keycode <= KeyCode.Z || keycode >= KeyCode.Zero && keycode <= KeyCode.Nine) {
791
+ __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_appendKey).call(this, String.fromCharCode(keycode));
792
+ }
793
+ }
794
+ }
430
795
  }
431
796
  _Typeahead_debounceInterval = new WeakMap(), _Typeahead_timeoutId = new WeakMap(), _Typeahead_callback = new WeakMap(), _Typeahead_skipPredicate = new WeakMap(), _Typeahead_pressedKeys = new WeakMap(), _Typeahead_selectedIndex = new WeakMap(), _Typeahead_items = new WeakMap(), _Typeahead_instances = new WeakSet(), _Typeahead_appendKey = function _Typeahead_appendKey(key) {
432
- __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").push(key.toLocaleUpperCase());
433
- clearTimeout(__classPrivateFieldGet(this, _Typeahead_timeoutId, "f"));
434
- __classPrivateFieldSet(this, _Typeahead_timeoutId, setTimeout(() => __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_searchItems).call(this), __classPrivateFieldGet(this, _Typeahead_debounceInterval, "f")), "f");
797
+ __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").push(key.toLocaleUpperCase());
798
+ clearTimeout(__classPrivateFieldGet(this, _Typeahead_timeoutId, "f"));
799
+ __classPrivateFieldSet(this, _Typeahead_timeoutId, setTimeout(() => __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_searchItems).call(this), __classPrivateFieldGet(this, _Typeahead_debounceInterval, "f")), "f");
435
800
  }, _Typeahead_searchItems = function _Typeahead_searchItems() {
436
- const term = __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").join("");
437
- for (let i = 1; i < __classPrivateFieldGet(this, _Typeahead_items, "f").length + 1; i++) {
438
- const index = (__classPrivateFieldGet(this, _Typeahead_selectedIndex, "f") + i) % __classPrivateFieldGet(this, _Typeahead_items, "f").length;
439
- const item = __classPrivateFieldGet(this, _Typeahead_items, "f")[index];
440
- const label = item[typeaheadLabel]?.().toLocaleUpperCase().trim();
441
- if (!__classPrivateFieldGet(this, _Typeahead_skipPredicate, "f")?.call(this, item) && label?.indexOf(term) === 0) {
442
- __classPrivateFieldGet(this, _Typeahead_callback, "f").call(this, item);
443
- break;
444
- }
445
- }
446
- this.reset();
801
+ const term = __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").join("");
802
+ for (let i = 1; i < __classPrivateFieldGet(this, _Typeahead_items, "f").length + 1; i++) {
803
+ const index = (__classPrivateFieldGet(this, _Typeahead_selectedIndex, "f") + i) % __classPrivateFieldGet(this, _Typeahead_items, "f").length;
804
+ const item = __classPrivateFieldGet(this, _Typeahead_items, "f")[index];
805
+ const label = item[typeaheadLabel]?.().toLocaleUpperCase().trim();
806
+ if (!__classPrivateFieldGet(this, _Typeahead_skipPredicate, "f")?.call(this, item) && label?.indexOf(term) === 0) {
807
+ __classPrivateFieldGet(this, _Typeahead_callback, "f").call(this, item);
808
+ break;
809
+ }
810
+ }
811
+ this.reset();
447
812
  };
448
813
 
449
814
  /**
@@ -460,290 +825,301 @@ var _ListKeyManager_instances, _ListKeyManager_typeahead, _ListKeyManager_findFi
460
825
  * @template T The type of managed item.
461
826
  */
462
827
  class ListKeyManager extends ListManager {
463
- constructor() {
464
- super(...arguments);
465
- _ListKeyManager_instances.add(this);
466
- /** @private */ _ListKeyManager_typeahead.set(this, void 0);
467
- /**
468
- * Whether the active item will wrap to the other end of
469
- * list when there are no more items in the given direction.
470
- * @default false
471
- */
472
- this.wrap = false;
473
- /**
474
- * Whether to activate the first and last items respectively when
475
- * the `HOME` or `END` key is pressed.
476
- * @default false
477
- */
478
- this.homeAndEnd = false;
479
- /**
480
- * Whether to activate every 10th (or configured) first/last item
481
- * in the up/down direction when the `PAGEUP` or `PAGEDOWN` key is pressed.
482
- * @default false
483
- */
484
- this.pageUpAndDown = false;
485
- /**
486
- * The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
487
- * @default 10
488
- */
489
- this.pageDelta = 10;
490
- /**
491
- * Whether to the list is oriented vertically.
492
- * @default false
493
- */
494
- this.vertical = false;
495
- /** The allowed modifier keys.
496
- * @default []
497
- */
498
- this.allowedModifiers = [];
499
- /**
500
- * A function used to skip items.
501
- * @param {T} item The item to test.
502
- * @returns {boolean} Whether `item` should be skipped.
503
- */
504
- this.skipPredicate = (item) => isDisabledMixin(item) && item.disabled;
505
- }
506
- /** @inheritdoc */
507
- setItems(items) {
508
- __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")?.setItems(items);
509
- return super.setItems(items);
510
- }
511
- /** @inheritdoc */
512
- updateActiveItem(item) {
513
- super.updateActiveItem(item);
514
- if (__classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")) {
515
- __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f").setSelectedIndex(item ? this.items.indexOf(item) : -1);
516
- }
517
- }
828
+ constructor() {
829
+ super(...arguments);
830
+ _ListKeyManager_instances.add(this);
831
+ /** @private */
832
+ _ListKeyManager_typeahead.set(this, void 0);
518
833
  /**
519
- * Configures the key manager to activate the first and last items respectively when the `HOME` or `END` key is pressed.
520
- * @param {boolean} [enabled = true] Whether to activate the first and last items respectively when
521
- * the `HOME` or `END` key is pressed.
522
- * @returns {ListKeyManager<T>} The configured key manager.
834
+ * Whether the active item will wrap to the other end of
835
+ * list when there are no more items in the given direction.
836
+ * @default false
523
837
  */
524
- withHomeAndEnd(enabled = true) {
525
- this.homeAndEnd = enabled;
526
- return this;
527
- }
838
+ this.wrap = false;
528
839
  /**
529
- * Configures the key manager to page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
530
- * @param {boolean} [enabled = true] Whether to activate page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
531
- * @param {number} [pageDelta=10] The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
532
- * @returns {ListKeyManager<T>} The configured key manager.
840
+ * Whether to activate the first and last items respectively when
841
+ * the `HOME` or `END` key is pressed.
842
+ * @default false
533
843
  */
534
- withPageUpAndDown(enabled = true, pageDelta = 10) {
535
- this.pageUpAndDown = enabled;
536
- this.pageDelta = pageDelta;
537
- return this;
538
- }
844
+ this.homeAndEnd = false;
539
845
  /**
540
- * Configures wrapping mode, which determines whether the active item will wrap to the other end of list when there are no more items in the given direction.
541
- * @param {boolean} [enabled = true] Whether the active item will wrap to the other end of
542
- * list when there are no more items in the given direction.
543
- * @returns {ListKeyManager<T>} The configured key manager.
846
+ * Whether to activate every 10th (or configured) first/last item
847
+ * in the up/down direction when the `PAGEUP` or `PAGEDOWN` key is pressed.
848
+ * @default false
544
849
  */
545
- withWrap(enabled = true) {
546
- this.wrap = enabled;
547
- return this;
548
- }
850
+ this.pageUpAndDown = false;
549
851
  /**
550
- * Configures whether to move the selection vertically.
551
- * @param {boolean} [enabled = true] Whether to move selection vertically.
552
- * @returns {ListKeyManager<T>} The configured key manager.
852
+ * The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
853
+ * @default 10
553
854
  */
554
- withVerticalOrientation(enabled = true) {
555
- this.vertical = enabled;
556
- return this;
557
- }
855
+ this.pageDelta = 10;
558
856
  /**
559
- * Configured allowed modifier keys.
560
- * @param {ModifierKey[]} modifiers The allowed modifier keys.
561
- * @returns {ListKeyManager<T>} The configured key manager.
857
+ * Whether to the list is oriented vertically.
858
+ * @default false
562
859
  */
563
- withAllowedModifiers(...modifiers) {
564
- this.allowedModifiers = modifiers;
565
- return this;
566
- }
567
- /**
568
- * Configures whether typeahead is enabled.
569
- * @param {boolean} [enabled = true] Whether typeahead is enabled.
570
- * @returns {ListKeyManager<T>} The configured key manager.
860
+ this.vertical = false;
861
+ /** The allowed modifier keys.
862
+ * @default []
571
863
  */
572
- withTypeahead(enabled = true) {
573
- if (enabled) {
574
- __classPrivateFieldSet(this, _ListKeyManager_typeahead, new Typeahead({ callback: (item) => this.setActiveItem(item) }), "f");
575
- }
576
- else {
577
- __classPrivateFieldSet(this, _ListKeyManager_typeahead, undefined, "f");
578
- }
579
- return this;
580
- }
864
+ this.allowedModifiers = [];
581
865
  /**
582
- * Configures a function used to test whether an item should be skipped.
583
- * @param skipPredicate A function used to determine whether an item should be skipped.
584
- * @returns {ListKeyManager<T>} The configured key manager.
866
+ * A function used to skip items.
867
+ * @param {T} item The item to test.
868
+ * @returns {boolean} Whether `item` should be skipped.
585
869
  */
586
- withSkipPredicate(skipPredicate) {
587
- this.skipPredicate = skipPredicate;
588
- return this;
589
- }
870
+ this.skipPredicate = item => isDisabledMixin(item) && item.disabled;
590
871
  /**
591
- * Sets the active item depending on the key event passed in.
592
- * @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
872
+ * The directionality.
873
+ * @default "ltr"
593
874
  */
594
- onKeyDown(e) {
595
- if (e.defaultPrevented)
596
- return;
597
- const modifierAllowed = isModifierAllowed(e, ...this.allowedModifiers);
598
- switch (e.key) {
599
- case "Left":
600
- case "ArrowLeft":
601
- if (modifierAllowed && !this.vertical) {
602
- e.preventDefault();
603
- const prev = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this);
604
- if (prev) {
605
- this.setActiveItem(prev);
606
- }
607
- }
608
- break;
609
- case "Up":
610
- case "ArrowUp":
611
- if (modifierAllowed) {
612
- e.preventDefault();
613
- const prev = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this);
614
- if (prev) {
615
- this.setActiveItem(prev);
616
- }
617
- }
618
- break;
619
- case "Right":
620
- case "ArrowRight":
621
- if (modifierAllowed && !this.vertical) {
622
- e.preventDefault();
623
- const next = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this);
624
- if (next) {
625
- this.setActiveItem(next);
626
- }
627
- }
628
- break;
629
- case "Down":
630
- case "ArrowDown":
631
- if (modifierAllowed) {
632
- e.preventDefault();
633
- const next = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this);
634
- if (next) {
635
- this.setActiveItem(next);
636
- }
637
- }
638
- break;
639
- case "Home":
640
- if (modifierAllowed && this.homeAndEnd) {
641
- e.preventDefault();
642
- const first = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findFirst).call(this);
643
- if (first) {
644
- this.setActiveItem(first);
645
- }
646
- }
647
- break;
648
- case "End":
649
- if (modifierAllowed && this.homeAndEnd) {
650
- e.preventDefault();
651
- const last = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findLast).call(this);
652
- if (last) {
653
- this.setActiveItem(last);
654
- }
655
- }
656
- break;
657
- case "PageUp":
658
- if (modifierAllowed && this.pageUpAndDown) {
659
- e.preventDefault();
660
- const prev = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPreviousByIndex).call(this, this.activeItem ? Math.max(0, this.items.indexOf(this.activeItem) - this.pageDelta) : 0);
661
- if (prev) {
662
- this.setActiveItem(prev);
663
- }
664
- }
665
- break;
666
- case "PageDown":
667
- if (modifierAllowed && this.pageUpAndDown) {
668
- e.preventDefault();
669
- const next = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNextByIndex).call(this, this.activeItem
670
- ? Math.min(this.items.length - 1, this.items.indexOf(this.activeItem) + this.pageDelta)
671
- : this.items.length - 1);
672
- if (next) {
673
- this.setActiveItem(next);
674
- }
675
- }
676
- break;
677
- default:
678
- if (modifierAllowed || hasModifierKey(e, "shift")) {
679
- __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")?.onKeyDown(e);
680
- }
681
- break;
875
+ this.directionality = "ltr";
876
+ }
877
+ /** @inheritdoc */
878
+ setItems(items) {
879
+ __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")?.setItems(items);
880
+ return super.setItems(items);
881
+ }
882
+ /** @inheritdoc */
883
+ updateActiveItem(item) {
884
+ super.updateActiveItem(item);
885
+ if (__classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")) {
886
+ __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f").setSelectedIndex(item ? this.items.indexOf(item) : -1);
887
+ }
888
+ }
889
+ /**
890
+ * Configures the key manager to activate the first and last items respectively when the `HOME` or `END` key is pressed.
891
+ * @param {boolean} [enabled = true] Whether to activate the first and last items respectively when
892
+ * the `HOME` or `END` key is pressed.
893
+ * @returns {ListKeyManager<T>} The configured key manager.
894
+ */
895
+ withHomeAndEnd(enabled = true) {
896
+ this.homeAndEnd = enabled;
897
+ return this;
898
+ }
899
+ /**
900
+ * Configures the key manager to page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
901
+ * @param {boolean} [enabled = true] Whether to activate page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
902
+ * @param {number} [pageDelta=10] The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
903
+ * @returns {ListKeyManager<T>} The configured key manager.
904
+ */
905
+ withPageUpAndDown(enabled = true, pageDelta = 10) {
906
+ this.pageUpAndDown = enabled;
907
+ this.pageDelta = pageDelta;
908
+ return this;
909
+ }
910
+ /**
911
+ * Configures wrapping mode, which determines whether the active item will wrap to the other end of list when there are no more items in the given direction.
912
+ * @param {boolean} [enabled = true] Whether the active item will wrap to the other end of
913
+ * list when there are no more items in the given direction.
914
+ * @returns {ListKeyManager<T>} The configured key manager.
915
+ */
916
+ withWrap(enabled = true) {
917
+ this.wrap = enabled;
918
+ return this;
919
+ }
920
+ /**
921
+ * Configures whether to move the selection vertically.
922
+ * @param {boolean} [enabled = true] Whether to move selection vertically.
923
+ * @returns {ListKeyManager<T>} The configured key manager.
924
+ */
925
+ withVerticalOrientation(enabled = true) {
926
+ this.vertical = enabled;
927
+ return this;
928
+ }
929
+ /**
930
+ * Configured allowed modifier keys.
931
+ * @param {ModifierKey[]} modifiers The allowed modifier keys.
932
+ * @returns {ListKeyManager<T>} The configured key manager.
933
+ */
934
+ withAllowedModifiers(...modifiers) {
935
+ this.allowedModifiers = modifiers;
936
+ return this;
937
+ }
938
+ /**
939
+ * Configures whether typeahead is enabled.
940
+ * @param {boolean} [enabled = true] Whether typeahead is enabled.
941
+ * @returns {ListKeyManager<T>} The configured key manager.
942
+ */
943
+ withTypeahead(enabled = true) {
944
+ if (enabled) {
945
+ __classPrivateFieldSet(this, _ListKeyManager_typeahead, new Typeahead({
946
+ callback: item => this.setActiveItem(item)
947
+ }), "f");
948
+ } else {
949
+ __classPrivateFieldSet(this, _ListKeyManager_typeahead, undefined, "f");
950
+ }
951
+ return this;
952
+ }
953
+ /**
954
+ * Configures a function used to test whether an item should be skipped.
955
+ * @param skipPredicate A function used to determine whether an item should be skipped.
956
+ * @returns {ListKeyManager<T>} The configured key manager.
957
+ */
958
+ withSkipPredicate(skipPredicate) {
959
+ this.skipPredicate = skipPredicate;
960
+ return this;
961
+ }
962
+ /**
963
+ * Configures the directionality.
964
+ * @param {"ltr" | "rtl"} directionality The directionality.
965
+ * @returns {ListKeyManager<T>} The configured key manager.
966
+ */
967
+ withDirectionality(directionality) {
968
+ this.directionality = directionality;
969
+ return this;
970
+ }
971
+ /**
972
+ * Sets the active item depending on the key event passed in.
973
+ * @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
974
+ */
975
+ onKeyDown(e) {
976
+ if (e.defaultPrevented) return;
977
+ const modifierAllowed = isModifierAllowed(e, ...this.allowedModifiers);
978
+ switch (e.key) {
979
+ case "Left":
980
+ case "ArrowLeft":
981
+ if (modifierAllowed && !this.vertical) {
982
+ e.preventDefault();
983
+ const prev = this.directionality === "ltr" ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this) : __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this);
984
+ if (prev) {
985
+ this.setActiveItem(prev);
986
+ }
987
+ }
988
+ break;
989
+ case "Up":
990
+ case "ArrowUp":
991
+ if (modifierAllowed) {
992
+ e.preventDefault();
993
+ const prev = this.directionality === "ltr" ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this) : __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this);
994
+ if (prev) {
995
+ this.setActiveItem(prev);
996
+ }
997
+ }
998
+ break;
999
+ case "Right":
1000
+ case "ArrowRight":
1001
+ if (modifierAllowed && !this.vertical) {
1002
+ e.preventDefault();
1003
+ const next = this.directionality === "ltr" ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this) : __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this);
1004
+ if (next) {
1005
+ this.setActiveItem(next);
1006
+ }
1007
+ }
1008
+ break;
1009
+ case "Down":
1010
+ case "ArrowDown":
1011
+ if (modifierAllowed) {
1012
+ e.preventDefault();
1013
+ const next = this.directionality === "ltr" ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this) : __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this);
1014
+ if (next) {
1015
+ this.setActiveItem(next);
1016
+ }
1017
+ }
1018
+ break;
1019
+ case "Home":
1020
+ if (modifierAllowed && this.homeAndEnd) {
1021
+ e.preventDefault();
1022
+ const first = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findFirst).call(this);
1023
+ if (first) {
1024
+ this.setActiveItem(first);
1025
+ }
1026
+ }
1027
+ break;
1028
+ case "End":
1029
+ if (modifierAllowed && this.homeAndEnd) {
1030
+ e.preventDefault();
1031
+ const last = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findLast).call(this);
1032
+ if (last) {
1033
+ this.setActiveItem(last);
1034
+ }
1035
+ }
1036
+ break;
1037
+ case "PageUp":
1038
+ if (modifierAllowed && this.pageUpAndDown) {
1039
+ e.preventDefault();
1040
+ const prev = (this.directionality === "ltr" ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPreviousByIndex) : __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNextByIndex))(this.activeItem ? Math.max(0, this.items.indexOf(this.activeItem) - this.pageDelta) : 0);
1041
+ if (prev) {
1042
+ this.setActiveItem(prev);
1043
+ }
682
1044
  }
1045
+ break;
1046
+ case "PageDown":
1047
+ if (modifierAllowed && this.pageUpAndDown) {
1048
+ e.preventDefault();
1049
+ const next = (this.directionality === "ltr" ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNextByIndex) : __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPreviousByIndex))(this.activeItem ? Math.min(this.items.length - 1, this.items.indexOf(this.activeItem) + this.pageDelta) : this.items.length - 1);
1050
+ if (next) {
1051
+ this.setActiveItem(next);
1052
+ }
1053
+ }
1054
+ break;
1055
+ default:
1056
+ if (modifierAllowed || hasModifierKey(e, "shift")) {
1057
+ __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")?.onKeyDown(e);
1058
+ }
1059
+ break;
683
1060
  }
1061
+ }
684
1062
  }
685
1063
  _ListKeyManager_typeahead = new WeakMap(), _ListKeyManager_instances = new WeakSet(), _ListKeyManager_findFirst = function _ListKeyManager_findFirst() {
686
- for (let i = 0; i < this.items.length; i++) {
687
- if (this.items[i] === this.activeItem)
688
- break;
689
- const test = this.items[i];
690
- if (!this.skipPredicate(test)) {
691
- return test;
692
- }
693
- }
694
- return null;
1064
+ for (let i = 0; i < this.items.length; i++) {
1065
+ if (this.items[i] === this.activeItem) break;
1066
+ const test = this.items[i];
1067
+ if (!this.skipPredicate(test)) {
1068
+ return test;
1069
+ }
1070
+ }
1071
+ return null;
695
1072
  }, _ListKeyManager_findLast = function _ListKeyManager_findLast() {
696
- for (let i = this.items.length - 1; i >= 0; i--) {
697
- if (this.items[i] === this.activeItem)
698
- break;
699
- const test = this.items[i];
700
- if (!this.skipPredicate(test)) {
701
- return test;
702
- }
703
- }
704
- return null;
1073
+ for (let i = this.items.length - 1; i >= 0; i--) {
1074
+ if (this.items[i] === this.activeItem) break;
1075
+ const test = this.items[i];
1076
+ if (!this.skipPredicate(test)) {
1077
+ return test;
1078
+ }
1079
+ }
1080
+ return null;
705
1081
  }, _ListKeyManager_findNext = function _ListKeyManager_findNext() {
706
- for (let i = 0; i < this.items.length; i++) {
707
- if (this.items[i] === this.activeItem) {
708
- for (let j = i + 1; j < this.items.length; j++) {
709
- const test = this.items[j];
710
- if (!this.skipPredicate(test)) {
711
- return test;
712
- }
713
- }
714
- break;
1082
+ for (let i = 0; i < this.items.length; i++) {
1083
+ if (this.items[i] === this.activeItem) {
1084
+ for (let j = i + 1; j < this.items.length; j++) {
1085
+ const test = this.items[j];
1086
+ if (!this.skipPredicate(test)) {
1087
+ return test;
715
1088
  }
1089
+ }
1090
+ break;
716
1091
  }
717
- return this.wrap ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findFirst).call(this) : null;
1092
+ }
1093
+ return this.wrap ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findFirst).call(this) : null;
718
1094
  }, _ListKeyManager_findPrevious = function _ListKeyManager_findPrevious() {
719
- for (let i = 0; i < this.items.length; i++) {
720
- if (this.items[i] === this.activeItem) {
721
- for (let j = i - 1; j >= 0; j--) {
722
- const test = this.items[j];
723
- if (!this.skipPredicate(test)) {
724
- return test;
725
- }
726
- }
727
- break;
1095
+ for (let i = 0; i < this.items.length; i++) {
1096
+ if (this.items[i] === this.activeItem) {
1097
+ for (let j = i - 1; j >= 0; j--) {
1098
+ const test = this.items[j];
1099
+ if (!this.skipPredicate(test)) {
1100
+ return test;
728
1101
  }
1102
+ }
1103
+ break;
729
1104
  }
730
- return this.wrap ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findLast).call(this) : null;
1105
+ }
1106
+ return this.wrap ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findLast).call(this) : null;
731
1107
  }, _ListKeyManager_findPreviousByIndex = function _ListKeyManager_findPreviousByIndex(index) {
732
- for (let i = index; i >= 0; i--) {
733
- const test = this.items[i];
734
- if (!this.skipPredicate(test)) {
735
- return test;
736
- }
1108
+ for (let i = index; i >= 0; i--) {
1109
+ const test = this.items[i];
1110
+ if (!this.skipPredicate(test)) {
1111
+ return test;
737
1112
  }
738
- return null;
1113
+ }
1114
+ return null;
739
1115
  }, _ListKeyManager_findNextByIndex = function _ListKeyManager_findNextByIndex(index) {
740
- for (let i = index; i < this.items.length; i++) {
741
- const test = this.items[i];
742
- if (!this.skipPredicate(test)) {
743
- return test;
744
- }
1116
+ for (let i = index; i < this.items.length; i++) {
1117
+ const test = this.items[i];
1118
+ if (!this.skipPredicate(test)) {
1119
+ return test;
745
1120
  }
746
- return null;
1121
+ }
1122
+ return null;
747
1123
  };
748
1124
 
749
1125
  var _FocusKeyManager_focusOptions;
@@ -752,24 +1128,25 @@ var _FocusKeyManager_focusOptions;
752
1128
  * @template T The type of managed item.
753
1129
  */
754
1130
  class FocusKeyManager extends ListKeyManager {
755
- constructor() {
756
- super(...arguments);
757
- /** @private */ _FocusKeyManager_focusOptions.set(this, void 0);
758
- }
759
- /** @inheritdoc */
760
- setActiveItem(item) {
761
- super.setActiveItem(item);
762
- item?.focus(__classPrivateFieldGet(this, _FocusKeyManager_focusOptions, "f"));
763
- }
764
- /**
765
- * Configures the key manager with options used to focus items.
766
- * @param {FocusOptions} options Options used to focus items.
767
- * @returns {FocusKeyManager<T>} The configured key manager.
768
- */
769
- withOptions(options) {
770
- __classPrivateFieldSet(this, _FocusKeyManager_focusOptions, options, "f");
771
- return this;
772
- }
1131
+ constructor() {
1132
+ super(...arguments);
1133
+ /** @private */
1134
+ _FocusKeyManager_focusOptions.set(this, void 0);
1135
+ }
1136
+ /** @inheritdoc */
1137
+ setActiveItem(item) {
1138
+ super.setActiveItem(item);
1139
+ item?.focus(__classPrivateFieldGet(this, _FocusKeyManager_focusOptions, "f"));
1140
+ }
1141
+ /**
1142
+ * Configures the key manager with options used to focus items.
1143
+ * @param {FocusOptions} options Options used to focus items.
1144
+ * @returns {FocusKeyManager<T>} The configured key manager.
1145
+ */
1146
+ withOptions(options) {
1147
+ __classPrivateFieldSet(this, _FocusKeyManager_focusOptions, options, "f");
1148
+ return this;
1149
+ }
773
1150
  }
774
1151
  _FocusKeyManager_focusOptions = new WeakMap();
775
1152
 
@@ -779,7 +1156,7 @@ _FocusKeyManager_focusOptions = new WeakMap();
779
1156
  * @returns Whether `value` is a `CheckedMixin`.
780
1157
  */
781
1158
  function isCheckedMixin(value) {
782
- return hasKeys(value, "checked");
1159
+ return hasKeys(value, "checked");
783
1160
  }
784
1161
 
785
1162
  /**
@@ -788,7 +1165,7 @@ function isCheckedMixin(value) {
788
1165
  * @returns Whether `value` is a `SelectedMixin`.
789
1166
  */
790
1167
  function isSelectedMixin(value) {
791
- return hasKeys(value, "selected");
1168
+ return hasKeys(value, "selected");
792
1169
  }
793
1170
 
794
1171
  /**
@@ -797,7 +1174,7 @@ function isSelectedMixin(value) {
797
1174
  * @return {boolean} Whether `element` is checked or selected.
798
1175
  */
799
1176
  function isCheckedOrSelected(element) {
800
- return (isCheckedMixin(element) && element.checked) || (isSelectedMixin(element) && element.selected);
1177
+ return isCheckedMixin(element) && element.checked || isSelectedMixin(element) && element.selected;
801
1178
  }
802
1179
  /**
803
1180
  * Sets the checked or selected state of an element.
@@ -805,12 +1182,11 @@ function isCheckedOrSelected(element) {
805
1182
  * @param {boolean} checkedOrSelected The checked or selected state.
806
1183
  */
807
1184
  function checkOrSelect(element, checkedOrSelected) {
808
- if (isCheckedMixin(element)) {
809
- element.checked = checkedOrSelected;
810
- }
811
- else {
812
- element.selected = checkedOrSelected;
813
- }
1185
+ if (isCheckedMixin(element)) {
1186
+ element.checked = checkedOrSelected;
1187
+ } else {
1188
+ element.selected = checkedOrSelected;
1189
+ }
814
1190
  }
815
1191
 
816
1192
  var _RovingTabIndexManager_disableRovingTabIndex;
@@ -819,50 +1195,51 @@ var _RovingTabIndexManager_disableRovingTabIndex;
819
1195
  * @template T The type of managed item.
820
1196
  */
821
1197
  class RovingTabIndexManager extends FocusKeyManager {
822
- constructor() {
823
- super(...arguments);
824
- /** @private */ _RovingTabIndexManager_disableRovingTabIndex.set(this, false);
825
- }
826
- /** @inheritdoc */
827
- updateActiveItem(item) {
828
- super.updateActiveItem(item);
829
- if (!__classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
830
- item?.setAttribute("tabindex", "0");
831
- for (const other of this.items) {
832
- if (other !== item && other.hasAttribute("tabindex")) {
833
- other.setAttribute("tabindex", "-1");
834
- }
835
- }
1198
+ constructor() {
1199
+ super(...arguments);
1200
+ /** @private */
1201
+ _RovingTabIndexManager_disableRovingTabIndex.set(this, false);
1202
+ }
1203
+ /** @inheritdoc */
1204
+ updateActiveItem(item) {
1205
+ super.updateActiveItem(item);
1206
+ if (!__classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
1207
+ item?.setAttribute("tabindex", "0");
1208
+ for (const other of this.items) {
1209
+ if (other !== item && other.hasAttribute("tabindex")) {
1210
+ other.setAttribute("tabindex", "-1");
836
1211
  }
837
- }
838
- /** @inheritdoc */
839
- setItems(items) {
840
- const result = super.setItems(items);
841
- if (!__classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
842
- for (const added of result.added) {
843
- if (added !== this.activeItem && !this.skipPredicate(added)) {
844
- added.setAttribute("tabindex", "-1");
845
- }
846
- }
1212
+ }
1213
+ }
1214
+ }
1215
+ /** @inheritdoc */
1216
+ setItems(items) {
1217
+ const result = super.setItems(items);
1218
+ if (!__classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
1219
+ for (const added of result.added) {
1220
+ if (added !== this.activeItem && !this.skipPredicate(added)) {
1221
+ added.setAttribute("tabindex", "-1");
847
1222
  }
848
- return result;
849
- }
850
- /**
851
- * Configures whether roving tab index is disabled.
852
- * @param {boolean} [disabled=true] Whether the roving tab index is disabled.
853
- * @returns {RovingTabIndexManager<T>} The configured roving tab index manager.
854
- */
855
- disableRovingTabIndex(disabled = true) {
856
- if (disabled !== __classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
857
- __classPrivateFieldSet(this, _RovingTabIndexManager_disableRovingTabIndex, disabled, "f");
858
- for (const item of this.items) {
859
- if (!this.skipPredicate(item)) {
860
- item?.setAttribute("tabindex", __classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f") || item === this.activeItem ? "0" : "-1");
861
- }
862
- }
1223
+ }
1224
+ }
1225
+ return result;
1226
+ }
1227
+ /**
1228
+ * Configures whether roving tab index is disabled.
1229
+ * @param {boolean} [disabled=true] Whether the roving tab index is disabled.
1230
+ * @returns {RovingTabIndexManager<T>} The configured roving tab index manager.
1231
+ */
1232
+ disableRovingTabIndex(disabled = true) {
1233
+ if (disabled !== __classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
1234
+ __classPrivateFieldSet(this, _RovingTabIndexManager_disableRovingTabIndex, disabled, "f");
1235
+ for (const item of this.items) {
1236
+ if (!this.skipPredicate(item)) {
1237
+ item?.setAttribute("tabindex", __classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f") || item === this.activeItem ? "0" : "-1");
863
1238
  }
864
- return this;
1239
+ }
865
1240
  }
1241
+ return this;
1242
+ }
866
1243
  }
867
1244
  _RovingTabIndexManager_disableRovingTabIndex = new WeakMap();
868
1245
 
@@ -872,37 +1249,44 @@ var _RadioKeyManager_disabled;
872
1249
  * @template T The type of managed item.
873
1250
  */
874
1251
  class RadioKeyManager extends RovingTabIndexManager {
875
- constructor() {
876
- super(...arguments);
877
- /** @private */ _RadioKeyManager_disabled.set(this, false);
878
- }
879
- /** A value indicating whether managed items are disabled. */
880
- get disabled() {
881
- return __classPrivateFieldGet(this, _RadioKeyManager_disabled, "f");
882
- }
883
- set disabled(value) {
884
- __classPrivateFieldSet(this, _RadioKeyManager_disabled, value, "f");
885
- this.items.forEach((x) => (x.disabled = value));
886
- }
887
- /** @inheritdoc */
888
- setItems(items) {
889
- if (this.disabled) {
890
- items.forEach((x) => (x.disabled = true));
1252
+ constructor() {
1253
+ super(...arguments);
1254
+ /** @private */
1255
+ _RadioKeyManager_disabled.set(this, false);
1256
+ }
1257
+ /** A value indicating whether managed items are disabled. */
1258
+ get disabled() {
1259
+ return __classPrivateFieldGet(this, _RadioKeyManager_disabled, "f");
1260
+ }
1261
+ set disabled(value) {
1262
+ __classPrivateFieldSet(this, _RadioKeyManager_disabled, value, "f");
1263
+ this.items.forEach(x => x.disabled = value);
1264
+ }
1265
+ /** @inheritdoc */
1266
+ setItems(items) {
1267
+ if (this.disabled) {
1268
+ items.forEach(x => x.disabled = true);
1269
+ }
1270
+ const {
1271
+ added,
1272
+ removed
1273
+ } = super.setItems(items);
1274
+ if (added.length > 0 || removed.length > 0) {
1275
+ if (!this.activeItem) {
1276
+ this.updateActiveItem(added.find(x => !this.skipPredicate(x)) ?? null);
1277
+ }
1278
+ if (this.activeItem && (this.activeItem.disabled || !isCheckedOrSelected(this.activeItem))) {
1279
+ const checked = added.find(x => !this.skipPredicate(x) && isCheckedOrSelected(x));
1280
+ if (checked) {
1281
+ this.updateActiveItem(checked);
891
1282
  }
892
- const { added, removed } = super.setItems(items);
893
- if (added.length > 0 || removed.length > 0) {
894
- if (!this.activeItem) {
895
- this.updateActiveItem(added.find((x) => !this.skipPredicate(x)) ?? null);
896
- }
897
- if (this.activeItem && (this.activeItem.disabled || !isCheckedOrSelected(this.activeItem))) {
898
- const checked = added.find((x) => !this.skipPredicate(x) && isCheckedOrSelected(x));
899
- if (checked) {
900
- this.updateActiveItem(checked);
901
- }
902
- }
903
- }
904
- return { added, removed };
1283
+ }
905
1284
  }
1285
+ return {
1286
+ added,
1287
+ removed
1288
+ };
1289
+ }
906
1290
  }
907
1291
  _RadioKeyManager_disabled = new WeakMap();
908
1292
 
@@ -914,111 +1298,119 @@ const selectionManager = Symbol("selectionManager");
914
1298
  * @template T The type of managed item.
915
1299
  */
916
1300
  class SelectionManager extends RadioKeyManager {
917
- constructor() {
918
- super(...arguments);
919
- _SelectionManager_instances.add(this);
920
- /** @private */ _SelectionManager_onSelectedItemsChangeCallback.set(this, void 0);
921
- /** @private */ _SelectionManager_selectedItems.set(this, new Array());
922
- /** @private */ _SelectionManager_multi.set(this, false);
923
- }
924
- /** A value indicating whether multiple items can be selected. */
925
- get multi() {
926
- return __classPrivateFieldGet(this, _SelectionManager_multi, "f");
927
- }
928
- set multi(value) {
929
- __classPrivateFieldSet(this, _SelectionManager_multi, value, "f");
930
- __classPrivateFieldGet(this, _SelectionManager_instances, "m", _SelectionManager_enforceSingleSelect).call(this, true);
931
- }
932
- /** The selected items. */
933
- get selectedItems() {
934
- return __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f");
935
- }
936
- /**
937
- * Selects or deselects the item based on the item's checked or selected state.
938
- * @param {T} item The item whose selection state has changed.
939
- */
940
- notifySelectionChange(item) {
941
- if (this.items.includes(item)) {
942
- if (isCheckedOrSelected(item)) {
943
- this.select(item);
944
- }
945
- else {
946
- this.deselect(item);
947
- }
948
- }
949
- }
950
- /**
951
- * Deselects the specified item.
952
- * @param {T} item The item to deselect.
953
- */
954
- deselect(item) {
955
- if (this.items.includes(item)) {
956
- if (isCheckedOrSelected(item)) {
957
- checkOrSelect(item, false);
958
- }
959
- const index = __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").indexOf(item);
960
- if (index >= 0) {
961
- __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").splice(index, 1);
962
- __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
963
- }
1301
+ constructor() {
1302
+ super(...arguments);
1303
+ _SelectionManager_instances.add(this);
1304
+ /** @private */
1305
+ _SelectionManager_onSelectedItemsChangeCallback.set(this, void 0);
1306
+ /** @private */
1307
+ _SelectionManager_selectedItems.set(this, new Array());
1308
+ /** @private */
1309
+ _SelectionManager_multi.set(this, false);
1310
+ }
1311
+ /** A value indicating whether multiple items can be selected. */
1312
+ get multi() {
1313
+ return __classPrivateFieldGet(this, _SelectionManager_multi, "f");
1314
+ }
1315
+ set multi(value) {
1316
+ __classPrivateFieldSet(this, _SelectionManager_multi, value, "f");
1317
+ __classPrivateFieldGet(this, _SelectionManager_instances, "m", _SelectionManager_enforceSingleSelect).call(this, true);
1318
+ }
1319
+ /** The selected items. */
1320
+ get selectedItems() {
1321
+ return __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f");
1322
+ }
1323
+ /**
1324
+ * Selects or deselects the item based on the item's checked or selected state.
1325
+ * @param {T} item The item whose selection state has changed.
1326
+ */
1327
+ notifySelectionChange(item) {
1328
+ if (this.items.includes(item)) {
1329
+ if (isCheckedOrSelected(item)) {
1330
+ this.select(item);
1331
+ } else {
1332
+ this.deselect(item);
1333
+ }
1334
+ }
1335
+ }
1336
+ /**
1337
+ * Deselects the specified item.
1338
+ * @param {T} item The item to deselect.
1339
+ */
1340
+ deselect(item) {
1341
+ if (this.items.includes(item)) {
1342
+ if (isCheckedOrSelected(item)) {
1343
+ checkOrSelect(item, false);
1344
+ }
1345
+ const index = __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").indexOf(item);
1346
+ if (index >= 0) {
1347
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").splice(index, 1);
1348
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1349
+ }
1350
+ }
1351
+ }
1352
+ /**
1353
+ * Updates the selected item.
1354
+ * @param {T | null | undefined} item The selected item.
1355
+ * @param {boolean} [activate=true] A value indicating whether to activate the item.
1356
+ */
1357
+ select(item, activate = true) {
1358
+ if (!item || this.items.includes(item)) {
1359
+ if (!this.multi) {
1360
+ for (const selected of __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f")) {
1361
+ if (selected !== item) {
1362
+ checkOrSelect(selected, false);
1363
+ }
964
1364
  }
965
- }
966
- /**
967
- * Updates the selected item.
968
- * @param {T | null | undefined} item The selected item.
969
- * @param {boolean} [activate=true] A value indicating whether to activate the item.
970
- */
971
- select(item, activate = true) {
972
- if (!item || this.items.includes(item)) {
973
- if (!this.multi) {
974
- for (const selected of __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f")) {
975
- if (selected !== item) {
976
- checkOrSelect(selected, false);
977
- }
978
- }
979
- __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length = 0;
980
- }
981
- if (item) {
982
- __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").push(item);
983
- if (!isCheckedOrSelected(item)) {
984
- checkOrSelect(item, true);
985
- }
986
- }
987
- if (activate) {
988
- this.updateActiveItem(item);
989
- }
990
- __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1365
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length = 0;
1366
+ }
1367
+ if (item) {
1368
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").push(item);
1369
+ if (!isCheckedOrSelected(item)) {
1370
+ checkOrSelect(item, true);
991
1371
  }
992
- }
993
- /** @inheritdoc */
994
- setItems(items) {
995
- const { added, removed } = super.setItems(items);
996
- __classPrivateFieldSet(this, _SelectionManager_selectedItems, __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").filter((x) => !removed.includes(x)), "f");
997
- __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").push(...added.filter((x) => isCheckedOrSelected(x)));
998
- __classPrivateFieldGet(this, _SelectionManager_instances, "m", _SelectionManager_enforceSingleSelect).call(this);
999
- __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1000
- return { added, removed };
1001
- }
1002
- /**
1003
- * Configures the selection manager with a callback invoked when selected items change.
1004
- * @param {() => void} callback The callback invoked when selected items change.
1005
- * @returns {SelectionManager<T>} The configured selection manager.
1006
- */
1007
- onSelectedItemsChange(callback) {
1008
- __classPrivateFieldSet(this, _SelectionManager_onSelectedItemsChangeCallback, callback, "f");
1009
- return this;
1010
- }
1372
+ }
1373
+ if (activate) {
1374
+ this.updateActiveItem(item);
1375
+ }
1376
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1377
+ }
1378
+ }
1379
+ /** @inheritdoc */
1380
+ setItems(items) {
1381
+ const {
1382
+ added,
1383
+ removed
1384
+ } = super.setItems(items);
1385
+ __classPrivateFieldSet(this, _SelectionManager_selectedItems, __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").filter(x => !removed.includes(x)), "f");
1386
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").push(...added.filter(x => isCheckedOrSelected(x)));
1387
+ __classPrivateFieldGet(this, _SelectionManager_instances, "m", _SelectionManager_enforceSingleSelect).call(this);
1388
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1389
+ return {
1390
+ added,
1391
+ removed
1392
+ };
1393
+ }
1394
+ /**
1395
+ * Configures the selection manager with a callback invoked when selected items change.
1396
+ * @param {() => void} callback The callback invoked when selected items change.
1397
+ * @returns {SelectionManager<T>} The configured selection manager.
1398
+ */
1399
+ onSelectedItemsChange(callback) {
1400
+ __classPrivateFieldSet(this, _SelectionManager_onSelectedItemsChangeCallback, callback, "f");
1401
+ return this;
1402
+ }
1011
1403
  }
1012
1404
  _SelectionManager_onSelectedItemsChangeCallback = new WeakMap(), _SelectionManager_selectedItems = new WeakMap(), _SelectionManager_multi = new WeakMap(), _SelectionManager_instances = new WeakSet(), _SelectionManager_enforceSingleSelect = function _SelectionManager_enforceSingleSelect(emit = false) {
1013
- if (!this.multi && __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length > 1) {
1014
- for (let i = 1; i < __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length; i++) {
1015
- checkOrSelect(__classPrivateFieldGet(this, _SelectionManager_selectedItems, "f")[i], false);
1016
- }
1017
- __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length = 1;
1018
- if (emit) {
1019
- __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1020
- }
1405
+ if (!this.multi && __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length > 1) {
1406
+ for (let i = 1; i < __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length; i++) {
1407
+ checkOrSelect(__classPrivateFieldGet(this, _SelectionManager_selectedItems, "f")[i], false);
1408
+ }
1409
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length = 1;
1410
+ if (emit) {
1411
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1021
1412
  }
1413
+ }
1022
1414
  };
1023
1415
 
1024
1416
  /**
@@ -1036,7 +1428,7 @@ _SelectionManager_onSelectedItemsChangeCallback = new WeakMap(), _SelectionManag
1036
1428
  * @returns {string[]} a list of IDs referenced by `element` for `attribute`.
1037
1429
  */
1038
1430
  function getAriaReferenceIds(element, attribute) {
1039
- return element.getAttribute(attribute)?.match(/\S+/g) ?? [];
1431
+ return element.getAttribute(attribute)?.match(/\S+/g) ?? [];
1040
1432
  }
1041
1433
  /**
1042
1434
  * Adds an ID to the list of IDs referenced by an element for a given ARIA attribute.
@@ -1045,12 +1437,12 @@ function getAriaReferenceIds(element, attribute) {
1045
1437
  * @param {string} id The ID to add.
1046
1438
  */
1047
1439
  function addAriaReferencedId(element, attribute, id) {
1048
- id = id.trim();
1049
- const ids = getAriaReferenceIds(element, attribute);
1050
- if (!ids.some((existingId) => existingId.trim() === id)) {
1051
- ids.push(id);
1052
- element.setAttribute(attribute, ids.join(" "));
1053
- }
1440
+ id = id.trim();
1441
+ const ids = getAriaReferenceIds(element, attribute);
1442
+ if (!ids.some(existingId => existingId.trim() === id)) {
1443
+ ids.push(id);
1444
+ element.setAttribute(attribute, ids.join(" "));
1445
+ }
1054
1446
  }
1055
1447
  /**
1056
1448
  * Removes an ID from a list of IDs referenced by an element for the specified ARIA attribute.
@@ -1059,14 +1451,13 @@ function addAriaReferencedId(element, attribute, id) {
1059
1451
  * @param {string} id The ID to remove.
1060
1452
  */
1061
1453
  function removeAriaReferencedId(element, attribute, id) {
1062
- id = id.trim();
1063
- const ids = getAriaReferenceIds(element, attribute).filter((val) => val !== id);
1064
- if (ids.length > 0) {
1065
- element.setAttribute(attribute, ids.join(" "));
1066
- }
1067
- else {
1068
- element.removeAttribute(attribute);
1069
- }
1454
+ id = id.trim();
1455
+ const ids = getAriaReferenceIds(element, attribute).filter(val => val !== id);
1456
+ if (ids.length > 0) {
1457
+ element.setAttribute(attribute, ids.join(" "));
1458
+ } else {
1459
+ element.removeAttribute(attribute);
1460
+ }
1070
1461
  }
1071
1462
 
1072
1463
  /**
@@ -1074,18 +1465,18 @@ function removeAriaReferencedId(element, attribute, id) {
1074
1465
  * @param {CSSStyleDeclaration} style The style of the element to visually hide.
1075
1466
  */
1076
1467
  function visuallyHide(style) {
1077
- style.position = "absolute";
1078
- style.appearance = "none";
1079
- style.visibility = "hidden";
1080
- style.border = "0";
1081
- style.outline = "0";
1082
- style.overflow = "hidden";
1083
- style.left = "0";
1084
- style.height = "1px";
1085
- style.width = "1px";
1086
- style.margin = "-1px";
1087
- style.padding = "0";
1088
- style.whiteSpace = "nowrap";
1468
+ style.position = "absolute";
1469
+ style.appearance = "none";
1470
+ style.visibility = "hidden";
1471
+ style.border = "0";
1472
+ style.outline = "0";
1473
+ style.overflow = "hidden";
1474
+ style.left = "0";
1475
+ style.height = "1px";
1476
+ style.width = "1px";
1477
+ style.margin = "-1px";
1478
+ style.padding = "0";
1479
+ style.whiteSpace = "nowrap";
1089
1480
  }
1090
1481
 
1091
1482
  /**
@@ -1099,134 +1490,141 @@ function visuallyHide(style) {
1099
1490
  var _a$2, _M3eAriaDescriber_nextId, _M3eAriaDescriber_messageContainers, _M3eAriaDescriber_createMessageContainer, _M3eAriaDescriber_createMessageElement;
1100
1491
  /** Utility for generating visually hidden elements that convey descriptive messages using `aria-describedby`. */
1101
1492
  class M3eAriaDescriber {
1102
- /**
1103
- * Adds an `aria-describedby` reference to a hidden element that contains the message.
1104
- * @param {Element} element The element for which to provide a visually hidden description.
1105
- * @param {string} message The message used to describe `element`.
1106
- * @param {string} [role="tooltip"] The ARIA role of the message.
1107
- */
1108
- static describe(element, message, role = "tooltip") {
1109
- if (isServer) {
1110
- return;
1111
- }
1112
- const rootNode = element.getRootNode();
1113
- if (!(rootNode instanceof ShadowRoot || rootNode instanceof Document)) {
1114
- return;
1115
- }
1116
- let container = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).get(rootNode);
1117
- if (!container) {
1118
- container = {
1119
- containerElement: __classPrivateFieldGet(this, _a$2, "m", _M3eAriaDescriber_createMessageContainer).call(this),
1120
- messageRegistry: new Map(),
1121
- };
1122
- // Append to body if document, otherwise, append as a child of shadow root.
1123
- (rootNode instanceof Document ? rootNode.body : rootNode).appendChild(container.containerElement);
1124
- __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).set(rootNode, container);
1125
- }
1126
- const key = `${role}:${message}`;
1127
- let entry = container.messageRegistry.get(key);
1128
- if (!entry) {
1129
- entry = { messageElement: __classPrivateFieldGet(this, _a$2, "m", _M3eAriaDescriber_createMessageElement).call(this, message, role), count: 0 };
1130
- container.containerElement.appendChild(entry.messageElement);
1131
- container.messageRegistry.set(key, entry);
1132
- }
1133
- entry.count++;
1134
- addAriaReferencedId(element, "aria-describedby", entry.messageElement.id);
1135
- }
1136
- /**
1137
- * Removes an `aria-describedby` reference to a hidden element that contains the message.
1138
- * @param {Element} element The element from which to remove a visually hidden description.
1139
- * @param {string} message The message used to describe `element`.
1140
- * @param {string} [role="tooltip"] The ARIA role of the message.
1141
- */
1142
- static removeDescription(element, message, role = "tooltip") {
1143
- if (isServer) {
1144
- return;
1145
- }
1146
- const rootNode = element.getRootNode();
1147
- const container = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).get(rootNode);
1148
- if (!container) {
1149
- return;
1150
- }
1151
- const key = `${role}:${message}`;
1152
- const entry = container.messageRegistry.get(key);
1153
- if (!entry) {
1154
- return;
1155
- }
1156
- entry.count--;
1157
- removeAriaReferencedId(element, "aria-describedby", entry.messageElement.id);
1158
- // If there are no more elements referencing the message, remove it from the DOM.
1159
- if (entry.count <= 0) {
1160
- entry.messageElement.remove();
1161
- container.messageRegistry.delete(key);
1162
- }
1163
- // If there are no more registered messages, remove the container from the DOM.
1164
- if (container.messageRegistry.size == 0) {
1165
- container.containerElement?.remove();
1166
- __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).delete(rootNode);
1167
- }
1168
- }
1493
+ /**
1494
+ * Adds an `aria-describedby` reference to a hidden element that contains the message.
1495
+ * @param {Element} element The element for which to provide a visually hidden description.
1496
+ * @param {string} message The message used to describe `element`.
1497
+ * @param {string} [role="tooltip"] The ARIA role of the message.
1498
+ */
1499
+ static describe(element, message, role = "tooltip") {
1500
+ if (isServer) {
1501
+ return;
1502
+ }
1503
+ const rootNode = element.getRootNode();
1504
+ if (!(rootNode instanceof ShadowRoot || rootNode instanceof Document)) {
1505
+ return;
1506
+ }
1507
+ let container = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).get(rootNode);
1508
+ if (!container) {
1509
+ container = {
1510
+ containerElement: __classPrivateFieldGet(this, _a$2, "m", _M3eAriaDescriber_createMessageContainer).call(this),
1511
+ messageRegistry: new Map()
1512
+ };
1513
+ // Append to body if document, otherwise, append as a child of shadow root.
1514
+ (rootNode instanceof Document ? rootNode.body : rootNode).appendChild(container.containerElement);
1515
+ __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).set(rootNode, container);
1516
+ }
1517
+ const key = `${role}:${message}`;
1518
+ let entry = container.messageRegistry.get(key);
1519
+ if (!entry) {
1520
+ entry = {
1521
+ messageElement: __classPrivateFieldGet(this, _a$2, "m", _M3eAriaDescriber_createMessageElement).call(this, message, role),
1522
+ count: 0
1523
+ };
1524
+ container.containerElement.appendChild(entry.messageElement);
1525
+ container.messageRegistry.set(key, entry);
1526
+ }
1527
+ entry.count++;
1528
+ addAriaReferencedId(element, "aria-describedby", entry.messageElement.id);
1529
+ }
1530
+ /**
1531
+ * Removes an `aria-describedby` reference to a hidden element that contains the message.
1532
+ * @param {Element} element The element from which to remove a visually hidden description.
1533
+ * @param {string} message The message used to describe `element`.
1534
+ * @param {string} [role="tooltip"] The ARIA role of the message.
1535
+ */
1536
+ static removeDescription(element, message, role = "tooltip") {
1537
+ if (isServer) {
1538
+ return;
1539
+ }
1540
+ const rootNode = element.getRootNode();
1541
+ const container = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).get(rootNode);
1542
+ if (!container) {
1543
+ return;
1544
+ }
1545
+ const key = `${role}:${message}`;
1546
+ const entry = container.messageRegistry.get(key);
1547
+ if (!entry) {
1548
+ return;
1549
+ }
1550
+ entry.count--;
1551
+ removeAriaReferencedId(element, "aria-describedby", entry.messageElement.id);
1552
+ // If there are no more elements referencing the message, remove it from the DOM.
1553
+ if (entry.count <= 0) {
1554
+ entry.messageElement.remove();
1555
+ container.messageRegistry.delete(key);
1556
+ }
1557
+ // If there are no more registered messages, remove the container from the DOM.
1558
+ if (container.messageRegistry.size == 0) {
1559
+ container.containerElement?.remove();
1560
+ __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).delete(rootNode);
1561
+ }
1562
+ }
1169
1563
  }
1170
1564
  _a$2 = M3eAriaDescriber, _M3eAriaDescriber_createMessageContainer = function _M3eAriaDescriber_createMessageContainer() {
1171
- const messageContainer = document.createElement("div");
1172
- messageContainer.classList.add("m3e-describedby-message-container");
1173
- visuallyHide(messageContainer.style);
1174
- return messageContainer;
1565
+ const messageContainer = document.createElement("div");
1566
+ messageContainer.classList.add("m3e-describedby-message-container");
1567
+ visuallyHide(messageContainer.style);
1568
+ return messageContainer;
1175
1569
  }, _M3eAriaDescriber_createMessageElement = function _M3eAriaDescriber_createMessageElement(message, role) {
1176
- var _b, _c;
1177
- const messageElement = document.createElement("span");
1178
- messageElement.id = `m3e-describedby-message-${__classPrivateFieldSet(this, _a$2, (_c = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_nextId), _b = _c++, _c), "f", _M3eAriaDescriber_nextId), _b}`;
1179
- messageElement.role = role;
1180
- messageElement.ariaAtomic = "true";
1181
- messageElement.innerText = message.trim();
1182
- return messageElement;
1570
+ var _b, _c;
1571
+ const messageElement = document.createElement("span");
1572
+ messageElement.id = `m3e-describedby-message-${__classPrivateFieldSet(this, _a$2, (_c = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_nextId), _b = _c++, _c), "f", _M3eAriaDescriber_nextId), _b}`;
1573
+ messageElement.role = role;
1574
+ messageElement.ariaAtomic = "true";
1575
+ messageElement.innerText = message.trim();
1576
+ return messageElement;
1577
+ };
1578
+ /** @private */
1579
+ _M3eAriaDescriber_nextId = {
1580
+ value: 0
1581
+ };
1582
+ /** @private */
1583
+ _M3eAriaDescriber_messageContainers = {
1584
+ value: new Map()
1183
1585
  };
1184
- /** @private */ _M3eAriaDescriber_nextId = { value: 0 };
1185
- /** @private */ _M3eAriaDescriber_messageContainers = { value: new Map() };
1186
1586
  globalThis.M3eAriaDescriber = M3eAriaDescriber;
1187
1587
 
1188
1588
  var _a$1, _M3eInteractivityChecker_cannotFocusParent;
1189
1589
  /** Utility for checking the interactivity of an element, such as whether it is focusable. */
1190
1590
  class M3eInteractivityChecker {
1191
- /**
1192
- * Determines whether a given element can receive focus.
1193
- * @param {Element} element The element to test.
1194
- * @param {readonly Element[]} [parents = undefined] The known parent elements to test. The default value is `undefined`.
1195
- * @returns {boolean} Whether `element` can receive focus.
1196
- */
1197
- static isFocusable(element, parents) {
1198
- if (element.matches(":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true]):not(:disabled,[disabled])")) {
1199
- return !__classPrivateFieldGet(this, _a$1, "m", _M3eInteractivityChecker_cannotFocusParent).call(this, parents);
1200
- }
1201
- if (!element.localName.includes("-") ||
1202
- !element.matches(":not(:disabled,[disabled])") ||
1203
- element.getAttribute("aria-disabled") === "true") {
1204
- return false;
1205
- }
1206
- if (element.shadowRoot?.delegatesFocus) {
1207
- return !__classPrivateFieldGet(this, _a$1, "m", _M3eInteractivityChecker_cannotFocusParent).call(this, parents);
1208
- }
1209
- return false;
1210
- }
1211
- /**
1212
- * Finds interactive elements that descend from the specified element.
1213
- * @param {HTMLElement} element The `HTMLElement` to search.
1214
- * @returns {HTMLElement[]} The interactive elements that descend from `element`.
1215
- */
1216
- static findInteractiveElements(element) {
1217
- const elements = new Array();
1218
- const walker = element.ownerDocument.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
1219
- for (let node = walker.nextNode(); node; node = walker.nextNode()) {
1220
- const element = walker.currentNode;
1221
- if (this.isFocusable(element)) {
1222
- elements.push(element);
1223
- }
1224
- }
1225
- return elements;
1226
- }
1591
+ /**
1592
+ * Determines whether a given element can receive focus.
1593
+ * @param {Element} element The element to test.
1594
+ * @param {readonly Element[]} [parents = undefined] The known parent elements to test. The default value is `undefined`.
1595
+ * @returns {boolean} Whether `element` can receive focus.
1596
+ */
1597
+ static isFocusable(element, parents) {
1598
+ if (element.matches(":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true]):not(:disabled,[disabled])")) {
1599
+ return !__classPrivateFieldGet(this, _a$1, "m", _M3eInteractivityChecker_cannotFocusParent).call(this, parents);
1600
+ }
1601
+ if (!element.localName.includes("-") || !element.matches(":not(:disabled,[disabled])") || element.getAttribute("aria-disabled") === "true") {
1602
+ return false;
1603
+ }
1604
+ if (element.shadowRoot?.delegatesFocus) {
1605
+ return !__classPrivateFieldGet(this, _a$1, "m", _M3eInteractivityChecker_cannotFocusParent).call(this, parents);
1606
+ }
1607
+ return false;
1608
+ }
1609
+ /**
1610
+ * Finds interactive elements that descend from the specified element.
1611
+ * @param {HTMLElement} element The `HTMLElement` to search.
1612
+ * @returns {HTMLElement[]} The interactive elements that descend from `element`.
1613
+ */
1614
+ static findInteractiveElements(element) {
1615
+ const elements = new Array();
1616
+ const walker = element.ownerDocument.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
1617
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
1618
+ const element = walker.currentNode;
1619
+ if (this.isFocusable(element)) {
1620
+ elements.push(element);
1621
+ }
1622
+ }
1623
+ return elements;
1624
+ }
1227
1625
  }
1228
1626
  _a$1 = M3eInteractivityChecker, _M3eInteractivityChecker_cannotFocusParent = function _M3eInteractivityChecker_cannotFocusParent(parents) {
1229
- return parents?.some((x) => x.matches(":is([aria-hidden='true'],:disabled,[disabled])")) ?? false;
1627
+ return parents?.some(x => x.matches(":is([aria-hidden='true'],:disabled,[disabled])")) ?? false;
1230
1628
  };
1231
1629
  globalThis.M3eInteractivityChecker = M3eInteractivityChecker;
1232
1630
 
@@ -1240,102 +1638,77 @@ var _M3eFocusTrapElement_instances, _M3eFocusTrapElement_onFocus, _M3eFocusTrapE
1240
1638
  * @attr disabled - Disables the focus trap.
1241
1639
  */
1242
1640
  let M3eFocusTrapElement = class M3eFocusTrapElement extends Disabled(LitElement) {
1243
- constructor() {
1244
- super(...arguments);
1245
- _M3eFocusTrapElement_instances.add(this);
1246
- }
1247
- /** @inheritdoc */
1248
- render() {
1249
- const trap = html `<div
1250
- class="trap"
1251
- .inert="${this.disabled}"
1252
- tabindex="0"
1253
- aria-hidden="true"
1254
- @focus="${__classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_onFocus)}"
1255
- ></div>`;
1256
- return html `${trap}<slot></slot>${trap}`;
1257
- }
1641
+ constructor() {
1642
+ super(...arguments);
1643
+ _M3eFocusTrapElement_instances.add(this);
1644
+ }
1645
+ /** @inheritdoc */
1646
+ render() {
1647
+ const trap = html`<div class="trap" .inert="${this.disabled}" tabindex="0" aria-hidden="true" @focus="${__classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_onFocus)}"></div>`;
1648
+ return html`${trap}<slot></slot>${trap}`;
1649
+ }
1258
1650
  };
1259
1651
  _M3eFocusTrapElement_instances = new WeakSet();
1260
1652
  _M3eFocusTrapElement_onFocus = function _M3eFocusTrapElement_onFocus(e) {
1261
- const [first, last] = __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_getFirstAndLastFocusableChild).call(this);
1262
- const isFirst = e?.target === this._firstTrap;
1263
- const fromFirst = e.relatedTarget === first;
1264
- const fromLast = e.relatedTarget === last;
1265
- const fromOutside = !fromFirst && !fromLast;
1266
- if ((!isFirst && fromLast) || (isFirst && fromOutside)) {
1267
- first?.focus();
1268
- return;
1269
- }
1270
- if ((isFirst && fromFirst) || (!isFirst && fromOutside)) {
1271
- last?.focus();
1272
- }
1653
+ const [first, last] = __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_getFirstAndLastFocusableChild).call(this);
1654
+ const isFirst = e?.target === this._firstTrap;
1655
+ const fromFirst = e.relatedTarget === first;
1656
+ const fromLast = e.relatedTarget === last;
1657
+ const fromOutside = !fromFirst && !fromLast;
1658
+ if (!isFirst && fromLast || isFirst && fromOutside) {
1659
+ first?.focus();
1660
+ return;
1661
+ }
1662
+ if (isFirst && fromFirst || !isFirst && fromOutside) {
1663
+ last?.focus();
1664
+ }
1273
1665
  };
1274
1666
  _M3eFocusTrapElement_getFirstAndLastFocusableChild = function _M3eFocusTrapElement_getFirstAndLastFocusableChild() {
1275
- let first = null;
1276
- let last = null;
1277
- __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, this, [], (element, parents) => {
1278
- if (M3eInteractivityChecker.isFocusable(element, parents) &&
1279
- element instanceof HTMLElement &&
1280
- element.tabIndex >= 0) {
1281
- first = first ?? element;
1282
- last = element;
1283
- }
1284
- });
1285
- return [first, last];
1667
+ let first = null;
1668
+ let last = null;
1669
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, this, [], (element, parents) => {
1670
+ if (M3eInteractivityChecker.isFocusable(element, parents) && element instanceof HTMLElement && element.tabIndex >= 0) {
1671
+ first = first ?? element;
1672
+ last = element;
1673
+ }
1674
+ });
1675
+ return [first, last];
1286
1676
  };
1287
1677
  _M3eFocusTrapElement_walkTree = function _M3eFocusTrapElement_walkTree(root, parents, callback) {
1288
- parents = [...parents, root];
1289
- for (const node of root.childNodes) {
1290
- if (node.nodeType !== Node.ELEMENT_NODE)
1291
- continue;
1292
- const element = node;
1293
- callback(element, parents);
1294
- if (element.shadowRoot) {
1295
- __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkShadowRoot).call(this, element, parents, callback);
1296
- }
1297
- else if (element instanceof HTMLSlotElement) {
1298
- __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkSlot).call(this, element, parents, callback);
1299
- }
1300
- else if (element.hasChildNodes()) {
1301
- __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, element, parents, callback);
1302
- }
1303
- }
1678
+ parents = [...parents, root];
1679
+ for (const node of root.childNodes) {
1680
+ if (node.nodeType !== Node.ELEMENT_NODE) continue;
1681
+ const element = node;
1682
+ callback(element, parents);
1683
+ if (element.shadowRoot) {
1684
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkShadowRoot).call(this, element, parents, callback);
1685
+ } else if (element instanceof HTMLSlotElement) {
1686
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkSlot).call(this, element, parents, callback);
1687
+ } else if (element.hasChildNodes()) {
1688
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, element, parents, callback);
1689
+ }
1690
+ }
1304
1691
  };
1305
1692
  _M3eFocusTrapElement_walkShadowRoot = function _M3eFocusTrapElement_walkShadowRoot(root, parents, callback) {
1306
- for (const node of root.shadowRoot?.childNodes ?? []) {
1307
- if (node.nodeType !== Node.ELEMENT_NODE)
1308
- continue;
1309
- const element = node;
1310
- callback(element, parents);
1311
- if (!element.hasChildNodes())
1312
- continue;
1313
- __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, element, parents, callback);
1314
- }
1693
+ for (const node of root.shadowRoot?.childNodes ?? []) {
1694
+ if (node.nodeType !== Node.ELEMENT_NODE) continue;
1695
+ const element = node;
1696
+ callback(element, parents);
1697
+ if (!element.hasChildNodes()) continue;
1698
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, element, parents, callback);
1699
+ }
1315
1700
  };
1316
1701
  _M3eFocusTrapElement_walkSlot = function _M3eFocusTrapElement_walkSlot(slot, parents, callback) {
1317
- for (const node of slot.assignedElements()) {
1318
- callback(node, parents);
1319
- if (!node.hasChildNodes())
1320
- continue;
1321
- __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, node, parents, callback);
1322
- }
1702
+ for (const node of slot.assignedElements()) {
1703
+ callback(node, parents);
1704
+ if (!node.hasChildNodes()) continue;
1705
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, node, parents, callback);
1706
+ }
1323
1707
  };
1324
1708
  /** The styles of the element. */
1325
- M3eFocusTrapElement.styles = css `
1326
- :host {
1327
- display: contents;
1328
- }
1329
- .trap {
1330
- outline: none;
1331
- }
1332
- `;
1333
- __decorate([
1334
- e(".trap")
1335
- ], M3eFocusTrapElement.prototype, "_firstTrap", void 0);
1336
- M3eFocusTrapElement = __decorate([
1337
- t$1("m3e-focus-trap")
1338
- ], M3eFocusTrapElement);
1709
+ M3eFocusTrapElement.styles = css`:host { display: contents; } .trap { outline: none; }`;
1710
+ __decorate([e(".trap")], M3eFocusTrapElement.prototype, "_firstTrap", void 0);
1711
+ M3eFocusTrapElement = __decorate([t$1("m3e-focus-trap")], M3eFocusTrapElement);
1339
1712
 
1340
1713
  /**
1341
1714
  * Adapted from Angular Material CDK Live Announcer
@@ -1348,71 +1721,85 @@ M3eFocusTrapElement = __decorate([
1348
1721
  var _a, _M3eLiveAnnouncer_nextId, _M3eLiveAnnouncer_liveElement, _M3eLiveAnnouncer_previousTimeout, _M3eLiveAnnouncer_currentPromise, _M3eLiveAnnouncer_currentResolve, _M3eLiveAnnouncer_createLiveElement;
1349
1722
  /** Utility for announcing messages to screen readers. */
1350
1723
  class M3eLiveAnnouncer {
1351
- static announce(message, ...args) {
1352
- if (isServer) {
1353
- return Promise.resolve();
1354
- }
1355
- __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement) ?? __classPrivateFieldGet(this, _a, "m", _M3eLiveAnnouncer_createLiveElement).call(this), "f", _M3eLiveAnnouncer_liveElement);
1356
- let politeness;
1357
- let duration;
1358
- if (args.length === 1 && typeof args[0] === "number") {
1359
- duration = args[0];
1360
- }
1361
- else {
1362
- [politeness, duration] = args;
1363
- }
1364
- this.clear();
1365
- clearTimeout(__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_previousTimeout));
1366
- __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).setAttribute("aria-live", politeness ?? "polite");
1367
- for (const modal of document.querySelectorAll("m3e-dialog")) {
1368
- addAriaReferencedId(modal, "aria-owns", __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).id);
1369
- }
1370
- __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentPromise) ?? new Promise((resolve) => (__classPrivateFieldSet(this, _a, resolve, "f", _M3eLiveAnnouncer_currentResolve))), "f", _M3eLiveAnnouncer_currentPromise);
1371
- clearTimeout(__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_previousTimeout));
1372
- __classPrivateFieldSet(this, _a, setTimeout(() => {
1373
- if (!__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement)) {
1374
- return;
1375
- }
1376
- __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).textContent = message;
1377
- if (duration !== undefined) {
1378
- __classPrivateFieldSet(this, _a, setTimeout(() => this.clear(), duration), "f", _M3eLiveAnnouncer_previousTimeout);
1379
- }
1380
- __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentResolve)?.call(this);
1381
- __classPrivateFieldSet(this, _a, __classPrivateFieldSet(this, _a, undefined, "f", _M3eLiveAnnouncer_currentResolve), "f", _M3eLiveAnnouncer_currentPromise);
1382
- }, 100), "f", _M3eLiveAnnouncer_previousTimeout);
1383
- return __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentPromise);
1384
- }
1385
- /**
1386
- * Clears the current text from the announcer element. Can be used to prevent
1387
- * screen readers from reading the text out again while the user is going
1388
- * through page landmarks.
1389
- */
1390
- static clear() {
1391
- if (__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement)) {
1392
- __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).textContent = "";
1393
- }
1394
- }
1724
+ static announce(message, ...args) {
1725
+ if (isServer) {
1726
+ return Promise.resolve();
1727
+ }
1728
+ __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement) ?? __classPrivateFieldGet(this, _a, "m", _M3eLiveAnnouncer_createLiveElement).call(this), "f", _M3eLiveAnnouncer_liveElement);
1729
+ let politeness;
1730
+ let duration;
1731
+ if (args.length === 1 && typeof args[0] === "number") {
1732
+ duration = args[0];
1733
+ } else {
1734
+ [politeness, duration] = args;
1735
+ }
1736
+ this.clear();
1737
+ clearTimeout(__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_previousTimeout));
1738
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).setAttribute("aria-live", politeness ?? "polite");
1739
+ for (const modal of document.querySelectorAll("m3e-dialog")) {
1740
+ addAriaReferencedId(modal, "aria-owns", __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).id);
1741
+ }
1742
+ __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentPromise) ?? new Promise(resolve => __classPrivateFieldSet(this, _a, resolve, "f", _M3eLiveAnnouncer_currentResolve)), "f", _M3eLiveAnnouncer_currentPromise);
1743
+ clearTimeout(__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_previousTimeout));
1744
+ __classPrivateFieldSet(this, _a, setTimeout(() => {
1745
+ if (!__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement)) {
1746
+ return;
1747
+ }
1748
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).textContent = message;
1749
+ if (duration !== undefined) {
1750
+ __classPrivateFieldSet(this, _a, setTimeout(() => this.clear(), duration), "f", _M3eLiveAnnouncer_previousTimeout);
1751
+ }
1752
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentResolve)?.call(this);
1753
+ __classPrivateFieldSet(this, _a, __classPrivateFieldSet(this, _a, undefined, "f", _M3eLiveAnnouncer_currentResolve), "f", _M3eLiveAnnouncer_currentPromise);
1754
+ }, 100), "f", _M3eLiveAnnouncer_previousTimeout);
1755
+ return __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentPromise);
1756
+ }
1757
+ /**
1758
+ * Clears the current text from the announcer element. Can be used to prevent
1759
+ * screen readers from reading the text out again while the user is going
1760
+ * through page landmarks.
1761
+ */
1762
+ static clear() {
1763
+ if (__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement)) {
1764
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).textContent = "";
1765
+ }
1766
+ }
1395
1767
  }
1396
1768
  _a = M3eLiveAnnouncer, _M3eLiveAnnouncer_createLiveElement = function _M3eLiveAnnouncer_createLiveElement() {
1397
- var _b, _c;
1398
- const prev = document.getElementsByClassName("m3e-live-announcer");
1399
- for (let i = 0; i < prev.length; i++) {
1400
- prev[i].remove();
1401
- }
1402
- const liveAnnouncer = document.createElement("div");
1403
- liveAnnouncer.classList.add("m3e-live-announcer");
1404
- liveAnnouncer.setAttribute("aria-atomic", "true");
1405
- liveAnnouncer.setAttribute("aria-live", "polite");
1406
- liveAnnouncer.id = `m3e-live-announcer-${__classPrivateFieldSet(this, _a, (_c = __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_nextId), _b = _c++, _c), "f", _M3eLiveAnnouncer_nextId), _b}`;
1407
- visuallyHide(liveAnnouncer.style);
1408
- document.body.append(liveAnnouncer);
1409
- return liveAnnouncer;
1769
+ var _b, _c;
1770
+ const prev = document.getElementsByClassName("m3e-live-announcer");
1771
+ for (let i = 0; i < prev.length; i++) {
1772
+ prev[i].remove();
1773
+ }
1774
+ const liveAnnouncer = document.createElement("div");
1775
+ liveAnnouncer.classList.add("m3e-live-announcer");
1776
+ liveAnnouncer.setAttribute("aria-atomic", "true");
1777
+ liveAnnouncer.setAttribute("aria-live", "polite");
1778
+ liveAnnouncer.id = `m3e-live-announcer-${__classPrivateFieldSet(this, _a, (_c = __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_nextId), _b = _c++, _c), "f", _M3eLiveAnnouncer_nextId), _b}`;
1779
+ visuallyHide(liveAnnouncer.style);
1780
+ document.body.append(liveAnnouncer);
1781
+ return liveAnnouncer;
1782
+ };
1783
+ /** @private */
1784
+ _M3eLiveAnnouncer_nextId = {
1785
+ value: 0
1786
+ };
1787
+ /** @private */
1788
+ _M3eLiveAnnouncer_liveElement = {
1789
+ value: void 0
1790
+ };
1791
+ /** @private */
1792
+ _M3eLiveAnnouncer_previousTimeout = {
1793
+ value: void 0
1794
+ };
1795
+ /** @private */
1796
+ _M3eLiveAnnouncer_currentPromise = {
1797
+ value: void 0
1798
+ };
1799
+ /** @private */
1800
+ _M3eLiveAnnouncer_currentResolve = {
1801
+ value: void 0
1410
1802
  };
1411
- /** @private */ _M3eLiveAnnouncer_nextId = { value: 0 };
1412
- /** @private */ _M3eLiveAnnouncer_liveElement = { value: void 0 };
1413
- /** @private */ _M3eLiveAnnouncer_previousTimeout = { value: void 0 };
1414
- /** @private */ _M3eLiveAnnouncer_currentPromise = { value: void 0 };
1415
- /** @private */ _M3eLiveAnnouncer_currentResolve = { value: void 0 };
1416
1803
  globalThis.M3eLiveAnnouncer = M3eLiveAnnouncer;
1417
1804
 
1418
1805
  export { FocusKeyManager, KeyCode, ListKeyManager, ListManager, M3eAriaDescriber, M3eFocusTrapElement, M3eInteractivityChecker, M3eLiveAnnouncer, ModifierKeys, RadioKeyManager, RovingTabIndexManager, SelectionManager, Typeahead, addAriaReferencedId, getAriaReferenceIds, getKeyCode, hasModifierKey, isModifierAllowed, isTypeaheadItem, removeAriaReferencedId, selectionManager, typeaheadLabel };