@m3e/nav-menu 1.0.5 → 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/index.js CHANGED
@@ -6,6 +6,7 @@
6
6
  import { LitElement, html, unsafeCSS, css } from 'lit';
7
7
  import { Selected, Disabled, EventAttribute, AttachInternals, Role, DesignToken, hasAssignedNodes, scrollIntoViewIfNeeded, PressedController, FocusController } from '@m3e/core';
8
8
  import { selectionManager, SelectionManager } from '@m3e/core/a11y';
9
+ import { M3eDirectionality } from '@m3e/core/bidi';
9
10
 
10
11
  /******************************************************************************
11
12
  Copyright (c) Microsoft Corporation.
@@ -20,33 +21,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
21
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21
22
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
23
  PERFORMANCE OF THIS SOFTWARE.
23
- ***************************************************************************** */
24
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
25
-
26
-
27
- function __decorate(decorators, target, key, desc) {
28
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
29
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
30
- 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;
31
- return c > 3 && r && Object.defineProperty(target, key, r), r;
32
- }
33
-
34
- function __classPrivateFieldGet(receiver, state, kind, f) {
35
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
36
- 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");
37
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
38
- }
39
-
40
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
41
- if (kind === "m") throw new TypeError("Private method is not writable");
42
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
43
- 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");
44
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
45
- }
46
-
47
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
48
- var e = new Error(message);
49
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
24
+ ***************************************************************************** */
25
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
26
+
27
+ function __decorate(decorators, target, key, desc) {
28
+ var c = arguments.length,
29
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
30
+ d;
31
+ 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;
32
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
33
+ }
34
+ function __classPrivateFieldGet(receiver, state, kind, f) {
35
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
36
+ 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");
37
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
38
+ }
39
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
40
+ if (kind === "m") throw new TypeError("Private method is not writable");
41
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
42
+ 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");
43
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
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;
50
48
  };
51
49
 
52
50
  /**
@@ -54,58 +52,707 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
54
52
  * Copyright 2017 Google LLC
55
53
  * SPDX-License-Identifier: BSD-3-Clause
56
54
  */
57
- const t$2=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
55
+ const t$2 = t => (e, o) => {
56
+ void 0 !== o ? o.addInitializer(() => {
57
+ customElements.define(t, e);
58
+ }) : customElements.define(t, e);
59
+ };
58
60
 
59
61
  /**
60
62
  * @license
61
63
  * Copyright 2019 Google LLC
62
64
  * SPDX-License-Identifier: BSD-3-Clause
63
65
  */
64
- const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$1)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$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$1),S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
66
+ const t$1 = globalThis,
67
+ e$4 = t$1.ShadowRoot && (void 0 === t$1.ShadyCSS || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
68
+ s$1 = Symbol(),
69
+ o$4 = new WeakMap();
70
+ let n$3 = class n {
71
+ constructor(t, e, o) {
72
+ if (this._$cssResult$ = true, o !== s$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
73
+ this.cssText = t, this.t = e;
74
+ }
75
+ get styleSheet() {
76
+ let t = this.o;
77
+ const s = this.t;
78
+ if (e$4 && void 0 === t) {
79
+ const e = void 0 !== s && 1 === s.length;
80
+ e && (t = o$4.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$4.set(s, t));
81
+ }
82
+ return t;
83
+ }
84
+ toString() {
85
+ return this.cssText;
86
+ }
87
+ };
88
+ const r$4 = t => new n$3("string" == typeof t ? t : t + "", void 0, s$1),
89
+ S$1 = (s, o) => {
90
+ if (e$4) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
91
+ const o = document.createElement("style"),
92
+ n = t$1.litNonce;
93
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
94
+ }
95
+ },
96
+ c$2 = e$4 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
97
+ let e = "";
98
+ for (const s of t.cssRules) e += s.cssText;
99
+ return r$4(e);
100
+ })(t) : t;
65
101
 
66
102
  /**
67
103
  * @license
68
104
  * Copyright 2017 Google LLC
69
105
  * SPDX-License-Identifier: BSD-3-Clause
70
- */const{is:i$1,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1: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$1=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.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$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(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$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$3(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$2(s));}else void 0!==s&&i.push(c$2(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$1(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$1).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$1;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$1)(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$1("elementProperties")]=new Map,y[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y}),(a$1.reactiveElementVersions??=[]).push("2.1.1");
106
+ */
107
+ const {
108
+ is: i$1,
109
+ defineProperty: e$3,
110
+ getOwnPropertyDescriptor: h$1,
111
+ getOwnPropertyNames: r$3,
112
+ getOwnPropertySymbols: o$3,
113
+ getPrototypeOf: n$2
114
+ } = Object,
115
+ a$1 = globalThis,
116
+ c$1 = a$1.trustedTypes,
117
+ l$1 = c$1 ? c$1.emptyScript : "",
118
+ p$1 = a$1.reactiveElementPolyfillSupport,
119
+ d$1 = (t, s) => t,
120
+ u$1 = {
121
+ toAttribute(t, s) {
122
+ switch (s) {
123
+ case Boolean:
124
+ t = t ? l$1 : null;
125
+ break;
126
+ case Object:
127
+ case Array:
128
+ t = null == t ? t : JSON.stringify(t);
129
+ }
130
+ return t;
131
+ },
132
+ fromAttribute(t, s) {
133
+ let i = t;
134
+ switch (s) {
135
+ case Boolean:
136
+ i = null !== t;
137
+ break;
138
+ case Number:
139
+ i = null === t ? null : Number(t);
140
+ break;
141
+ case Object:
142
+ case Array:
143
+ try {
144
+ i = JSON.parse(t);
145
+ } catch (t) {
146
+ i = null;
147
+ }
148
+ }
149
+ return i;
150
+ }
151
+ },
152
+ f$1 = (t, s) => !i$1(t, s),
153
+ b = {
154
+ attribute: true,
155
+ type: String,
156
+ converter: u$1,
157
+ reflect: false,
158
+ useDefault: false,
159
+ hasChanged: f$1
160
+ };
161
+ Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= new WeakMap();
162
+ class y extends HTMLElement {
163
+ static addInitializer(t) {
164
+ this._$Ei(), (this.l ??= []).push(t);
165
+ }
166
+ static get observedAttributes() {
167
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
168
+ }
169
+ static createProperty(t, s = b) {
170
+ 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) {
171
+ const i = Symbol(),
172
+ h = this.getPropertyDescriptor(t, i, s);
173
+ void 0 !== h && e$3(this.prototype, t, h);
174
+ }
175
+ }
176
+ static getPropertyDescriptor(t, s, i) {
177
+ const {
178
+ get: e,
179
+ set: r
180
+ } = h$1(this.prototype, t) ?? {
181
+ get() {
182
+ return this[s];
183
+ },
184
+ set(t) {
185
+ this[s] = t;
186
+ }
187
+ };
188
+ return {
189
+ get: e,
190
+ set(s) {
191
+ const h = e?.call(this);
192
+ r?.call(this, s), this.requestUpdate(t, h, i);
193
+ },
194
+ configurable: true,
195
+ enumerable: true
196
+ };
197
+ }
198
+ static getPropertyOptions(t) {
199
+ return this.elementProperties.get(t) ?? b;
200
+ }
201
+ static _$Ei() {
202
+ if (this.hasOwnProperty(d$1("elementProperties"))) return;
203
+ const t = n$2(this);
204
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
205
+ }
206
+ static finalize() {
207
+ if (this.hasOwnProperty(d$1("finalized"))) return;
208
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
209
+ const t = this.properties,
210
+ s = [...r$3(t), ...o$3(t)];
211
+ for (const i of s) this.createProperty(i, t[i]);
212
+ }
213
+ const t = this[Symbol.metadata];
214
+ if (null !== t) {
215
+ const s = litPropertyMetadata.get(t);
216
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
217
+ }
218
+ this._$Eh = new Map();
219
+ for (const [t, s] of this.elementProperties) {
220
+ const i = this._$Eu(t, s);
221
+ void 0 !== i && this._$Eh.set(i, t);
222
+ }
223
+ this.elementStyles = this.finalizeStyles(this.styles);
224
+ }
225
+ static finalizeStyles(s) {
226
+ const i = [];
227
+ if (Array.isArray(s)) {
228
+ const e = new Set(s.flat(1 / 0).reverse());
229
+ for (const s of e) i.unshift(c$2(s));
230
+ } else void 0 !== s && i.push(c$2(s));
231
+ return i;
232
+ }
233
+ static _$Eu(t, s) {
234
+ const i = s.attribute;
235
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
236
+ }
237
+ constructor() {
238
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
239
+ }
240
+ _$Ev() {
241
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
242
+ }
243
+ addController(t) {
244
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
245
+ }
246
+ removeController(t) {
247
+ this._$EO?.delete(t);
248
+ }
249
+ _$E_() {
250
+ const t = new Map(),
251
+ s = this.constructor.elementProperties;
252
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
253
+ t.size > 0 && (this._$Ep = t);
254
+ }
255
+ createRenderRoot() {
256
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
257
+ return S$1(t, this.constructor.elementStyles), t;
258
+ }
259
+ connectedCallback() {
260
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
261
+ }
262
+ enableUpdating(t) {}
263
+ disconnectedCallback() {
264
+ this._$EO?.forEach(t => t.hostDisconnected?.());
265
+ }
266
+ attributeChangedCallback(t, s, i) {
267
+ this._$AK(t, i);
268
+ }
269
+ _$ET(t, s) {
270
+ const i = this.constructor.elementProperties.get(t),
271
+ e = this.constructor._$Eu(t, i);
272
+ if (void 0 !== e && true === i.reflect) {
273
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u$1).toAttribute(s, i.type);
274
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
275
+ }
276
+ }
277
+ _$AK(t, s) {
278
+ const i = this.constructor,
279
+ e = i._$Eh.get(t);
280
+ if (void 0 !== e && this._$Em !== e) {
281
+ const t = i.getPropertyOptions(e),
282
+ h = "function" == typeof t.converter ? {
283
+ fromAttribute: t.converter
284
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u$1;
285
+ this._$Em = e;
286
+ const r = h.fromAttribute(s, t.type);
287
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
288
+ }
289
+ }
290
+ requestUpdate(t, s, i) {
291
+ if (void 0 !== t) {
292
+ const e = this.constructor,
293
+ h = this[t];
294
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f$1)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
295
+ this.C(t, s, i);
296
+ }
297
+ false === this.isUpdatePending && (this._$ES = this._$EP());
298
+ }
299
+ C(t, s, {
300
+ useDefault: i,
301
+ reflect: e,
302
+ wrapped: h
303
+ }, r) {
304
+ 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));
305
+ }
306
+ async _$EP() {
307
+ this.isUpdatePending = true;
308
+ try {
309
+ await this._$ES;
310
+ } catch (t) {
311
+ Promise.reject(t);
312
+ }
313
+ const t = this.scheduleUpdate();
314
+ return null != t && (await t), !this.isUpdatePending;
315
+ }
316
+ scheduleUpdate() {
317
+ return this.performUpdate();
318
+ }
319
+ performUpdate() {
320
+ if (!this.isUpdatePending) return;
321
+ if (!this.hasUpdated) {
322
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
323
+ for (const [t, s] of this._$Ep) this[t] = s;
324
+ this._$Ep = void 0;
325
+ }
326
+ const t = this.constructor.elementProperties;
327
+ if (t.size > 0) for (const [s, i] of t) {
328
+ const {
329
+ wrapped: t
330
+ } = i,
331
+ e = this[s];
332
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
333
+ }
334
+ }
335
+ let t = false;
336
+ const s = this._$AL;
337
+ try {
338
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
339
+ } catch (s) {
340
+ throw t = false, this._$EM(), s;
341
+ }
342
+ t && this._$AE(s);
343
+ }
344
+ willUpdate(t) {}
345
+ _$AE(t) {
346
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
347
+ }
348
+ _$EM() {
349
+ this._$AL = new Map(), this.isUpdatePending = false;
350
+ }
351
+ get updateComplete() {
352
+ return this.getUpdateComplete();
353
+ }
354
+ getUpdateComplete() {
355
+ return this._$ES;
356
+ }
357
+ shouldUpdate(t) {
358
+ return true;
359
+ }
360
+ update(t) {
361
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
362
+ }
363
+ updated(t) {}
364
+ firstUpdated(t) {}
365
+ }
366
+ y.elementStyles = [], y.shadowRootOptions = {
367
+ mode: "open"
368
+ }, y[d$1("elementProperties")] = new Map(), y[d$1("finalized")] = new Map(), p$1?.({
369
+ ReactiveElement: y
370
+ }), (a$1.reactiveElementVersions ??= []).push("2.1.1");
71
371
 
