https://www.mcgill.ca/contact-us/themes/custom/miles/mcgill-ds/dist/web-components/mds-wcs.js?tltik8
1var Wt = Object.defineProperty; 2var Vt = (s, t, e) => t in s ? Wt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e; 3var g = (s, t, e) => Vt(s, typeof t != "symbol" ? t + "" : t, e); 4/** 5 * @license 6 * Copyright 2019 Google LLC 7 * SPDX-License-Identifier: BSD-3-Clause 8 */ 9const D = window, at = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, rt = Symbol(), ct = /* @__PURE__ */ new WeakMap(); 10let At = class { 11 constructor(t, e, i) { 12 if (this._$cssResult$ = !0, i !== rt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); 13 this.cssText = t, this.t = e; 14 } 15 get styleSheet() { 16 let t = this.o; 17 const e = this.t; 18 if (at && t === void 0) { 19 const i = e !== void 0 && e.length === 1; 20 i && (t = ct.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ct.set(e, t)); 21 } 22 return t; 23 } 24 toString() { 25 return this.cssText; 26 } 27}; 28const St = (s) => new At(typeof s == "string" ? s : s + "", void 0, rt), y = (s, ...t) => { 29 const e = s.length === 1 ? s[0] : t.reduce((i, o, n) => i + ((a) => { 30 if (a._$cssResult$ === !0) return a.cssText; 31 if (typeof a == "number") return a; 32 throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); 33 })(o) + s[n + 1], s[0]); 34 return new At(e, s, rt); 35}, Kt = (s, t) => { 36 at ? s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => { 37 const i = document.createElement("style"), o = D.litNonce; 38 o !== void 0 && i.setAttribute("nonce", o), i.textContent = e.cssText, s.appendChild(i); 39 }); 40}, ut = at ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => { 41 let e = ""; 42 for (const i of t.cssRules) e += i.cssText; 43 return St(e); 44})(s) : s; 45/** 46 * @license 47 * Copyright 2017 Google LLC 48 * SPDX-License-Identifier: BSD-3-Clause 49 */ 50var V; 51const I = window, pt = I.trustedTypes, Zt = pt ? pt.emptyScript : "", gt = I.reactiveElementPolyfillSupport, tt = { toAttribute(s, t) { 52 switch (t) { 53 case Boolean: 54 s = s ? Zt : null; 55 break; 56 case Object: 57 case Array: 58 s = s == null ? s : JSON.stringify(s); 59 } 60 return s; 61}, fromAttribute(s, t) { 62 let e = s; 63 switch (t) { 64 case Boolean: 65 e = s !== null; 66 break; 67 case Number: 68 e = s === null ? null : Number(s); 69 break; 70 case Object: 71 case Array: 72 try { 73 e = JSON.parse(s); 74 } catch { 75 e = null; 76 } 77 } 78 return e; 79} }, kt = (s, t) => t !== s && (t == t || s == s), K = { attribute: !0, type: String, converter: tt, reflect: !1, hasChanged: kt }, et = "finalized"; 80let x = class extends HTMLElement { 81 constructor() { 82 super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this._$Eu(); 83 } 84 static addInitializer(t) { 85 var e; 86 this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t); 87 } 88 static get observedAttributes() { 89 this.finalize(); 90 const t = []; 91 return this.elementProperties.forEach((e, i) => { 92 const o = this._$Ep(i, e); 93 o !== void 0 && (this._$Ev.set(o, i), t.push(o)); 94 }), t; 95 } 96 static createProperty(t, e = K) { 97 if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) { 98 const i = typeof t == "symbol" ? Symbol() : "__" + t, o = this.getPropertyDescriptor(t, i, e); 99 o !== void 0 && Object.defineProperty(this.prototype, t, o); 100 } 101 } 102 static getPropertyDescriptor(t, e, i) { 103 return { get() { 104 return this[e]; 105 }, set(o) { 106 const n = this[t]; 107 this[e] = o, this.requestUpdate(t, n, i); 108 }, configurable: !0, enumerable: !0 }; 109 } 110 static getPropertyOptions(t) { 111 return this.elementProperties.get(t) || K; 112 } 113 static finalize() { 114 if (this.hasOwnProperty(et)) return !1; 115 this[et] = !0; 116 const t = Object.getPrototypeOf(this); 117 if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) { 118 const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)]; 119 for (const o of i) this.createProperty(o, e[o]); 120 } 121 return this.elementStyles = this.finalizeStyles(this.styles), !0; 122 } 123 static finalizeStyles(t) { 124 const e = []; 125 if (Array.isArray(t)) { 126 const i = new Set(t.flat(1 / 0).reverse()); 127 for (const o of i) e.unshift(ut(o)); 128 } else t !== void 0 && e.push(ut(t)); 129 return e; 130 } 131 static _$Ep(t, e) { 132 const i = e.attribute; 133 return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0; 134 } 135 _$Eu() { 136 var t; 137 this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (t = this.constructor.h) === null || t === void 0 || t.forEach((e) => e(this)); 138 } 139 addController(t) { 140 var e, i; 141 ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(t), this.renderRoot !== void 0 && this.isConnected && ((i = t.hostConnected) === null || i === void 0 || i.call(t)); 142 } 143 removeController(t) { 144 var e; 145 (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1); 146 } 147 _$Eg() {
148 this.constructor.elementProperties.forEach((t, e) => { 149 this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]); 150 }); 151 } 152 createRenderRoot() { 153 var t; 154 const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions); 155 return Kt(e, this.constructor.elementStyles), e; 156 } 157 connectedCallback() { 158 var t; 159 this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) === null || t === void 0 || t.forEach((e) => { 160 var i; 161 return (i = e.hostConnected) === null || i === void 0 ? void 0 : i.call(e); 162 }); 163 } 164 enableUpdating(t) { 165 } 166 disconnectedCallback() { 167 var t; 168 (t = this._$ES) === null || t === void 0 || t.forEach((e) => { 169 var i; 170 return (i = e.hostDisconnected) === null || i === void 0 ? void 0 : i.call(e); 171 }); 172 } 173 attributeChangedCallback(t, e, i) { 174 this._$AK(t, i); 175 } 176 _$EO(t, e, i = K) { 177 var o; 178 const n = this.constructor._$Ep(t, i); 179 if (n !== void 0 && i.reflect === !0) { 180 const a = (((o = i.converter) === null || o === void 0 ? void 0 : o.toAttribute) !== void 0 ? i.converter : tt).toAttribute(e, i.type); 181 this._$El = t, a == null ? this.removeAttribute(n) : this.setAttribute(n, a), this._$El = null; 182 } 183 } 184 _$AK(t, e) { 185 var i; 186 const o = this.constructor, n = o._$Ev.get(t); 187 if (n !== void 0 && this._$El !== n) { 188 const a = o.getPropertyOptions(n), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? a.converter : tt; 189 this._$El = n, this[n] = h.fromAttribute(e, a.type), this._$El = null; 190 } 191 } 192 requestUpdate(t, e, i) { 193 let o = !0; 194 t !== void 0 && (((i = i || this.constructor.getPropertyOptions(t)).hasChanged || kt)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, i))) : o = !1), !this.isUpdatePending && o && (this._$E_ = this._$Ej()); 195 } 196 async _$Ej() { 197 this.isUpdatePending = !0; 198 try { 199 await this._$E_; 200 } catch (e) { 201 Promise.reject(e); 202 } 203 const t = this.scheduleUpdate(); 204 return t != null && await t, !this.isUpdatePending; 205 } 206 scheduleUpdate() { 207 return this.performUpdate(); 208 } 209 performUpdate() { 210 var t; 211 if (!this.isUpdatePending) return; 212 this.hasUpdated, this._$Ei && (this._$Ei.forEach((o, n) => this[n] = o), this._$Ei = void 0); 213 let e = !1; 214 const i = this._$AL; 215 try { 216 e = this.shouldUpdate(i), e ? (this.willUpdate(i), (t = this._$ES) === null || t === void 0 || t.forEach((o) => { 217 var n; 218 return (n = o.hostUpdate) === null || n === void 0 ? void 0 : n.call(o); 219 }), this.update(i)) : this._$Ek(); 220 } catch (o) { 221 throw e = !1, this._$Ek(), o; 222 } 223 e && this._$AE(i); 224 } 225 willUpdate(t) { 226 } 227 _$AE(t) { 228 var e; 229 (e = this._$ES) === null || e === void 0 || e.forEach((i) => { 230 var o; 231 return (o = i.hostUpdated) === null || o === void 0 ? void 0 : o.call(i); 232 }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); 233 } 234 _$Ek() { 235 this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; 236 } 237 get updateComplete() { 238 return this.getUpdateComplete(); 239 } 240 getUpdateComplete() { 241 return this._$E_; 242 } 243 shouldUpdate(t) { 244 return !0; 245 } 246 update(t) { 247 this._$EC !== void 0 && (this._$EC.forEach((e, i) => this._$EO(i, this[i], e)), this._$EC = void 0), this._$Ek(); 248 } 249 updated(t) { 250 } 251 firstUpdated(t) { 252 } 253}; 254x[et] = !0, x.elementProperties = /* @__PURE__ */ new Map(), x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, gt == null || gt({ ReactiveElement: x }), ((V = I.reactiveElementVersions) !== null && V !== void 0 ? V : I.reactiveElementVersions = []).push("1.6.3"); 255/** 256 * @license 257 * Copyright 2017 Google LLC 258 * SPDX-License-Identifier: BSD-3-Clause 259 */ 260var Z; 261const j = window, H = j.trustedTypes, mt = H ? H.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, it = "$lit$", w = `lit$${(Math.random() + "").slice(9)}$`, Ct = "?" + w, Ft = `<${Ct}>`, C = document, L = () => C.createComment(""), O = (s) => s === null || typeof s != "object" && typeof s != "function", Et = Array.isArray, Jt = (s) => Et(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", F = `[ 262\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, vt = /-->/g, ft = />/g, S = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ 263\f\r"'\`<>=]|("|')|))|$)`, "g"), bt = /'/g, _t = /"/g, xt = /^(?:script|style|textarea|title)$/i, Qt = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }
263), l = Qt(1), E = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), yt = /* @__PURE__ */ new WeakMap(), k = C.createTreeWalker(C, 129, null, !1); 264function Ht(s, t) { 265 if (!Array.isArray(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array"); 266 return mt !== void 0 ? mt.createHTML(t) : t; 267} 268const Xt = (s, t) => { 269 const e = s.length - 1, i = []; 270 let o, n = t === 2 ? "<svg>" : "", a = P; 271 for (let h = 0; h < e; h++) { 272 const r = s[h]; 273 let d, c, u = -1, m = 0; 274 for (; m < r.length && (a.lastIndex = m, c = a.exec(r), c !== null); ) m = a.lastIndex, a === P ? c[1] === "!--" ? a = vt : c[1] !== void 0 ? a = ft : c[2] !== void 0 ? (xt.test(c[2]) && (o = RegExp("</" + c[2], "g")), a = S) : c[3] !== void 0 && (a = S) : a === S ? c[0] === ">" ? (a = o ?? P, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, d = c[1], a = c[3] === void 0 ? S : c[3] === '"' ? _t : bt) : a === _t || a === bt ? a = S : a === vt || a === ft ? a = P : (a = S, o = void 0); 275 const _ = a === S && s[h + 1].startsWith("/>") ? " " : ""; 276 n += a === P ? r + Ft : u >= 0 ? (i.push(d), r.slice(0, u) + it + r.slice(u) + w + _) : r + w + (u === -2 ? (i.push(void 0), h) : _); 277 } 278 return [Ht(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i]; 279}; 280class U { 281 constructor({ strings: t, _$litType$: e }, i) { 282 let o; 283 this.parts = []; 284 let n = 0, a = 0; 285 const h = t.length - 1, r = this.parts, [d, c] = Xt(t, e); 286 if (this.el = U.createElement(d, i), k.currentNode = this.el.content, e === 2) { 287 const u = this.el.content, m = u.firstChild; 288 m.remove(), u.append(...m.childNodes); 289 } 290 for (; (o = k.nextNode()) !== null && r.length < h; ) { 291 if (o.nodeType === 1) { 292 if (o.hasAttributes()) { 293 const u = []; 294 for (const m of o.getAttributeNames()) if (m.endsWith(it) || m.startsWith(w)) { 295 const _ = c[a++]; 296 if (u.push(m), _ !== void 0) { 297 const Gt = o.getAttribute(_.toLowerCase() + it).split(w), z = /([.?@])?(.*)/.exec(_); 298 r.push({ type: 1, index: n, name: z[2], strings: Gt, ctor: z[1] === "." ? te : z[1] === "?" ? ie : z[1] === "@" ? se : W }); 299 } else r.push({ type: 6, index: n }); 300 } 301 for (const m of u) o.removeAttribute(m); 302 } 303 if (xt.test(o.tagName)) { 304 const u = o.textContent.split(w), m = u.length - 1; 305 if (m > 0) { 306 o.textContent = H ? H.emptyScript : ""; 307 for (let _ = 0; _ < m; _++) o.append(u[_], L()), k.nextNode(), r.push({ type: 2, index: ++n }); 308 o.append(u[m], L()); 309 } 310 } 311 } else if (o.nodeType === 8) if (o.data === Ct) r.push({ type: 2, index: n }); 312 else { 313 let u = -1; 314 for (; (u = o.data.indexOf(w, u + 1)) !== -1; ) r.push({ type: 7, index: n }), u += w.length - 1; 315 } 316 n++; 317 } 318 } 319 static createElement(t, e) { 320 const i = C.createElement("template"); 321 return i.innerHTML = t, i; 322 } 323} 324function T(s, t, e = s, i) { 325 var o, n, a, h; 326 if (t === E) return t; 327 let r = i !== void 0 ? (o = e._$Co) === null || o === void 0 ? void 0 : o[i] : e._$Cl; 328 const d = O(t) ? void 0 : t._$litDirective$; 329 return (r == null ? void 0 : r.constructor) !== d && ((n = r == null ? void 0 : r._$AO) === null || n === void 0 || n.call(r, !1), d === void 0 ? r = void 0 : (r = new d(s), r._$AT(s, e, i)), i !== void 0 ? ((a = (h = e)._$Co) !== null && a !== void 0 ? a : h._$Co = [])[i] = r : e._$Cl = r), r !== void 0 && (t = T(s, r._$AS(s, t.values), r, i)), t; 330} 331class Yt { 332 constructor(t, e) { 333 this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; 334 } 335 get parentNode() { 336 return this._$AM.parentNode; 337 } 338 get _$AU() { 339 return this._$AM._$AU; 340 } 341 u(t) { 342 var e; 343 const { el: { content: i }, parts: o } = this._$AD, n = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : C).importNode(i, !0); 344 k.currentNode = n; 345 let a = k.nextNode(), h = 0, r = 0, d = o[0]; 346 for (; d !== void 0; ) { 347 if (h === d.index) { 348 let c; 349 d.type === 2 ? c = new B(a, a.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(a, d.name, d.strings, this, t) : d.type === 6 && (c = new oe(a, this, t)), this._$AV.push(c), d = o[++r]; 350 } 351 h !== (d == null ? void 0 : d.index) && (a = k.nextNode(), h++); 352 } 353 return k.currentNode = C, n; 354 } 355 v(t) { 356 let e = 0; 357 for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.str
357ings.length - 2) : i._$AI(t[e])), e++; 358 } 359} 360class B { 361 constructor(t, e, i, o) { 362 var n; 363 this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = o, this._$Cp = (n = o == null ? void 0 : o.isConnected) === null || n === void 0 || n; 364 } 365 get _$AU() { 366 var t, e; 367 return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp; 368 } 369 get parentNode() { 370 let t = this._$AA.parentNode; 371 const e = this._$AM; 372 return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t; 373 } 374 get startNode() { 375 return this._$AA; 376 } 377 get endNode() { 378 return this._$AB; 379 } 380 _$AI(t, e = this) { 381 t = T(this, t, e), O(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Jt(t) ? this.T(t) : this._(t); 382 } 383 k(t) { 384 return this._$AA.parentNode.insertBefore(t, this._$AB); 385 } 386 $(t) { 387 this._$AH !== t && (this._$AR(), this._$AH = this.k(t)); 388 } 389 _(t) { 390 this._$AH !== p && O(this._$AH) ? this._$AA.nextSibling.data = t : this.$(C.createTextNode(t)), this._$AH = t; 391 } 392 g(t) { 393 var e; 394 const { values: i, _$litType$: o } = t, n = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = U.createElement(Ht(o.h, o.h[0]), this.options)), o); 395 if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n) this._$AH.v(i); 396 else { 397 const a = new Yt(n, this), h = a.u(this.options); 398 a.v(i), this.$(h), this._$AH = a; 399 } 400 } 401 _$AC(t) { 402 let e = yt.get(t.strings); 403 return e === void 0 && yt.set(t.strings, e = new U(t)), e; 404 } 405 T(t) { 406 Et(this._$AH) || (this._$AH = [], this._$AR()); 407 const e = this._$AH; 408 let i, o = 0; 409 for (const n of t) o === e.length ? e.push(i = new B(this.k(L()), this.k(L()), this, this.options)) : i = e[o], i._$AI(n), o++; 410 o < e.length && (this._$AR(i && i._$AB.nextSibling, o), e.length = o); 411 } 412 _$AR(t = this._$AA.nextSibling, e) { 413 var i; 414 for ((i = this._$AP) === null || i === void 0 || i.call(this, !1, !0, e); t && t !== this._$AB; ) { 415 const o = t.nextSibling; 416 t.remove(), t = o; 417 } 418 } 419 setConnected(t) { 420 var e; 421 this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t)); 422 } 423} 424class W { 425 constructor(t, e, i, o, n) { 426 this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = p; 427 } 428 get tagName() { 429 return this.element.tagName; 430 } 431 get _$AU() { 432 return this._$AM._$AU; 433 } 434 _$AI(t, e = this, i, o) { 435 const n = this.strings; 436 let a = !1; 437 if (n === void 0) t = T(this, t, e, 0), a = !O(t) || t !== this._$AH && t !== E, a && (this._$AH = t); 438 else { 439 const h = t; 440 let r, d; 441 for (t = n[0], r = 0; r < n.length - 1; r++) d = T(this, h[i + r], e, r), d === E && (d = this._$AH[r]), a || (a = !O(d) || d !== this._$AH[r]), d === p ? t = p : t !== p && (t += (d ?? "") + n[r + 1]), this._$AH[r] = d; 442 } 443 a && !o && this.j(t); 444 } 445 j(t) { 446 t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); 447 } 448} 449class te extends W { 450 constructor() { 451 super(...arguments), this.type = 3; 452 } 453 j(t) { 454 this.element[this.name] = t === p ? void 0 : t; 455 } 456} 457const ee = H ? H.emptyScript : ""; 458class ie extends W { 459 constructor() { 460 super(...arguments), this.type = 4; 461 } 462 j(t) { 463 t && t !== p ? this.element.setAttribute(this.name, ee) : this.element.removeAttribute(this.name); 464 } 465} 466class se extends W { 467 constructor(t, e, i, o, n) { 468 super(t, e, i, o, n), this.type = 5; 469 } 470 _$AI(t, e = this) { 471 var i; 472 if ((t = (i = T(this, t, e, 0)) !== null && i !== void 0 ? i : p) === E) return; 473 const o = this._$AH, n = t === p && o !== p || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive, a = t !== p && (
473o === p || n); 474 n && this.element.removeEventListener(this.name, this, o), a && this.element.addEventListener(this.name, this, t), this._$AH = t; 475 } 476 handleEvent(t) { 477 var e, i; 478 typeof this._$AH == "function" ? this._$AH.call((i = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && i !== void 0 ? i : this.element, t) : this._$AH.handleEvent(t); 479 } 480} 481class oe { 482 constructor(t, e, i) { 483 this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i; 484 } 485 get _$AU() { 486 return this._$AM._$AU; 487 } 488 _$AI(t) { 489 T(this, t); 490 } 491} 492const $t = j.litHtmlPolyfillSupport; 493$t == null || $t(U, B), ((Z = j.litHtmlVersions) !== null && Z !== void 0 ? Z : j.litHtmlVersions = []).push("2.8.0"); 494const ne = (s, t, e) => { 495 var i, o; 496 const n = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t; 497 let a = n._$litPart$; 498 if (a === void 0) { 499 const h = (o = e == null ? void 0 : e.renderBefore) !== null && o !== void 0 ? o : null; 500 n._$litPart$ = a = new B(t.insertBefore(L(), h), h, void 0, e ?? {}); 501 } 502 return a._$AI(s), a; 503}; 504/** 505 * @license 506 * Copyright 2017 Google LLC 507 * SPDX-License-Identifier: BSD-3-Clause 508 */ 509var J, Q; 510let v = class extends x { 511 constructor() { 512 super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; 513 } 514 createRenderRoot() { 515 var t, e; 516 const i = super.createRenderRoot(); 517 return (t = (e = this.renderOptions).renderBefore) !== null && t !== void 0 || (e.renderBefore = i.firstChild), i; 518 } 519 update(t) { 520 const e = this.render(); 521 this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ne(e, this.renderRoot, this.renderOptions); 522 } 523 connectedCallback() { 524 var t; 525 super.connectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!0); 526 } 527 disconnectedCallback() { 528 var t; 529 super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1); 530 } 531 render() { 532 return E; 533 } 534}; 535v.finalized = !0, v._$litElement$ = !0, (J = globalThis.litElementHydrateSupport) === null || J === void 0 || J.call(globalThis, { LitElement: v }); 536const wt = globalThis.litElementPolyfillSupport; 537wt == null || wt({ LitElement: v }); 538((Q = globalThis.litElementVersions) !== null && Q !== void 0 ? Q : globalThis.litElementVersions = []).push("3.3.3"); 539/** 540 * @license 541 * Copyright 2017 Google LLC 542 * SPDX-License-Identifier: BSD-3-Clause 543 */ 544const lt = (s) => (t) => typeof t == "function" ? ((e, i) => (customElements.define(e, i), i))(s, t) : ((e, i) => { 545 const { kind: o, elements: n } = i; 546 return { kind: o, elements: n, finisher(a) { 547 customElements.define(e, a); 548 } }; 549})(s, t); 550/** 551 * @license 552 * Copyright 2017 Google LLC 553 * SPDX-License-Identifier: BSD-3-Clause 554 */ 555const ae = (s, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? { ...t, finisher(e) { 556 e.createProperty(t.key, s); 557} } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: t.key, initializer() { 558 typeof t.initializer == "function" && (this[t.key] = t.initializer.call(this)); 559}, finisher(e) { 560 e.createProperty(t.key, s); 561} }, re = (s, t, e) => { 562 t.constructor.createProperty(e, s); 563}; 564function $(s) { 565 return (t, e) => e !== void 0 ? re(s, t, e) : ae(s, t); 566} 567/** 568 * @license 569 * Copyright 2017 Google LLC 570 * SPDX-License-Identifier: BSD-3-Clause 571 */ 572const le = ({ finisher: s, descriptor: t }) => (e, i) => { 573 var o; 574 if (i === void 0) { 575 const n = (o = e.originalKey) !== null && o !== void 0 ? o : e.key, a = t != null ? { kind: "method", placement: "prototype", key: n, descriptor: t(e.key) } : { ...e, key: n }; 576 return s != null && (a.finisher = function(h) { 577 s(h, n); 578 }), a; 579 } 580 { 581 const n = e.constructor; 582 t !== void 0 && Object.defineProperty(e, i, t(i)), s == null || s(n, i); 583 } 584}; 585/** 586 * @license 587 * Copyright 2021 Google LLC 588 * SPDX-License-Identifier: BSD-3-Clause 589 */ 590var X; 591const de = ((X = window.HTMLSlotElement) === null || X === void 0 ? void 0 : X.prototype.assignedElements) != null ? (s, t) => s.assignedElements(t) : (s, t) => s.assignedNodes(t).filter((e) => e.nodeType === Node.ELEMENT_NODE); 592function Tt(s) { 593 const { slot: t, selector: e } = s ?? {}; 594 return le({ descriptor: (i) => ({ get() { 595 var o; 596 const n = "slot" + (t ? `[name=${t}]` : ":not([name])"), a = (o = this.renderRoot) === null || o === void 0 ? void 0 : o.querySelector(n), h = a != null ? de(a, s) : []; 597 return e ? h.filter((r) => r.matches(e)) : h; 598 }, enumerable: !0, configurable: !0 }) }); 599} 600const he = ":root{--animation-duration: .6s;--animation-duration-fast: .3s;--animation-duration-slow: 1.2s;--loading-animation: fade-in var(--animation-duration) ease-in .3s backwards;--fixed-spacing-unit: .5rem;container-type:inline-size}
600.sr-only:not(:focus):not(:active){clip:rect(0 0 0 0);clip-path:inset(100%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@keyframes fade-in{0%{opacity:0%}to{opacity:100%}}@keyframes snap-in{0%{width:0;height:0;overflow:hidden}to{height:auto;width:auto;overflow:auto}}mds-drawer{animation:var(--loading-animation)}mds-drawer:not(:defined){animation:snap-in .3s;animation-fill-mode:backwards;animation-delay:.4s;display:block}mds-extra-details{display:block;animation:var(--loading-animation)}mds-extra-details:not(:defined) *{animation:var(--loading-animation)}open-close-toggle,extra-details{animation:wc-fade-in .6s ease-in;display:inline-block}mds-extra-details:not(:defined){visibility:hidden}mds-placeholder,mds-placeholder:not(:defined){display:block;opacity:0%}mds-placeholder[ready]{animation:var(--loading-animation);opacity:100%}mds-toggle-scrim[onState]{display:block;position:absolute;top:0;bottom:0;height:100%;width:100%;z-index:999}mds-toggle-scrim[onState]::part(scrim-layer){background:#000;opacity:30%;height:100%;width:100%}mds-menu::part(hidden-slotted-content){height:0;overflow:hidden}mds-dialog{--dialog-animation-time: .3s}mds-dialog[onState]{--adjusted-width: calc(var(--mds-container-max-width) * .8);--dialog-width: var(--adjusted-width, 80%)}mds-dialog.mds-dark::part(dialog-element){background:#111;color:#fff}mds-dialog::part(dialog-body){padding:5rem 3rem 3rem}mds-dialog .mds-search__submit{align-items:center}mds-dialog input[type=search]:focus,mds-dialog input[type=search]:hover{border-color:unset;box-shadow:0 2px #000}@supports (-moz-appearance: none){mds-dialog::part(dialog-element){animation:ff-dialog-fade var(--dialog-animation-time) ease-out forwards}mds-dialog::part(dialog-element)::backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#000c}}@keyframes ff-dialog-fade{0%{opacity:0%}to{opacity:80%}}mds-shutter{display:block}mds-shutter.mds-shutter-closed::part(height-container){--overrideHeight: 0}mds-shutter.mds-shutter-open::part(height-container){--overrideHeight: unset}
600mds-tab-group{display:block;--tab-list-flex-direction: row;--tab-list-tab-box-shadow-orientation: 0 var(--mds-spacing-x-small, .25rem);--tab-list-tab-border-radius: var(--mds-border-radius)}@container (max-width: 720px){mds-tab-group{--tab-list-flex-direction: column;--tab-list-tab-box-shadow-orientation: calc(-1*var(--mds-spacing-x-small, .25rem)) 0;--tab-list-tab-border-radius: 0;--tab-group-flex-direction: row;--tab-group-gap: var(--mds-spacing-x-small)}}mds-tab-panel{display:none}mds-tab-panel[active]{display:block}"; 601let ce = St(he); 602var ue = Object.defineProperty, Pt = (s, t, e, i) => { 603 for (var o = void 0, n = s.length - 1, a; n >= 0; n--) 604 (a = s[n]) && (o = a(t, e, o) || o); 605 return o && ue(t, e, o), o; 606}; 607class dt extends v { 608 constructor() { 609 super(...arguments), this.openStatus = !1, this.sectionTitle = ""; 610 } 611 // Handle button click to open/close drawer. 612 handleClick() { 613 this.openStatus = !this.openStatus; 614 } 615 // Render the element. 616 render() { 617 let t = l`<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M1.5 3C1.22386 3 1 3.22386 1 3.5C1 3.77614 1.22386 4 1.5 4H13.5C13.7761 4 14 3.77614 14 3.5C14 3.22386 13.7761 3 13.5 3H1.5ZM1 7.5C1 7.22386 1.22386 7 1.5 7H13.5C13.7761 7 14 7.22386 14 7.5C14 7.77614 13.7761 8 13.5 8H1.5C1.22386 8 1 7.77614 1 7.5ZM1 11.5C1 11.2239 1.22386 11 1.5 11H13.5C13.7761 11 14 11.2239 14 11.5C14 11.7761 13.7761 12 13.5 12H1.5C1.22386 12 1 11.7761 1 11.5Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>`, e = l`<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>`, i = "open", o = t; 618 return this.openStatus && (i = "close", o = e), l` 619 <section> 620 <button @click=${this.handleClick} > 621 <span class="sr-only"> 622 ${i} 623 </span> 624 ${o} 625 </button> 626 <div class="drawer-contents"> 627 <h3>${this.sectionTitle}</h3> 628 <slot></slot> 629 </div> 630 </section>`; 631 } 632 // Set styles. 633 static get styles() { 634 return [ 635 y` 636 /* Main containing element for drawer. */ 637 :host { 638 display: flex; 639 position: relative; 640 background: white; 641 /* Should be full height of screen.*/ 642 height: 100vh; 643 /* Set some basic styling variables for parts of the drawer.*/ 644 --button-width: 2rem; 645 /* Drawer width is relative to button width; allows for space proportionate to button width while also taking up most of the viewport width. */ 646 --drawer-width: calc(100vw - 4*var(--button-width)); 647 /* Basic padding for contents. */ 648 --drawer-padding: 0.5rem; 649 } 650 651 /* Open/close button for drawer. */ 652 button { 653 position: absolute; 654 top: 0; 655 /* Button positioned with reference to it's own width.*/ 656 right: calc(-1* var(--button-width)); 657 width: var(--button-width); 658 height: var(--button-width); 659 padding: 0; 660 margin: 0; 661 background: white; 662 border: none; 663 } 664 665 /* Defines 'root' of drawer and the element that 'opens'.*/ 666 section { 667 /* Margin-left initially set to negative drawer-width, so 'closed'. */ 668 margin-left: calc(-1 * var(--drawer-width)); 669 /* Use transition for animation on open/shut states. */ 670 transition: margin-left var(--animation-duration-fast); 671 } 672 /* When open, reset margin-left. */ 673 :host([openstatus]) section { 674 margin-left: 0; 675 } 676 677 /* Holds main contents of drawer.*/ 678 .drawer-contents { 679 padding: var(--drawer-padding); 680 /* Width required to avoid reflow. */ 681 width: calc(var(--drawer-width) - 2*var(--drawer-padding)); 682 } 683 `, 684 // Include shared styles provided by css-importer. 685 ce 686 ]; 687 } 688} 689Pt([ 690 $({ type: Boolean, reflect: !0 }) 691], dt.prototype, "openStatus"); 692Pt([ 693 $({ type: String }) 694], dt.prototype, "sectionTitle"); 695const pe = function() { 696 customElements.define("mds-drawer", dt); 697}; 698class st extends v { 699 constructor() { 700 super(), this.animate = !0, this.toggleStatus = !1; 701 } 702 render() { 703 return l` 704 <div part="toggle-wrapper"> 705 <!-- Ionicon open icon markup. --> 706 <ion-icon aria-hidden="true" name="add-sharp" part="toggle-open-icon" alt="open"> 707 open 708 </ion-icon> 709 <!-- Ionicon close icon markup. --> 710 <ion-icon 711 aria-hidden="true" 712 name="remove-sharp" 713 part="toggle-close-icon" 714 alt="close" 715 > 716 close 717 </ion-icon> 718 </div> 719 `; 720 } 721} 722g(st, "properties", { 723 // Property/attribute to determine if should animate at all - this should be dynamic since animation can be a bad user experience for some. 724 animate: { type: Boolean, reflect: !0 },
725 // Toggled 'on' or 'off'. 726 toggleStatus: { type: Boolean, reflect: !0 } 727}), g(st, "styles", y` 728 :host { 729 /* Specify a general animation duration variable for the entire component, inheriting a common externally provided duration or using a fallback value. */ 730 --toggle-animation-duration: var(--animation-duration-fast, 0.3s); 731 } 732 733 /* Container div - useful for positioning. */ 734 div[part="toggle-wrapper"] { 735 position: relative; 736 } 737 738 /* ion-icon component for icon; positioned absolutely so can cross-fade transition. */ 739 ion-icon { 740 /* Position icon in center of wrapper. */ 741 position: absolute; 742 opacity: 0; 743 } 744 /* If animate attribute is set, use transition. */ 745 :host([animate]) ion-icon { 746 transition: opacity var(--toggle-animation-duration); 747 } 748 749 /* If off, show 'on' icon. */ 750 :host(:not([togglestatus])) ion-icon[name="add-sharp"] { 751 opacity: 1; 752 } 753 /* If on, show 'off' icon. */ 754 :host([toggleStatus]) ion-icon[name="remove-sharp"] { 755 opacity: 1; 756 } 757 `); 758class ot extends v { 759 constructor() { 760 super(), this.activeStatus = !1, this.open = this.activeStatus; 761 } 762 // Use firstUpdated lifecyle hook to fire a custom event 'childready' - allows parent components to know when a child component is fully loaded and first rendered and respond to event appropriately. See Placeholder for an implementation that does this. 763 firstUpdated() { 764 let t = new CustomEvent("childready", { 765 bubbles: !0, 766 composed: !0 767 }); 768 this.dispatchEvent(t), this._getHeights(); 769 } 770 // Uses connectedCallback to compute some properties and set up some event listeners. 771 connectedCallback() { 772 if (super.connectedCallback(), this.autoOpenSelector) { 773 let e = this.querySelectorAll(this.autoOpenSelector).length > 0; 774 !this.activeStatus && e && (this.activeStatus = !0); 775 } 776 let t = this; 777 window.addEventListener( 778 "resize", 779 function() { 780 t._handleWindowResize(); 781 }, 782 !1 783 ); 784 } 785 // Listen for widow resize and adjust height variables. 786 _handleWindowResize() { 787 this._getHeights(); 788 } 789 // Handle toggle using native details element toggle event. 790 // TODO: the only trouble w/ using the native toggle event is there's no way to animate the 'out' state of the contents since by the time toggle fires, the details element is already 'closed' and contents totally hidden. Listening to click on summary could override this but then everything else has to be handled explicitly by the component. A solution could be to handle BOTH events and postpone triggering the toggle until after some effect has been done. But this is progressive enhancement - add things in layers weighing convenience vs effort. IE these suggestions steps would be high effort and require a re-wiring most of the details behaviours. Would probably require major version change - probably breaks API? 791 _handleToggle() { 792 this.activeStatus = this._details.open, this._getHeights(); 793 } 794 // Get the child details element to query for heights, children etc. 795 get _details() { 796 var t; 797 return ((t = this.renderRoot) == null ? void 0 : t.querySelector("details")) ?? null; 798 } 799 // Calculates the heights required for animating the component on open/shut. 800 _getHeights() { 801 let t = this; 802 requestAnimationFrame(function() { 803 let e = t._details.querySelector("summary"), i = t._details.querySelector("div"), o = e.clientHeight, a = i.clientHeight + o; 804 t.style.setProperty("--initHeight", String(o) + "px"), t.style.setProperty("--activeHeight", String(a) + "px"); 805 }); 806 } 807 render() { 808 return l` 809 <details ?open=${this.activeStatus} @toggle=${this._handleToggle}> 810 <summary part="summary"> 811 <!-- open-close-toggle CE for nicer animated toggling; forwards toggle-wrapper part for themeing. --> 812 <open-close-toggle 813 exportparts="toggle-wrapper" 814 ?toggleStatus="${this.activeStatus}" 815 ></open-close-toggle> 816 <slot name="summary"></slot> 817 </summary> 818 <div part="contents"> 819 <slot></slot> 820 </div> 821 </details> 822 `; 823 } 824} 825g(ot, "properties", { 826 // Dynamic property to track current state of open/closed status. 827 // TODO: not sure this is needed anymore, re-evaluate later on next version. 828 open: { 829 type: Boolean 830 }, 831 // Property to see if details element should be open or closed by default. Reflect as attribute. 832 activeStatus: { 833 type: Boolean, 834 reflect: !0 835 }, 836 // Property for autoOpenSelector, allows component to check for children matching that selector. 837 // Allows for checking child elements for 'activity' and setting parent open/closed. 838 autoOpenSelector: { type: String } 839}), g(ot, "styles", y` 840 :host { 841 /* Specify a general animation duration variable for the entire component, inheriting a common externally provided duration or using a fallback value. */ 842 --ed-animation-duration: var(--animation-duration-fast, 0.3s); 843 --ed-animation-duration-slow: calc(3 * var(--ed-animation-duration)); 844 display: block; 845 transition: height var(--ed-animation-duration); 846 height: var(--initHeight); 847 overflow: hidden; 848 } 849 850 /* Set height when active attribute set (thus 'open') to activeHeight variable. */ 851 :host([activestatus]) { 852 height: var(--activeHeight); 853 } 854 855 :host details div[part="contents"] { 856 opacity: 0; 857 transition: opacity var(--ed-animation-duration-slow); 858 } 859 860 :host([activestatus]) details div[part="contents"] { 861 opacity: 1; 862 } 863 864 /* TODO: these rules about summary styling could be styled outside of component in CSS file; using part at the same time as regular details summary is styled. Then again, component should be as self-contained as possible. */ 865 866 /* Standards compliant method of unsetting 'marker' in details summary element. */ 867 :host details summary { 868 list-style: none; 869 } 870 /* Legacy method of hiding marker, still required for some browsers. */ 871 :host details summary::-webkit-details-marker { 872 display: none; 873 } 874 875 /* Want any headers inside summary to be inline-block. */ 876 /* :host details summary * { 877 display: inline-block; 878 } */ 879 `); 880class Mt extends v { 881 constructor() { 882 super(), this.ready = !1, this.awaitChildReady = !1; 883 } 884 connectedCallback() { 885 super.connectedCallback(), this.awaitChildReady && this.addEventListener("childready", function(t) { 886 t.stopPropagation(), this.ready = !0; 887 }); 888 } 889 // Handles slotchange event - when placeholder slot is filled, this event fired. Slot can be filled with LightDOM or better, other components who's custom elements will only be slotted after they are defined (loaded). Therefore the Placeholder is 'ready' when it's children are.
890 handleSlotChange() { 891 this.awaitChildReady || (this.ready = !0); 892 } 893 render() { 894 return l` 895 <slot @slotchange=${this.handleSlotChange}></slot> 896 `; 897 } 898} 899g(Mt, "properties", { 900 // Property/attribute for readiness of contents. 901 ready: { type: Boolean, reflect: !0 }, 902 // Property/attribute for checking for explicit child readiness. 903 awaitChildReady: { type: Boolean, reflect: !0 } 904}); 905const ge = function() { 906 customElements.define("open-close-toggle", st), customElements.define("mds-extra-details", ot), customElements.define("mds-placeholder", Mt); 907}; 908/** 909 * @license 910 * Copyright 2020 Google LLC 911 * SPDX-License-Identifier: BSD-3-Clause 912 */ 913const me = (s) => s.strings === void 0; 914/** 915 * @license 916 * Copyright 2017 Google LLC 917 * SPDX-License-Identifier: BSD-3-Clause 918 */ 919const Lt = { ATTRIBUTE: 1, CHILD: 2 }, Ot = (s) => (...t) => ({ _$litDirective$: s, values: t }); 920let Ut = class { 921 constructor(t) { 922 } 923 get _$AU() { 924 return this._$AM._$AU; 925 } 926 _$AT(t, e, i) { 927 this._$Ct = t, this._$AM = e, this._$Ci = i; 928 } 929 _$AS(t, e) { 930 return this.update(t, e); 931 } 932 update(t, e) { 933 return this.render(...e); 934 } 935}; 936/** 937 * @license 938 * Copyright 2017 Google LLC 939 * SPDX-License-Identifier: BSD-3-Clause 940 */ 941const M = (s, t) => { 942 var e, i; 943 const o = s._$AN; 944 if (o === void 0) return !1; 945 for (const n of o) (i = (e = n)._$AO) === null || i === void 0 || i.call(e, t, !1), M(n, t); 946 return !0; 947}, q = (s) => { 948 let t, e; 949 do { 950 if ((t = s._$AM) === void 0) break; 951 e = t._$AN, e.delete(s), s = t; 952 } while ((e == null ? void 0 : e.size) === 0); 953}, Nt = (s) => { 954 for (let t; t = s._$AM; s = t) { 955 let e = t._$AN; 956 if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set(); 957 else if (e.has(s)) break; 958 e.add(s), be(t); 959 } 960}; 961function ve(s) { 962 this._$AN !== void 0 ? (q(this), this._$AM = s, Nt(this)) : this._$AM = s; 963} 964function fe(s, t = !1, e = 0) { 965 const i = this._$AH, o = this._$AN; 966 if (o !== void 0 && o.size !== 0) if (t) if (Array.isArray(i)) for (let n = e; n < i.length; n++) M(i[n], !1), q(i[n]); 967 else i != null && (M(i, !1), q(i)); 968 else M(this, s); 969} 970const be = (s) => { 971 var t, e, i, o; 972 s.type == Lt.CHILD && ((t = (i = s)._$AP) !== null && t !== void 0 || (i._$AP = fe), (e = (o = s)._$AQ) !== null && e !== void 0 || (o._$AQ = ve)); 973}; 974class _e extends Ut { 975 constructor() { 976 super(...arguments), this._$AN = void 0; 977 } 978 _$AT(t, e, i) { 979 super._$AT(t, e, i), Nt(this), this.isConnected = t._$AU; 980 } 981 _$AO(t, e = !0) { 982 var i, o; 983 t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) === null || i === void 0 || i.call(this) : (o = this.disconnected) === null || o === void 0 || o.call(this)), e && (M(this, t), q(this)); 984 } 985 setValue(t) { 986 if (me(this._$Ct)) this._$Ct._$AI(t, this); 987 else { 988 const e = [...this._$Ct._$AH]; 989 e[this._$Ci] = t, this._$Ct._$AI(e, this, 0); 990 } 991 } 992 disconnected() { 993 } 994 reconnected() { 995 } 996} 997/** 998 * @license 999 * Copyright 2020 Google LLC 1000 * SPDX-License-Identifier: BSD-3-Clause 1001 */ 1002const Rt = () => new ye(); 1003let ye = class { 1004}; 1005const Y = /* @__PURE__ */ new WeakMap(), Bt = Ot(class extends _e { 1006 render(s) { 1007 return p; 1008 } 1009 update(s, [t]) { 1010 var e; 1011 const i = t !== this.G; 1012 return i && this.G !== void 0 && this.ot(void 0), (i || this.rt !== this.lt) && (this.G = t, this.dt = (e = s.options) === null || e === void 0 ? void 0 : e.host, this.ot(this.lt = s.element)), p; 1013 } 1014 ot(s) { 1015 var t; 1016 if (typeof this.G == "function") { 1017 const e = (t = this.dt) !== null && t !== void 0 ? t : globalThis; 1018 let i = Y.get(e); 1019 i === void 0 && (i = /* @__PURE__ */ new WeakMap(), Y.set(e, i)), i.get(this.G) !== void 0 && this.G.call(this.dt, void 0), i.set(this.G, s), s !== void 0 && this.G.call(this.dt, s); 1020 } else this.G.value = s; 1021 } 1022 get rt() { 1023 var s, t, e; 1024 return typeof this.G == "function" ? (t = Y.get((s = this.dt) !== null && s !== void 0 ? s : globalThis)) === null || t === void 0 ? void 0 : t.get(this.G) : (e = this.G) === null || e === void 0 ? void 0 : e.value; 1025 } 1026 disconnected() { 1027 this.rt === this.lt && this.ot(void 0); 1028 } 1029 reconnected() { 1030 this.ot(this.lt); 1031 } 1032}); 1033class f extends v { 1034 constructor() { 1035 super(); 1036 g(this, "_toggleActions", { 1037 off: "offEvent", 1038 on: "onEvent" 1039 }); 1040 this.onState = !1, this.context = void 0, this.name = void 0; 1041 } 1042 connectedCallback() { 1043 super.connectedCallback(), this._addListeners(); 1044 } 1045 render() { 1046 return this._defaultMarkup(); 1047 } 1048 /** 1049 * 1050 * @param {string} toggleAction 1051 */ 1052 _toggleEvent(e) { 1053 let i = new CustomEvent(e, { 1054 detail: { context: this.context }, 1055 composed: !0, 1056 bubbles: !0 1057 }); 1058 this.dispatchEvent(i); 1059 } 1060 // Add listeners for actions - checking for which context they belong too etc. 1061 _addListeners() { 1062 let e = this; 1063 this.context && (window.addEventListener( 1064 e._toggleActions.on, 1065 function(i) { 1066 /** @type {CustomEvent} */ 1067 i.detail.context == e.context && (e.onState = !0); 1068 } 1069 ), window.addEventListener(e._toggleActions.off, function(i) { 1070 /** @type {CustomEvent}*/ 1071 i.detail.context == e.context && (e.onState = !1); 1072 })); 1073 } 1074 // Determines which type of click handler to use - one that requires context (handleClick) or one that handles local component state only(simpleHandleClick). 1075 _handleClickType() { 1076 return this.context ? this._handleClick() : this._simpleHandleClick(); 1077 } 1078 _simpleHandleClick() { 1079 this.onState == !0 ? this.onState = !1 : this.onState = !0; 1080 } 1081 _handleClick() { 1082 let e = this._toggleActions.on; 1083 this.onState && (e = this._toggleActions.off), this._toggleEvent(e); 1084 } 1085 /** @returns {import("lit").TemplateResult | undefined} */ 1086 _defaultMarkup() { 1087 return l`<button part="toggle-button" @click=${this._handleClickType}> 1088 ${this.name} 1089 <slot></slot> 1090 ${this.onState ? l`<slot name="on-markup"></slot>` : l`<slot name="off-markup"></slot>`} 1091 </button>`; 1092 } 1093 firstUpdated() { 1094 let e = new CustomEvent("childready", { 1095 bubbles: !0, 1096 composed: !0 1097 }); 1098 this.dispatchEvent(e); 1099 } 1100 // TODO: should events be differentiated if context 1101 // is set, eg. new event(this.context+eventname)? Probably not for now. 1102} 1103g(f, "properties", { 1104 name: { type: String }, 1105 context: { type: String }, 1106 // TODO: break up the examples in Stories to be separate stories - easier to illustrate different capabilities/examples that way. 1107 onState: { type: Boolean, reflect: !0 } 1108}); 1109class $e extends f { 1110 _defaultMarkup() { 1111 if (this.onState) 1112 return l`<div><slot></slot></div>`; 1113 } 1114} 1115class zt extends f { 1116 _defaultMarkup() { 1117 let t = "fade-in"; 1118 return this.onState || (t = "fade-out"), l`<div class="${t}"><slot></slot></div>`; 1119 } 1120} 1121g(zt, "styles", y` 1122 div { 1123 transition: opacity 0.3s; 1124 } 1125 .fade-in { 1126 opacity: 100%; 1127 } 1128 .fade-out { 1129 opacity: 0%; 1130 } 1131 `); 1132class Dt extends f { 1133 constructor() { 1134 super(), this.iconSet = "ionicons"; 1135 } 1136 // Adds a close icon inside a button as the only content. 1137 _defaultMarkup() { 1138 let t; 1139 return this.iconSet == "ionicons" ? t = l`<ion-icon name="close-outline">close</ion-icon>` : this.iconSet == "lucide" && (t = l`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`), l` 1140 <button part="close-button" @click=${this._handleClick}> 1141 ${t} 1142 </button> 1143 `; 1144 } 1145} 1146/** 1147 * @typedef {'ionicons' | 'lucide'} iconSetType 1148 */ 1149g(Dt, "properties", { 1150 ...f.properties, 1151 iconSet: { type: String } 1152}); 1153class ht extends f { 1154 constructor() { 1155 super(), this.settingsMenu = void 0; 1156 } 1157 // Adds a "hamburger" or "close" icon inside a button as the only content depending on onState. 1158 _defaultMarkup() { 1159 return l` 1160 <button part="menu-button" @click=${this._handleClickType}> 1161 ${this.onState ? l`<ion-icon name="close-outline">close</ion-icon>` : l`<ion-icon name=${this.settingsMenu ? "options-outline" : "menu-outline"}>menu</ion-icon>`} 1162 </button> 1163 `; 1164 } 1165} 1166g(ht, "properties", { 1167 ...f.properties, 1168 // Allow for a 'settings' icon for the menu with this attribute. 1169 settingsMenu: { type: Boolean } 1170}); 1171class we extends f { 1172 // Adds a "scrim" - a large 'see-through' layer that can cover other content, depending on onState. Clicking the layer itself can toggle onState. Styleable via part selector. 1173 _defaultMarkup() { 1174 return l` 1175 <div part="scrim-layer" 1176 @click=${this._handleClickType}> 1177 <!-- NB: Nothing goes here, the scrim shouldn't have children elements. --> 1178 </div> 1179 `; 1180 } 1181} 1182class G extends f { 1183 constructor() { 1184 super(); 1185 // Setup and checks matchMedia, add dynamic checking if dynamic attribute set. 1186 g(this, "doSizeCheck", () => { 1187 this.mq && (this._size = window.matchMedia(this.mq), this._size.matches ? (this.onState = !0, this._matching = !0) : (this.onState = !1, this._matching = !1), this.dynamic && (this._size.onchange = (e) => { 1188 e.matches ? (this.onState = !0, this._matching = !0) : (this.onState = !1, this._matching = !1); 1189 })); 1190 }); 1191 this.dynamic = void 0, this.debug = void 0, this.mq = void 0; 1192 } 1193 connectedCallback() { 1194 super.connectedCallback(), this.doSizeCheck(); 1195 } 1196 render() { 1197 let e; 1198 if (this.debug && (e = l`<span 1199 >meta info: viewport width: ${this._size}, onState: ${this.onState}, mq: 1200 ${this.mq}</span 1201 >`), this.onState) 1202 return e = l`${e} <slot></slot>`, e; 1203 } 1204} 1205g(G, "properties", { 1206 ...f.properties, 1207 // Media-query string. 1208 // See https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia. 1209 mq: { type: String }, 1210 // Whether to check matchmedia all the time. 1211 // If false, just check once at first render. 1212 dynamic: { type: Boolean }, 1213 // MatchMedia check with mq. Private. 1214 _size: { type: Object }, 1215 // Stored result of matchMedia. 1216 _matching: { type: Boolean } 1217}); 1218class It extends G {
1219 constructor() { 1220 super(), this.withButton = void 0, this.settingsMenu = void 0; 1221 } 1222 render() { 1223 let t; 1224 return this.withButton && !this._matching && (t = l` 1225 <mds-toggle-menu exportparts="menu-button" @click=${this._handleClickType} 1226 ?settingsMenu=${this.settingsMenu} 1227 ?onState=${this.onState} 1228 ></mds-toggle-menu> 1229 `), l`<slot name="menu-label"></slot> ${t} ${this.onState ? l`<span part="slotted-content"><slot></slot></span>` : l`<span part="hidden-slotted-content"><slot></slot></span>`} `; 1230 } 1231} 1232g(It, "properties", { 1233 ...G.properties, 1234 // Property to automatically include an open/close button. 1235 withButton: { type: Boolean }, 1236 // Attribute to allow settingsMenu to be passed down into <mds-toggle-menu>. 1237 settingsMenu: { type: Boolean } 1238}); 1239class Ae extends ht { 1240 _defaultMarkup() { 1241 return l` 1242 <button part="menu-button" @click=${this._handleClickType}> 1243 ${this.onState ? l`<ion-icon name="close-outline">close</ion-icon>` : l`<ion-icon name="options-outline">settings</ion-icon>`} 1244 </button> 1245 `; 1246 } 1247} 1248const Se = function() { 1249 customElements.define("mds-toggle", f), customElements.define("mds-toggle-view", $e), customElements.define("mds-toggle-view-fade", zt), customElements.define("mds-toggle-close", Dt), customElements.define("mds-toggle-menu", ht), customElements.define("mds-toggle-settings", Ae), customElements.define("mds-toggle-scrim", we), customElements.define("mds-mobile-toggle", G), customElements.define("mds-menu", It); 1250}; 1251class jt extends f { 1252 constructor() { 1253 super(...arguments); 1254 // Create a ref object for the dialog element inside the ShadowDOM so it can be referenced later directly. 1255 g(this, "dialogRef", Rt()); 1256 } 1257 /** 1258 * Listens for click outside of dialog and fires dialog.close() and fires custom offEvent for sharing state. (see toggle.js) 1259 * 1260 * @fires dialog.close() 1261 * @fires offEvent 1262 * */ 1263 _handleClick(e) { 1264 e.type == "close" && e.target == this.dialogRef.value && (this.onState = !1, this._toggleEvent(this._toggleActions.off)); 1265 let i = ( 1266 /** @type {HTMLElement}*/ 1267 e.target 1268 ); 1269 ((i == null ? void 0 : i.tagName) == "DIALOG" || (i == null ? void 0 : i.tagName) == "MDS-TOGGLE-CLOSE") && /** @type {HTMLDialogElement}*/ 1270 this.dialogRef.value.close(); 1271 } 1272 // When updated, if onState true, call showModal. 1273 updated() { 1274 this.onState && /** @type {HTMLDialogElement}*/ 1275 this.dialogRef.value.showModal(); 1276 } 1277 // Override Toggle class _defaultMarkup with markup for this extended component. 1278 _defaultMarkup() { 1279 return l` 1280 <dialog part="dialog-element" 1281 ${Bt(this.dialogRef)} 1282 @click=${// Handle any click events to see if they will close the dialog. 1283 this._handleClick} 1284 @close=${// Specifically listen for the close event on the dialog itself. 1285 this._handleClick} 1286 > 1287 <div part="dialog-body"> 1288 <slot></slot> 1289 <mds-toggle-close part="dialog-close"></mds-toggle-close> 1290 </div> 1291 </dialog> 1292 `; 1293 } 1294} 1295g(jt, "styles", y` 1296 dialog { 1297 margin-top: 10rem; 1298 /* NB! 0 padding means any child content clicked will pass event.target.tagName !== DIALOG, so clicking child content (except mds-toggle-close) will NOT close the dialog. This allows the background part of a modal dialog to be clicked to close. */ 1299 padding: 0; 1300 border: none; 1301 width: var(--dialog-width, 90%); 1302 overflow: visible; 1303 1304 &::backdrop { 1305 animation: wc-backdrop-filter-blur var(--dialog-animation-time) ease-out forwards; 1306 } 1307 } 1308 1309 /* Regrettably non-FF browsers require keyframes scoped to same shadow root. */ 1310 @keyframes wc-backdrop-filter-blur { 1311 from { 1312 backdrop-filter: blur(0); 1313 } 1314 1315 to { 1316 background: rgba(0 0 0 / 80%); 1317 backdrop-filter: blur(2px); 1318 } 1319 } 1320 1321 /* Holds dialog contents. */ 1322 [part="dialog-body"] { 1323 padding: 1rem; 1324 } 1325 1326 /* Absolutely position mds-toggle-close component to the top-right of the dialog. */ 1327 mds-toggle-close[part="dialog-close"] { 1328 position: absolute; 1329 top: 0; 1330 right: 0; 1331 } 1332 1333 /* Theme the actual close button part. */ 1334 mds-toggle-close::part(close-button) { 1335 border: none; 1336 border-radius: var(--mds-border-radius); 1337 font-size: 1.5rem; 1338 padding-top: 0.45rem; 1339 background: inherit; 1340 color: var(--mds-color-gray-900); 1341 } 1342 1343 /* Highlight the close button part on hover/focus. */ 1344 mds-toggle-close::part(close-button):hover, 1345 mds-toggle-close::part(close-button):focus { 1346 color: var(--mds-color-black); 1347 cursor: pointer; 1348 } 1349 1350 /* Support for dark-mode: e.g. mds-dialog.mds-dark: */ 1351 :host(.mds-dark) mds-toggle-close::part(close-button) { 1352 color: var(--mds-color-gray-300); 1353 background: inherit; 1354 } 1355 :host(.mds-dark) mds-toggle-close::part(close-button):hover, 1356 :host(.mds-dark) mds-toggle-close::part(close-button):focus { 1357 color: var(--mds-color-white); 1358 } 1359 `); 1360const ke = function() { 1361 customElements.define("mds-dialog", jt); 1362}; 1363/** 1364 * @license 1365 * Copyright 2018 Google LLC 1366 * SPDX-License-Identifier: BSD-3-Clause 1367 */ 1368const qt = "important", Ce = " !" + qt, Ee = Ot(class extends Ut { 1369 constructor(s) { 1370 var t; 1371 if (super(s), s.type !== Lt.ATTRIBUTE || s.name !== "style" || ((t = s.strings) === null || t === void 0 ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute."); 1372 } 1373 render(s) { 1374 return Object.keys(s).reduce((t, e) => { 1375 const i = s[e]; 1376 return i == null ? t : t + `${e = e.includes("-") ? e : e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${i};`; 1377 }, ""); 1378 } 1379 update(s, [t]) { 1380 const { style: e } = s.element; 1381 if (this.ht === void 0) { 1382 this.ht = /* @__PURE__ */ new Set(); 1383 for (const i in t) this.ht.add(i); 1384 return this.render(t); 1385 } 1386 this.ht.forEach((i) => { 1387 t[i] == null && (this.ht.delete(i), i.includes("-") ? e.removeProperty(i) : e[i] = ""); 1388 }); 1389 for (const i in t) { 1390 const o = t[i]; 1391 if (o != null) { 1392 this.ht.add(i); 1393 const n = typeof o == "string" && o.endsWith(Ce); 1394 i.includes("-") || n ? e.setProperty(i, n ? o.slice(0, -11) : o, n ? qt : "") : e[i] = o; 1395 } 1396 } 1397 return E; 1398 } 1399}); 1400class nt extends v { 1401 constructor() { 1402 super(); 1403 // Reference for height container - allows 1404 // height to be animated with CSS transition. 1405 g(this, "_heightContainerRef", Rt()); 1406 this.open = !1, this.initialHeight = void 0; 1407 } 1408 // Measure height via scrollHeight of contents as soon as content is slotted.
1409 _handleSlotChange() { 1410 var e, i; 1411 this.initialHeight = (i = (e = this._heightContainerRef) == null ? void 0 : e.value) == null ? void 0 : i.scrollHeight; 1412 } 1413 render() { 1414 const e = { "--initHeight": this.initialHeight + "px", "--overrideHeight": this.open ? "unset" : "0px" }; 1415 return l` 1416 <div 1417 part="height-container" 1418 ${Bt(this._heightContainerRef)} 1419 style=${Ee(e)} 1420 > 1421 <slot @slotchange=${this._handleSlotChange}></slot> 1422 </div> 1423 `; 1424 } 1425} 1426g(nt, "properties", { 1427 // open property to directly set to open. 1428 open: { reflect: !0, type: Boolean }, 1429 // initialHeight to store initial height of contents. 1430 initialHeight: { type: Number } 1431}), g(nt, "styles", y` 1432 div { 1433 /* Custom properties allow height to be dynamic and set programatically or manually via outside selectors. */ 1434 --initHeight; 1435 --overrideHeight; 1436 1437 /* Height calculation. */ 1438 --height: var(--initHeight, 0); 1439 1440 /* Height falls back to initHeight or 0. */ 1441 height: var(--overrideHeight, var(--height)); 1442 overflow: hidden; 1443 1444 /* Animate height changes. */ 1445 transition: height .3s; 1446 } 1447 1448 /* Utility classes to change override height when applied to host. */ 1449 :host(.mds-shutter-closed) div { 1450 --overrideHeight: 0; 1451 } 1452 1453 :host(.mds-shutter-open) div { 1454 --overrideHeight: unset; 1455 } 1456 `); 1457const xe = function() { 1458 customElements.define("mds-shutter", nt); 1459}; 1460var He = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, b = (s, t, e, i) => { 1461 for (var o = i > 1 ? void 0 : i ? Te(t, e) : t, n = s.length - 1, a; n >= 0; n--) 1462 (a = s[n]) && (o = (i ? a(t, e, o) : a(o)) || o); 1463 return i && o && He(t, e, o), o; 1464}; 1465let A = class extends v { 1466 constructor() { 1467 super(...arguments), this.name = "", this._activePanel = void 0, this._activeLabel = void 0; 1468 } 1469 connectedCallback() { 1470 super.connectedCallback(), this.addEventListener("tabClick", this._handleTabClick), this.addEventListener("keydown", this._addKBSupport); 1471 } 1472 // On first update (i.e., component setup with tabs etc.) look for and select first tab. 1473 firstUpdated() { 1474 this._assignAriaRoles(), this._selectInitialTab(); 1475 } 1476 // Set up Aria roles for elements in the tab-group. 1477 _assignAriaRoles() {
1478 this._tabs.forEach(function(s) { 1479 s.setAttribute("role", "tab"); 1480 }), this._panels.forEach(function(s) { 1481 s.setAttribute("role", "tabpanel"); 1482 }); 1483 } 1484 // If there is no initial _activeLabel and no tab-label is manually set with attribute active, select the 1st tab in list by default. 1485 _selectInitialTab() { 1486 this._activeLabel = this._tabs.find(function(t) { 1487 return t.active === !0; 1488 }), this._activeLabel || (this._activeLabel = this._tabs[0]); 1489 let s = this._activeLabel.panel; 1490 this._activePanel = this._panels.find(function(t) { 1491 return t.name === s; 1492 }), this._activeLabel.active = !0, this._activeLabel.setAttribute("aria-selected", "true"), this._activePanel && (this._activePanel.active = !0, this._activePanel.setAttribute("aria-hidden", "false")); 1493 } 1494 // Move right or left between tabs by updating _activeLabel and calling _setActiveInactive. 1495 _arrowKeys(s, t) { 1496 let e = s === "right" ? 1 : -1; 1497 this._activeLabel = this._tabs[t + e], this._activeLabel.active = !0, this._setActiveInactive(); 1498 } 1499 // Method to handle the right or down arrow key. 1500 _nextTab(s, t) { 1501 t < this._tabs.length - 1 && this._arrowKeys("right", t), t === this._tabs.length - 1 && (t = -1, this._arrowKeys("right", t)), s.preventDefault(); 1502 } 1503 // Method to handle the left or up arrow key. 1504 _previousTab(s, t) { 1505 t > 0 && this._arrowKeys("left", t), t === 0 && (t = this._tabs.length, this._arrowKeys("left", t)), s.preventDefault(); 1506 } 1507 // Listen for keyboard events corresponding to arrow keys to navigate tabs. 1508 _addKBSupport(s) { 1509 var o; 1510 let t = (o = this._activeLabel) == null ? void 0 : o.panel, e = this._tabs.findIndex(function(n) { 1511 return n.panel === t; 1512 }); 1513 (this.parentElement ? this.parentElement.clientWidth <= 720 : !1) ? s.key === "ArrowDown" ? this._nextTab(s, e) : s.key === "ArrowUp" && this._previousTab(s, e) : s.key === "ArrowRight" ? this._nextTab(s, e) : s.key === "ArrowLeft" && this._previousTab(s, e); 1514 } 1515 // Set labels and panels to active or inactive states if selected. 1516 _setActiveInactive() { 1517 var e, i, o; 1518 let s = this._activeLabel;
1519 this._tabs.forEach(function(n) { 1520 n.panel !== (s == null ? void 0 : s.panel) && (n.active = !1, n.removeAttribute("aria-selected"), n.setAttribute("tab-index", "-1")); 1521 }); 1522 let t = this._activePanel; 1523 this._panels.forEach(function(n) { 1524 n.name === (s == null ? void 0 : s.panel) ? (n.active = !0, t = n) : (n.active = !1, n.setAttribute("aria-hidden", "true")); 1525 }), this._activePanel = t, this._activeLabel && ((i = (e = this._activeLabel.shadowRoot) == null ? void 0 : e.querySelector("button")) == null || i.focus(), this._activeLabel.active = !0, this._activeLabel.setAttribute("aria-selected", "true")), (o = this._activePanel) == null || o.removeAttribute("aria-hidden"); 1526 } 1527 _handleTabClick(s) { 1528 this._activeLabel = s.detail.label, this._activeLabel && (this._activeLabel.active = !0), this._setActiveInactive(), s.stopPropagation(); 1529 } 1530 render() { 1531 return l` <section> 1532 1533 <!-- Optional header. --> 1534 <slot name="tab-group-header"> 1535 <span class="tg-header"> 1536 ${this.name} 1537 </span> 1538 </slot> 1539 1540 <div class="tab-list-and-panels"> 1541 1542 <!-- Slot for tab-labels. --> 1543 <!-- tabindex="0" maybe useful here, but not required. --> 1544 <div role="tablist"> 1545 <slot name="nav"></slot> 1546 </div> 1547 1548 <div class="panels"> 1549 <!-- Slot for tab-panels. --> 1550 <slot></slot> 1551 </div> 1552 1553 </div> 1554 </section>`; 1555 } 1556}; 1557A.styles = y` 1558 1559 :host { 1560 1561 /* Some container query settings to present tab-group better in smaller containers. TODO: arguably all of this should be in theme layer - aka LightDOM. */ 1562 @container(max-width: 720px) { 1563 --tab-translate-value: calc(-1 * var(--mds-spacing-x-small) / 2), 0; 1564 1565 & .tab-list-and-panels { 1566 border-top: var(--mds-border-thin-light); 1567 border-bottom: var(--mds-border-thin-light); 1568 } 1569 } 1570 } 1571 1572 /* General container for tab list and panels. */ 1573 div.tab-list-and-panels { 1574 display: flex; 1575 gap: var(--tab-group-gap, 0); 1576 flex-direction: var(--tab-group-flex-direction, column); 1577 1578 /* List of tab-labels. */ 1579 & [role=tablist] { 1580 display: flex; 1581 flex-direction: var(--tab-list-flex-direction); 1582 flex-basis: 25%; 1583 gap: var(--mds-spacing-x-small); 1584 } 1585 1586 & .panels { 1587 flex-grow: 1; 1588 } 1589 } 1590 1591 /* tab-group-header for use with h2-h4. */ 1592 slot[name=tab-group-header]::slotted(:is(h2, h3, h4)) { 1593 padding-bottom: var(--mds-spacing-x-small); 1594 } 1595 `; 1596b([ 1597 $({ reflect: !0, type: String }) 1598], A.prototype, "name", 2); 1599b([ 1600 $({ state: !0, type: String }) 1601], A.prototype, "_activePanel", 2); 1602b([ 1603 $({ state: !0, type: Object }) 1604], A.prototype, "_activeLabel", 2); 1605b([ 1606 Tt({ slot: "nav", selector: "mds-tab-label", flatten: !0 }) 1607], A.prototype, "_tabs", 2); 1608b([ 1609 Tt({ selector: "mds-tab-panel", flatten: !0 }) 1610], A.prototype, "_panels", 2); 1611A = b([ 1612 lt("mds-tab-group") 1613], A); 1614let N = class extends v { 1615 constructor() { 1616 super(...arguments), this.active = !1, this.name = ""; 1617 } 1618 // Add Aria attributes. 1619 firstUpdated() { 1620 this.setAttribute("aria-labelledby", this.name); 1621 } 1622 render() { 1623 return l`<div tabindex=0><slot></slot></div>`; 1624 } 1625}; 1626N.styles = y` 1627 div { 1628 border-top: var(--mds-border-thin); 1629 padding: var(--mds-spacing-medium) 0; 1630 } 1631 1632 @container(max-width: 720px) { 1633 :host { 1634 & div { 1635 border-top: none; 1636 } 1637 padding: 0 .5rem; 1638 height: 100%; 1639 } 1640 :host([active]) { 1641 background: white; 1642 } 1643 } 1644 1645 /* Focus for the tab-panel. */ 1646 :host(:focus) div { 1647 outline: var(--mds-color-a11y); 1648 } 1649 `; 1650b([ 1651 $({ type: Boolean, reflect: !0 }) 1652], N.prototype, "active", 2); 1653b([ 1654 $() 1655], N.prototype, "name", 2); 1656N = b([ 1657 lt("mds-tab-panel") 1658], N); 1659let R = class extends v { 1660 constructor() { 1661 super(), this.active = !1, this.panel = "", this.panel = ""; 1662 } 1663 // Add aria-controls attributes for each label. 1664 firstUpdated() { 1665 this.setAttribute("aria-controls", this.panel); 1666 } 1667 // Click on a tab. 1668 _tabClick() { 1669 let s = new CustomEvent("tabClick", { 1670 bubbles: !0, 1671 detail: { panel: this.panel, label: this } 1672 }); 1673 this.dispatchEvent(s); 1674 } 1675 render() { 1676 return l` 1677 <button 1678 part="tab-button" 1679 @click=${this._tabClick} 1680 tabindex=${this.active ? "0" : "-1"} 1681 > 1682 <slot></slot> 1683 </button> 1684 `; 1685 } 1686}; 1687R.styles = y` 1688 1689 /* Disable animation values if user prefers reduced motion or if --no-transitions-value is set manually. */ 1690 @media (prefers-reduced-motion: reduce) { 1691 :host { 1692 --no-transitions-value: none; 1693 } 1694 } 1695 1696 :host { 1697 --active-bg: var(--mds-color-white); 1698 1699 display: flex; 1700 } 1701 1702 :host(:focus) { 1703 border: none; 1704 } 1705 1706 /* Active tab-label. */ 1707 1708 :host([active]) button { 1709 --tab-shadow-color: var(--tab-shadow-color-active); 1710 1711 background: var(--active-bg); 1712 color: var(--mds-color-black); 1713 font-weight: var(--mds-font-weight-semibold); 1714 } 1715 1716 /* tab-label button. */ 1717 1718 button { 1719 --tab-shadow-color: transparent; 1720 --tab-shadow-color-hover: var(--mds-color-primary-500); 1721 --tab-shadow-color-active: var(--mds-color-black); 1722 1723 background: var(--mds-color-gray-100); 1724 border-radius: var(--tab-list-tab-border-radius, 0) var(--tab-list-tab-border-radius, 0) 0 0; 1725 border: none transparent; 1726 box-shadow: var(--tab-list-tab-box-shadow-orientation, 0 var(--mds-spacing-small, .5rem)) var(--tab-shadow-color); 1727 color: var(--mds-color-gray-600); 1728 flex-grow: 1; 1729 font-weight: var(--mds-font-weight-light); 1730 font-size: var(--mds-font-size-medium); 1731 margin: 0; 1732 padding: var(--mds-spacing-x-small) var(--mds-spacing-small); 1733 /* Transitions button states, but not if --no-transitions-value is set. */ 1734 transition: var(--no-transitions-value, all) var(--mds-transition-duration-short); 1735 1736 &:hover, 1737 &:focus, 1738 &:focus-within { 1739 --tab-shadow-color: var(--tab-shadow-color-hover); 1740 background: var(--mds-color-white, #FFF); 1741 } 1742 1743 &:focus-within { 1744 outline: none; 1745 } 1746 } 1747 `; 1748b([ 1749 $({ type: Boolean, reflect: !0 }) 1750], R.prototype, "active", 2); 1751b([ 1752 $() 1753], R.prototype, "panel", 2); 1754R = b([ 1755 lt("mds-tab-label") 1756], R); 1757ge(); 1758Se(); 1759ke(); 1760pe(); 1761xe();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.