/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Et = globalThis, te = Et.ShadowRoot && (Et.ShadyCSS === void 0 || Et.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Re = Symbol(), me = /* @__PURE__ */ new WeakMap();
let is = class {
constructor(t, e, i) {
if (this._$cssResult$ = !0, i !== Re) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = e;
}
get styleSheet() {
let t = this.o;
const e = this.t;
if (te && t === void 0) {
const i = e !== void 0 && e.length === 1;
i && (t = me.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && me.set(e, t));
}
return t;
}
toString() {
return this.cssText;
}
};
const os = (s) => new is(typeof s == "string" ? s : s + "", void 0, Re), ns = (s, t) => {
if (te) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
else for (const e of t) {
const i = document.createElement("style"), r = Et.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
}
}, be = te ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
let e = "";
for (const i of t.cssRules) e += i.cssText;
return os(e);
})(s) : s;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const { is: as, defineProperty: ls, getOwnPropertyDescriptor: hs, getOwnPropertyNames: cs, getOwnPropertySymbols: us, getPrototypeOf: ds } = Object, D = globalThis, Ce = D.trustedTypes, ps = Ce ? Ce.emptyScript : "", jt = D.reactiveElementPolyfillSupport, ct = (s, t) => s, xt = {
toAttribute(s, t) {
switch (t) {
case Boolean:
s = s ? ps : null;
break;
case Object:
case Array:
s = s == null ? s : JSON.stringify(s);
}
return s;
}, fromAttribute(s, t) {
let e = s;
switch (t) {
case Boolean:
e = s !== null;
break;
case Number:
e = s === null ? null : Number(s);
break;
case Object:
case Array:
try {
e = JSON.parse(s);
} catch {
e = null;
}
}
return e;
}
}, ee = (s, t) => !as(s, t), ve = { attribute: !0, type: String, converter: xt, reflect: !1, useDefault: !1, hasChanged: ee };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), D.litPropertyMetadata ?? (D.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
let Q = class extends HTMLElement {
static addInitializer(t) {
this._$Ei(), (this.l ?? (this.l = [])).push(t);
}
static get observedAttributes() {
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
}
static createProperty(t, e = ve) {
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
r !== void 0 && ls(this.prototype, t, r);
}
}
static getPropertyDescriptor(t, e, i) {
const { get: r, set: o } = hs(this.prototype, t) ?? {
get() {
return this[e];
}, set(n) {
this[e] = n;
}
};
return {
get: r, set(n) {
const a = r == null ? void 0 : r.call(this);
o == null || o.call(this, n), this.requestUpdate(t, a, i);
}, configurable: !0, enumerable: !0
};
}
static getPropertyOptions(t) {
return this.elementProperties.get(t) ?? ve;
}
static _$Ei() {
if (this.hasOwnProperty(ct("elementProperties"))) return;
const t = ds(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
}
static finalize() {
if (this.hasOwnProperty(ct("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ct("properties"))) {
const e = this.properties, i = [...cs(e), ...us(e)];
for (const r of i) this.createProperty(r, e[r]);
}
const t = this[Symbol.metadata];
if (t !== null) {
const e = litPropertyMetadata.get(t);
if (e !== void 0) for (const [i, r] of e) this.elementProperties.set(i, r);
}
this._$Eh = /* @__PURE__ */ new Map();
for (const [e, i] of this.elementProperties) {
const r = this._$Eu(e, i);
r !== void 0 && this._$Eh.set(r, e);
}
this.elementStyles = this.finalizeStyles(this.styles);
}
static finalizeStyles(t) {
const e = [];
if (Array.isArray(t)) {
const i = new Set(t.flat(1 / 0).reverse());
for (const r of i) e.unshift(be(r));
} else t !== void 0 && e.push(be(t));
return e;
}
static _$Eu(t, e) {
const i = e.attribute;
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
}
constructor() {
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
}
_$Ev() {
var t;
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
}
addController(t) {
var e;
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
}
removeController(t) {
var e;
(e = this._$EO) == null || e.delete(t);
}
_$E_() {
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
for (const i of e.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 ns(t, this.constructor.elementStyles), t;
}
connectedCallback() {
var t;
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
var i;
return (i = e.hostConnected) == null ? void 0 : i.call(e);
});
}
enableUpdating(t) {
}
disconnectedCallback() {
var t;
(t = this._$EO) == null || t.forEach((e) => {
var i;
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
});
}
attributeChangedCallback(t, e, i) {
this._$AK(t, i);
}
_$ET(t, e) {
var o;
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
if (r !== void 0 && i.reflect === !0) {
const n = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : xt).toAttribute(e, i.type);
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
}
}
_$AK(t, e) {
var o, n;
const i = this.constructor, r = i._$Eh.get(t);
if (r !== void 0 && this._$Em !== r) {
const a = i.getPropertyOptions(r), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : xt;
this._$Em = r;
const u = h.fromAttribute(e, a.type);
this[r] = u ?? ((n = this._$Ej) == null ? void 0 : n.get(r)) ?? u, this._$Em = null;
}
}
requestUpdate(t, e, i, r = !1, o) {
var n;
if (t !== void 0) {
const a = this.constructor;
if (r === !1 && (o = this[t]), i ?? (i = a.getPropertyOptions(t)), !((i.hasChanged ?? ee)(o, e) || i.useDefault && i.reflect && o === ((n = this._$Ej) == null ? void 0 : n.get(t)) && !this.hasAttribute(a._$Eu(t, i)))) return;
this.C(t, e, i);
}
this.isUpdatePending === !1 && (this._$ES = this._$EP());
}
C(t, e, { useDefault: i, reflect: r, wrapped: o }, n) {
i && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
}
async _$EP() {
this.isUpdatePending = !0;
try {
await this._$ES;
} catch (e) {
Promise.reject(e);
}
const t = this.scheduleUpdate();
return t != null && await t, !this.isUpdatePending;
}
scheduleUpdate() {
return this.performUpdate();
}
performUpdate() {
var i;
if (!this.isUpdatePending) return;
if (!this.hasUpdated) {
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
for (const [o, n] of this._$Ep) this[o] = n;
this._$Ep = void 0;
}
const r = this.constructor.elementProperties;
if (r.size > 0) for (const [o, n] of r) {
const { wrapped: a } = n, h = this[o];
a !== !0 || this._$AL.has(o) || h === void 0 || this.C(o, void 0, n, h);
}
}
let t = !1;
const e = this._$AL;
try {
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((r) => {
var o;
return (o = r.hostUpdate) == null ? void 0 : o.call(r);
}), this.update(e)) : this._$EM();
} catch (r) {
throw t = !1, this._$EM(), r;
}
t && this._$AE(e);
}
willUpdate(t) {
}
_$AE(t) {
var e;
(e = this._$EO) == null || e.forEach((i) => {
var r;
return (r = i.hostUpdated) == null ? void 0 : r.call(i);
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
}
_$EM() {
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
}
get updateComplete() {
return this.getUpdateComplete();
}
getUpdateComplete() {
return this._$ES;
}
shouldUpdate(t) {
return !0;
}
update(t) {
this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
}
updated(t) {
}
firstUpdated(t) {
}
};
Q.elementStyles = [], Q.shadowRootOptions = { mode: "open" }, Q[ct("elementProperties")] = /* @__PURE__ */ new Map(), Q[ct("finalized")] = /* @__PURE__ */ new Map(), jt == null || jt({ ReactiveElement: Q }), (D.reactiveElementVersions ?? (D.reactiveElementVersions = [])).push("2.1.2");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const ut = globalThis, ye = (s) => s, Ot = ut.trustedTypes, _e = Ot ? Ot.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, He = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Fe = "?" + k, fs = `<${Fe}>`, j = document, dt = () => j.createComment(""), pt = (s) => s === null || typeof s != "object" && typeof s != "function", se = Array.isArray, gs = (s) => se(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", Gt = `[
\f\r]`, ht = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, we = /-->/g, $e = />/g, M = RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), Se = /'/g, Ae = /"/g, je = /^(?:script|style|textarea|title)$/i, ms = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), c = ms(1), G = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Ee = /* @__PURE__ */ new WeakMap(), R = j.createTreeWalker(j, 129);
function Ge(s, t) {
if (!se(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
return _e !== void 0 ? _e.createHTML(t) : t;
}
const bs = (s, t) => {
const e = s.length - 1, i = [];
let r, o = t === 2 ? "" : t === 3 ? "" : "")), i];
};
class ft {
constructor({ strings: t, _$litType$: e }, i) {
let r;
this.parts = [];
let o = 0, n = 0;
const a = t.length - 1, h = this.parts, [u, b] = bs(t, e);
if (this.el = ft.createElement(u, i), R.currentNode = this.el.content, e === 2 || e === 3) {
const d = this.el.content.firstChild;
d.replaceWith(...d.childNodes);
}
for (; (r = R.nextNode()) !== null && h.length < a;) {
if (r.nodeType === 1) {
if (r.hasAttributes()) for (const d of r.getAttributeNames()) if (d.endsWith(He)) {
const C = b[n++], v = r.getAttribute(d).split(k), A = /([.?@])?(.*)/.exec(C);
h.push({ type: 1, index: o, name: A[2], strings: v, ctor: A[1] === "." ? vs : A[1] === "?" ? ys : A[1] === "@" ? _s : Bt }), r.removeAttribute(d);
} else d.startsWith(k) && (h.push({ type: 6, index: o }), r.removeAttribute(d));
if (je.test(r.tagName)) {
const d = r.textContent.split(k), C = d.length - 1;
if (C > 0) {
r.textContent = Ot ? Ot.emptyScript : "";
for (let v = 0; v < C; v++) r.append(d[v], dt()), R.nextNode(), h.push({ type: 2, index: ++o });
r.append(d[C], dt());
}
}
} else if (r.nodeType === 8) if (r.data === Fe) h.push({ type: 2, index: o });
else {
let d = -1;
for (; (d = r.data.indexOf(k, d + 1)) !== -1;) h.push({ type: 7, index: o }), d += k.length - 1;
}
o++;
}
}
static createElement(t, e) {
const i = j.createElement("template");
return i.innerHTML = t, i;
}
}
function Z(s, t, e = s, i) {
var n, a;
if (t === G) return t;
let r = i !== void 0 ? (n = e._$Co) == null ? void 0 : n[i] : e._$Cl;
const o = pt(t) ? void 0 : t._$litDirective$;
return (r == null ? void 0 : r.constructor) !== o && ((a = r == null ? void 0 : r._$AO) == null || a.call(r, !1), o === void 0 ? r = void 0 : (r = new o(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = r : e._$Cl = r), r !== void 0 && (t = Z(s, r._$AS(s, t.values), r, i)), t;
}
class Cs {
constructor(t, e) {
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
}
get parentNode() {
return this._$AM.parentNode;
}
get _$AU() {
return this._$AM._$AU;
}
u(t) {
const { el: { content: e }, parts: i } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? j).importNode(e, !0);
R.currentNode = r;
let o = R.nextNode(), n = 0, a = 0, h = i[0];
for (; h !== void 0;) {
if (n === h.index) {
let u;
h.type === 2 ? u = new Ct(o, o.nextSibling, this, t) : h.type === 1 ? u = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (u = new ws(o, this, t)), this._$AV.push(u), h = i[++a];
}
n !== (h == null ? void 0 : h.index) && (o = R.nextNode(), n++);
}
return R.currentNode = j, r;
}
p(t) {
let e = 0;
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
}
}
class Ct {
get _$AU() {
var t;
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
}
constructor(t, e, i, r) {
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
}
get parentNode() {
let t = this._$AA.parentNode;
const e = this._$AM;
return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
}
get startNode() {
return this._$AA;
}
get endNode() {
return this._$AB;
}
_$AI(t, e = this) {
t = Z(this, t, e), pt(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== G && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : gs(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 !== m && pt(this._$AH) ? this._$AA.nextSibling.data = t : this.T(j.createTextNode(t)), this._$AH = t;
}
$(t) {
var o;
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = ft.createElement(Ge(i.h, i.h[0]), this.options)), i);
if (((o = this._$AH) == null ? void 0 : o._$AD) === r) this._$AH.p(e);
else {
const n = new Cs(r, this), a = n.u(this.options);
n.p(e), this.T(a), this._$AH = n;
}
}
_$AC(t) {
let e = Ee.get(t.strings);
return e === void 0 && Ee.set(t.strings, e = new ft(t)), e;
}
k(t) {
se(this._$AH) || (this._$AH = [], this._$AR());
const e = this._$AH;
let i, r = 0;
for (const o of t) r === e.length ? e.push(i = new Ct(this.O(dt()), this.O(dt()), this, this.options)) : i = e[r], i._$AI(o), r++;
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
}
_$AR(t = this._$AA.nextSibling, e) {
var i;
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t !== this._$AB;) {
const r = ye(t).nextSibling;
ye(t).remove(), t = r;
}
}
setConnected(t) {
var e;
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
}
}
class Bt {
get tagName() {
return this.element.tagName;
}
get _$AU() {
return this._$AM._$AU;
}
constructor(t, e, i, r, o) {
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = m;
}
_$AI(t, e = this, i, r) {
const o = this.strings;
let n = !1;
if (o === void 0) t = Z(this, t, e, 0), n = !pt(t) || t !== this._$AH && t !== G, n && (this._$AH = t);
else {
const a = t;
let h, u;
for (t = o[0], h = 0; h < o.length - 1; h++) u = Z(this, a[i + h], e, h), u === G && (u = this._$AH[h]), n || (n = !pt(u) || u !== this._$AH[h]), u === m ? t = m : t !== m && (t += (u ?? "") + o[h + 1]), this._$AH[h] = u;
}
n && !r && this.j(t);
}
j(t) {
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
}
}
class vs extends Bt {
constructor() {
super(...arguments), this.type = 3;
}
j(t) {
this.element[this.name] = t === m ? void 0 : t;
}
}
class ys extends Bt {
constructor() {
super(...arguments), this.type = 4;
}
j(t) {
this.element.toggleAttribute(this.name, !!t && t !== m);
}
}
class _s extends Bt {
constructor(t, e, i, r, o) {
super(t, e, i, r, o), this.type = 5;
}
_$AI(t, e = this) {
if ((t = Z(this, t, e, 0) ?? m) === G) return;
const i = this._$AH, r = t === m && i !== m || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== m && (i === m || r);
r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
}
handleEvent(t) {
var e;
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
}
}
class ws {
constructor(t, e, i) {
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
}
get _$AU() {
return this._$AM._$AU;
}
_$AI(t) {
Z(this, t);
}
}
const qt = ut.litHtmlPolyfillSupport;
qt == null || qt(ft, Ct), (ut.litHtmlVersions ?? (ut.litHtmlVersions = [])).push("3.3.2");
const $s = (s, t, e) => {
const i = (e == null ? void 0 : e.renderBefore) ?? t;
let r = i._$litPart$;
if (r === void 0) {
const o = (e == null ? void 0 : e.renderBefore) ?? null;
i._$litPart$ = r = new Ct(t.insertBefore(dt(), o), o, void 0, e ?? {});
}
return r._$AI(s), r;
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const F = globalThis;
let X = class extends Q {
constructor() {
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
}
createRenderRoot() {
var e;
const t = super.createRenderRoot();
return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
}
update(t) {
const e = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = $s(e, this.renderRoot, this.renderOptions);
}
connectedCallback() {
var t;
super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
}
disconnectedCallback() {
var t;
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
}
render() {
return G;
}
};
var Me;
X._$litElement$ = !0, X.finalized = !0, (Me = F.litElementHydrateSupport) == null || Me.call(F, { LitElement: X });
const Wt = F.litElementPolyfillSupport;
Wt == null || Wt({ LitElement: X });
(F.litElementVersions ?? (F.litElementVersions = [])).push("4.2.2");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const f = (s) => (t, e) => {
e !== void 0 ? e.addInitializer(() => {
customElements.define(s, t);
}) : customElements.define(s, t);
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Ss = { attribute: !0, type: String, converter: xt, reflect: !1, hasChanged: ee }, As = (s = Ss, t, e) => {
const { kind: i, metadata: r } = e;
let o = globalThis.litPropertyMetadata.get(r);
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(e.name, s), i === "accessor") {
const { name: n } = e;
return {
set(a) {
const h = t.get.call(this);
t.set.call(this, a), this.requestUpdate(n, h, s, !0, a);
}, init(a) {
return a !== void 0 && this.C(n, void 0, s, a), a;
}
};
}
if (i === "setter") {
const { name: n } = e;
return function (a) {
const h = this[n];
t.call(this, a), this.requestUpdate(n, h, s, !0, a);
};
}
throw Error("Unsupported decorator location: " + i);
};
function l(s) {
return (t, e) => typeof e == "object" ? As(s, t, e) : ((i, r, o) => {
const n = r.hasOwnProperty(o);
return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
})(s, t, e);
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function V(s) {
return l({ ...s, state: !0, attribute: !1 });
}
const _ = [];
for (let s = 0; s < 256; ++s)
_.push((s + 256).toString(16).slice(1));
function Es(s, t = 0) {
return (_[s[t + 0]] + _[s[t + 1]] + _[s[t + 2]] + _[s[t + 3]] + "-" + _[s[t + 4]] + _[s[t + 5]] + "-" + _[s[t + 6]] + _[s[t + 7]] + "-" + _[s[t + 8]] + _[s[t + 9]] + "-" + _[s[t + 10]] + _[s[t + 11]] + _[s[t + 12]] + _[s[t + 13]] + _[s[t + 14]] + _[s[t + 15]]).toLowerCase();
}
let zt;
const xs = new Uint8Array(16);
function Os() {
if (!zt) {
if (typeof crypto > "u" || !crypto.getRandomValues)
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
zt = crypto.getRandomValues.bind(crypto);
}
return zt(xs);
}
const Ts = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: Ts };
function Ps(s, t, e) {
var r;
if (xe.randomUUID && !s)
return xe.randomUUID();
s = s || {};
const i = s.random ?? ((r = s.rng) == null ? void 0 : r.call(s)) ?? Os();
if (i.length < 16)
throw new Error("Random bytes length must be >= 16");
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Es(i);
}
class Mt {
constructor() {
this.subscribers = /* @__PURE__ */ new Map();
}
subscribe(t) {
const e = Ps();
return this.subscribers.set(e, t), e;
}
unsubscribe(t) {
this.subscribers.delete(t);
}
notify(t) {
for (const e of this.subscribers.values())
e(t);
}
}
class Ls extends Mt {
// Default breakpoint
constructor() {
super(), this.currentBreakpoint = "desktop", this.setupObserver();
}
setupObserver() {
"ResizeObserver" in globalThis ? (this.resizeObserver = new ResizeObserver(() => {
this.calculateBreakpoint();
}), this.resizeObserver.observe(document.body)) : window.addEventListener("resize", () => this.calculateBreakpoint()), this.calculateBreakpoint();
}
calculateBreakpoint() {
const t = window.innerWidth;
let e = this.currentBreakpoint;
t < 860 ? this.currentBreakpoint = "mobile" : this.currentBreakpoint = "desktop", e !== this.currentBreakpoint && this.notify(this.currentBreakpoint);
}
get breakpoint() {
return this.currentBreakpoint;
}
get isMobile() {
return this.currentBreakpoint === "mobile";
}
}
const At = new Ls();
var w = /* @__PURE__ */ ((s) => (s.BREAKPOINT_CHANGED = "BreakpointEvents/BREAKPOINT_CHANGED", s))(w || {});
class E {
constructor(t, e = !1) {
this.id = "", this.breakpointPrefix = "uhf-breakpoint--", this.host = t, this.host.addController(this), this.addClassesToHost = e;
}
hostConnected() {
this.addClassesToHost && this.host.updateComplete.then(() => {
this.host.classList.add(this.getBreakpointClasses());
}), this.id = At.subscribe(() => {
this.addClassesToHost && (Array.from(this.host.classList).filter((t) => t.startsWith(this.breakpointPrefix)).forEach((t) => this.host.classList.remove(t)), this.host.classList.add(this.getBreakpointClasses())), this.host.dispatchEvent(new CustomEvent("BreakpointEvents/BREAKPOINT_CHANGED", {
detail: { breakpoint: this.breakpoint, isMobile: this.isMobile },
bubbles: !1
}));
});
}
hostDisconnected() {
At.unsubscribe(this.id);
}
// Public API
get isMobile() {
return At.isMobile;
}
get breakpoint() {
return At.breakpoint;
}
getBreakpointClasses() {
return `${this.breakpointPrefix}${this.breakpoint}`;
}
}
var $ = /* @__PURE__ */ ((s) => (s.LIGHT = "light", s.DARK = "dark", s))($ || {}), gt = /* @__PURE__ */ ((s) => (s.RTL = "rtl", s.LTR = "ltr", s))(gt || {});
class ks extends Mt {
constructor() {
super(), this.mutationObserver = null, this.context = {
headerTheme: "light",
footerTheme: "light",
alignment: this.getInitialAlignment(),
assignment: void 0,
locale: "en-us"
}, this.fetchTasAssignment(), this.watchHtmlDirection();
}
getInitialAlignment() {
const t = document.documentElement;
return (t.getAttribute("dir") || t.dir || "ltr").toLowerCase() === "rtl" ? "rtl" : "ltr";
}
watchHtmlDirection() {
const t = document.documentElement;
this.mutationObserver = new MutationObserver((e) => {
e.forEach((i) => {
if (i.type === "attributes" && i.attributeName === "dir") {
const r = this.getInitialAlignment();
this.context.alignment !== r && this.updateContext({ alignment: r });
}
});
}), this.mutationObserver.observe(t, {
attributes: !0,
attributeFilter: ["dir"]
});
}
updateContext(t) {
const e = { ...this.context };
this.context = { ...this.context, ...t }, JSON.stringify(e) !== JSON.stringify(this.context) && this.notify(t);
}
getContext() {
return this.context;
}
async fetchTasAssignment() {
let t = "x-exp-clientid";
try {
const e = {
"Content-Type": "applicationhttps://www.microsoft.com/json"
}, i = localStorage.getItem(t);
i && (e["x-exp-clientid"] = i);
let r = await fetch("https://uhf-exp-fd-gbcrdgggfbggh0g3.b02.azurefd.net/api/v1/tas", {
method: "GET",
headers: e
});
if (!r.ok)
throw new Error(`Error: ${r.status} ${r.statusText}`);
const o = await r.json();
!i && o.clientId && localStorage.setItem(t, o.clientId), this.updateContext({ assignment: o });
} catch (e) {
console.error("Unable to fetch UHF assignment: " + e.message);
}
}
}
const qe = new ks();
class U {
constructor(t) {
this.host = t, this.host.addController(this), this.contextService = qe;
}
hostConnected() {
this.id = this.contextService.subscribe(this.onContextChanged.bind(this));
}
hostDisconnected() {
this.id && this.contextService.unsubscribe(this.id);
}
onContextChanged(t) {
this.host.dispatchEvent(new CustomEvent("ContextEvents/CONTEXT_CHANGED", {
detail: t,
bubbles: !1
}));
}
setContext(t) {
this.contextService.updateContext(t);
}
getAlignmentClasses() {
return `uhf-alignment--${this.alignment}`;
}
get alignment() {
return this.contextService.getContext().alignment || gt.LTR;
}
get locale() {
return this.contextService.getContext().locale || "en-us";
}
getLocaleLabel() {
return ((this.locale ?? "").trim().split(/[-_]/)[0] || "en").toUpperCase();
}
get assignment() {
return this.contextService.getContext().assignment;
}
getHeaderThemeClasses() {
return `uhf-theme--${this.headerTheme}`;
}
get headerTheme() {
return this.contextService.getContext().headerTheme || $.LIGHT;
}
getFooterThemeClasses() {
return `uhf-theme--${this.footerTheme}`;
}
get footerTheme() {
return this.contextService.getContext().footerTheme || $.LIGHT;
}
}
class Is extends Mt {
constructor() {
super(), this.state = {
searchState: { isSearchOpen: !1 },
mobileState: { isContextualNavOpen: !1, isGlobalNavOpen: !1 },
meControlState: { config: void 0, activeAccount: void 0 }
};
}
setState(t) {
const e = { ...this.state }, i = t(e);
this.state = { ...this.state, ...i }, JSON.stringify(e) !== JSON.stringify(this.state) && this.notify(i);
}
getState() {
return this.state;
}
}
const Ds = new Is();
var T = /* @__PURE__ */ ((s) => (s.STATE_CHANGED = "StateEvents/STATE_CHANGED", s))(T || {});
class J {
constructor(t) {
(this.host = t).addController(this), this.stateService = Ds;
}
hostConnected() {
this.id = this.stateService.subscribe(this.onStateChanged.bind(this));
}
hostDisconnected() {
this.id && this.stateService.unsubscribe(this.id);
}
onStateChanged(t) {
this.host.dispatchEvent(new CustomEvent("StateEvents/STATE_CHANGED", {
detail: t,
bubbles: !1
}));
}
getState() {
return this.stateService.getState();
}
setState(t) {
this.stateService.setState(t);
}
}
var Us = Object.defineProperty, Ns = (s, t, e, i) => {
for (var r = void 0, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(t, e, r) || r);
return r && Us(t, e, r), r;
};
class p extends X {
constructor(t = !1) {
super(), this.debug = !1, this.originalChildren = [], this.passthroughChildren = !1, this.passthroughChildren = t;
}
connectedCallback() {
if (!this.passthroughChildren) {
let t = [];
Array.from(this.children).forEach((e) => {
t.push(e.cloneNode(!0)), e.remove();
}), this.originalChildren = t;
}
super.connectedCallback();
}
createRenderRoot() {
return this;
}
getChildren() {
return this.originalChildren.map((t) => t.cloneNode(!0));
}
getChildrenBySlot(t) {
return t === "default" ? this.originalChildren.filter((e) => !(e instanceof Element) || !e.getAttribute("slot")).map((e) => e.cloneNode(!0)) : this.originalChildren.filter((e) => e instanceof Element && e.getAttribute("slot") === t).map((e) => e.cloneNode(!0));
}
findFirstCustomAncestor() {
let t = this.parentElement;
for (; t;) {
if (t.tagName.includes("-"))
return t;
t = t.parentElement;
}
return null;
}
checkIfSlotExists(t) {
return this.originalChildren.some((e) => e instanceof Element && e.getAttribute("slot") === t);
}
}
Ns([
l({ type: Boolean })
], p.prototype, "debug");
var Bs = Object.defineProperty, Ms = Object.getOwnPropertyDescriptor, vt = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Ms(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Bs(t, e, r), r;
};
let tt = class extends p {
constructor() {
super(), this.partnerId = "", this.headerId = "", this.theme = "light", this.locale = "en-us", this.onBreakpointChanged = () => {
this.requestUpdate();
}, this.onStateChanged = (s) => {
const t = s.detail;
t.searchState !== void 0 && this.classList.toggle("search-open", t.searchState.isSearchOpen ?? !1);
}, this.breakpointController = new E(this), this.contextController = new U(this), this.stateController = new J(this);
}
connectedCallback() {
const s = this.theme === "dark" ? $.DARK : $.LIGHT;
this.contextController.setContext({
headerTheme: s,
locale: this.locale,
headerId: this.headerId,
partnerId: this.partnerId
}), super.connectedCallback(), this.addEventListener(T.STATE_CHANGED, this.onStateChanged), this.addEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged);
}
disconnectedCallback() {
this.removeEventListener(T.STATE_CHANGED, this.onStateChanged), this.removeEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), super.disconnectedCallback();
}
willUpdate(s) {
var t;
if (s.has("theme")) {
const e = $[(t = this.theme) == null ? void 0 : t.toUpperCase()] || $.LIGHT;
this.contextController.setContext({ headerTheme: e });
}
}
updated() {
this.dispatchEvent(new CustomEvent("uhf-header-rendered", {
bubbles: !0,
composed: !0,
detail: {
view: this.breakpointController.isMobile ? "mobile" : "desktop"
}
}));
}
// get the children of the action container
// need this for mobile view when the actions are rendered
// outside the action container
getActionChildren() {
const s = super.getChildrenBySlot("actions");
if (!s || s.length === 0) return [];
const t = s[0];
return Array.from(t.children).map((e) => e.cloneNode(!0));
}
getActionChildByTag(s) {
return this.getActionChildren().filter(
(t) => t instanceof Element && t.tagName.toLowerCase() === s
);
}
render() {
let s = [
this.breakpointController.getBreakpointClasses(),
this.contextController.getHeaderThemeClasses()
];
return this.breakpointController.isMobile ? c`
${super.getChildrenBySlot("skip-link")}
${super.getChildrenBySlot("promo-banner")}
${super.getChildrenBySlot("site-promo-banner")}
` : c`
${super.getChildrenBySlot("skip-link")}
${super.getChildrenBySlot("promo-banner")}
${super.getChildrenBySlot("site-promo-banner")}
`;
}
};
vt([
l({ type: String })
], tt.prototype, "partnerId", 2);
vt([
l({ type: String })
], tt.prototype, "headerId", 2);
vt([
l({ type: String })
], tt.prototype, "theme", 2);
vt([
l({ type: String })
], tt.prototype, "locale", 2);
tt = vt([
f("uhf-header")
], tt);
var Rs = Object.getOwnPropertyDescriptor, Hs = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Rs(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(r) || r);
return r;
};
let Oe = class extends p {
// this is just a simple container element
// basically the equivalent of a div
constructor() {
super(!0);
}
};
Oe = Hs([
f("uhf-actions")
], Oe);
var Fs = Object.defineProperty, js = Object.getOwnPropertyDescriptor, We = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? js(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Fs(t, e, r), r;
};
let Kt = class extends p {
constructor() {
super(), this.pipe = "true", this.breakpointController = new E(this, !0);
}
render() {
return c`
${super.getChildrenBySlot("microsoft-logo")}
${this.checkIfSlotExists("brand-logo") ? c`
${super.getChildrenBySlot("brand-logo")}
` : ""}
`;
}
};
We([
l({ type: String })
], Kt.prototype, "pipe", 2);
Kt = We([
f("uhf-brand")
], Kt);
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const et = (s) => s ?? m;
var Gs = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, N = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? qs(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Gs(t, e, r), r;
};
let P = class extends p {
constructor() {
super(), this.brand = "", this.overflowText = "More", this.homeUrl = "", this.homeText = "", this.theme = "", this.logoImageUrl = "", this.logoAlt = "", this.onBreakpointChanged = () => {
this.requestUpdate();
}, this.breakpointController = new E(this), this.stateController = new J(this);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged);
}
disconnectedCallback() {
this.removeEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), super.disconnectedCallback();
}
render() {
return this.breakpointController.isMobile ? c`
${super.getChildren()}
` : c`
${super.getChildren()}
`;
}
};
N([
l({ type: String })
], P.prototype, "brand", 2);
N([
l({ type: String })
], P.prototype, "overflowText", 2);
N([
l({ type: String })
], P.prototype, "homeUrl", 2);
N([
l({ type: String })
], P.prototype, "homeText", 2);
N([
l({ type: String })
], P.prototype, "theme", 2);
N([
l({ type: String, attribute: "logoimageurl" })
], P.prototype, "logoImageUrl", 2);
N([
l({ type: String, attribute: "logoalt" })
], P.prototype, "logoAlt", 2);
P = N([
f("uhf-contextual-nav")
], P);
var Ws = Object.defineProperty, zs = Object.getOwnPropertyDescriptor, re = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? zs(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Ws(t, e, r), r;
};
let Tt = class extends p {
constructor() {
super(...arguments), this.brand = "", this.overflowText = "More";
}
render() {
const s = JSON.stringify({
Compnm: "UHF",
view: "UHF",
Pa: "UniversalHeader",
Hn: this.overflowText,
eHN: "More",
cN: `CatNav_${this.overflowText}_nonnav`,
eCN: "CatNav_More_nonnav"
});
return c`
`;
}
};
re([
l({ type: String })
], Tt.prototype, "brand", 2);
re([
l({ type: String })
], Tt.prototype, "overflowText", 2);
Tt = re([
f("uhf-contextual-nav-desktop")
], Tt);
const Ks = (s) => s.filter((t) => {
const e = getComputedStyle(t);
if (e.display === "none" || e.visibility === "hidden") return !1;
let i = t.parentElement;
for (; i;) {
const r = getComputedStyle(i);
if (r.display === "none" || r.visibility === "hidden") return !1;
i = i.parentElement;
}
return !0;
}), ze = [
"a[href]",
"button:not([disabled])",
"input:not([disabled])",
"select:not([disabled])",
"textarea:not([disabled])",
'[tabindex]:not([tabindex="-1"])',
'[role="menuitem"]',
'[role="option"]'
];
class Ke {
constructor(t, e) {
this.focusedIndex = -1, this.menuItems = [], this.host = t, this.containerQuery = e, this.host.addController(this);
}
hostConnected() {
}
getFocusableMenuItems() {
const t = this.containerQuery ? this.host.querySelector(this.containerQuery) : this.host;
if (!t) return [];
const e = t.querySelectorAll(ze.join(", "));
return Ks(Array.from(e));
}
focusFirstMenuItem() {
this.menuItems = this.getFocusableMenuItems(), this.menuItems.length > 0 && (this.focusedIndex = 0, this.menuItems[0].focus(), this.updateMenuItemAttributes());
}
focusLastMenuItem() {
this.menuItems = this.getFocusableMenuItems(), this.menuItems.length > 0 && (this.focusedIndex = this.menuItems.length - 1, this.menuItems[this.focusedIndex].focus(), this.updateMenuItemAttributes());
}
focusNextItem() {
this.menuItems = this.getFocusableMenuItems(), this.menuItems.length !== 0 && (this.focusedIndex = (this.focusedIndex + 1) % this.menuItems.length, this.menuItems[this.focusedIndex].focus(), this.updateMenuItemAttributes());
}
focusPreviousItem() {
this.menuItems = this.getFocusableMenuItems(), this.menuItems.length !== 0 && (this.focusedIndex = this.focusedIndex <= 0 ? this.menuItems.length - 1 : this.focusedIndex - 1, this.menuItems[this.focusedIndex].focus(), this.updateMenuItemAttributes());
}
updateMenuItemAttributes() {
this.menuItems.forEach((t, e) => {
e === this.focusedIndex ? t.classList.add("focused") : t.classList.remove("focused");
});
}
activateCurrentItem() {
this.focusedIndex >= 0 && this.menuItems[this.focusedIndex] && this.menuItems[this.focusedIndex].click();
}
setFocusIndex(t) {
this.focusedIndex = t, this.updateMenuItemAttributes();
}
getItemCount() {
return this.menuItems = this.getFocusableMenuItems(), this.menuItems.length;
}
}
class Vs extends Mt {
constructor() {
super(), window.addEventListener("keydown", (t) => this.notify(t));
}
}
const Js = new Vs();
class ie {
constructor(t, e, i) {
this.keyboardService = Js, this.handleKeyDown = (r) => {
switch (r.key) {
case "ArrowDown":
r.preventDefault(), this.callbacks.onArrowDown ? this.callbacks.onArrowDown(this.focusController) : this.focusController.focusNextItem();
break;
case "ArrowUp":
r.preventDefault(), this.callbacks.onArrowUp ? this.callbacks.onArrowUp(this.focusController) : this.focusController.focusPreviousItem();
break;
case "Home":
r.preventDefault(), this.callbacks.onHome ? this.callbacks.onHome(this.focusController) : this.focusController.focusFirstMenuItem();
break;
case "End":
r.preventDefault(), this.callbacks.onEnd ? this.callbacks.onEnd(this.focusController) : this.focusController.focusLastMenuItem();
break;
case "Escape":
r.preventDefault(), this.callbacks.onEscape && this.callbacks.onEscape(this.focusController);
break;
case "Tab":
this.callbacks.onTab && this.callbacks.onTab(this.focusController, r);
break;
case "Enter":
this.callbacks.onEnter && this.callbacks.onEnter(this.focusController);
break;
case " ":
this.callbacks.onSpace && this.callbacks.onSpace(this.focusController);
break;
}
}, this.listen = () => {
this.id || (this.id = this.keyboardService.subscribe(this.handleKeyDown));
}, this.deafen = () => {
this.id && (this.keyboardService.unsubscribe(this.id), this.id = void 0);
}, (this.host = t).addController(this), this.focusController = new Ke(this.host, i), this.callbacks = e;
}
hostConnected() {
}
hostDisconnected() {
this.deafen();
}
}
var L = /* @__PURE__ */ ((s) => (s.POSITION_CALCULATED = "PositionEvents/POSITION_CALCULATED", s))(L || {});
class Ys {
// margin from the edge of the viewport
constructor(t, e, i, r, o = 0) {
this.calculateMobilePosition = () => {
var lt, wt;
const n = (lt = this.host.findFirstCustomAncestor()) == null ? void 0 : lt.querySelector(this.anchorSelector), a = (wt = this.host.findFirstCustomAncestor()) == null ? void 0 : wt.querySelector(this.popoutSelector);
if (!n || !a) return;
a.style.removeProperty("top"), a.style.removeProperty("left"), a.style.removeProperty("width");
const h = n.getBoundingClientRect(), u = window.scrollY, b = h.top + u, d = h.height;
let C = "100%", v = 0, A = b + d;
a.style.width = C, a.style.left = `${v}px`, a.style.top = `${A}px`, a.style.visibility = "visible", this.host.dispatchEvent(new CustomEvent("PositionEvents/POSITION_CALCULATED", { bubbles: !0 }));
}, this.calculatePosition = () => {
var de, pe, fe;
const n = (de = this.host.findFirstCustomAncestor()) == null ? void 0 : de.querySelector(this.anchorSelector), a = (pe = this.host.findFirstCustomAncestor()) == null ? void 0 : pe.querySelector(this.popoutSelector);
if (!n || !a) return;
a.style.visibility = "hidden";
const h = n.getBoundingClientRect(), u = window.scrollX, b = window.scrollY, d = window.innerWidth, C = u + d, v = 0, A = h.top + b, lt = h.left + u, wt = h.width + u, ss = h.height, Y = Math.max(a.scrollWidth, a.offsetWidth), $t = (fe = a.offsetParent) == null ? void 0 : fe.getBoundingClientRect(), rs = this.isRtl();
let B = 0, St = 0;
for (const Ft of this.positions)
if (Ft === "bottom") {
if (St = A + ss, rs) {
let O = lt + h.width - Y;
if (O < v + this.margin) {
B = Math.min(u + this.margin, C - Y - this.margin);
break;
}
B = O;
} else {
let O = lt;
if (O + Y > C - this.margin) {
B = Math.max(C - Y - this.margin, u + this.margin);
break;
}
B = O;
}
break;
} else if (Ft === "left") {
let O = -Y;
if (h.x + O < v + this.margin)
continue;
B = O, St = $t ? h.top - $t.top : A;
break;
} else if (Ft === "right") {
let O = wt, ge = O + Y;
if (h.x + ge > C - this.margin)
continue;
B = O, St = $t ? h.top - $t.top : A;
break;
}
a.style.top = `${St}px`, a.style.left = `${B}px`, a.style.visibility = "visible", this.host.dispatchEvent(new CustomEvent("PositionEvents/POSITION_CALCULATED", { bubbles: !0 }));
}, (this.host = t).addController(this), this.positions = e, this.anchorSelector = i, this.popoutSelector = r, this.margin = o, this.positions.push(
"bottom"
/* BOTTOM */
);
}
hostConnected() {
}
isRtl() {
return qe.getContext().alignment === gt.RTL;
}
}
var Qs = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, it = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Xs(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Qs(t, e, r), r;
};
let q = class extends p {
constructor() {
super(), this.brand = "", this.homeUrl = "", this.homeText = "", this.logoImageUrl = "", this.logoAlt = "", this.onStateChanged = (s) => {
var e;
const t = s.detail;
if (((e = t.mobileState) == null ? void 0 : e.isContextualNavOpen) !== void 0) {
const i = t.mobileState.isContextualNavOpen;
this.updateToggleState(i), i || this.keyboardController.deafen();
}
}, this.toggleMenu = () => {
let s = !this.stateController.getState().mobileState.isContextualNavOpen;
this.stateController.setState((t) => ({ mobileState: { ...t.mobileState, isContextualNavOpen: s } }));
}, this.updateToggleState = (s) => {
const t = this.querySelector("button.uhf-contextual-nav-trigger uhf-icon");
t && t.setAttribute("iconName", s ? "ChevronUp" : "ChevronDown");
const e = this.querySelector("uhf-popout.uhf-contextual-nav-popout");
e && (s ? e.setAttribute("open", "") : e.removeAttribute("open"));
}, this.handlePopoutOpened = (s) => {
s.stopPropagation(), this.keyboardController.focusController.focusFirstMenuItem(), this.keyboardController.listen();
}, this.handleOutsideClick = (s) => {
this.stateController.getState().mobileState.isContextualNavOpen && !this.contains(s.target) && this.toggleMenu();
}, this.breakpointController = new E(this), this.stateController = new J(this), this.keyboardController = new ie(this, {
onTab: (s, t) => {
if (t.shiftKey)
s.focusedIndex <= 0 ? this.toggleMenu() : (t.preventDefault(), s.focusPreviousItem());
else {
const e = s.getItemCount();
s.focusedIndex >= e - 1 ? this.toggleMenu() : (t.preventDefault(), s.focusNextItem());
}
}
}, "uhf-popout.uhf-contextual-nav-popout");
}
connectedCallback() {
super.connectedCallback(), document.addEventListener("click", this.handleOutsideClick), this.addEventListener(L.POSITION_CALCULATED, this.handlePopoutOpened), this.addEventListener(T.STATE_CHANGED, this.onStateChanged);
}
disconnectedCallback() {
document.removeEventListener("click", this.handleOutsideClick), this.removeEventListener(L.POSITION_CALCULATED, this.handlePopoutOpened), this.removeEventListener(T.STATE_CHANGED, this.onStateChanged), super.disconnectedCallback();
}
render() {
return c`
`;
}
};
it([
l({ type: String })
], q.prototype, "brand", 2);
it([
l({ type: String })
], q.prototype, "homeUrl", 2);
it([
l({ type: String })
], q.prototype, "homeText", 2);
it([
l({ type: String, attribute: "logoimageurl" })
], q.prototype, "logoImageUrl", 2);
it([
l({ type: String, attribute: "logoalt" })
], q.prototype, "logoAlt", 2);
q = it([
f("uhf-contextual-nav-mobile")
], q);
class Ve {
constructor(t, e, i) {
(this.host = t).addController(this), this.onResize = i, this.resizeElement = e, this.setupResizeObserver();
}
hostDisconnected() {
this.cleanupResizeObserver();
}
setupResizeObserver() {
"ResizeObserver" in globalThis ? (this.resizeObserver = new ResizeObserver(() => {
this.onResize();
}), this.resizeObserver.observe(this.resizeElement)) : globalThis.addEventListener("resize", this.onResize);
}
cleanupResizeObserver() {
this.resizeObserver ? this.resizeObserver.disconnect() : globalThis.removeEventListener("resize", this.onResize);
}
}
class Zs {
constructor(t, e = {}) {
var i;
this._isOverflowing = !1, this._visibleItems = 0, this._itemWidthCache = /* @__PURE__ */ new Map(), this._triggerWidth = 0, this._beforeWidth = 0, this._afterWidth = 0, this._hasMeasured = !1, this._calculateOverflow = async () => {
var d;
if (!this._menuContainer) return;
const r = this._menuItems, o = !this._hasMeasured || this._itemsChanged(r);
o && await this._measureMenuItems(r);
const n = await this._getAvailableWidth();
if (n === 0) return;
const a = n - this._options.overflowBuffer - this._triggerWidth - this._beforeWidth - this._afterWidth;
let h = 0, u = 0;
for (const C of r) {
const v = this._itemWidthCache.get(C) || 0;
if (h += v, h <= a) {
u++, C.classList.remove("hidden");
continue;
}
break;
}
const b = this._visibleItems;
this._visibleItems = u, this._isOverflowing = u < r.length, this._beforeContent.forEach((C) => C.classList.remove("hidden")), this._afterContent.forEach((C) => C.classList.remove("hidden")), this._isOverflowing && ((d = this._overflowTrigger) == null || d.classList.remove("hidden")), this._menuContainer.classList.add("overflow-ready"), (b !== this._visibleItems || o) && this._updateOverflowMenu(this.overflowDropdownContent);
}, (this.host = t).addController(this), this._options = {
overflowBuffer: e.overflowBuffer ?? 100,
containerSelector: e.containerSelector ?? "",
fixedSiblingWidths: e.fixedSiblingWidths ?? {}
}, (i = this.host.updateComplete) == null || i.then(() => {
const r = this._flexContainer || this.host.querySelector(".uhf-overflow-menu");
this.resizeController = new Ve(t, r, this._calculateOverflow);
});
}
hostUpdated() {
if (this._hasMeasured) {
const t = this._menuItems;
this._itemsChanged(t) && this._calculateOverflow();
} else
this._calculateOverflow();
}
/**
* Measure every menu item and cache its width. Items must be in the
* layout (not display:none) for offsetWidth to be accurate. On the
* very first call the entire menu is still visibility:hidden (via CSS)
* so the user never sees the momentarily-unhidden items.
*/
async _measureMenuItems(t) {
var r;
this._itemWidthCache.clear();
for (const o of t) {
const n = await this._getEffectiveWidth(o);
this._itemWidthCache.set(o, n), o.classList.add("hidden");
}
let e = 0;
for (const o of this._beforeContent)
e += await this._getEffectiveWidth(o);
this._beforeWidth = e;
let i = 0;
for (const o of this._afterContent)
i += await this._getEffectiveWidth(o);
this._afterWidth = i, (r = this._overflowTrigger) == null || r.classList.remove("hidden"), this._triggerWidth = this._overflowTrigger ? await this._getEffectiveWidth(this._overflowTrigger) : 0, this._hasMeasured = !0;
}
/**
* Compute the space available for menu items by measuring the ancestor
* flex container and subtracting everything that isn't the overflow
* menu's region.
*/
async _getAvailableWidth() {
const t = this._flexChild, e = this._flexContainer;
if (!e || !t) return 0;
const i = this._menuItems, r = this._overflowTrigger, o = this._beforeContent, n = this._afterContent;
i.forEach((v) => v.classList.add("hidden")), r && r.classList.add("hidden"), o.forEach((v) => v.classList.add("hidden")), n.forEach((v) => v.classList.add("hidden"));
const a = getComputedStyle(e), h = e.clientWidth - parseFloat(a.paddingLeft) - parseFloat(a.paddingRight), u = parseFloat(a.gap) || 0;
let b = 0, d = 0;
for (const v of Array.from(e.children)) {
if (d++, v === t) continue;
const A = v.tagName.toUpperCase();
if (this._options.fixedSiblingWidths[A]) {
b += this._options.fixedSiblingWidths[A];
continue;
}
b += await this._getEffectiveWidth(v);
}
const C = d > 1 ? (d - 1) * u : 0;
return h - b - C;
}
/**
* Get the effective rendered width of an element. Elements with
* display:contents or display:inline (e.g. custom elements without
* explicit display) report offsetWidth as 0. For those, recursively
* sum the widths of their children until real boxes are found.
*/
async _getEffectiveWidth(t) {
if (t instanceof X && t.isUpdatePending && await t.updateComplete, t.offsetWidth > 0) return t.offsetWidth;
let e = 0;
for (const i of Array.from(t.children))
e += await this._getEffectiveWidth(i);
return e;
}
/**
* Check whether the current DOM items differ from the cached set
* (e.g. after a Lit re-render that creates new element clones).
*/
_itemsChanged(t) {
return t.length !== this._itemWidthCache.size ? !0 : t.some((e) => !this._itemWidthCache.has(e));
}
/**
* Populate the overflow trigger's dropdown body with the given items.
*/
_updateOverflowMenu(t) {
const e = this.host.querySelector(".overflow-trigger div.uhf-dropdown-body");
t && e && (e.innerHTML = "", t.forEach((i) => e.appendChild(i)));
}
// ── DOM Getters ──────────────────────────────────────────────────
/** The inner wrapper div rendered by uhf-overflow-menu. */
get _menuContainer() {
return this.host.querySelector(".uhf-overflow-menu") || null;
}
/**
* The ancestor flex container used to compute available width.
* Uses the explicit `containerSelector` option when set, otherwise
* walks up the DOM to find the nearest flex/grid parent.
*/
get _flexContainer() {
if (this._options.containerSelector)
return this.host.closest(this._options.containerSelector) || null;
let t = this.host.parentElement;
for (; t;) {
const e = getComputedStyle(t).display;
if (["flex", "inline-flex", "grid", "inline-grid"].includes(e))
return t;
t = t.parentElement;
}
return null;
}
/**
* The direct child of the flex container that contains (or is an
* ancestor of) this overflow menu. Used to exclude "our" region
* when summing sibling widths.
*/
get _flexChild() {
const t = this._flexContainer;
if (!t) return null;
let e = this.host;
for (; e && e.parentElement !== t;)
e = e.parentElement;
return e;
}
/** The overflow dropdown trigger element. */
get _overflowTrigger() {
return this.host.querySelector(".overflow-trigger") || null;
}
/** Navigable items inside the items container. */
get _menuItems() {
const t = this.host.querySelector("div.uhf-overflow-menu-items");
return t ? Array.from(t.children).filter(
(e) => e.matches("uhf-dropdown, .uhf-nav-link")
) : [];
}
/** Non-collapsible content rendered before the collapsible items. */
get _beforeContent() {
const t = this.host.querySelector("div.uhf-overflow-menu-before");
return t ? Array.from(t.children) : [];
}
/** Non-collapsible content rendered after the collapsible items. */
get _afterContent() {
const t = this.host.querySelector("div.uhf-overflow-menu-after");
return t ? Array.from(t.children) : [];
}
// ── Overflow Item Conversion ─────────────────────────────────────
_isNavLink(t) {
return t.matches(".uhf-nav-link, a[href]");
}
_isDropdown(t) {
return t.matches("uhf-dropdown");
}
_convertNavLinkToDropdownLink(t) {
var h;
const e = t.getAttribute("href") || "#", i = ((h = t.textContent) == null ? void 0 : h.trim()) || "", r = t.getAttribute("name") || "", o = t.getAttribute("data-m") || "", n = t.getAttribute("id") || "", a = document.createElement("a");
return a.className = "uhf-nav-item uhf-dropdown-link", a.href = e, n && (a.id = n), a.setAttribute("name", r), a.setAttribute("data-m", o), a.textContent = i, a;
}
_convertDropdownToFlyout(t) {
var h;
const e = t.getAttribute("text") || ((h = t.textContent) == null ? void 0 : h.trim()) || "", i = t.getAttribute("name") || "", r = t.getAttribute("data-m") || "", o = t.getAttribute("id") || "", n = this._getDropdownDestination(t), a = document.createElement("uhf-flyout");
return a.setAttribute("text", e), o && (a.id = o), a.setAttribute("name", i), a.setAttribute("data-m", r), a.replaceChildren(...n.content), a;
}
_getDropdownDestination(t) {
const e = t.querySelectorAll("uhf-dropdown-column");
if (e.length > 0)
return {
type: "multicolumn",
content: Array.from(e).map((r) => this._convertColumnToTemplate(r))
};
const i = t.querySelectorAll(".uhf-dropdown-link, a[href]");
return i.length > 0 ? {
type: "submenu",
content: Array.from(i).map((r) => this._convertLinkToTemplate(r))
} : { type: "unknown", content: [] };
}
_convertColumnToTemplate(t) {
const e = t.getAttribute("title") || "", i = t.querySelectorAll(".uhf-dropdown-link, a[href]"), r = t.getAttribute("data-m") || "", o = Array.from(i).map(
(a) => this._convertLinkToTemplate(a)
), n = document.createElement("uhf-flyout");
return n.setAttribute("text", e), n.setAttribute("data-m", r), n.replaceChildren(...o), n;
}
_convertLinkToTemplate(t) {
var h;
const e = t.getAttribute("href") || "#", i = ((h = t.textContent) == null ? void 0 : h.trim()) || "", r = t.getAttribute("name") || "", o = t.getAttribute("data-m") || "", n = t.getAttribute("id") || "", a = document.createElement("a");
return a.className = "uhf-nav-item uhf-dropdown-link", a.href = e, n && (a.id = n), a.setAttribute("name", r), a.setAttribute("data-m", o), a.textContent = i, a;
}
get overflowDropdownContent() {
const t = [];
return this.overflowItems.forEach((e) => {
this._isNavLink(e) ? t.push(this._convertNavLinkToDropdownLink(e)) : this._isDropdown(e) && t.push(this._convertDropdownToFlyout(e));
}), t;
}
// ── Public API ───────────────────────────────────────────────────
get isOverflowing() {
return this._isOverflowing;
}
get visibleItems() {
return this._visibleItems;
}
get overflowItems() {
return this._menuItems.slice(this._visibleItems);
}
}
var tr = Object.defineProperty, er = Object.getOwnPropertyDescriptor, ot = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? er(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && tr(t, e, r), r;
};
let W = class extends p {
constructor() {
super(...arguments), this.overflowText = "More", this.triggerDataM = "", this.containerSelector = "", this.overflowBuffer = 100, this.fixedSiblingWidths = "";
}
firstUpdated() {
const s = {
overflowBuffer: this.overflowBuffer,
containerSelector: this.containerSelector || void 0
};
if (this.fixedSiblingWidths)
try {
s.fixedSiblingWidths = JSON.parse(this.fixedSiblingWidths);
} catch {
}
this.overflowController = new Zs(this, s);
}
render() {
return c`
`;
}
};
ot([
l({ type: String })
], W.prototype, "overflowText", 2);
ot([
l({ type: String })
], W.prototype, "triggerDataM", 2);
ot([
l({ type: String })
], W.prototype, "containerSelector", 2);
ot([
l({ type: Number })
], W.prototype, "overflowBuffer", 2);
ot([
l({ type: String })
], W.prototype, "fixedSiblingWidths", 2);
W = ot([
f("uhf-overflow-menu")
], W);
class sr {
constructor(t, e) {
this.host = t, this.host.addController(this), this.initialForm = e, this.formData = { ...e };
}
hostConnected() {
}
resetForm() {
this.formData = { ...this.initialForm };
}
setFormData(t, e) {
this.formData[t] = e;
}
get data() {
return this.formData;
}
}
class rr {
constructor(t, e) {
this.isLoading = !1, this.error = null, (this.host = t).addController(this), this.baseUrl = e;
}
hostConnected() {
}
hostDisconnected() {
this.abortController && this.abortController.abort();
}
setIsLoading(t) {
this.isLoading = t, this.host.dispatchEvent(new CustomEvent("ApiEvents/LOADING_CHANGED", {
detail: { isLoading: t },
bubbles: !1
}));
}
async fetchData(t, e) {
this.setIsLoading(!0), this.error = null, this.abortController && this.abortController.abort(), this.abortController = new AbortController();
try {
const i = await fetch(
`${this.baseUrl}${t}`,
{
...e,
signal: (e == null ? void 0 : e.signal) || this.abortController.signal
}
);
if (!i.ok)
throw new Error(`Error: ${i.status} ${i.statusText}`);
return await i.json();
} catch (i) {
return this.error = i.message, null;
} finally {
this.setIsLoading(!1), this.abortController = null;
}
}
setBaseUrl(t) {
this.baseUrl = t;
}
}
var I = /* @__PURE__ */ ((s) => (s.TERM_CLICKED = "SearchEvents/TERM_CLICKED", s.AUTO_SUGGEST_UPDATED = "SearchEvents/AUTO_SUGGEST_UPDATED", s))(I || {});
function ir(s, t) {
let e;
return function (...i) {
const r = this;
clearTimeout(e), e = setTimeout(() => {
s.apply(r, i);
}, t);
};
}
const Je = (s, t, e, i, r, o) => {
setTimeout(() => {
s() ? t() : r > 0 ? Je(s, t, i, i, r - 1, o) : console.warn(o);
}, e);
};
class or {
constructor(t) {
this.handleOutsideClick = (e) => {
this.isOpen && !this.host.contains(e.target) && this.toggle();
}, this.onEscapeClicked = (e) => {
let i = this.host.querySelector("input[type='search']");
i && i === document.activeElement ? this.toggle() : (e.setFocusIndex(-1), i == null || i.focus());
}, this.boldText = (e, i) => {
if (!i.trim()) return e;
const r = new RegExp(`(${i})`, "gi");
return e.replace(r, "$1");
}, this.getImageUrl = (e) => e.startsWith("http") ? e : `https:${e}`, this.setAutoSuggestWidth = () => {
var r;
let e = (r = this.host.querySelector("input")) == null ? void 0 : r.scrollWidth, i = this.host.querySelector("uhf-popout");
e && i && (i.style.width = `${e}px`);
}, this.toggle = () => {
let e = !this.isOpen;
this.stateController.setState((i) => ({ searchState: { ...i.searchState, isSearchOpen: e } })), e ? (this.keyboardController.listen(), this.fetchSuggestions(!0)) : (this.formController.resetForm(), this.keyboardController.deafen(), this.keyboardController.focusController.setFocusIndex(-1), this.host.dispatchEvent(new CustomEvent(I.AUTO_SUGGEST_UPDATED, { detail: { autoSuggestResults: [] }, bubbles: !1 })));
}, this.fetchSuggestions = (e = !1) => {
var i;
(i = this.apiController) == null || i.fetchData(`?${this.createAutoSuggestQueryString(e)}`).then((r) => {
let o = this.processAutoSuggestResults(r);
this.host.dispatchEvent(new CustomEvent(I.AUTO_SUGGEST_UPDATED, { detail: { autoSuggestResults: o }, bubbles: !1 }));
});
}, this.host = t, this.host.addController(this), this.stateController = new J(this.host), this.formController = new sr(this.host, { q: "" }), this.contextController = new U(this.host), this.keyboardController = new ie(this.host, {
onEscape: this.onEscapeClicked
}, "uhf-popout"), this.debouncedAutoSuggestFetch = ir(this.fetchSuggestions, 300), this.host.updateComplete.then(() => {
this.resizeController = new Ve(this.host, this.host.querySelector("input.uhf-search-input"), this.setAutoSuggestWidth), this.apiController = new rr(this.host, this.host.autoSuggestUrl), this.setAutoSuggestWidth();
});
}
hostConnected() {
document.addEventListener("click", this.handleOutsideClick);
}
hostDisconnected() {
document.removeEventListener("click", this.handleOutsideClick);
}
createAutoSuggestQueryString(t = !1) {
let e = this.host, i = {
market: this.contextController.locale,
clientId: e.clientId,
sources: e.source,
counts: e.productCount
};
return t ? (i.feature = "zerostate", i.site = window.location.origin.includes("localhost") ? "http://approjects.co.za/?big=en-us/" : window.location.origin + window.location.pathname) : i.query = this.query.trim(), new URLSearchParams(i).toString();
}
processAutoSuggestResults(t) {
var i;
let e = [];
return (i = t == null ? void 0 : t.ResultSets) == null || i.forEach((r) => {
r.Type == "product" ? r.Suggests.forEach((n) => {
let a = document.createElement("uhf-autosuggest-item");
a.setAttribute("text", this.boldText(n.Title, this.query)), a.setAttribute("url", n.Url), n.ImageUrl && a.setAttribute("imageUrl", this.getImageUrl(n.ImageUrl)), a.setAttribute("secondaryText", n.Source), e.push(a);
}) : r.Type == "term" && r.Suggests.forEach((n) => {
let a = document.createElement("uhf-autosuggest-item");
a.setAttribute("text", this.boldText(n.Txt, this.query)), e.push(a);
});
}), e;
}
setForm(t, e) {
this.formController.setFormData(t, e), this.debouncedAutoSuggestFetch();
}
submit() {
const t = this.host.searchUrl.includes("?") ? "&" : "?";
let e = `${this.host.searchUrl}${t}${this.host.queryParameterName}=${encodeURIComponent(this.query)}`;
this.host.searchParams && (e += `&${this.host.searchParams}`), window.location.href = e;
}
get isOpen() {
return this.stateController.getState().searchState.isSearchOpen || !1;
}
get query() {
const t = this.host.queryParameterName || "q";
return this.formController.data[t] ?? "";
}
}
var nr = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, x = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? ar(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && nr(t, e, r), r;
};
let S = class extends p {
constructor() {
super(), this.searchUrl = "", this.autoSuggestUrl = "http://approjects.co.za/?big=msstoreapiprod/api/autosuggest", this.zeroStateUrl = "", this.placeholder = "Search...", this.searchLabel = "", this.queryParameterName = "q", this.clientId = "7F27B536-CF6B-4C65-8638-A0F8CBDFCA65", this.productCount = "5,1,5", this.source = "Microsoft-Terms,Iris-Products,DCatAll-Products", this.cancelLabel = "Cancel", this.searchParams = "", this.autoSuggestResults = [], this.onBreakpointChanged = () => {
this.requestUpdate();
}, this.onStateChanged = (s) => {
var e;
const t = s.detail;
if (((e = t.searchState) == null ? void 0 : e.isSearchOpen) !== void 0) {
let i = t.searchState.isSearchOpen;
this.classList.toggle("search-open", i);
const r = this.querySelector(".uhf-search-container");
r && r.classList.toggle("hidden", !i);
const o = this.querySelector(".uhf-search-button");
o && o.classList.toggle("hidden", i), i && this.querySelector("input").focus();
}
}, this.handleAutoSuggestUpdate = (s) => {
const { autoSuggestResults: t } = s.detail;
this.autoSuggestResults = t;
}, this.handleTermClicked = (s) => {
s.stopImmediatePropagation();
const { term: t } = s.detail;
this.searchController.setForm(this.queryParameterName, t), this.searchController.submit();
}, this.onChange = (s) => {
const t = s.target;
this.searchController.setForm(this.queryParameterName, t.value);
}, this.onSubmit = (s) => {
s.preventDefault(), this.searchController.submit();
}, this.searchController = new or(this), this.breakpointController = new E(this), this.stateController = new J(this);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(I.AUTO_SUGGEST_UPDATED, this.handleAutoSuggestUpdate), this.addEventListener(I.TERM_CLICKED, this.handleTermClicked), this.addEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), this.addEventListener(T.STATE_CHANGED, this.onStateChanged);
}
disconnectedCallback() {
super.disconnectedCallback(), this.removeEventListener(I.AUTO_SUGGEST_UPDATED, this.handleAutoSuggestUpdate), this.removeEventListener(I.TERM_CLICKED, this.handleTermClicked), this.removeEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), this.removeEventListener(T.STATE_CHANGED, this.onStateChanged), this.searchController.isOpen && this.searchController.toggle();
}
render() {
return c`
${this.breakpointController.isMobile ? c`
` : ""}
${this.breakpointController.isMobile ? "" : c`
`}
0 && this.searchController.isOpen}"
targetSelector="input.uhf-search-input"
positions="bottom"
style=""
id="uhf-autosuggest-popout"
role="listbox"
disableMobilePositioning
>
${this.autoSuggestResults}
`;
}
};
x([
l({ type: String })
], S.prototype, "searchUrl", 2);
x([
l({ type: String })
], S.prototype, "autoSuggestUrl", 2);
x([
l({ type: String })
], S.prototype, "zeroStateUrl", 2);
x([
l({ type: String })
], S.prototype, "placeholder", 2);
x([
l({ type: String, attribute: "search-label" })
], S.prototype, "searchLabel", 2);
x([
l({ type: String })
], S.prototype, "queryParameterName", 2);
x([
l({ type: String })
], S.prototype, "clientId", 2);
x([
l({ type: String })
], S.prototype, "productCount", 2);
x([
l({ type: String })
], S.prototype, "source", 2);
x([
l({ type: String, attribute: "cancel-label" })
], S.prototype, "cancelLabel", 2);
x([
l({ type: String, attribute: "search-params" })
], S.prototype, "searchParams", 2);
x([
V()
], S.prototype, "autoSuggestResults", 2);
S = x([
f("uhf-search")
], S);
var lr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, oe = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? hr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && lr(t, e, r), r;
};
let Pt = class extends p {
constructor() {
super(...arguments), this.iconName = "", this.size = 16;
}
render() {
return c`
`;
}
};
oe([
l({ type: String })
], Pt.prototype, "iconName", 2);
oe([
l({ type: Number })
], Pt.prototype, "size", 2);
Pt = oe([
f("uhf-icon")
], Pt);
var cr = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, nt = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? ur(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && cr(t, e, r), r;
};
let z = class extends p {
constructor() {
super(), this.cartUrl = "", this.cartCountUrl = "http://approjects.co.za/?big=store/buy/cartcount", this.cartLabel = "", this.cartCountText = "items in cart", this.cartCount = 0, this.normalizeCartCountUrl = () => this.cartCountUrl && this.cartCountUrl.startsWith("//") ? `https:${this.cartCountUrl}` : this.cartCountUrl, this.handleCartUpdates = (s) => {
try {
const t = this.normalizeCartCountUrl();
if (!t || typeof s.data != "string") return;
let e;
try {
e = new URL(t).origin;
} catch {
console.warn("[UHF Cart] Invalid cartCountUrl:", t);
return;
}
if (s.origin !== e) return;
const i = s.data.indexOf("="), r = i === -1 ? s.data : s.data.slice(0, i), o = i === -1 ? "" : s.data.slice(i + 1);
if (r !== "DR_Cart_Count") return;
this.cartCount = /^\d+$/.test(o) ? parseInt(o, 10) : 0;
} catch (t) {
console.warn("[UHF Cart] Cart count processing failed", t);
}
};
}
connectedCallback() {
super.connectedCallback(), window.addEventListener("message", this.handleCartUpdates);
}
disconnectedCallback() {
window.removeEventListener("message", this.handleCartUpdates), super.disconnectedCallback();
}
render() {
return c`
${this.cartLabel}
${this.cartCount}
`;
}
};
nt([
l({ type: String })
], z.prototype, "cartUrl", 2);
nt([
l({ type: String })
], z.prototype, "cartCountUrl", 2);
nt([
l({ type: String, attribute: "cart-label" })
], z.prototype, "cartLabel", 2);
nt([
l({ type: String, attribute: "cart-count-text" })
], z.prototype, "cartCountText", 2);
nt([
V()
], z.prototype, "cartCount", 2);
z = nt([
f("uhf-cart")
], z);
var dr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, ne = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? pr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && dr(t, e, r), r;
};
let Lt = class extends p {
constructor() {
super(), this.text = "Menu", this.dataM = "", this.onBreakpointChanged = () => {
this.requestUpdate();
}, this.breakpointController = new E(this);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged);
}
disconnectedCallback() {
this.removeEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), super.disconnectedCallback();
}
render() {
return this.breakpointController.isMobile ? c`
${super.getChildren()}
` : c`
${super.getChildren()}
`;
}
};
ne([
l({ type: String })
], Lt.prototype, "text", 2);
ne([
l({ type: String, attribute: "data-m" })
], Lt.prototype, "dataM", 2);
Lt = ne([
f("uhf-dropdown")
], Lt);
class fr {
constructor() {
this.subscribers = [], window.addEventListener("keydown", (t) => this.notify(t));
}
notify(t) {
if (this.subscribers.length === 0) return;
const e = this.subscribers[this.subscribers.length - 1];
e(t);
}
subscribe(t) {
this.subscribers.push(t);
}
unsubscribe() {
this.subscribers.pop();
}
clearAll() {
this.subscribers = [];
}
}
const gr = new fr();
var H = /* @__PURE__ */ ((s) => (s.TOGGLE = "DropdownEvents/TOGGLE", s.CLOSE_VIA_TAB = "DropdownEvents/CLOSE_VIA_TAB", s))(H || {});
class Ye {
constructor(t) {
this.isOpen = !1, this.margin = 16, this.keyboardService = gr, this.handleKeyDown = (e) => {
var i;
switch (e.key) {
case "ArrowDown":
e.preventDefault(), this.focusController.focusNextItem();
break;
case "ArrowUp":
e.preventDefault(), this.focusController.focusPreviousItem();
break;
case "Home":
e.preventDefault(), this.focusController.focusFirstMenuItem();
break;
case "End":
e.preventDefault(), this.focusController.focusLastMenuItem();
break;
case "Escape":
e.preventDefault(), this.toggle(), (i = this.host.querySelector(this.buttonQuery)) == null || i.focus();
break;
case "Tab":
if (e.shiftKey)
this.focusController.focusedIndex <= 0 ? (this.toggle(), this.host.dispatchEvent(new CustomEvent("DropdownEvents/CLOSE_VIA_TAB", {
bubbles: !0,
detail: { originalEvent: e }
}))) : (e.preventDefault(), this.focusController.focusPreviousItem());
else {
const r = this.focusController.getItemCount();
this.focusController.focusedIndex >= r - 1 ? (this.toggle(), this.host.dispatchEvent(new CustomEvent("DropdownEvents/CLOSE_VIA_TAB", {
bubbles: !0,
detail: { originalEvent: e }
}))) : (e.preventDefault(), this.focusController.focusNextItem());
}
break;
case "Enter":
case " ":
this.focusController.focusedIndex >= 0 && (e.preventDefault(), this.focusController.activateCurrentItem());
break;
}
}, this.handleOutsideClick = (e) => {
!this.host.contains(e.target) && this.isOpen && (this.toggle(), this.keyboardService.clearAll());
}, this.toggle = () => {
this.isOpen = !this.isOpen, this.isOpen ? this.keyboardService.subscribe(this.handleKeyDown) : (this.keyboardService.unsubscribe(), this.focusController.focusedIndex = -1), this.host.dispatchEvent(new CustomEvent("DropdownEvents/TOGGLE", {
detail: { isOpen: this.isOpen },
bubbles: !1
}));
}, this.afterPopoutOpened = (e) => {
e.stopImmediatePropagation();
}, this.host = t, this.host.addController(this), this.focusController = new Ke(this.host, "uhf-popout"), this.buttonQuery = "button.uhf-nav-item";
}
hostConnected() {
document.addEventListener("click", this.handleOutsideClick);
}
hostDisconnected() {
document.removeEventListener("click", this.handleOutsideClick);
}
}
var mr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, ae = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? br(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && mr(t, e, r), r;
};
let kt = class extends p {
constructor() {
super(), this.text = "Menu", this.dataM = "", this.hasColumns = !1, this.onChildClosedViaTab = (s) => {
if (s.target === this || !this.dropdownController.isOpen) return;
s.stopPropagation();
const { originalEvent: t } = s.detail, i = s.target.querySelector("button.uhf-flyout-trigger"), r = this.querySelector("uhf-popout.uhf-dropdown-menu");
if (!r) return;
const n = Array.from(r.querySelectorAll(ze.join(", "))).filter((h) => !h.closest("uhf-flyout-desktop uhf-popout")), a = i ? n.indexOf(i) : -1;
t.shiftKey ? a >= 0 && (t.preventDefault(), i.focus(), this.dropdownController.focusController.focusedIndex = a) : a >= 0 && a < n.length - 1 ? (t.preventDefault(), n[a + 1].focus(), this.dropdownController.focusController.focusedIndex = a + 1) : this.dropdownController.toggle();
}, this.onToggle = () => {
const s = this.dropdownController.isOpen, t = this.querySelector("button.uhf-nav-item");
t && (t.classList.toggle("open", s), t.setAttribute("aria-expanded", String(s)));
const e = this.querySelector("uhf-popout");
e && (e.setAttribute("aria-disabled", String(!s)), s ? e.setAttribute("open", "") : e.removeAttribute("open"));
}, this.dropdownController = new Ye(this);
}
connectedCallback() {
super.connectedCallback(), this.hasColumns = this.checkHasColumns(), this.addEventListener(L.POSITION_CALCULATED, this.dropdownController.afterPopoutOpened), this.addEventListener(H.TOGGLE, this.onToggle), this.addEventListener(H.CLOSE_VIA_TAB, this.onChildClosedViaTab);
}
disconnectedCallback() {
this.removeEventListener(L.POSITION_CALCULATED, this.dropdownController.afterPopoutOpened), this.removeEventListener(H.TOGGLE, this.onToggle), this.removeEventListener(H.CLOSE_VIA_TAB, this.onChildClosedViaTab), super.disconnectedCallback();
}
checkHasColumns() {
return super.getChildren().some((t) => t.nodeName.toLowerCase() === "uhf-dropdown-column");
}
render() {
return c`
`;
}
};
ae([
l({ type: String })
], kt.prototype, "text", 2);
ae([
l({ type: String, attribute: "data-m" })
], kt.prototype, "dataM", 2);
kt = ae([
f("uhf-dropdown-desktop")
], kt);
var Cr = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, Qe = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? vr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Cr(t, e, r), r;
};
let Vt = class extends p {
constructor() {
super(), this.text = "", this.isOpen = !1, this.toggle = () => {
this.isOpen = !this.isOpen, this.updateToggleState();
}, this.onStateChanged = (s) => {
var e, i;
const t = s.detail;
t.mobileState && (!((e = t.mobileState) != null && e.isContextualNavOpen) || !((i = t.mobileState) != null && i.isGlobalNavOpen)) && this.isOpen && (this.isOpen = !1, this.updateToggleState());
}, this.updateToggleState = () => {
const s = this.querySelector("button.uhf-dropdown-trigger-mobile");
s && s.classList.toggle("open", this.isOpen);
const t = this.querySelector("uhf-icon");
t && t.setAttribute("iconName", this.isOpen ? "ChevronUp" : "ChevronDown");
const e = this.querySelector(".uhf-dropdown-container");
e && e.classList.toggle("hidden", !this.isOpen);
}, this.stateController = new J(this);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(T.STATE_CHANGED, this.onStateChanged);
}
disconnectedCallback() {
this.removeEventListener(T.STATE_CHANGED, this.onStateChanged), super.disconnectedCallback();
}
render() {
return c`
${super.getChildren().map((s) => c`- ${s}
`)}
`;
}
};
Qe([
l({ type: String })
], Vt.prototype, "text", 2);
Vt = Qe([
f("uhf-dropdown-mobile")
], Vt);
var yr = Object.getOwnPropertyDescriptor, _r = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? yr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(r) || r);
return r;
};
let Te = class extends p {
constructor() {
super(), this.breakpointController = new E(this, !0);
}
render() {
return c`
`;
}
};
Te = _r([
f("uhf-dropdown-header")
], Te);
var wr = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, Xe = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? $r(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && wr(t, e, r), r;
};
let Jt = class extends p {
constructor() {
super(), this.title = "", this.onBreakpointChanged = () => {
this.requestUpdate();
}, this.breakpointController = new E(this, !0);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged);
}
disconnectedCallback() {
this.removeEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), super.disconnectedCallback();
}
render() {
return this.breakpointController.isMobile ? c`
${super.getChildren()}
` : c`
${this.title}
${super.getChildren().map((s) => c`- ${s}
`)}
`;
}
};
Xe([
l({ type: String })
], Jt.prototype, "title", 2);
Jt = Xe([
f("uhf-dropdown-column")
], Jt);
var Sr = Object.getOwnPropertyDescriptor, Ar = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Sr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(r) || r);
return r;
};
let Pe = class extends p {
constructor() {
super(), this.breakpointController = new E(this, !0);
}
render() {
return c`
${super.getChildren()}
`;
}
};
Pe = Ar([
f("uhf-dropdown-footer")
], Pe);
var Er = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, le = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? xr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Er(t, e, r), r;
};
let It = class extends p {
constructor() {
super(), this.text = "", this.dataM = "", this.onBreakpointChanged = () => {
this.requestUpdate();
}, this.breakpointController = new E(this);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged);
}
disconnectedCallback() {
this.removeEventListener(w.BREAKPOINT_CHANGED, this.onBreakpointChanged), super.disconnectedCallback();
}
render() {
return this.breakpointController.isMobile ? c`
${super.getChildren()}
` : c`
${super.getChildren()}
`;
}
};
le([
l({ type: String })
], It.prototype, "text", 2);
le([
l({ type: String, attribute: "data-m" })
], It.prototype, "dataM", 2);
It = le([
f("uhf-flyout")
], It);
var Or = Object.defineProperty, Tr = Object.getOwnPropertyDescriptor, he = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Tr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Or(t, e, r), r;
};
let Dt = class extends p {
constructor() {
super(), this.text = "", this.dataM = "", this.onToggle = () => {
const s = this.flyoutController.isOpen, t = this.querySelector("button.uhf-flyout-trigger");
t && (t.classList.toggle("open", s), t.setAttribute("aria-expanded", String(s)));
const e = this.querySelector("uhf-popout");
e && (s ? e.setAttribute("open", "") : e.removeAttribute("open"));
}, this.onMouseEnter = () => {
this.flyoutController.isOpen || this.flyoutController.toggle();
}, this.onMouseLeave = (s) => {
const t = s.relatedTarget, e = this.querySelector("uhf-popout");
this.flyoutController.isOpen && e && !e.contains(t) && this.flyoutController.toggle();
}, this.flyoutController = new Ye(this), this.contextController = new U(this);
}
connectedCallback() {
super.connectedCallback(), this.addEventListener(L.POSITION_CALCULATED, this.flyoutController.afterPopoutOpened), this.addEventListener(H.TOGGLE, this.onToggle);
}
disconnectedCallback() {
this.removeEventListener(L.POSITION_CALCULATED, this.flyoutController.afterPopoutOpened), this.removeEventListener(H.TOGGLE, this.onToggle), super.disconnectedCallback();
}
render() {
return c`
${super.getChildren()}
`;
}
};
he([
l({ type: String })
], Dt.prototype, "text", 2);
he([
l({ type: String, attribute: "data-m" })
], Dt.prototype, "dataM", 2);
Dt = he([
f("uhf-flyout-desktop")
], Dt);
var Pr = Object.getOwnPropertyDescriptor, Lr = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Pr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(r) || r);
return r;
};
let Le = class extends p {
constructor() {
super(), this.contextController = new U(this);
}
firstUpdated() {
requestAnimationFrame(() => this.updateLocaleLinks());
}
normalizeLocale(s) {
return (s ?? "").trim().replace(/_/g, "-").toLowerCase();
}
buildHref(s, t) {
return `${s.origin}${t}${s.search}${s.hash}`;
}
updateLocaleLinks() {
const s = this.normalizeLocale(this.contextController.locale), t = new URL(window.location.href), e = t.pathname;
Array.from(this.querySelectorAll("a[data-uhf-locale]")).forEach((r) => {
const o = r.getAttribute("data-uhf-locale");
if (!o) return;
const n = this.resolveLocale(o, s), a = this.replaceLocaleInPath(e, s, n);
r.setAttribute("href", this.buildHref(t, a));
});
}
resolveLocale(s, t) {
const e = this.normalizeLocale(s);
if (e.includes("-"))
return e;
const i = this.normalizeLocale(t).split("-").filter(Boolean);
return i.length <= 1 ? e : [e, ...i.slice(1)].join("-");
}
replaceLocaleInPath(s, t, e) {
const i = s.split("/").filter(Boolean);
if (i.length === 0)
return "/" + e;
const r = this.normalizeLocale(t), o = i.map((a) => this.normalizeLocale(a)), n = o.findIndex((a) => a === r);
if (n >= 0)
i[n] = e;
else {
const a = o.findIndex((h) => this.looksLikeLocale(h));
a >= 0 ? i[a] = e : i.unshift(e);
}
return "/" + i.join("/");
}
looksLikeLocale(s) {
return /^[a-z]{2,3}(-[a-z]{4})?(-([a-z]{2}|\d{3}))?(-[a-z0-9]{5,8})*$/i.test(s);
}
render() {
const s = this.contextController.getLocaleLabel();
return c` `;
}
};
Le = Lr([
f("uhf-locale-picker")
], Le);
var kr = Object.defineProperty, Ir = Object.getOwnPropertyDescriptor, Ze = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Ir(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && kr(t, e, r), r;
};
let Yt = class extends p {
constructor() {
super(), this.theme = "light", this.contextController = new U(this);
}
connectedCallback() {
const s = this.theme === "dark" ? $.DARK : $.LIGHT;
this.contextController.setContext({ footerTheme: s }), super.connectedCallback();
}
willUpdate(s) {
if (s.has("theme")) {
const t = this.theme === "dark" ? $.DARK : $.LIGHT;
this.contextController.setContext({ footerTheme: t });
}
}
firstUpdated(s) {
super.firstUpdated(s), this.initializeCCPA();
}
initializeCCPA() {
const t = navigator.globalPrivacyControl ? !1 : this.checkThirdPartyAdsOptOutCookie();
window.GPC_DataSharingOptIn = t, window.onGPCLoaded && typeof window.onGPCLoaded == "function" && window.onGPCLoaded();
}
checkThirdPartyAdsOptOutCookie() {
try {
return this.getCookie("3PAdsOptOut") !== "1";
} catch {
return !0;
}
}
getCookie(s) {
const t = document.cookie.match("(^|;)\\s*" + s + "\\s*=\\s*([^;]+)");
return t ? t[2] : "";
}
render() {
return c`
`;
}
};
Ze([
l({ type: String })
], Yt.prototype, "theme", 2);
Yt = Ze([
f("uhf-footer")
], Yt);
var Dr = Object.getOwnPropertyDescriptor, Ur = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Dr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(r) || r);
return r;
};
let ke = class extends p {
constructor() {
super();
}
render() {
return c`
`;
}
};
ke = Ur([
f("uhf-footer-nav")
], ke);
var Nr = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, ts = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Br(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Nr(t, e, r), r;
};
let Qt = class extends p {
constructor() {
super(), this.title = "";
}
render() {
return c`
`;
}
};
ts([
l({ type: String })
], Qt.prototype, "title", 2);
Qt = ts([
f("uhf-footer-nav-group")
], Qt);
var Mr = Object.getOwnPropertyDescriptor, Rr = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Mr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = n(r) || r);
return r;
};
let Ie = class extends p {
constructor() {
super();
}
firstUpdated() {
var t;
let s = (t = document.getElementById("uhf-Footer_ManageCookies")) == null ? void 0 : t.parentElement;
s && s.classList.add("hidden");
}
render() {
return c`
`;
}
};
Ie = Rr([
f("uhf-footer-menu")
], Ie);
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Hr = { CHILD: 2 }, Fr = (s) => (...t) => ({ _$litDirective$: s, values: t });
class jr {
constructor(t) {
}
get _$AU() {
return this._$AM._$AU;
}
_$AT(t, e, i) {
this._$Ct = t, this._$AM = e, this._$Ci = i;
}
_$AS(t, e) {
return this.update(t, e);
}
update(t, e) {
return this.render(...e);
}
}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
class Xt extends jr {
constructor(t) {
if (super(t), this.it = m, t.type !== Hr.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
}
render(t) {
if (t === m || t == null) return this._t = void 0, this.it = t;
if (t === G) return t;
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
if (t === this.it) return this._t;
this.it = t;
const e = [t];
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
}
}
Xt.directiveName = "unsafeHTML", Xt.resultType = 1;
const De = Fr(Xt);
var Gr = Object.defineProperty, qr = Object.getOwnPropertyDescriptor, yt = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? qr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Gr(t, e, r), r;
};
let st = class extends p {
constructor() {
super(), this.text = "", this.url = "", this.imageUrl = null, this.secondaryText = null, this.onTermClick = (s) => {
this.dispatchEvent(new CustomEvent(I.TERM_CLICKED, {
detail: {
term: s.target.innerText
},
bubbles: !0
}));
};
}
render() {
return this.imageUrl ? c`
${De(this.text)}
${this.secondaryText ? c`${this.secondaryText}` : ""}
` : c`
${De(this.text)}
`;
}
};
yt([
l({ type: String })
], st.prototype, "text", 2);
yt([
l({ type: String })
], st.prototype, "url", 2);
yt([
l({ type: String })
], st.prototype, "imageUrl", 2);
yt([
l({ type: String })
], st.prototype, "secondaryText", 2);
st = yt([
f("uhf-autosuggest-item")
], st);
var Wr = Object.defineProperty, zr = Object.getOwnPropertyDescriptor, at = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? zr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Wr(t, e, r), r;
};
let K = class extends p {
constructor() {
super(!0), this.targetSelector = "", this.positions = "bottom,right,left", this.margin = 15, this.open = !1, this.disableMobilePositioning = !1, this.calculatePosition = () => {
var s, t;
this.open && (this.breakpointController.isMobile && !this.disableMobilePositioning ? (s = this.positionController) == null || s.calculateMobilePosition() : (t = this.positionController) == null || t.calculatePosition());
}, this.breakpointController = new E(this);
}
connectedCallback() {
super.connectedCallback(), this.positionController = new Ys(
this,
this.positions.split(","),
this.targetSelector,
"uhf-popout",
this.margin
), window.addEventListener("resize", this.calculatePosition);
}
disconnectedCallback() {
window.removeEventListener("resize", this.calculatePosition), super.disconnectedCallback();
}
firstUpdated(s) {
this.calculatePosition();
}
updated(s) {
this.open ? (this.classList.remove("hidden"), setTimeout(() => {
this.calculatePosition();
}, 0)) : this.classList.add("hidden");
}
render() {
return c``;
}
};
at([
l({ type: String })
], K.prototype, "targetSelector", 2);
at([
l({ type: String })
], K.prototype, "positions", 2);
at([
l({ type: Number })
], K.prototype, "margin", 2);
at([
l({ type: Boolean })
], K.prototype, "open", 2);
at([
l({ type: Boolean })
], K.prototype, "disableMobilePositioning", 2);
K = at([
f("uhf-popout")
], K);
var Kr = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, Rt = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Vr(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Kr(t, e, r), r;
};
let mt = class extends p {
constructor() {
super(), this.dataM = "", this.extensibleLinks = "", this.signInLabel = "", this.redirectWrapperFocus = (s) => {
const t = s.target;
if (t != null && t.matches('div[role="button"]')) {
const e = t.querySelector("button");
e && e.focus();
}
};
}
connectedCallback() {
super.connectedCallback(), this.dataM = '{"Compnm": "UHF", "view": "UHF", "Pa": "UniversalHeader"}', this.observeRoleButtonTabIndex(), this.addEventListener("focusin", this.redirectWrapperFocus);
}
disconnectedCallback() {
var s, t;
this.removeEventListener("focusin", this.redirectWrapperFocus), (s = this.mutationObserver) == null || s.disconnect(), (t = this.reactRoot) == null || t.unmount(), super.disconnectedCallback();
}
/**
* The @mecontrol/fluent-web library wraps the trigger button in a
* div[role="button"] when the flyout is expanded. This wrapper persists
* after the flyout closes and remains in the tab order, causing an extra
* tab stop on the mecontrol. This observer removes the wrapper from the
* sequential tab order so only the inner