72
372
  /**
73
373
  * @license
74
374
  * Copyright 2017 Google LLC
75
375
  * SPDX-License-Identifier: BSD-3-Clause
76
- */const o$2={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$2=(t=o$2,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$1(t){return (e,o)=>"object"==typeof o?r$2(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)}
376
+ */
377
+ const o$2 = {
378
+ attribute: true,
379
+ type: String,
380
+ converter: u$1,
381
+ reflect: false,
382
+ hasChanged: f$1
383
+ },
384
+ r$2 = (t = o$2, e, r) => {
385
+ const {
386
+ kind: n,
387
+ metadata: i
388
+ } = r;
389
+ let s = globalThis.litPropertyMetadata.get(i);
390
+ 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) {
391
+ const {
392
+ name: o
393
+ } = r;
394
+ return {
395
+ set(r) {
396
+ const n = e.get.call(this);
397
+ e.set.call(this, r), this.requestUpdate(o, n, t);
398
+ },
399
+ init(e) {
400
+ return void 0 !== e && this.C(o, void 0, t, e), e;
401
+ }
402
+ };
403
+ }
404
+ if ("setter" === n) {
405
+ const {
406
+ name: o
407
+ } = r;
408
+ return function (r) {
409
+ const n = this[o];
410
+ e.call(this, r), this.requestUpdate(o, n, t);
411
+ };
412
+ }
413
+ throw Error("Unsupported decorator location: " + n);
414
+ };
415
+ function n$1(t) {
416
+ return (e, o) => "object" == typeof o ? r$2(t, e, o) : ((t, e, o) => {
417
+ const r = e.hasOwnProperty(o);
418
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
419
+ })(t, e, o);
420
+ }
77
421
 
78
422
  /**
79
423
  * @license
80
424
  * Copyright 2017 Google LLC
81
425
  * SPDX-License-Identifier: BSD-3-Clause
82
- */function r$1(r){return n$1({...r,state:true,attribute:false})}
426
+ */
427
+ function r$1(r) {
428
+ return n$1({
429
+ ...r,
430
+ state: true,
431
+ attribute: false
432
+ });
433
+ }
83
434
 
84
435
  /**
85
436
  * @license
86
437
  * Copyright 2017 Google LLC
87
438
  * SPDX-License-Identifier: BSD-3-Clause
88
439
  */
89
- const e$2=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
440
+ const e$2 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
90
441
 
91
442
  /**
92
443
  * @license
93
444
  * Copyright 2017 Google LLC
94
445
  * SPDX-License-Identifier: BSD-3-Clause
95
- */function e$1(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$2(n,s,{get(){return o(this)}})}}
446
+ */
447
+ function e$1(e, r) {
448
+ return (n, s, i) => {
449
+ const o = t => t.renderRoot?.querySelector(e) ?? null;
450
+ return e$2(n, s, {
451
+ get() {
452
+ return o(this);
453
+ }
454
+ });
455
+ };
456
+ }
96
457
 
97
458
  /**
98
459
  * @license
99
460
  * Copyright 2017 Google LLC
100
461
  * SPDX-License-Identifier: BSD-3-Clause
101
462
  */
102
- const t=globalThis,i=t.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$1="?"+h,n=`<${o$1}>`,r=document,l=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$1)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.3.1");
463
+ const t = globalThis,
464
+ i = t.trustedTypes,
465
+ s = i ? i.createPolicy("lit-html", {
466
+ createHTML: t => t
467
+ }) : void 0,
468
+ e = "$lit$",
469
+ h = `lit$${Math.random().toFixed(9).slice(2)}$`,
470
+ o$1 = "?" + h,
471
+ n = `<${o$1}>`,
472
+ r = document,
473
+ l = () => r.createComment(""),
474
+ c = t => null === t || "object" != typeof t && "function" != typeof t,
475
+ a = Array.isArray,
476
+ u = t => a(t) || "function" == typeof t?.[Symbol.iterator],
477
+ d = "[ \t\n\f\r]",
478
+ f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
479
+ v = /-->/g,
480
+ _ = />/g,
481
+ m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"),
482
+ p = /'/g,
483
+ g = /"/g,
484
+ $ = /^(?:script|style|textarea|title)$/i,
485
+ T = Symbol.for("lit-noChange"),
486
+ E = Symbol.for("lit-nothing"),
487
+ A = new WeakMap(),
488
+ C = r.createTreeWalker(r, 129);
489
+ function P(t, i) {
490
+ if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
491
+ return void 0 !== s ? s.createHTML(i) : i;
492
+ }
493
+ const V = (t, i) => {
494
+ const s = t.length - 1,
495
+ o = [];
496
+ let r,
497
+ l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "",
498
+ c = f;
499
+ for (let i = 0; i < s; i++) {
500
+ const s = t[i];
501
+ let a,
502
+ u,
503
+ d = -1,
504
+ y = 0;
505
+ for (; y < s.length && (c.lastIndex = y, u = c.exec(s), null !== u);) y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = r ?? f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
506
+ const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
507
+ l += c === f ? s + n : d >= 0 ? (o.push(a), s.slice(0, d) + e + s.slice(d) + h + x) : s + h + (-2 === d ? i : x);
508
+ }
509
+ return [P(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")), o];
510
+ };
511
+ class N {
512
+ constructor({
513
+ strings: t,
514
+ _$litType$: s
515
+ }, n) {
516
+ let r;
517
+ this.parts = [];
518
+ let c = 0,
519
+ a = 0;
520
+ const u = t.length - 1,
521
+ d = this.parts,
522
+ [f, v] = V(t, s);
523
+ if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
524
+ const t = this.el.content.firstChild;
525
+ t.replaceWith(...t.childNodes);
526
+ }
527
+ for (; null !== (r = C.nextNode()) && d.length < u;) {
528
+ if (1 === r.nodeType) {
529
+ if (r.hasAttributes()) for (const t of r.getAttributeNames()) if (t.endsWith(e)) {
530
+ const i = v[a++],
531
+ s = r.getAttribute(t).split(h),
532
+ e = /([.?@])?(.*)/.exec(i);
533
+ d.push({
534
+ type: 1,
535
+ index: c,
536
+ name: e[2],
537
+ strings: s,
538
+ ctor: "." === e[1] ? H : "?" === e[1] ? I : "@" === e[1] ? L : k
539
+ }), r.removeAttribute(t);
540
+ } else t.startsWith(h) && (d.push({
541
+ type: 6,
542
+ index: c
543
+ }), r.removeAttribute(t));
544
+ if ($.test(r.tagName)) {
545
+ const t = r.textContent.split(h),
546
+ s = t.length - 1;
547
+ if (s > 0) {
548
+ r.textContent = i ? i.emptyScript : "";
549
+ for (let i = 0; i < s; i++) r.append(t[i], l()), C.nextNode(), d.push({
550
+ type: 2,
551
+ index: ++c
552
+ });
553
+ r.append(t[s], l());
554
+ }
555
+ }
556
+ } else if (8 === r.nodeType) if (r.data === o$1) d.push({
557
+ type: 2,
558
+ index: c
559
+ });else {
560
+ let t = -1;
561
+ for (; -1 !== (t = r.data.indexOf(h, t + 1));) d.push({
562
+ type: 7,
563
+ index: c
564
+ }), t += h.length - 1;
565
+ }
566
+ c++;
567
+ }
568
+ }
569
+ static createElement(t, i) {
570
+ const s = r.createElement("template");
571
+ return s.innerHTML = t, s;
572
+ }
573
+ }
574
+ function S(t, i, s = t, e) {
575
+ if (i === T) return i;
576
+ let h = void 0 !== e ? s._$Co?.[e] : s._$Cl;
577
+ const o = c(i) ? void 0 : i._$litDirective$;
578
+ return h?.constructor !== o && (h?._$AO?.(false), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? (s._$Co ??= [])[e] = h : s._$Cl = h), void 0 !== h && (i = S(t, h._$AS(t, i.values), h, e)), i;
579
+ }
580
+ class M {
581
+ constructor(t, i) {
582
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
583
+ }
584
+ get parentNode() {
585
+ return this._$AM.parentNode;
586
+ }
587
+ get _$AU() {
588
+ return this._$AM._$AU;
589
+ }
590
+ u(t) {
591
+ const {
592
+ el: {
593
+ content: i
594
+ },
595
+ parts: s
596
+ } = this._$AD,
597
+ e = (t?.creationScope ?? r).importNode(i, true);
598
+ C.currentNode = e;
599
+ let h = C.nextNode(),
600
+ o = 0,
601
+ n = 0,
602
+ l = s[0];
603
+ for (; void 0 !== l;) {
604
+ if (o === l.index) {
605
+ let i;
606
+ 2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
607
+ }
608
+ o !== l?.index && (h = C.nextNode(), o++);
609
+ }
610
+ return C.currentNode = r, e;
611
+ }
612
+ p(t) {
613
+ let i = 0;
614
+ for (const s of this._$AV) void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
615
+ }
616
+ }
617
+ class R {
618
+ get _$AU() {
619
+ return this._$AM?._$AU ?? this._$Cv;
620
+ }
621
+ constructor(t, i, s, e) {
622
+ this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
623
+ }
624
+ get parentNode() {
625
+ let t = this._$AA.parentNode;
626
+ const i = this._$AM;
627
+ return void 0 !== i && 11 === t?.nodeType && (t = i.parentNode), t;
628
+ }
629
+ get startNode() {
630
+ return this._$AA;
631
+ }
632
+ get endNode() {
633
+ return this._$AB;
634
+ }
635
+ _$AI(t, i = this) {
636
+ t = S(this, t, i), c(t) ? t === E || null == t || "" === t ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u(t) ? this.k(t) : this._(t);
637
+ }
638
+ O(t) {
639
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
640
+ }
641
+ T(t) {
642
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
643
+ }
644
+ _(t) {
645
+ this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r.createTextNode(t)), this._$AH = t;
646
+ }
647
+ $(t) {
648
+ const {
649
+ values: i,
650
+ _$litType$: s
651
+ } = t,
652
+ e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
653
+ if (this._$AH?._$AD === e) this._$AH.p(i);else {
654
+ const t = new M(e, this),
655
+ s = t.u(this.options);
656
+ t.p(i), this.T(s), this._$AH = t;
657
+ }
658
+ }
659
+ _$AC(t) {
660
+ let i = A.get(t.strings);
661
+ return void 0 === i && A.set(t.strings, i = new N(t)), i;
662
+ }
663
+ k(t) {
664
+ a(this._$AH) || (this._$AH = [], this._$AR());
665
+ const i = this._$AH;
666
+ let s,
667
+ e = 0;
668
+ for (const h of t) e === i.length ? i.push(s = new R(this.O(l()), this.O(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
669
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
670
+ }
671
+ _$AR(t = this._$AA.nextSibling, i) {
672
+ for (this._$AP?.(false, true, i); t !== this._$AB;) {
673
+ const i = t.nextSibling;
674
+ t.remove(), t = i;
675
+ }
676
+ }
677
+ setConnected(t) {
678
+ void 0 === this._$AM && (this._$Cv = t, this._$AP?.(t));
679
+ }
680
+ }
681
+ class k {
682
+ get tagName() {
683
+ return this.element.tagName;
684
+ }
685
+ get _$AU() {
686
+ return this._$AM._$AU;
687
+ }
688
+ constructor(t, i, s, e, h) {
689
+ this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = E;
690
+ }
691
+ _$AI(t, i = this, s, e) {
692
+ const h = this.strings;
693
+ let o = false;
694
+ if (void 0 === h) t = S(this, t, i, 0), o = !c(t) || t !== this._$AH && t !== T, o && (this._$AH = t);else {
695
+ const e = t;
696
+ let n, r;
697
+ for (t = h[0], n = 0; n < h.length - 1; n++) r = S(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
698
+ }
699
+ o && !e && this.j(t);
700
+ }
701
+ j(t) {
702
+ t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
703
+ }
704
+ }
705
+ class H extends k {
706
+ constructor() {
707
+ super(...arguments), this.type = 3;
708
+ }
709
+ j(t) {
710
+ this.element[this.name] = t === E ? void 0 : t;
711
+ }
712
+ }
713
+ class I extends k {
714
+ constructor() {
715
+ super(...arguments), this.type = 4;
716
+ }
717
+ j(t) {
718
+ this.element.toggleAttribute(this.name, !!t && t !== E);
719
+ }
720
+ }
721
+ class L extends k {
722
+ constructor(t, i, s, e, h) {
723
+ super(t, i, s, e, h), this.type = 5;
724
+ }
725
+ _$AI(t, i = this) {
726
+ if ((t = S(this, t, i, 0) ?? E) === T) return;
727
+ const s = this._$AH,
728
+ e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive,
729
+ h = t !== E && (s === E || e);
730
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
731
+ }
732
+ handleEvent(t) {
733
+ "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
734
+ }
735
+ }
736
+ class z {
737
+ constructor(t, i, s) {
738
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
739
+ }
740
+ get _$AU() {
741
+ return this._$AM._$AU;
742
+ }
743
+ _$AI(t) {
744
+ S(this, t);
745
+ }
746
+ }
747
+ const j = t.litHtmlPolyfillSupport;
748
+ j?.(N, R), (t.litHtmlVersions ??= []).push("3.3.1");
103
749
 
104
750
  /**
105
751
  * @license
106
752
  * Copyright 2018 Google LLC
107
753
  * SPDX-License-Identifier: BSD-3-Clause
108
- */const o=o=>o??E;
754
+ */
755
+ const o = o => o ?? E;
109
756
 
110
757
  var _M3eNavMenuItemElement_instances, _M3eNavMenuItemElement_items, _M3eNavMenuItemElement_menu, _M3eNavMenuItemElement_path, _M3eNavMenuItemElement_link, _M3eNavMenuItemElement_renderIcon, _M3eNavMenuItemElement_handleIconSlotChange, _M3eNavMenuItemElement_handleSlotChange, _M3eNavMenuItemElement_handleItemSlotChange, _M3eNavMenuItemElement_handleClick, _M3eNavMenuItemElement_handleCollapsibleEvent;
111
758
  var M3eNavMenuItemElement_1;
@@ -224,160 +871,137 @@ var M3eNavMenuItemElement_1;
224
871
  * @cssprop --m3e-nav-menu-item-vertical-inset - Vertical margin for first/last child items.
225
872
  */
226
873
  let M3eNavMenuItemElement = M3eNavMenuItemElement_1 = class M3eNavMenuItemElement extends Selected(Disabled(EventAttribute(AttachInternals(Role(LitElement, "treeitem"), true), "opening", "opened", "closing", "closed"))) {
227
- constructor() {
228
- super(...arguments);
229
- _M3eNavMenuItemElement_instances.add(this);
230
- /** @private */ this._hasChildItems = false;
231
- /** @private */ _M3eNavMenuItemElement_items.set(this, []);
232
- /** @private */ _M3eNavMenuItemElement_menu.set(this, null);
233
- /** @private */ _M3eNavMenuItemElement_path.set(this, new Array());
234
- /** @private */ _M3eNavMenuItemElement_link.set(this, null);
235
- /**
236
- * Whether the item is expanded.
237
- * @default false
238
- */
239
- this.open = false;
240
- }
241
- /** A reference to the nested `HTMLAnchorElement`. */
242
- get link() {
243
- return __classPrivateFieldGet(this, _M3eNavMenuItemElement_link, "f");
244
- }
245
- /** A reference to the element used to present the label of the item. */
246
- get label() {
247
- return this._base ?? null;
248
- }
249
- /** Whether the item is visible. */
250
- get visible() {
251
- return !__classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").some((x) => !x.open);
252
- }
253
- /** The full path of the item, starting with the top-most ancestor, including this item. */
254
- get path() {
255
- return [...__classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f"), this];
256
- }
257
- /** Whether the item has child items. */
258
- get hasChildItems() {
259
- return this._hasChildItems;
260
- }
261
- /** The parenting item. */
262
- get parentItem() {
263
- return __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f")[__classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length - 1] ?? null;
264
- }
265
- /** The items that immediately descend from this item. */
266
- get childItems() {
267
- return __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f");
268
- }
269
- /** The one-based level of the item. */
270
- get level() {
271
- return __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length + 1;
272
- }
874
+ constructor() {
875
+ super(...arguments);
876
+ _M3eNavMenuItemElement_instances.add(this);
877
+ /** @private */
878
+ this._hasChildItems = false;
879
+ /** @private */
880
+ _M3eNavMenuItemElement_items.set(this, []);
881
+ /** @private */
882
+ _M3eNavMenuItemElement_menu.set(this, null);
883
+ /** @private */
884
+ _M3eNavMenuItemElement_path.set(this, new Array());
885
+ /** @private */
886
+ _M3eNavMenuItemElement_link.set(this, null);
273
887
  /**
274
- * Expands this item, and optionally, all descendants.
275
- * @param {boolean} [descendants=false] Whether to expand all descendants.
888
+ * Whether the item is expanded.
889
+ * @default false
276
890
  */
277
- expand(descendants = false) {
278
- if (this.hasChildItems) {
279
- this.open = true;
280
- if (descendants) {
281
- this.childItems.forEach((x) => x.expand(true));
282
- }
283
- }
891
+ this.open = false;
892
+ }
893
+ /** A reference to the nested `HTMLAnchorElement`. */
894
+ get link() {
895
+ return __classPrivateFieldGet(this, _M3eNavMenuItemElement_link, "f");
896
+ }
897
+ /** A reference to the element used to present the label of the item. */
898
+ get label() {
899
+ return this._base ?? null;
900
+ }
901
+ /** Whether the item is visible. */
902
+ get visible() {
903
+ return !__classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").some(x => !x.open);
904
+ }
905
+ /** The full path of the item, starting with the top-most ancestor, including this item. */
906
+ get path() {
907
+ return [...__classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f"), this];
908
+ }
909
+ /** Whether the item has child items. */
910
+ get hasChildItems() {
911
+ return this._hasChildItems;
912
+ }
913
+ /** The parenting item. */
914
+ get parentItem() {
915
+ return __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f")[__classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length - 1] ?? null;
916
+ }
917
+ /** The items that immediately descend from this item. */
918
+ get childItems() {
919
+ return __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f");
920
+ }
921
+ /** The one-based level of the item. */
922
+ get level() {
923
+ return __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length + 1;
924
+ }
925
+ /**
926
+ * Expands this item, and optionally, all descendants.
927
+ * @param {boolean} [descendants=false] Whether to expand all descendants.
928
+ */
929
+ expand(descendants = false) {
930
+ if (this.hasChildItems) {
931
+ this.open = true;
932
+ if (descendants) {
933
+ this.childItems.forEach(x => x.expand(true));
934
+ }
284
935
  }
285
- /**
286
- * Collapses this item, and optionally, all descendants.
287
- * @param {boolean} [descendants=false] Whether to expand all descendants.
288
- */
289
- collapse(descendants = false) {
290
- if (this.hasChildItems) {
291
- this.open = false;
292
- if (descendants) {
293
- this.childItems.forEach((x) => x.collapse(true));
294
- }
295
- }
936
+ }
937
+ /**
938
+ * Collapses this item, and optionally, all descendants.
939
+ * @param {boolean} [descendants=false] Whether to expand all descendants.
940
+ */
941
+ collapse(descendants = false) {
942
+ if (this.hasChildItems) {
943
+ this.open = false;
944
+ if (descendants) {
945
+ this.childItems.forEach(x => x.collapse(true));
946
+ }
296
947
  }
297
- /** Toggles the expanded state of the item. */
298
- toggle() {
299
- if (this.hasChildItems) {
300
- this.open = !this.open;
301
- }
948
+ }
949
+ /** Toggles the expanded state of the item. */
950
+ toggle() {
951
+ if (this.hasChildItems) {
952
+ this.open = !this.open;
302
953
  }
303
- /** @inheritdoc */
304
- connectedCallback() {
305
- super.connectedCallback();
306
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length = 0;
307
- for (let item = this.parentElement?.closest("m3e-nav-menu-item"); item; item = item.parentElement?.closest("m3e-nav-menu-item")) {
308
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").push(item);
309
- }
310
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").reverse();
311
- this.style.setProperty("--_nav-menu-item-level", `${this.level}`);
312
- __classPrivateFieldSet(this, _M3eNavMenuItemElement_menu, this.closest("m3e-nav-menu"), "f");
954
+ }
955
+ /** @inheritdoc */
956
+ connectedCallback() {
957
+ super.connectedCallback();
958
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length = 0;
959
+ for (let item = this.parentElement?.closest("m3e-nav-menu-item"); item; item = item.parentElement?.closest("m3e-nav-menu-item")) {
960
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").push(item);
313
961
  }
314
- /** @inheritdoc */
315
- disconnectedCallback() {
316
- super.disconnectedCallback();
317
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length = 0;
962
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").reverse();
963
+ this.style.setProperty("--_nav-menu-item-level", `${this.level}`);
964
+ __classPrivateFieldSet(this, _M3eNavMenuItemElement_menu, this.closest("m3e-nav-menu"), "f");
965
+ }
966
+ /** @inheritdoc */
967
+ disconnectedCallback() {
968
+ super.disconnectedCallback();
969
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").length = 0;
970
+ }
971
+ /** @inheritdoc */
972
+ update(changedProperties) {
973
+ super.update(changedProperties);
974
+ if (changedProperties.has("selected")) {
975
+ // Remove aria-selected and just use aria-current.
976
+ this.ariaSelected = null;
977
+ this.ariaCurrent = this.hasChildItems ? null : `${this.selected}`;
978
+ for (const icon of this.querySelectorAll(":scope > m3e-icon[slot]")) {
979
+ icon.toggleAttribute("filled", this.selected);
980
+ }
981
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").forEach(x => x.selected = this.selected);
982
+ if (this.selected && !this.hasChildItems) {
983
+ this.closest("m3e-nav-menu")?.[selectionManager].notifySelectionChange(this);
984
+ }
318
985
  }
319
- /** @inheritdoc */
320
- update(changedProperties) {
321
- super.update(changedProperties);
322
- if (changedProperties.has("selected")) {
323
- // Remove aria-selected and just use aria-current.
324
- this.ariaSelected = null;
325
- this.ariaCurrent = this.hasChildItems ? null : `${this.selected}`;
326
- for (const icon of this.querySelectorAll(":scope > m3e-icon[slot]")) {
327
- icon.toggleAttribute("filled", this.selected);
328
- }
329
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").forEach((x) => (x.selected = this.selected));
330
- if (this.selected && !this.hasChildItems) {
331
- this.closest("m3e-nav-menu")?.[selectionManager].notifySelectionChange(this);
332
- }
333
- }
334
- if (changedProperties.has("open") || changedProperties.has("_hasChildItems")) {
335
- this.ariaExpanded = this._hasChildItems ? `${this.open}` : null;
336
- }
337
- if ((changedProperties.has("_hasChildItems") && this.disabled) || changedProperties.has("disabled")) {
338
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f").forEach((x) => (x.disabled = this.disabled));
339
- }
986
+ if (changedProperties.has("open") || changedProperties.has("_hasChildItems")) {
987
+ this.ariaExpanded = this._hasChildItems ? `${this.open}` : null;
340
988
  }
341
- /** @inheritdoc */
342
- firstUpdated(_changedProperties) {
343
- super.firstUpdated(_changedProperties);
344
- const base = this._base;
345
- if (base) {
346
- [this.focusRing, this.stateLayer, this.ripple].forEach((x) => x?.attach(base));
347
- }
989
+ if (changedProperties.has("_hasChildItems") && this.disabled || changedProperties.has("disabled")) {
990
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f").forEach(x => x.disabled = this.disabled);
348
991
  }
349
- /** @inheritdoc */
350
- render() {
351
- return html `<div class="base" @click="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleClick)}">
352
- <m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer>
353
- <m3e-focus-ring class="focus-ring" inward ?disabled="${this.disabled}"></m3e-focus-ring>
354
- <m3e-ripple class="ripple" ?disabled="${this.disabled}"></m3e-ripple>
355
- <div class="icon" aria-hidden="true">${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_renderIcon).call(this)}</div>
356
- <div class="label">
357
- <slot name="label" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleSlotChange)}"></slot>
358
- </div>
359
- <slot name="badge"></slot>
360
- <div aria-hidden="true" class="toggle">
361
- <slot name="toggle-icon">
362
- <svg class="toggle-icon" viewBox="0 -960 960 960" fill="currentColor">
363
- <path d="M480-360 280-560h400L480-360Z" />
364
- </svg>
365
- </slot>
366
- </div>
367
- </div>
368
- <m3e-collapsible
369
- class="group"
370
- role="group"
371
- aria-hidden="${o(this._hasChildItems ? undefined : "true")}"
372
- ?open="${this._hasChildItems && this.open}"
373
- @opening="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}"
374
- @opened="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}"
375
- @closing="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}"
376
- @closed="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}"
377
- >
378
- <slot @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleItemSlotChange)}"></slot>
379
- </m3e-collapsible>`;
992
+ }
993
+ /** @inheritdoc */
994
+ firstUpdated(_changedProperties) {
995
+ super.firstUpdated(_changedProperties);
996
+ const base = this._base;
997
+ if (base) {
998
+ [this.focusRing, this.stateLayer, this.ripple].forEach(x => x?.attach(base));
380
999
  }
1000
+ }
1001
+ /** @inheritdoc */
1002
+ render() {
1003
+ return html`<div class="base" @click="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleClick)}"><m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer><m3e-focus-ring class="focus-ring" inward ?disabled="${this.disabled}"></m3e-focus-ring><m3e-ripple class="ripple" ?disabled="${this.disabled}"></m3e-ripple><div class="icon" aria-hidden="true">${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_renderIcon).call(this)}</div><div class="label"><slot name="label" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleSlotChange)}"></slot></div><slot name="badge"></slot><div aria-hidden="true" class="toggle"><slot name="toggle-icon"><svg class="toggle-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-360 280-560h400L480-360Z"/></svg></slot></div></div><m3e-collapsible class="group" role="group" aria-hidden="${o(this._hasChildItems ? undefined : "true")}" ?open="${this._hasChildItems && this.open}" @opening="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}" @opened="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}" @closing="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}" @closed="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleCollapsibleEvent)}"><slot @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleItemSlotChange)}"></slot></m3e-collapsible>`;
1004
+ }
381
1005
  };
382
1006
  _M3eNavMenuItemElement_items = new WeakMap();
383
1007
  _M3eNavMenuItemElement_menu = new WeakMap();
@@ -385,257 +1009,67 @@ _M3eNavMenuItemElement_path = new WeakMap();
385
1009
  _M3eNavMenuItemElement_link = new WeakMap();
386
1010
  _M3eNavMenuItemElement_instances = new WeakSet();
387
1011
  _M3eNavMenuItemElement_renderIcon = function _M3eNavMenuItemElement_renderIcon() {
388
- const icon = html `<slot name="icon" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleIconSlotChange)}"></slot>`;
389
- return this.selected && !this.hasChildItems
390
- ? html `<slot name="selected-icon" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleIconSlotChange)}">${icon}</slot>`
391
- : icon;
1012
+ const icon = html`<slot name="icon" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleIconSlotChange)}"></slot>`;
1013
+ return this.selected && !this.hasChildItems ? html`<slot name="selected-icon" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemElement_instances, "m", _M3eNavMenuItemElement_handleIconSlotChange)}">${icon}</slot>` : icon;
392
1014
  };
393
1015
  _M3eNavMenuItemElement_handleIconSlotChange = function _M3eNavMenuItemElement_handleIconSlotChange(e) {
394
- this.classList.toggle("-with-icon", hasAssignedNodes(e.target));
1016
+ this.classList.toggle("-with-icon", hasAssignedNodes(e.target));
395
1017
  };
396
1018
  _M3eNavMenuItemElement_handleSlotChange = function _M3eNavMenuItemElement_handleSlotChange(e) {
397
- __classPrivateFieldSet(this, _M3eNavMenuItemElement_link, e.target.assignedElements({ flatten: true }).find((x) => x instanceof HTMLAnchorElement) ??
398
- null, "f");
399
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_link, "f")?.setAttribute("tabindex", "-1");
1019
+ __classPrivateFieldSet(this, _M3eNavMenuItemElement_link, e.target.assignedElements({
1020
+ flatten: true
1021
+ }).find(x => x instanceof HTMLAnchorElement) ?? null, "f");
1022
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_link, "f")?.setAttribute("tabindex", "-1");
400
1023
  };
401
1024
  _M3eNavMenuItemElement_handleItemSlotChange = function _M3eNavMenuItemElement_handleItemSlotChange(e) {
402
- __classPrivateFieldSet(this, _M3eNavMenuItemElement_items, e.target
403
- .assignedElements({ flatten: true })
404
- .filter((x) => x instanceof M3eNavMenuItemElement_1), "f");
405
- const hadChildItems = this._hasChildItems;
406
- this._hasChildItems = __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f").length > 0;
407
- this.classList.toggle("-has-items", this._hasChildItems);
408
- if (hadChildItems || this._hasChildItems) {
409
- this.selected = __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f").some((x) => x.selected);
410
- }
1025
+ __classPrivateFieldSet(this, _M3eNavMenuItemElement_items, e.target.assignedElements({
1026
+ flatten: true
1027
+ }).filter(x => x instanceof M3eNavMenuItemElement_1), "f");
1028
+ const hadChildItems = this._hasChildItems;
1029
+ this._hasChildItems = __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f").length > 0;
1030
+ this.classList.toggle("-has-items", this._hasChildItems);
1031
+ if (hadChildItems || this._hasChildItems) {
1032
+ this.selected = __classPrivateFieldGet(this, _M3eNavMenuItemElement_items, "f").some(x => x.selected);
1033
+ }
411
1034
  };
412
1035
  _M3eNavMenuItemElement_handleClick = function _M3eNavMenuItemElement_handleClick() {
413
- if (this.disabled)
414
- return;
415
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_menu, "f")?.[selectionManager].setActiveItem(this);
416
- if (!this._hasChildItems) {
417
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_menu, "f")?.[selectionManager].select(this);
418
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").forEach((x) => (x.selected = this.selected));
419
- __classPrivateFieldGet(this, _M3eNavMenuItemElement_link, "f")?.click();
420
- const drawerContainer = this.closest("m3e-drawer-container");
421
- if (drawerContainer) {
422
- const drawer = this.closest("[slot='start']") ?? this.closest("[slot='end')");
423
- if (drawer &&
424
- (drawerContainer.classList.contains(`-${drawer.slot}-push`) ||
425
- drawerContainer.classList.contains(`-${drawer.slot}-over`))) {
426
- setTimeout(() => drawerContainer.removeAttribute(drawer.slot), 300);
427
- }
428
- }
429
- }
430
- else {
431
- this.toggle();
1036
+ if (this.disabled) return;
1037
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_menu, "f")?.[selectionManager].setActiveItem(this);
1038
+ if (!this._hasChildItems) {
1039
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_menu, "f")?.[selectionManager].select(this);
1040
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_path, "f").forEach(x => x.selected = this.selected);
1041
+ __classPrivateFieldGet(this, _M3eNavMenuItemElement_link, "f")?.click();
1042
+ const drawerContainer = this.closest("m3e-drawer-container");
1043
+ if (drawerContainer) {
1044
+ const drawer = this.closest("[slot='start']") ?? this.closest("[slot='end')");
1045
+ if (drawer && (drawerContainer.classList.contains(`-${drawer.slot}-push`) || drawerContainer.classList.contains(`-${drawer.slot}-over`))) {
1046
+ setTimeout(() => drawerContainer.removeAttribute(drawer.slot), 300);
1047
+ }
432
1048
  }
1049
+ } else {
1050
+ this.toggle();
1051
+ }
433
1052
  };
434
1053
  _M3eNavMenuItemElement_handleCollapsibleEvent = function _M3eNavMenuItemElement_handleCollapsibleEvent(e) {
435
- e.stopPropagation();
436
- this.dispatchEvent(new Event(e.type, { bubbles: true }));
1054
+ e.stopPropagation();
1055
+ this.dispatchEvent(new Event(e.type, {
1056
+ bubbles: true
1057
+ }));
437
1058
  };
438
1059
  /** The styles of the element. */
439
- M3eNavMenuItemElement.styles = css `
440
- :host {
441
- display: block;
442
- flex: none;
443
- outline: none;
444
- user-select: none;
445
- position: relative;
446
- font-size: var(--m3e-nav-menu-item-font-size, ${DesignToken.typescale.standard.label.large.fontSize});
447
- font-weight: var(--m3e-nav-menu-item-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight});
448
- line-height: var(--m3e-nav-menu-item-line-height, ${DesignToken.typescale.standard.label.large.lineHeight});
449
- letter-spacing: var(--m3e-nav-menu-item-tracking, ${DesignToken.typescale.standard.label.large.tracking});
450
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
451
- }
452
- .base {
453
- display: flex;
454
- align-items: center;
455
- position: relative;
456
- padding-inline: var(--m3e-nav-menu-item-padding, 1.5rem);
457
- height: calc(var(--m3e-nav-menu-item-height, 3.5rem) + ${DesignToken.density.calc(-3)});
458
- column-gap: var(--m3e-nav-menu-item-spacing, 0.75rem);
459
- transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard},
460
- background-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
461
- }
462
- .base,
463
- .focus-ring {
464
- border-radius: var(--m3e-nav-menu-item-shape, ${DesignToken.shape.corner.full});
465
- }
466
- .label {
467
- flex: 1 1 auto;
468
- display: flex;
469
- align-items: center;
470
- position: relative;
471
- overflow: hidden;
472
- vertical-align: middle;
473
- }
474
- .icon,
475
- .toggle {
476
- flex: none;
477
- display: flex;
478
- align-items: center;
479
- justify-content: center;
480
- position: relative;
481
- vertical-align: middle;
482
- }
483
- ::slotted([slot="badge"]) {
484
- flex: none;
485
- position: relative;
486
- font-size: var(--m3e-nav-menu-item-badge-font-size, ${DesignToken.typescale.standard.label.large.fontSize});
487
- font-weight: var(--m3e-nav-menu-item-badge-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight});
488
- line-height: var(--m3e-nav-menu-item-badge-line-height, ${DesignToken.typescale.standard.label.large.lineHeight});
489
- letter-spacing: var(--m3e-nav-menu-item-badge-tracking, ${DesignToken.typescale.standard.label.large.tracking});
490
- }
491
- .toggle {
492
- transition: ${unsafeCSS(`transform var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
493
- ${DesignToken.motion.easing.standard}`)};
494
- }
495
- :host(:not(.-with-icon)) .icon {
496
- display: none;
497
- }
498
- .icon {
499
- margin-inline-start: -0.5rem;
500
- }
501
- .toggle {
502
- margin-inline-end: -0.5rem;
503
- }
504
- .group {
505
- padding-inline-start: var(--m3e-nav-menu-item-inset, 1rem);
506
- }
507
- :host([open]) .toggle {
508
- transform: rotate(180deg);
509
- }
510
- :host(:not(.-has-items)) .toggle,
511
- :host(:not(.-has-items)) .group {
512
- display: none;
513
- }
514
- ::slotted([slot="selected-icon"]),
515
- ::slotted([slot="icon"]),
516
- ::slotted([slot="toggle-icon"]),
517
- .toggle-icon {
518
- vertical-align: middle;
519
- width: 1em;
520
- height: 1em;
521
- font-size: var(--m3e-nav-menu-item-icon-size, 1.5rem);
522
- }
523
- :host(:not(:disabled)) .base {
524
- cursor: pointer;
525
- }
526
- :host(:not(:disabled)) .base {
527
- color: var(--m3e-nav-menu-item-label-color, ${DesignToken.color.onSurfaceVariant});
528
- }
529
- :host(:disabled) .base {
530
- color: color-mix(
531
- in srgb,
532
- var(--m3e-nav-menu-item-disabled-color, ${DesignToken.color.onSurface})
533
- var(--m3e-nav-menu-item-disabled-color-opacity, 38%),
534
- transparent
535
- );
536
- }
537
- :host([selected]:not(.-has-items):not(:disabled)) .base {
538
- color: var(--m3e-nav-menu-item-selected-label-color, ${DesignToken.color.onSecondaryContainer});
539
- background-color: var(--m3e-nav-menu-item-selected-container-color, ${DesignToken.color.secondaryContainer});
540
- --m3e-state-layer-focus-color: var(
541
- --m3e-nav-menu-item-selected-container-focus-color,
542
- ${DesignToken.color.onSecondaryContainer}
543
- );
544
- --m3e-state-layer-hover-color: var(
545
- --m3e-nav-menu-item-selected-container-hover-color,
546
- ${DesignToken.color.onSecondaryContainer}
547
- );
548
- --m3e-ripple-color: var(--m3e-nav-menu-item-selected-ripple-color, ${DesignToken.color.onSecondaryContainer});
549
- }
550
- :host(:not([selected]):not(.-has-items):not(:disabled)) .base {
551
- --m3e-state-layer-focus-color: var(
552
- --m3e-nav-menu-item-unselected-container-focus-color,
553
- ${DesignToken.color.onSurface}
554
- );
555
- --m3e-state-layer-hover-color: var(
556
- --m3e-nav-menu-item-unselected-container-hover-color,
557
- ${DesignToken.color.onSurface}
558
- );
559
- --m3e-ripple-color: var(--m3e-nav-menu-item-unselected-ripple-color, ${DesignToken.color.onSurface});
560
- }
561
- .state-layer {
562
- margin-inline: auto;
563
- }
564
- :host([selected].-has-items:not(:disabled)) .base {
565
- background-color: var(--m3e-nav-menu-item-open-container-color, ${DesignToken.color.surfaceContainerHighest});
566
- --m3e-state-layer-focus-color: var(
567
- --m3e-nav-menu-item-open-container-focus-color,
568
- ${DesignToken.color.onSurface}
569
- );
570
- --m3e-state-layer-hover-color: var(
571
- --m3e-nav-menu-item-open-container-hover-color,
572
- ${DesignToken.color.onSurface}
573
- );
574
- --m3e-ripple-color: var(--m3e-nav-menu-item-open-ripple-color, ${DesignToken.color.onSurface});
575
- }
576
- ::slotted(a[slot="label"]) {
577
- all: unset;
578
- }
579
- ::slotted(m3e-divider) {
580
- margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem);
581
- }
582
- ::slotted(m3e-nav-menu-item:first-of-type) {
583
- margin-block-start: var(--m3e-nav-menu-item-vertical-inset, 0.25rem);
584
- }
585
- ::slotted(m3e-nav-menu-item:last-of-type) {
586
- margin-block-end: var(--m3e-nav-menu-item-vertical-inset, 0.25rem);
587
- }
588
- @media (prefers-reduced-motion) {
589
- .base,
590
- .toggle,
591
- .state-layer {
592
- transition: none !important;
593
- }
594
- }
595
- @media (forced-colors: active) {
596
- .base,
597
- .state-layer {
598
- transition: none !important;
599
- }
600
-
601
- :host(:disabled) .base {
602
- color: GrayText;
603
- }
604
- :host(:not([selected]):not(:disabled)) .base {
605
- color: ButtonText;
606
- }
607
- :host([selected]:not(.-has-items):not(:disabled)) .base {
608
- forced-color-adjust: none;
609
- color: ButtonFace;
610
- background-color: ButtonText;
611
- }
612
- :host([selected].-has-items:not(:disabled)) .base {
613
- background-color: unset;
614
- color: ButtonText;
615
- }
616
- }
617
- `;
618
- __decorate([
619
- e$1(".state-layer")
620
- ], M3eNavMenuItemElement.prototype, "stateLayer", void 0);
621
- __decorate([
622
- e$1(".focus-ring")
623
- ], M3eNavMenuItemElement.prototype, "focusRing", void 0);
624
- __decorate([
625
- e$1(".ripple")
626
- ], M3eNavMenuItemElement.prototype, "ripple", void 0);
627
- __decorate([
628
- e$1(".base")
629
- ], M3eNavMenuItemElement.prototype, "_base", void 0);
630
- __decorate([
631
- r$1()
632
- ], M3eNavMenuItemElement.prototype, "_hasChildItems", void 0);
633
- __decorate([
634
- n$1({ type: Boolean, reflect: true })
635
- ], M3eNavMenuItemElement.prototype, "open", void 0);
636
- M3eNavMenuItemElement = M3eNavMenuItemElement_1 = __decorate([
637
- t$2("m3e-nav-menu-item")
638
- ], M3eNavMenuItemElement);
1060
+ M3eNavMenuItemElement.styles = css`:host { display: block; flex: none; outline: none; user-select: none; position: relative; font-size: var(--m3e-nav-menu-item-font-size, ${DesignToken.typescale.standard.label.large.fontSize}); font-weight: var(--m3e-nav-menu-item-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight}); line-height: var(--m3e-nav-menu-item-line-height, ${DesignToken.typescale.standard.label.large.lineHeight}); letter-spacing: var(--m3e-nav-menu-item-tracking, ${DesignToken.typescale.standard.label.large.tracking}); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { display: flex; align-items: center; position: relative; padding-inline: var(--m3e-nav-menu-item-padding, 1.5rem); height: calc(var(--m3e-nav-menu-item-height, 3.5rem) + ${DesignToken.density.calc(-3)}); column-gap: var(--m3e-nav-menu-item-spacing, 0.75rem); transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard},
1061
+ background-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)}; } .base, .focus-ring { border-radius: var(--m3e-nav-menu-item-shape, ${DesignToken.shape.corner.full}); } .label { flex: 1 1 auto; display: flex; align-items: center; position: relative; overflow: hidden; vertical-align: middle; } .icon, .toggle { flex: none; display: flex; align-items: center; justify-content: center; position: relative; vertical-align: middle; } ::slotted([slot="badge"]) { flex: none; position: relative; font-size: var(--m3e-nav-menu-item-badge-font-size, ${DesignToken.typescale.standard.label.large.fontSize}); font-weight: var(--m3e-nav-menu-item-badge-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight}); line-height: var(--m3e-nav-menu-item-badge-line-height, ${DesignToken.typescale.standard.label.large.lineHeight}); letter-spacing: var(--m3e-nav-menu-item-badge-tracking, ${DesignToken.typescale.standard.label.large.tracking}); } .toggle { transition: ${unsafeCSS(`transform var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
1062
+ ${DesignToken.motion.easing.standard}`)}; } :host(:not(.-with-icon)) .icon { display: none; } .icon { margin-inline-start: -0.5rem; } .toggle { margin-inline-end: -0.5rem; } .group { padding-inline-start: var(--m3e-nav-menu-item-inset, 1rem); } :host([open]) .toggle { transform: rotate(180deg); } :host(:not(.-has-items)) .toggle, :host(:not(.-has-items)) .group { display: none; } ::slotted([slot="selected-icon"]), ::slotted([slot="icon"]), ::slotted([slot="toggle-icon"]), .toggle-icon { vertical-align: middle; width: 1em; height: 1em; font-size: var(--m3e-nav-menu-item-icon-size, 1.5rem); } :host(:not(:disabled)) .base { cursor: pointer; } :host(:not(:disabled)) .base { color: var(--m3e-nav-menu-item-label-color, ${DesignToken.color.onSurfaceVariant}); } :host(:disabled) .base { color: color-mix( in srgb, var(--m3e-nav-menu-item-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-nav-menu-item-disabled-color-opacity, 38%), transparent ); } :host([selected]:not(.-has-items):not(:disabled)) .base { color: var(--m3e-nav-menu-item-selected-label-color, ${DesignToken.color.onSecondaryContainer}); background-color: var(--m3e-nav-menu-item-selected-container-color, ${DesignToken.color.secondaryContainer}); --m3e-state-layer-focus-color: var( --m3e-nav-menu-item-selected-container-focus-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-state-layer-hover-color: var( --m3e-nav-menu-item-selected-container-hover-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-ripple-color: var(--m3e-nav-menu-item-selected-ripple-color, ${DesignToken.color.onSecondaryContainer}); } :host(:not([selected]):not(.-has-items):not(:disabled)) .base { --m3e-state-layer-focus-color: var( --m3e-nav-menu-item-unselected-container-focus-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-hover-color: var( --m3e-nav-menu-item-unselected-container-hover-color, ${DesignToken.color.onSurface} ); --m3e-ripple-color: var(--m3e-nav-menu-item-unselected-ripple-color, ${DesignToken.color.onSurface}); } .state-layer { margin-inline: auto; } :host([selected].-has-items:not(:disabled)) .base { background-color: var(--m3e-nav-menu-item-open-container-color, ${DesignToken.color.surfaceContainerHighest}); --m3e-state-layer-focus-color: var( --m3e-nav-menu-item-open-container-focus-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-hover-color: var( --m3e-nav-menu-item-open-container-hover-color, ${DesignToken.color.onSurface} ); --m3e-ripple-color: var(--m3e-nav-menu-item-open-ripple-color, ${DesignToken.color.onSurface}); } ::slotted(a[slot="label"]) { all: unset; } ::slotted(m3e-divider) { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); } ::slotted(m3e-nav-menu-item:first-of-type) { margin-block-start: var(--m3e-nav-menu-item-vertical-inset, 0.25rem); } ::slotted(m3e-nav-menu-item:last-of-type) { margin-block-end: var(--m3e-nav-menu-item-vertical-inset, 0.25rem); } @media (prefers-reduced-motion) { .base, .toggle, .state-layer { transition: none !important; } } @media (forced-colors: active) { .base, .state-layer { transition: none !important; } :host(:disabled) .base { color: GrayText; } :host(:not([selected]):not(:disabled)) .base { color: ButtonText; } :host([selected]:not(.-has-items):not(:disabled)) .base { forced-color-adjust: none; color: ButtonFace; background-color: ButtonText; } :host([selected].-has-items:not(:disabled)) .base { background-color: unset; color: ButtonText; } }`;
1063
+ __decorate([e$1(".state-layer")], M3eNavMenuItemElement.prototype, "stateLayer", void 0);
1064
+ __decorate([e$1(".focus-ring")], M3eNavMenuItemElement.prototype, "focusRing", void 0);
1065
+ __decorate([e$1(".ripple")], M3eNavMenuItemElement.prototype, "ripple", void 0);
1066
+ __decorate([e$1(".base")], M3eNavMenuItemElement.prototype, "_base", void 0);
1067
+ __decorate([r$1()], M3eNavMenuItemElement.prototype, "_hasChildItems", void 0);
1068
+ __decorate([n$1({
1069
+ type: Boolean,
1070
+ reflect: true
1071
+ })], M3eNavMenuItemElement.prototype, "open", void 0);
1072
+ M3eNavMenuItemElement = M3eNavMenuItemElement_1 = __decorate([t$2("m3e-nav-menu-item")], M3eNavMenuItemElement);
639
1073
 
640
1074
  var _M3eNavMenuElement_instances, _M3eNavMenuElement_ignoreFocusVisible, _M3eNavMenuElement_ignoreFocus, _M3eNavMenuElement_keyDownHandler, _M3eNavMenuElement_keyUpHandler, _M3eNavMenuElement_pointerDownHandler, _M3eNavMenuElement_handleSlotChange, _M3eNavMenuElement_handleKeyDown, _M3eNavMenuElement_handleKeyUp, _M3eNavMenuElement_handlePointerDown, _M3eNavMenuElement_activateItem, _M3eNavMenuElement_updateFocusVisible, _M3eNavMenuElement_updateItemFocusVisible, _b;
641
1075
  var M3eNavMenuElement_1;
@@ -713,96 +1147,99 @@ var M3eNavMenuElement_1;
713
1147
  * @cssprop --m3e-nav-menu-scrollbar-color - Color of the menu scrollbar.
714
1148
  */
715
1149
  let M3eNavMenuElement = M3eNavMenuElement_1 = class M3eNavMenuElement extends Role(LitElement, "tree") {
716
- constructor() {
717
- super();
718
- _M3eNavMenuElement_instances.add(this);
719
- /** @private */ _M3eNavMenuElement_ignoreFocusVisible.set(this, false);
720
- /** @private */ _M3eNavMenuElement_ignoreFocus.set(this, false);
721
- /** @private */
722
- this[_b] = new SelectionManager()
723
- .withVerticalOrientation()
724
- .withHomeAndEnd()
725
- .withTypeahead()
726
- .withSkipPredicate((x) => x.disabled || !x.visible)
727
- .disableRovingTabIndex()
728
- .onActiveItemChange(() => {
729
- if (this[selectionManager].activeItem) {
730
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_activateItem).call(this, this[selectionManager].activeItem);
731
- }
732
- })
733
- .onSelectedItemsChange(() => {
734
- const selected = this.selected;
735
- for (const item of this.items) {
736
- if (item !== selected) {
737
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateItemFocusVisible).call(this, item, false, false);
738
- }
739
- }
740
- if (selected?.label) {
741
- scrollIntoViewIfNeeded(selected.label, this, { block: "start", behavior: "smooth" });
742
- }
743
- });
744
- /** @private */ _M3eNavMenuElement_keyDownHandler.set(this, (e) => __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handleKeyDown).call(this, e));
745
- /** @private */ _M3eNavMenuElement_keyUpHandler.set(this, (e) => __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handleKeyUp).call(this, e));
746
- /** @private */ _M3eNavMenuElement_pointerDownHandler.set(this, (e) => __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handlePointerDown).call(this, e));
747
- new PressedController(this, { callback: (pressed) => (__classPrivateFieldSet(this, _M3eNavMenuElement_ignoreFocus, pressed, "f")) });
748
- new FocusController(this, {
749
- callback: () => {
750
- if (!__classPrivateFieldGet(this, _M3eNavMenuElement_ignoreFocus, "f")) {
751
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
752
- }
753
- },
1150
+ constructor() {
1151
+ super();
1152
+ _M3eNavMenuElement_instances.add(this);
1153
+ /** @private */
1154
+ _M3eNavMenuElement_ignoreFocusVisible.set(this, false);
1155
+ /** @private */
1156
+ _M3eNavMenuElement_ignoreFocus.set(this, false);
1157
+ /** @private */
1158
+ this[_b] = new SelectionManager().withVerticalOrientation().withHomeAndEnd().withTypeahead().withSkipPredicate(x => x.disabled || !x.visible).disableRovingTabIndex().onActiveItemChange(() => {
1159
+ if (this[selectionManager].activeItem) {
1160
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_activateItem).call(this, this[selectionManager].activeItem);
1161
+ }
1162
+ }).onSelectedItemsChange(() => {
1163
+ const selected = this.selected;
1164
+ for (const item of this.items) {
1165
+ if (item !== selected) {
1166
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateItemFocusVisible).call(this, item, false, false);
1167
+ }
1168
+ }
1169
+ if (selected?.label) {
1170
+ scrollIntoViewIfNeeded(selected.label, this, {
1171
+ block: "start",
1172
+ behavior: "smooth"
754
1173
  });
755
- }
756
- /** The selected item of the menu. */
757
- get selected() {
758
- return this[selectionManager].selectedItems[0] ?? null;
759
- }
760
- /** All the items of the menu. */
761
- get items() {
762
- return this[selectionManager].items;
763
- }
764
- /**
765
- * Expands the specified items, or all items if no items are provided.
766
- * @param {M3eNavMenuItemElement | undefined} items The items to expand.
767
- */
768
- expand(items) {
769
- (items ?? this[selectionManager].items).forEach((x) => x.expand());
770
- }
771
- /**
772
- * Collapses the specified items, or all items if no items are provided.
773
- * @param {M3eNavMenuItemElement | undefined} items The items to collapse.
774
- */
775
- collapse(items) {
776
- (items ?? this[selectionManager].items).forEach((x) => x.collapse());
777
- const activeItem = this[selectionManager].activeItem;
778
- if (activeItem && !activeItem.visible) {
779
- for (let parent = activeItem.parentItem; parent; parent = parent.parentItem) {
780
- if (parent.visible) {
781
- this[selectionManager].setActiveItem(parent);
782
- break;
783
- }
784
- }
1174
+ }
1175
+ });
1176
+ /** @private */
1177
+ _M3eNavMenuElement_keyDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handleKeyDown).call(this, e));
1178
+ /** @private */
1179
+ _M3eNavMenuElement_keyUpHandler.set(this, e => __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handleKeyUp).call(this, e));
1180
+ /** @private */
1181
+ _M3eNavMenuElement_pointerDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handlePointerDown).call(this, e));
1182
+ new PressedController(this, {
1183
+ callback: pressed => __classPrivateFieldSet(this, _M3eNavMenuElement_ignoreFocus, pressed, "f")
1184
+ });
1185
+ new FocusController(this, {
1186
+ callback: () => {
1187
+ if (!__classPrivateFieldGet(this, _M3eNavMenuElement_ignoreFocus, "f")) {
1188
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
785
1189
  }
1190
+ }
1191
+ });
1192
+ }
1193
+ /** The selected item of the menu. */
1194
+ get selected() {
1195
+ return this[selectionManager].selectedItems[0] ?? null;
1196
+ }
1197
+ /** All the items of the menu. */
1198
+ get items() {
1199
+ return this[selectionManager].items;
1200
+ }
1201
+ /**
1202
+ * Expands the specified items, or all items if no items are provided.
1203
+ * @param {M3eNavMenuItemElement | undefined} items The items to expand.
1204
+ */
1205
+ expand(items) {
1206
+ (items ?? this[selectionManager].items).forEach(x => x.expand());
1207
+ }
1208
+ /**
1209
+ * Collapses the specified items, or all items if no items are provided.
1210
+ * @param {M3eNavMenuItemElement | undefined} items The items to collapse.
1211
+ */
1212
+ collapse(items) {
1213
+ (items ?? this[selectionManager].items).forEach(x => x.collapse());
1214
+ const activeItem = this[selectionManager].activeItem;
1215
+ if (activeItem && !activeItem.visible) {
1216
+ for (let parent = activeItem.parentItem; parent; parent = parent.parentItem) {
1217
+ if (parent.visible) {
1218
+ this[selectionManager].setActiveItem(parent);
1219
+ break;
1220
+ }
1221
+ }
786
1222
  }
787
- /** @inheritdoc */
788
- connectedCallback() {
789
- super.connectedCallback();
790
- this.setAttribute("tabindex", "0");
791
- this.addEventListener("keydown", __classPrivateFieldGet(this, _M3eNavMenuElement_keyDownHandler, "f"));
792
- this.addEventListener("keyup", __classPrivateFieldGet(this, _M3eNavMenuElement_keyUpHandler, "f"));
793
- this.addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eNavMenuElement_pointerDownHandler, "f"));
794
- }
795
- /** @inheritdoc */
796
- disconnectedCallback() {
797
- super.disconnectedCallback();
798
- this.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eNavMenuElement_keyDownHandler, "f"));
799
- this.removeEventListener("keyup", __classPrivateFieldGet(this, _M3eNavMenuElement_keyUpHandler, "f"));
800
- this.removeEventListener("pointerdown", __classPrivateFieldGet(this, _M3eNavMenuElement_pointerDownHandler, "f"));
801
- }
802
- /** @inheritdoc */
803
- render() {
804
- return html `<slot @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handleSlotChange)}"></slot>`;
805
- }
1223
+ }
1224
+ /** @inheritdoc */
1225
+ connectedCallback() {
1226
+ super.connectedCallback();
1227
+ this.setAttribute("tabindex", "0");
1228
+ this.addEventListener("keydown", __classPrivateFieldGet(this, _M3eNavMenuElement_keyDownHandler, "f"));
1229
+ this.addEventListener("keyup", __classPrivateFieldGet(this, _M3eNavMenuElement_keyUpHandler, "f"));
1230
+ this.addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eNavMenuElement_pointerDownHandler, "f"));
1231
+ }
1232
+ /** @inheritdoc */
1233
+ disconnectedCallback() {
1234
+ super.disconnectedCallback();
1235
+ this.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eNavMenuElement_keyDownHandler, "f"));
1236
+ this.removeEventListener("keyup", __classPrivateFieldGet(this, _M3eNavMenuElement_keyUpHandler, "f"));
1237
+ this.removeEventListener("pointerdown", __classPrivateFieldGet(this, _M3eNavMenuElement_pointerDownHandler, "f"));
1238
+ }
1239
+ /** @inheritdoc */
1240
+ render() {
1241
+ return html`<slot @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_handleSlotChange)}"></slot>`;
1242
+ }
806
1243
  };
807
1244
  _M3eNavMenuElement_ignoreFocusVisible = new WeakMap();
808
1245
  _M3eNavMenuElement_ignoreFocus = new WeakMap();
@@ -812,159 +1249,134 @@ _M3eNavMenuElement_pointerDownHandler = new WeakMap();
812
1249
  _M3eNavMenuElement_instances = new WeakSet();
813
1250
  _b = selectionManager;
814
1251
  _M3eNavMenuElement_handleSlotChange = function _M3eNavMenuElement_handleSlotChange() {
815
- for (const divider of this.querySelectorAll("m3e-divider")) {
816
- divider.ariaHidden = "true";
817
- }
818
- const { added } = this[selectionManager].setItems([...this.querySelectorAll("m3e-nav-menu-item")]);
819
- for (const item of added) {
820
- item.id = item.id || `m3e-nav-menu-item-${M3eNavMenuElement_1.__nextId++}`;
821
- }
822
- if (this[selectionManager].activeItem) {
823
- this.setAttribute("aria-activedescendant", this[selectionManager].activeItem.id);
824
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
825
- }
826
- else {
827
- this.removeAttribute("aria-activedescendant");
828
- }
1252
+ for (const divider of this.querySelectorAll("m3e-divider")) {
1253
+ divider.ariaHidden = "true";
1254
+ }
1255
+ const {
1256
+ added
1257
+ } = this[selectionManager].setItems([...this.querySelectorAll("m3e-nav-menu-item")]);
1258
+ for (const item of added) {
1259
+ item.id = item.id || `m3e-nav-menu-item-${M3eNavMenuElement_1.__nextId++}`;
1260
+ }
1261
+ if (this[selectionManager].activeItem) {
1262
+ this.setAttribute("aria-activedescendant", this[selectionManager].activeItem.id);
1263
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
1264
+ } else {
1265
+ this.removeAttribute("aria-activedescendant");
1266
+ }
829
1267
  };
830
1268
  _M3eNavMenuElement_handleKeyDown = function _M3eNavMenuElement_handleKeyDown(e) {
831
- __classPrivateFieldSet(this, _M3eNavMenuElement_ignoreFocusVisible, false, "f");
832
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
833
- const item = this[selectionManager].activeItem;
834
- if (e.defaultPrevented || !item || item.disabled)
835
- return;
836
- switch (e.key) {
837
- case "Enter":
838
- case " ":
839
- e.preventDefault();
840
- if (e.key === " " && item.ripple && !item.ripple.visible) {
841
- item.ripple.show(0, 0, true);
842
- }
843
- if (item.hasChildItems) {
844
- item.toggle();
845
- }
846
- else if (!item.selected) {
847
- this[selectionManager].select(item);
848
- item.link?.click();
849
- }
850
- break;
851
- case "*":
852
- e.preventDefault();
853
- item.expand(true);
854
- break;
855
- case "Left":
856
- case "ArrowLeft":
857
- e.preventDefault();
858
- if (item.hasChildItems && item.open) {
859
- item.collapse();
860
- }
861
- else {
862
- const parent = item.parentItem;
863
- if (parent) {
864
- parent.collapse();
865
- this[selectionManager].setActiveItem(parent);
866
- }
867
- }
868
- break;
869
- case "Right":
870
- case "ArrowRight":
871
- if (item.hasChildItems) {
872
- if (!item.open) {
873
- e.preventDefault();
874
- item.expand();
875
- }
876
- else {
877
- try {
878
- this[selectionManager].vertical = false;
879
- this[selectionManager].onKeyDown(e);
880
- }
881
- finally {
882
- this[selectionManager].vertical = true;
883
- }
884
- }
885
- }
886
- else {
887
- e.preventDefault();
888
- }
889
- break;
890
- default:
891
- this[selectionManager].onKeyDown(e);
892
- break;
893
- }
1269
+ __classPrivateFieldSet(this, _M3eNavMenuElement_ignoreFocusVisible, false, "f");
1270
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
1271
+ const item = this[selectionManager].activeItem;
1272
+ if (e.defaultPrevented || !item || item.disabled) return;
1273
+ switch (e.key) {
1274
+ case "Enter":
1275
+ case " ":
1276
+ e.preventDefault();
1277
+ if (e.key === " " && item.ripple && !item.ripple.visible) {
1278
+ item.ripple.show(0, 0, true);
1279
+ }
1280
+ if (item.hasChildItems) {
1281
+ item.toggle();
1282
+ } else if (!item.selected) {
1283
+ this[selectionManager].select(item);
1284
+ item.link?.click();
1285
+ }
1286
+ break;
1287
+ case "*":
1288
+ e.preventDefault();
1289
+ item.expand(true);
1290
+ break;
1291
+ case "Left":
1292
+ case "ArrowLeft":
1293
+ e.preventDefault();
1294
+ if (M3eDirectionality.current === "ltr") {
1295
+ if (item.hasChildItems && item.open) {
1296
+ item.collapse();
1297
+ } else {
1298
+ const parent = item.parentItem;
1299
+ if (parent) {
1300
+ parent.collapse();
1301
+ this[selectionManager].setActiveItem(parent);
1302
+ }
1303
+ }
1304
+ } else if (item.hasChildItems && !item.open) {
1305
+ item.expand();
1306
+ }
1307
+ break;
1308
+ case "Right":
1309
+ case "ArrowRight":
1310
+ e.preventDefault();
1311
+ if (M3eDirectionality.current === "rtl") {
1312
+ if (item.hasChildItems && item.open) {
1313
+ item.collapse();
1314
+ } else {
1315
+ const parent = item.parentItem;
1316
+ if (parent) {
1317
+ parent.collapse();
1318
+ this[selectionManager].setActiveItem(parent);
1319
+ }
1320
+ }
1321
+ } else if (item.hasChildItems && !item.open) {
1322
+ item.expand();
1323
+ }
1324
+ break;
1325
+ default:
1326
+ this[selectionManager].onKeyDown(e);
1327
+ break;
1328
+ }
894
1329
  };
895
1330
  _M3eNavMenuElement_handleKeyUp = function _M3eNavMenuElement_handleKeyUp(e) {
896
- const item = this[selectionManager].activeItem;
897
- if (!e.defaultPrevented && item && !item.disabled && e.key === " ") {
898
- item.ripple?.hide();
899
- }
1331
+ const item = this[selectionManager].activeItem;
1332
+ if (!e.defaultPrevented && item && !item.disabled && e.key === " ") {
1333
+ item.ripple?.hide();
1334
+ }
900
1335
  };
901
1336
  _M3eNavMenuElement_handlePointerDown = function _M3eNavMenuElement_handlePointerDown(e) {
902
- if (!e.defaultPrevented && !__classPrivateFieldGet(this, _M3eNavMenuElement_ignoreFocusVisible, "f")) {
903
- __classPrivateFieldSet(this, _M3eNavMenuElement_ignoreFocusVisible, true, "f");
904
- const item = e
905
- .composedPath()
906
- .reverse()
907
- .find((x) => x instanceof M3eNavMenuItemElement);
908
- if (item && !item.disabled) {
909
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateItemFocusVisible).call(this, item, true, false);
910
- }
1337
+ if (!e.defaultPrevented && !__classPrivateFieldGet(this, _M3eNavMenuElement_ignoreFocusVisible, "f")) {
1338
+ __classPrivateFieldSet(this, _M3eNavMenuElement_ignoreFocusVisible, true, "f");
1339
+ const item = e.composedPath().reverse().find(x => x instanceof M3eNavMenuItemElement);
1340
+ if (item && !item.disabled) {
1341
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateItemFocusVisible).call(this, item, true, false);
911
1342
  }
1343
+ }
912
1344
  };
913
1345
  _M3eNavMenuElement_activateItem = function _M3eNavMenuElement_activateItem(item) {
914
- this.setAttribute("aria-activedescendant", item.id);
915
- if (item.label) {
916
- scrollIntoViewIfNeeded(item.label, this, { block: "nearest", behavior: "smooth" });
917
- }
918
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
1346
+ this.setAttribute("aria-activedescendant", item.id);
1347
+ if (item.label) {
1348
+ scrollIntoViewIfNeeded(item.label, this, {
1349
+ block: "nearest",
1350
+ behavior: "smooth"
1351
+ });
1352
+ }
1353
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateFocusVisible).call(this);
919
1354
  };
920
1355
  _M3eNavMenuElement_updateFocusVisible = function _M3eNavMenuElement_updateFocusVisible() {
921
- const focused = this.matches(":focus") || this.matches(":focus-within");
922
- const focusVisible = !__classPrivateFieldGet(this, _M3eNavMenuElement_ignoreFocusVisible, "f") && this.matches(":focus-visible");
923
- this[selectionManager].items.forEach((x) => {
924
- const active = x === this[selectionManager].activeItem;
925
- __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateItemFocusVisible).call(this, x, active && focused, active && focusVisible);
926
- });
1356
+ const focused = this.matches(":focus") || this.matches(":focus-within");
1357
+ const focusVisible = !__classPrivateFieldGet(this, _M3eNavMenuElement_ignoreFocusVisible, "f") && this.matches(":focus-visible");
1358
+ this[selectionManager].items.forEach(x => {
1359
+ const active = x === this[selectionManager].activeItem;
1360
+ __classPrivateFieldGet(this, _M3eNavMenuElement_instances, "m", _M3eNavMenuElement_updateItemFocusVisible).call(this, x, active && focused, active && focusVisible);
1361
+ });
927
1362
  };
928
1363
  _M3eNavMenuElement_updateItemFocusVisible = function _M3eNavMenuElement_updateItemFocusVisible(item, focused, focusVisible) {
929
- if (focused && focusVisible) {
930
- item.stateLayer?.show("focused");
931
- }
932
- else {
933
- item.stateLayer?.hide("focused");
934
- }
935
- if (focusVisible) {
936
- item.focusRing?.show();
937
- }
938
- else {
939
- item.focusRing?.hide();
940
- }
1364
+ if (focused && focusVisible) {
1365
+ item.stateLayer?.show("focused");
1366
+ } else {
1367
+ item.stateLayer?.hide("focused");
1368
+ }
1369
+ if (focusVisible) {
1370
+ item.focusRing?.show();
1371
+ } else {
1372
+ item.focusRing?.hide();
1373
+ }
941
1374
  };
942
1375
  /** The styles of the element. */
943
- M3eNavMenuElement.styles = css `
944
- :host {
945
- display: flex;
946
- flex-direction: column;
947
- outline: none;
948
- overflow-y: auto;
949
- overflow-x: hidden;
950
- position: relative;
951
- min-height: 0;
952
- padding-block-start: var(--m3e-nav-menu-padding-top, 0.5rem);
953
- padding-block-end: var(--m3e-nav-menu-padding-bottom, 0.5rem);
954
- padding-inline-start: var(--m3e-nav-menu-padding-left, 0.75rem);
955
- padding-inline-end: var(--m3e-nav-menu-padding-right, 0.75rem);
956
- scrollbar-width: ${DesignToken.scrollbar.width};
957
- scrollbar-color: ${DesignToken.scrollbar.color};
958
- }
959
- ::slotted(m3e-divider) {
960
- margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem);
961
- flex: none;
962
- }
963
- `;
964
- /** @private */ M3eNavMenuElement.__nextId = 0;
965
- M3eNavMenuElement = M3eNavMenuElement_1 = __decorate([
966
- t$2("m3e-nav-menu")
967
- ], M3eNavMenuElement);
1376
+ M3eNavMenuElement.styles = css`:host { display: flex; flex-direction: column; outline: none; overflow-y: auto; overflow-x: hidden; position: relative; min-height: 0; padding-block-start: var(--m3e-nav-menu-padding-top, 0.5rem); padding-block-end: var(--m3e-nav-menu-padding-bottom, 0.5rem); padding-inline-start: var(--m3e-nav-menu-padding-left, 0.75rem); padding-inline-end: var(--m3e-nav-menu-padding-right, 0.75rem); scrollbar-width: ${DesignToken.scrollbar.width}; scrollbar-color: ${DesignToken.scrollbar.color}; } ::slotted(m3e-divider) { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); flex: none; }`;
1377
+ /** @private */
1378
+ M3eNavMenuElement.__nextId = 0;
1379
+ M3eNavMenuElement = M3eNavMenuElement_1 = __decorate([t$2("m3e-nav-menu")], M3eNavMenuElement);
968
1380
 
969
1381
  var _M3eNavMenuItemGroupElement_instances, _M3eNavMenuItemGroupElement_labelId, _M3eNavMenuItemGroupElement_label, _M3eNavMenuItemGroupElement_handleLabelSlotChange;
970
1382
  var M3eNavMenuItemGroupElement_1;
@@ -1011,72 +1423,56 @@ var M3eNavMenuItemGroupElement_1;
1011
1423
  * @cssprop --m3e-nav-menu-item-group-label-space - Vertical spacing around the group's label.
1012
1424
  */
1013
1425
  let M3eNavMenuItemGroupElement = M3eNavMenuItemGroupElement_1 = class M3eNavMenuItemGroupElement extends Role(LitElement, "group") {
1014
- constructor() {
1015
- super(...arguments);
1016
- _M3eNavMenuItemGroupElement_instances.add(this);
1017
- /** @private */ _M3eNavMenuItemGroupElement_labelId.set(this, `m3e-nav-menu-item-group-label-${M3eNavMenuItemGroupElement_1.__nextId++}`);
1018
- /** @private */ _M3eNavMenuItemGroupElement_label.set(this, void 0);
1019
- }
1020
- /** @inheritdoc */
1021
- connectedCallback() {
1022
- super.connectedCallback();
1023
- this.classList.toggle("-divided", this.previousElementSibling?.tagName === "M3E-DIVIDER");
1024
- }
1025
- /** @inheritdoc */
1026
- disconnectedCallback() {
1027
- super.disconnectedCallback();
1028
- this.classList.remove("-divided");
1029
- }
1030
- /** @inheritdoc */
1031
- render() {
1032
- return html `<slot name="label" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_instances, "m", _M3eNavMenuItemGroupElement_handleLabelSlotChange)}"></slot><slot></slot>`;
1033
- }
1426
+ constructor() {
1427
+ super(...arguments);
1428
+ _M3eNavMenuItemGroupElement_instances.add(this);
1429
+ /** @private */
1430
+ _M3eNavMenuItemGroupElement_labelId.set(this, `m3e-nav-menu-item-group-label-${M3eNavMenuItemGroupElement_1.__nextId++}`);
1431
+ /** @private */
1432
+ _M3eNavMenuItemGroupElement_label.set(this, void 0);
1433
+ }
1434
+ /** @inheritdoc */
1435
+ connectedCallback() {
1436
+ super.connectedCallback();
1437
+ this.classList.toggle("-divided", this.previousElementSibling?.tagName === "M3E-DIVIDER");
1438
+ }
1439
+ /** @inheritdoc */
1440
+ disconnectedCallback() {
1441
+ super.disconnectedCallback();
1442
+ this.classList.remove("-divided");
1443
+ }
1444
+ /** @inheritdoc */
1445
+ render() {
1446
+ return html`<slot name="label" @slotchange="${__classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_instances, "m", _M3eNavMenuItemGroupElement_handleLabelSlotChange)}"></slot><slot></slot>`;
1447
+ }
1034
1448
  };
1035
1449
  _M3eNavMenuItemGroupElement_labelId = new WeakMap();
1036
1450
  _M3eNavMenuItemGroupElement_label = new WeakMap();
1037
1451
  _M3eNavMenuItemGroupElement_instances = new WeakSet();
1038
1452
  _M3eNavMenuItemGroupElement_handleLabelSlotChange = function _M3eNavMenuItemGroupElement_handleLabelSlotChange(e) {
1039
- const label = e.target.assignedElements({ flatten: true })[0];
1040
- if (label !== __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f")) {
1041
- // If the label is changed and its id matched the reversed id,
1042
- // clear the id in the event the element is moved elsewhere in the DOM.
1043
- if (__classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f")?.id === __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_labelId, "f")) {
1044
- __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id = "";
1045
- }
1046
- __classPrivateFieldSet(this, _M3eNavMenuItemGroupElement_label, label, "f");
1047
- if (__classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f")) {
1048
- __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").role = "none";
1049
- __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id = __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id || __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_labelId, "f");
1050
- this.setAttribute("aria-labelledby", __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id);
1051
- }
1052
- else {
1053
- this.removeAttribute("aria-labelledby");
1054
- }
1453
+ const label = e.target.assignedElements({
1454
+ flatten: true
1455
+ })[0];
1456
+ if (label !== __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f")) {
1457
+ // If the label is changed and its id matched the reversed id,
1458
+ // clear the id in the event the element is moved elsewhere in the DOM.
1459
+ if (__classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f")?.id === __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_labelId, "f")) {
1460
+ __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id = "";
1461
+ }
1462
+ __classPrivateFieldSet(this, _M3eNavMenuItemGroupElement_label, label, "f");
1463
+ if (__classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f")) {
1464
+ __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id = __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id || __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_labelId, "f");
1465
+ this.setAttribute("aria-labelledby", __classPrivateFieldGet(this, _M3eNavMenuItemGroupElement_label, "f").id);
1466
+ } else {
1467
+ this.removeAttribute("aria-labelledby");
1055
1468
  }
1469
+ }
1056
1470
  };
1057
1471
  /** The styles of the element. */
1058
- M3eNavMenuItemGroupElement.styles = css `
1059
- :host {
1060
- display: contents;
1061
- }
1062
- ::slotted([slot="label"]) {
1063
- margin-inline-start: var(--m3e-nav-menu-item-group-label-inset, 1rem);
1064
- margin-block-end: var(--m3e-nav-menu-item-group-label-space, 1rem);
1065
- flex: none;
1066
- }
1067
- :host(.-divided) ::slotted([slot="label"]) {
1068
- margin-block-start: calc(
1069
- var(--m3e-nav-menu-item-group-label-space, 1rem) - var(--m3e-nav-menu-divider-margin, 0.25rem)
1070
- );
1071
- }
1072
- :host(:not(.-divided)) ::slotted([slot="label"]) {
1073
- margin-block-start: var(--m3e-nav-menu-item-group-label-space, 1rem);
1074
- }
1075
- `;
1076
- /** @private */ M3eNavMenuItemGroupElement.__nextId = 0;
1077
- M3eNavMenuItemGroupElement = M3eNavMenuItemGroupElement_1 = __decorate([
1078
- t$2("m3e-nav-menu-item-group")
1079
- ], M3eNavMenuItemGroupElement);
1472
+ M3eNavMenuItemGroupElement.styles = css`:host { display: contents; } ::slotted([slot="label"]) { margin-inline-start: var(--m3e-nav-menu-item-group-label-inset, 1rem); margin-block-end: var(--m3e-nav-menu-item-group-label-space, 1rem); flex: none; } :host(.-divided) ::slotted([slot="label"]) { margin-block-start: calc( var(--m3e-nav-menu-item-group-label-space, 1rem) - var(--m3e-nav-menu-divider-margin, 0.25rem) ); } :host(:not(.-divided)) ::slotted([slot="label"]) { margin-block-start: var(--m3e-nav-menu-item-group-label-space, 1rem); }`;
1473
+ /** @private */
1474
+ M3eNavMenuItemGroupElement.__nextId = 0;
1475
+ M3eNavMenuItemGroupElement = M3eNavMenuItemGroupElement_1 = __decorate([t$2("m3e-nav-menu-item-group")], M3eNavMenuItemGroupElement);
1080
1476
 
1081
1477
  export { M3eNavMenuElement, M3eNavMenuItemElement, M3eNavMenuItemGroupElement };
1082
1478
  //# sourceMappingURL=index.js.map