diff --git a/devtools/__chromium_devtools_metrics_reporter.js b/devtools/__chromium_devtools_metrics_reporter.js
new file mode 100644
index 0000000..029f3bb
--- /dev/null
+++ b/devtools/__chromium_devtools_metrics_reporter.js
@@ -0,0 +1,956 @@
+!function() {
+ "use strict";
+ let t = -1;
+ const e = () => t
+ , n = e => {
+ addEventListener("pageshow", n => {
+ n.persisted && (t = n.timeStamp,
+ e(n))
+ }
+ , !0)
+ }
+ , r = (t, e, n, r) => {
+ let i, o;
+ return s => {
+ e.value >= 0 && (s || r) && (o = e.value - (i ?? 0),
+ (o || void 0 === i) && (i = e.value,
+ e.delta = o,
+ e.rating = ( (t, e) => t > e[1] ? "poor" : t > e[0] ? "needs-improvement" : "good")(e.value, n),
+ t(e)))
+ }
+ }
+ , i = t => {
+ requestAnimationFrame( () => requestAnimationFrame( () => t()))
+ }
+ , o = () => {
+ const t = performance.getEntriesByType("navigation")[0];
+ if (t && t.responseStart > 0 && t.responseStart < performance.now())
+ return t
+ }
+ , s = () => {
+ const t = o();
+ return t?.activationStart ?? 0
+ }
+ , a = (t, n=-1) => {
+ const r = o();
+ let i = "navigate";
+ return e() >= 0 ? i = "back-forward-cache" : r && (document.prerendering || s() > 0 ? i = "prerender" : document.wasDiscarded ? i = "restore" : r.type && (i = r.type.replace(/_/g, "-"))),
+ {
+ name: t,
+ value: n,
+ rating: "good",
+ delta: 0,
+ entries: [],
+ id: `v5-${Date.now()}-${Math.floor(8999999999999 * Math.random()) + 1e12}`,
+ navigationType: i
+ }
+ }
+ , c = new WeakMap;
+ function l(t, e) {
+ return c.get(t) || c.set(t, new e),
+ c.get(t)
+ }
+ class u {
+ _onAfterProcessingUnexpectedShift;
+ _sessionValue = 0;
+ _sessionEntries = [];
+ _processEntry(t) {
+ if (t.hadRecentInput)
+ return;
+ const e = this._sessionEntries[0]
+ , n = this._sessionEntries.at(-1);
+ this._sessionValue && e && n && t.startTime - n.startTime < 1e3 && t.startTime - e.startTime < 5e3 ? (this._sessionValue += t.value,
+ this._sessionEntries.push(t)) : (this._sessionValue = t.value,
+ this._sessionEntries = [t]),
+ this._onAfterProcessingUnexpectedShift?.(t)
+ }
+ }
+ const d = (t, e, n={}) => {
+ try {
+ if (PerformanceObserver.supportedEntryTypes.includes(t)) {
+ const r = new PerformanceObserver(t => {
+ Promise.resolve().then( () => {
+ e(t.getEntries())
+ }
+ )
+ }
+ );
+ return r.observe({
+ type: t,
+ buffered: !0,
+ ...n
+ }),
+ r
+ }
+ } catch {}
+ }
+ , m = t => {
+ let e = !1;
+ return () => {
+ e || (t(),
+ e = !0)
+ }
+ }
+ ;
+ let p = -1;
+ const g = new Set
+ , f = () => "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0
+ , h = t => {
+ if ("hidden" === document.visibilityState) {
+ if ("visibilitychange" === t.type)
+ for (const t of g)
+ t();
+ isFinite(p) || (p = "visibilitychange" === t.type ? t.timeStamp : 0,
+ removeEventListener("prerenderingchange", h, !0))
+ }
+ }
+ , y = () => {
+ if (p < 0) {
+ const t = s()
+ , e = document.prerendering ? void 0 : globalThis.performance.getEntriesByType("visibility-state").filter(e => "hidden" === e.name && e.startTime > t)[0]?.startTime;
+ p = e ?? f(),
+ addEventListener("visibilitychange", h, !0),
+ addEventListener("prerenderingchange", h, !0),
+ n( () => {
+ setTimeout( () => {
+ p = f()
+ }
+ )
+ }
+ )
+ }
+ return {
+ get firstHiddenTime() {
+ return p
+ },
+ onHidden(t) {
+ g.add(t)
+ }
+ }
+ }
+ , v = t => {
+ document.prerendering ? addEventListener("prerenderingchange", () => t(), !0) : t()
+ }
+ , T = [1800, 3e3]
+ , _ = (t, e={}) => {
+ v( () => {
+ const o = y();
+ let c, l = a("FCP");
+ const u = d("paint", t => {
+ for (const e of t)
+ "first-contentful-paint" === e.name && (u.disconnect(),
+ e.startTime < o.firstHiddenTime && (l.value = Math.max(e.startTime - s(), 0),
+ l.entries.push(e),
+ c(!0)))
+ }
+ );
+ u && (c = r(t, l, T, e.reportAllChanges),
+ n(n => {
+ l = a("FCP"),
+ c = r(t, l, T, e.reportAllChanges),
+ i( () => {
+ l.value = performance.now() - n.timeStamp,
+ c(!0)
+ }
+ )
+ }
+ ))
+ }
+ )
+ }
+ , E = [.1, .25]
+ , b = (t, e={}) => {
+ const o = y();
+ _(m( () => {
+ let s, c = a("CLS", 0);
+ const m = l(e, u)
+ , p = t => {
+ for (const e of t)
+ m._processEntry(e);
+ m._sessionValue > c.value && (c.value = m._sessionValue,
+ c.entries = m._sessionEntries,
+ s())
+ }
+ , g = d("layout-shift", p);
+ g && (s = r(t, c, E, e.reportAllChanges),
+ o.onHidden( () => {
+ p(g.takeRecords()),
+ s(!0)
+ }
+ ),
+ n( () => {
+ m._sessionValue = 0,
+ c = a("CLS", 0),
+ s = r(t, c, E, e.reportAllChanges),
+ i( () => s())
+ }
+ ),
+ setTimeout(s))
+ }
+ ))
+ }
+ ;
+ let S = 0
+ , L = 1 / 0
+ , I = 0;
+ const P = t => {
+ for (const e of t)
+ e.interactionId && (L = Math.min(L, e.interactionId),
+ I = Math.max(I, e.interactionId),
+ S = I ? (I - L) / 7 + 1 : 0)
+ }
+ ;
+ let D;
+ const C = () => D ? S : performance.interactionCount ?? 0;
+ let M = 0;
+ class w {
+ _longestInteractionList = [];
+ _longestInteractionMap = new Map;
+ _onBeforeProcessingEntry;
+ _onAfterProcessingINPCandidate;
+ _resetInteractions() {
+ M = C(),
+ this._longestInteractionList.length = 0,
+ this._longestInteractionMap.clear()
+ }
+ _estimateP98LongestInteraction() {
+ const t = Math.min(this._longestInteractionList.length - 1, Math.floor((C() - M) / 50));
+ return this._longestInteractionList[t]
+ }
+ _processEntry(t) {
+ if (this._onBeforeProcessingEntry?.(t),
+ !t.interactionId && "first-input" !== t.entryType)
+ return;
+ const e = this._longestInteractionList.at(-1);
+ let n = this._longestInteractionMap.get(t.interactionId);
+ if (n || this._longestInteractionList.length < 10 || t.duration > e._latency) {
+ if (n ? t.duration > n._latency ? (n.entries = [t],
+ n._latency = t.duration) : t.duration === n._latency && t.startTime === n.entries[0].startTime && n.entries.push(t) : (n = {
+ id: t.interactionId,
+ entries: [t],
+ _latency: t.duration
+ },
+ this._longestInteractionMap.set(n.id, n),
+ this._longestInteractionList.push(n)),
+ this._longestInteractionList.sort( (t, e) => e._latency - t._latency),
+ this._longestInteractionList.length > 10) {
+ const t = this._longestInteractionList.splice(10);
+ for (const e of t)
+ this._longestInteractionMap.delete(e.id)
+ }
+ this._onAfterProcessingINPCandidate?.(n)
+ }
+ }
+ }
+ const A = t => {
+ const e = globalThis.requestIdleCallback || setTimeout;
+ "hidden" === document.visibilityState ? t() : (t = m(t),
+ addEventListener("visibilitychange", t, {
+ once: !0,
+ capture: !0
+ }),
+ e( () => {
+ t(),
+ removeEventListener("visibilitychange", t, {
+ capture: !0
+ })
+ }
+ ))
+ }
+ , x = [200, 500]
+ , F = (t, e={}) => {
+ if (!globalThis.PerformanceEventTiming || !("interactionId"in PerformanceEventTiming.prototype))
+ return;
+ const i = y();
+ v( () => {
+ "interactionCount"in performance || D || (D = d("event", P, {
+ type: "event",
+ buffered: !0,
+ durationThreshold: 0
+ }));
+ let o, s = a("INP");
+ const c = l(e, w)
+ , u = t => {
+ A( () => {
+ for (const e of t)
+ c._processEntry(e);
+ const e = c._estimateP98LongestInteraction();
+ e && e._latency !== s.value && (s.value = e._latency,
+ s.entries = e.entries,
+ o())
+ }
+ )
+ }
+ , m = d("event", u, {
+ durationThreshold: e.durationThreshold ?? 40
+ });
+ o = r(t, s, x, e.reportAllChanges),
+ m && (m.observe({
+ type: "first-input",
+ buffered: !0
+ }),
+ i.onHidden( () => {
+ u(m.takeRecords()),
+ o(!0)
+ }
+ ),
+ n( () => {
+ c._resetInteractions(),
+ s = a("INP"),
+ o = r(t, s, x, e.reportAllChanges)
+ }
+ ))
+ }
+ )
+ }
+ ;
+ class B {
+ _onBeforeProcessingEntry;
+ _processEntry(t) {
+ this._onBeforeProcessingEntry?.(t)
+ }
+ }
+ const N = [2500, 4e3]
+ , k = (t, e={}) => {
+ v( () => {
+ const o = y();
+ let c, u = a("LCP");
+ const p = l(e, B)
+ , g = t => {
+ e.reportAllChanges || (t = t.slice(-1));
+ for (const e of t)
+ p._processEntry(e),
+ e.startTime < o.firstHiddenTime && (u.value = Math.max(e.startTime - s(), 0),
+ u.entries = [e],
+ c())
+ }
+ , f = d("largest-contentful-paint", g);
+ if (f) {
+ c = r(t, u, N, e.reportAllChanges);
+ const o = m( () => {
+ g(f.takeRecords()),
+ f.disconnect(),
+ c(!0)
+ }
+ )
+ , s = t => {
+ t.isTrusted && (A(o),
+ removeEventListener(t.type, s, {
+ capture: !0
+ }))
+ }
+ ;
+ for (const t of ["keydown", "click", "visibilitychange"])
+ addEventListener(t, s, {
+ capture: !0
+ });
+ n(n => {
+ u = a("LCP"),
+ c = r(t, u, N, e.reportAllChanges),
+ i( () => {
+ u.value = performance.now() - n.timeStamp,
+ c(!0)
+ }
+ )
+ }
+ )
+ }
+ }
+ )
+ }
+ , O = [800, 1800]
+ , R = t => {
+ document.prerendering ? v( () => R(t)) : "complete" !== document.readyState ? addEventListener("load", () => R(t), !0) : setTimeout(t)
+ }
+ , j = t => {
+ if ("loading" === document.readyState)
+ return "loading";
+ {
+ const e = o();
+ if (e) {
+ if (t < e.domInteractive)
+ return "loading";
+ if (0 === e.domContentLoadedEventStart || t < e.domContentLoadedEventStart)
+ return "dom-interactive";
+ if (0 === e.domComplete || t < e.domComplete)
+ return "dom-content-loaded"
+ }
+ }
+ return "complete"
+ }
+ , W = t => {
+ const e = t.nodeName;
+ return 1 === t.nodeType ? e.toLowerCase() : e.toUpperCase().replace(/^#/, "")
+ }
+ , V = t => {
+ let e = "";
+ try {
+ for (; 9 !== t?.nodeType; ) {
+ const n = t
+ , r = n.id ? "#" + n.id : [W(n), ...Array.from(n.classList).sort()].join(".");
+ if (e.length + r.length > 99)
+ return e || r;
+ if (e = e ? r + ">" + e : r,
+ n.id)
+ break;
+ t = n.parentNode
+ }
+ } catch {}
+ return e
+ }
+ , q = t => t.find(t => 1 === t.node?.nodeType) || t[0];
+ var H = Object.freeze({
+ __proto__: null,
+ CLSThresholds: E,
+ FCPThresholds: T,
+ INPThresholds: x,
+ LCPThresholds: N,
+ TTFBThresholds: O,
+ onCLS: (t, e={}) => {
+ const n = l(e = Object.assign({}, e), u)
+ , r = new WeakMap;
+ n._onAfterProcessingUnexpectedShift = t => {
+ if (t?.sources?.length) {
+ const n = q(t.sources)
+ , i = n?.node;
+ if (i) {
+ const t = e.generateTarget?.(i) ?? V(i);
+ r.set(n, t)
+ }
+ }
+ }
+ ,
+ b(e => {
+ const n = (t => {
+ let e = {};
+ if (t.entries.length) {
+ const n = t.entries.reduce( (t, e) => t.value > e.value ? t : e);
+ if (n?.sources?.length) {
+ const t = q(n.sources);
+ t && (e = {
+ largestShiftTarget: r.get(t),
+ largestShiftTime: n.startTime,
+ largestShiftValue: n.value,
+ largestShiftSource: t,
+ largestShiftEntry: n,
+ loadState: j(n.startTime)
+ })
+ }
+ }
+ return Object.assign(t, {
+ attribution: e
+ })
+ }
+ )(e);
+ t(n)
+ }
+ , e)
+ }
+ ,
+ onFCP: (t, n={}) => {
+ _(n => {
+ const r = (t => {
+ let n = {
+ timeToFirstByte: 0,
+ firstByteToFCP: t.value,
+ loadState: j(e())
+ };
+ if (t.entries.length) {
+ const e = o()
+ , r = t.entries.at(-1);
+ if (e) {
+ const i = e.activationStart || 0
+ , o = Math.max(0, e.responseStart - i);
+ n = {
+ timeToFirstByte: o,
+ firstByteToFCP: t.value - o,
+ loadState: j(t.entries[0].startTime),
+ navigationEntry: e,
+ fcpEntry: r
+ }
+ }
+ }
+ return Object.assign(t, {
+ attribution: n
+ })
+ }
+ )(n);
+ t(r)
+ }
+ , n)
+ }
+ ,
+ onINP: (t, e={}) => {
+ const n = l(e = Object.assign({}, e), w);
+ let r = []
+ , i = []
+ , o = 0;
+ const s = new WeakMap
+ , a = new WeakMap;
+ let c = !1;
+ const u = () => {
+ c || (A(m),
+ c = !0)
+ }
+ , m = () => {
+ const t = n._longestInteractionList.map(t => s.get(t.entries[0]))
+ , e = i.length - 50;
+ i = i.filter( (n, r) => r >= e || t.includes(n));
+ const a = new Set;
+ for (const t of i) {
+ const e = p(t.startTime, t.processingEnd);
+ for (const t of e)
+ a.add(t)
+ }
+ const l = r.length - 1 - 50;
+ r = r.filter( (t, e) => t.startTime > o && e > l || a.has(t)),
+ c = !1
+ }
+ ;
+ n._onBeforeProcessingEntry = t => {
+ !async function(t) {
+ if (!e.onEachInteraction)
+ return;
+ if (await Promise.resolve(),
+ !t.interactionId)
+ return;
+ const n = g({
+ entries: [t],
+ name: "INP",
+ rating: "good",
+ value: t.duration,
+ delta: t.duration,
+ navigationType: "navigate",
+ id: "N/A"
+ });
+ e.onEachInteraction(n)
+ }(t),
+ (t => {
+ const e = t.startTime + t.duration;
+ let n;
+ o = Math.max(o, t.processingEnd);
+ for (let r = i.length - 1; r >= 0; r--) {
+ const o = i[r];
+ if (Math.abs(e - o.renderTime) <= 8) {
+ n = o,
+ n.startTime = Math.min(t.startTime, n.startTime),
+ n.processingStart = Math.min(t.processingStart, n.processingStart),
+ n.processingEnd = Math.max(t.processingEnd, n.processingEnd),
+ n.entries.push(t);
+ break
+ }
+ }
+ n || (n = {
+ startTime: t.startTime,
+ processingStart: t.processingStart,
+ processingEnd: t.processingEnd,
+ renderTime: e,
+ entries: [t]
+ },
+ i.push(n)),
+ (t.interactionId || "first-input" === t.entryType) && s.set(t, n),
+ u()
+ }
+ )(t)
+ }
+ ,
+ n._onAfterProcessingINPCandidate = t => {
+ if (!a.get(t)) {
+ const n = t.entries[0].target;
+ if (n) {
+ const r = e.generateTarget?.(n) ?? V(n);
+ a.set(t, r)
+ }
+ }
+ }
+ ;
+ const p = (t, e) => {
+ const n = [];
+ for (const i of r)
+ if (!(i.startTime + i.duration < t)) {
+ if (i.startTime > e)
+ break;
+ n.push(i)
+ }
+ return n
+ }
+ , g = t => {
+ const e = t.entries[0]
+ , r = s.get(e)
+ , i = e.processingStart
+ , o = Math.max(e.startTime + e.duration, i)
+ , c = Math.min(r.processingEnd, o)
+ , l = r.entries.sort( (t, e) => t.processingStart - e.processingStart)
+ , u = p(e.startTime, c)
+ , d = n._longestInteractionMap.get(e.interactionId)
+ , m = {
+ interactionTarget: a.get(d),
+ interactionType: e.name.startsWith("key") ? "keyboard" : "pointer",
+ interactionTime: e.startTime,
+ nextPaintTime: o,
+ processedEventEntries: l,
+ longAnimationFrameEntries: u,
+ inputDelay: i - e.startTime,
+ processingDuration: c - i,
+ presentationDelay: o - c,
+ loadState: j(e.startTime),
+ longestScript: void 0,
+ totalScriptDuration: void 0,
+ totalStyleAndLayoutDuration: void 0,
+ totalPaintDuration: void 0,
+ totalUnattributedDuration: void 0
+ };
+ return (t => {
+ if (!t.longAnimationFrameEntries?.length)
+ return;
+ const e = t.interactionTime
+ , n = t.inputDelay
+ , r = t.processingDuration;
+ let i, o, s = 0, a = 0, c = 0, l = 0;
+ for (const c of t.longAnimationFrameEntries) {
+ a = a + c.startTime + c.duration - c.styleAndLayoutStart;
+ for (const t of c.scripts) {
+ const c = t.startTime + t.duration;
+ if (c < e)
+ continue;
+ const u = c - Math.max(e, t.startTime)
+ , d = t.duration ? u / t.duration * t.forcedStyleAndLayoutDuration : 0;
+ s += u - d,
+ a += d,
+ u > l && (o = t.startTime < e + n ? "input-delay" : t.startTime >= e + n + r ? "presentation-delay" : "processing-duration",
+ i = t,
+ l = u)
+ }
+ }
+ const u = t.longAnimationFrameEntries.at(-1)
+ , d = u ? u.startTime + u.duration : 0;
+ d >= e + n + r && (c = t.nextPaintTime - d),
+ i && o && (t.longestScript = {
+ entry: i,
+ subpart: o,
+ intersectingDuration: l
+ }),
+ t.totalScriptDuration = s,
+ t.totalStyleAndLayoutDuration = a,
+ t.totalPaintDuration = c,
+ t.totalUnattributedDuration = t.nextPaintTime - e - s - a - c
+ }
+ )(m),
+ Object.assign(t, {
+ attribution: m
+ })
+ }
+ ;
+ d("long-animation-frame", t => {
+ r = r.concat(t),
+ u()
+ }
+ ),
+ F(e => {
+ const n = g(e);
+ t(n)
+ }
+ , e)
+ }
+ ,
+ onLCP: (t, e={}) => {
+ const n = l(e = Object.assign({}, e), B)
+ , r = new WeakMap;
+ n._onBeforeProcessingEntry = t => {
+ const n = t.element;
+ if (n) {
+ const i = e.generateTarget?.(n) ?? V(n);
+ r.set(t, i)
+ }
+ }
+ ,
+ k(e => {
+ const n = (t => {
+ let e = {
+ timeToFirstByte: 0,
+ resourceLoadDelay: 0,
+ resourceLoadDuration: 0,
+ elementRenderDelay: t.value
+ };
+ if (t.entries.length) {
+ const n = o();
+ if (n) {
+ const i = n.activationStart || 0
+ , o = t.entries.at(-1)
+ , s = o.url && performance.getEntriesByType("resource").filter(t => t.name === o.url)[0]
+ , a = Math.max(0, n.responseStart - i)
+ , c = Math.max(a, s ? (s.requestStart || s.startTime) - i : 0)
+ , l = Math.min(t.value, Math.max(c, s ? s.responseEnd - i : 0));
+ e = {
+ target: r.get(o),
+ timeToFirstByte: a,
+ resourceLoadDelay: c - a,
+ resourceLoadDuration: l - c,
+ elementRenderDelay: t.value - l,
+ navigationEntry: n,
+ lcpEntry: o
+ },
+ o.url && (e.url = o.url),
+ s && (e.lcpResourceEntry = s)
+ }
+ }
+ return Object.assign(t, {
+ attribution: e
+ })
+ }
+ )(e);
+ t(n)
+ }
+ , e)
+ }
+ ,
+ onTTFB: (t, e={}) => {
+ ( (t, e={}) => {
+ let i = a("TTFB")
+ , c = r(t, i, O, e.reportAllChanges);
+ R( () => {
+ const l = o();
+ l && (i.value = Math.max(l.responseStart - s(), 0),
+ i.entries = [l],
+ c(!0),
+ n( () => {
+ i = a("TTFB", 0),
+ c = r(t, i, O, e.reportAllChanges),
+ c(!0)
+ }
+ ))
+ }
+ )
+ }
+ )(e => {
+ const n = (t => {
+ let e = {
+ waitingDuration: 0,
+ cacheDuration: 0,
+ dnsDuration: 0,
+ connectionDuration: 0,
+ requestDuration: 0
+ };
+ if (t.entries.length) {
+ const n = t.entries[0]
+ , r = n.activationStart || 0
+ , i = Math.max((n.workerStart || n.fetchStart) - r, 0)
+ , o = Math.max(n.domainLookupStart - r, 0)
+ , s = Math.max(n.connectStart - r, 0)
+ , a = Math.max(n.connectEnd - r, 0);
+ e = {
+ waitingDuration: i,
+ cacheDuration: o - i,
+ dnsDuration: s - o,
+ connectionDuration: a - s,
+ requestDuration: t.value - a,
+ navigationEntry: n
+ }
+ }
+ return Object.assign(t, {
+ attribution: e
+ })
+ }
+ )(e);
+ t(n)
+ }
+ , e)
+ }
+ });
+ var U = Object.freeze({
+ __proto__: null,
+ onEachLayoutShift: function(t) {
+ new PerformanceObserver(e => {
+ const n = e.getEntries().filter(t => "hadRecentInput"in t);
+ for (const e of n) {
+ if (e.hadRecentInput)
+ continue;
+ const n = e.sources.map(t => t.node).filter(t => t instanceof Node);
+ t({
+ attribution: {
+ affectedNodes: n
+ },
+ entry: e,
+ value: e.value
+ })
+ }
+ }
+ ).observe({
+ type: "layout-shift",
+ buffered: !0
+ })
+ }
+ });
+ function $(t) {
+ return `layout-shift-${t.value}-${t.startTime}`
+ }
+ const {onLCP: z, onCLS: G, onINP: J} = H
+ , {onEachLayoutShift: K} = U
+ , Q = []
+ , X = []
+ , Y = []
+ , Z = Window.prototype.addEventListener;
+ Window.prototype.addEventListener = function(...t) {
+ return Q.push(t),
+ Z.call(this, ...t)
+ }
+ ;
+ const tt = Document.prototype.addEventListener;
+ Document.prototype.addEventListener = function(...t) {
+ return X.push(t),
+ tt.call(this, ...t)
+ }
+ ;
+ class et extends PerformanceObserver {
+ constructor(...t) {
+ super(...t),
+ Y.push(this)
+ }
+ }
+ globalThis.PerformanceObserver = et;
+ let nt = !1;
+ function rt(t) {
+ const e = JSON.stringify(t);
+ window.__chromium_devtools_metrics_reporter(e)
+ }
+ window.__chromium_devtools_kill_live_metrics = () => {
+ if (!nt) {
+ for (const t of Y)
+ t.disconnect();
+ for (const t of Q)
+ window.removeEventListener(...t);
+ for (const t of X)
+ document.removeEventListener(...t);
+ nt = !0
+ }
+ }
+ ;
+ const it = [];
+ function ot(t) {
+ const e = it.length;
+ return it.push(new WeakRef(t)),
+ e
+ }
+ function st() {
+ if (document.prerendering)
+ return !0;
+ const t = self.performance.getEntriesByType?.("navigation")[0]?.activationStart;
+ return void 0 !== t && t > 0
+ }
+ window.getNodeForIndex = t => it[t].deref();
+ let at = null;
+ rt({
+ name: "reset"
+ }),
+ new PerformanceObserver(t => {
+ for (const e of t.getEntries())
+ null !== at || st() || (at = "hidden" === e.name)
+ }
+ ).observe({
+ type: "visibility-state",
+ buffered: !0
+ }),
+ n( () => {
+ at = !1,
+ rt({
+ name: "reset"
+ })
+ }
+ ),
+ z(t => {
+ const e = {
+ name: "LCP",
+ value: t.value,
+ startedHidden: Boolean(at),
+ phases: {
+ timeToFirstByte: t.attribution.timeToFirstByte,
+ resourceLoadDelay: t.attribution.resourceLoadDelay,
+ resourceLoadTime: t.attribution.resourceLoadDuration,
+ elementRenderDelay: t.attribution.elementRenderDelay
+ }
+ }
+ , n = t.attribution.lcpEntry?.element;
+ n && (e.nodeIndex = ot(n)),
+ rt(e)
+ }
+ , {
+ reportAllChanges: !0
+ }),
+ G(t => {
+ rt({
+ name: "CLS",
+ value: t.value,
+ clusterShiftIds: t.entries.map($)
+ })
+ }
+ , {
+ reportAllChanges: !0
+ }),
+ J(t => {
+ rt({
+ name: "INP",
+ value: t.value,
+ phases: {
+ inputDelay: t.attribution.inputDelay,
+ processingDuration: t.attribution.processingDuration,
+ presentationDelay: t.attribution.presentationDelay
+ },
+ startTime: t.entries[0].startTime,
+ entryGroupId: t.entries[0].interactionId,
+ interactionType: t.attribution.interactionType
+ })
+ }
+ , {
+ reportAllChanges: !0,
+ durationThreshold: 0,
+ onEachInteraction: function(t) {
+ const e = {
+ name: "InteractionEntry",
+ duration: t.value,
+ phases: {
+ inputDelay: t.attribution.inputDelay,
+ processingDuration: t.attribution.processingDuration,
+ presentationDelay: t.attribution.presentationDelay
+ },
+ startTime: t.entries[0].startTime,
+ entryGroupId: t.entries[0].interactionId,
+ nextPaintTime: t.attribution.nextPaintTime,
+ interactionType: t.attribution.interactionType,
+ eventName: t.entries[0].name,
+ longAnimationFrameEntries: (n = t.attribution.longAnimationFrameEntries.slice(-5).map(t => t.toJSON()),
+ n.map(t => {
+ const e = [];
+ for (const n of t.scripts) {
+ if (e.length < 10) {
+ e.push(n);
+ continue
+ }
+ const t = e.findIndex(t => t.duration < n.duration);
+ -1 !== t && (e[t] = n)
+ }
+ return e.sort( (t, e) => t.startTime - e.startTime),
+ t.scripts = e,
+ t
+ }
+ ))
+ };
+ var n;
+ const r = t.attribution.interactionTarget;
+ r && (e.nodeIndex = Number(r)),
+ rt(e)
+ },
+ generateTarget(t) {
+ if (t)
+ return String(ot(t))
+ }
+ }),
+ K(t => {
+ rt({
+ name: "LayoutShift",
+ score: t.value,
+ uniqueLayoutShiftId: $(t.entry),
+ affectedNodeIndices: t.attribution.affectedNodes.map(ot)
+ })
+ }
+ )
+}();
diff --git a/github/3.css b/github/3.css
new file mode 100644
index 0000000..4436a2d
--- /dev/null
+++ b/github/3.css
@@ -0,0 +1,8146 @@
+performance.mark('js-parse-end:20425-e0dc13f26c8ee149.js');
+'use strict';
+(
+ globalThis.webpackChunk_github_ui_github_ui = globalThis.webpackChunk_github_ui_github_ui ||
+ []
+).push(
+ [['20425'],
+ {
+ 91707(e, t, i) {
+ i.r(t),
+ i.d(t, {
+ Attachment: () => Attachment,
+ default:
+ () => f
+ });
+ let Attachment = class Attachment {
+ constructor(e, t) {
+ this.file = e,
+ this.directory = t,
+ this.state = 'pending',
+ this.id = null,
+ this.href = null,
+ this.name = null,
+ this.percent = 0
+ }
+ static traverse(e, t) {
+ var i,
+ o;
+ return i = e,
+ t &&
+ (o = i).items &&
+ Array.from(o.items).some(
+ e => {
+ let t = e.webkitGetAsEntry &&
+ e.webkitGetAsEntry();
+ return t &&
+ t.isDirectory
+ }
+ ) ? n(
+ '',
+ Array.from(i.items).map(e => e.webkitGetAsEntry()).filter(e => null != e)
+ ) : Promise.resolve(r(Array.from(i.files || [])).map(e => new Attachment(e)))
+ }
+ static from(e) {
+ let t = [];
+ for (let i of e) if (i instanceof File) t.push(new Attachment(i));
+ else if (i instanceof Attachment) t.push(i);
+ else throw Error('Unexpected type');
+ return t
+ }
+ get fullPath() {
+ return this.directory ? `${ this.directory }/${ this.file.name }` : this.file.name
+ }
+ isImage() {
+ return ['image/gif',
+ 'image/png',
+ 'image/jpg',
+ 'image/jpeg',
+ 'image/svg+xml'].indexOf(this.file.type) > - 1
+ }
+ isVideo() {
+ return ['video/mp4',
+ 'video/quicktime'].indexOf(this.file.type) > - 1
+ }
+ saving(e) {
+ if ('pending' !== this.state && 'saving' !== this.state) throw Error(`Unexpected transition from ${ this.state } to saving`);
+ this.state = 'saving',
+ this.percent = e
+ }
+ saved(e) {
+ var t,
+ i,
+ r;
+ if ('pending' !== this.state && 'saving' !== this.state) throw Error(`Unexpected transition from ${ this.state } to saved`);
+ this.state = 'saved',
+ this.id = null != (t = null == e ? void 0 : e.id) ? t : null,
+ this.href = null != (i = null == e ? void 0 : e.href) ? i : null,
+ this.name = null != (r = null == e ? void 0 : e.name) ? r : null
+ }
+ isPending() {
+ return 'pending' === this.state
+ }
+ isSaving() {
+ return 'saving' === this.state
+ }
+ isSaved() {
+ return 'saved' === this.state
+ }
+ };
+ function r(e) {
+ return Array.from(e).filter(e => !e.name.startsWith('.'))
+ }
+ async function n(e, t) {
+ let i = [];
+ for (let o of r(t)) if (o.isDirectory) i.push(
+ ...await n(
+ o.fullPath,
+ await function (e) {
+ return new Promise(
+ function (t, i) {
+ let r = [],
+ n = e.createReader(),
+ o = () => {
+ n.readEntries(e => {
+ e.length > 0 ? (r.push(...e), o()) : t(r)
+ }, i)
+ };
+ o()
+ }
+ )
+ }(o)
+ )
+ );
+ else {
+ let t = await function (e) {
+ return new Promise(function (t, i) {
+ e.file(t, i)
+ })
+ }(o);
+ i.push(new Attachment(t, e))
+ }
+ return i
+ }
+ let FileAttachmentElement = class FileAttachmentElement extends HTMLElement {
+ connectedCallback() {
+ this.addEventListener('dragenter', a),
+ this.addEventListener('dragover', a),
+ this.addEventListener('dragleave', l),
+ this.addEventListener('drop', c),
+ this.addEventListener('paste', d),
+ this.addEventListener('change', u)
+ }
+ disconnectedCallback() {
+ this.removeEventListener('dragenter', a),
+ this.removeEventListener('dragover', a),
+ this.removeEventListener('dragleave', l),
+ this.removeEventListener('drop', c),
+ this.removeEventListener('paste', d),
+ this.removeEventListener('change', u)
+ }
+ get directory() {
+ return this.hasAttribute('directory')
+ }
+ set directory(e) {
+ e ? this.setAttribute('directory', '') : this.removeAttribute('directory')
+ }
+ async attach(e) {
+ let t = e instanceof DataTransfer ? await Attachment.traverse(e, this.directory) : Attachment.from(e);
+ this.dispatchEvent(
+ new CustomEvent(
+ 'file-attachment-accept',
+ {
+ bubbles: !0,
+ cancelable: !0,
+ detail: {
+ attachments: t
+ }
+ }
+ )
+ ) &&
+ t.length &&
+ this.dispatchEvent(
+ new CustomEvent(
+ 'file-attachment-accepted',
+ {
+ bubbles: !0,
+ detail: {
+ attachments: t
+ }
+ }
+ )
+ )
+ }
+ };
+ function o(e) {
+ return Array.from(e.types).indexOf('Files') >= 0
+ }
+ let s = null;
+ function a(e) {
+ let t = e.currentTarget;
+ s &&
+ clearTimeout(s),
+ s = window.setTimeout(() => t.removeAttribute('hover'), 200);
+ let i = e.dataTransfer;
+ i &&
+ o(i) &&
+ (
+ i.dropEffect = 'copy',
+ t.setAttribute('hover', ''),
+ e.preventDefault()
+ )
+ }
+ function l(e) {
+ e.dataTransfer &&
+ (e.dataTransfer.dropEffect = 'none'),
+ e.currentTarget.removeAttribute('hover'),
+ e.stopPropagation(),
+ e.preventDefault()
+ }
+ function c(e) {
+ let t = e.currentTarget;
+ if (!(t instanceof FileAttachmentElement)) return;
+ t.removeAttribute('hover');
+ let i = e.dataTransfer;
+ i &&
+ o(i) &&
+ (t.attach(i), e.stopPropagation(), e.preventDefault())
+ }
+ let h = /^image\/(gif|png|jpeg)$/;
+ function d(e) {
+ if (!e.clipboardData || !e.clipboardData.items) return;
+ let t = e.currentTarget;
+ if (!(t instanceof FileAttachmentElement)) return;
+ let i = function (e) {
+ for (let t of e) if ('file' === t.kind && h.test(t.type)) return t.getAsFile();
+ return null
+ }(e.clipboardData.items);
+ i &&
+ (t.attach([i]), e.preventDefault())
+ }
+ function u(e) {
+ let t = e.currentTarget;
+ if (!(t instanceof FileAttachmentElement)) return;
+ let i = e.target;
+ if (!(i instanceof HTMLInputElement)) return;
+ let r = t.getAttribute('input');
+ if (r && i.id !== r) return;
+ let n = i.files;
+ n &&
+ 0 !== n.length &&
+ (t.attach(n), i.value = '')
+ }
+ window.customElements.get('file-attachment') ||
+ (
+ window.FileAttachmentElement = FileAttachmentElement,
+ window.customElements.define('file-attachment', FileAttachmentElement)
+ );
+ let f = FileAttachmentElement
+ },
+ 70170(e, t, i) {
+ function r(e, t = 0, {
+ start: i = !0,
+ middle: n = !0,
+ once: o = !1
+ }
+ = {}) {
+ let s,
+ a = i,
+ l = 0,
+ c = !1;
+ function h(...r) {
+ if (c) return;
+ let d = Date.now() - l;
+ l = Date.now(),
+ i &&
+ n &&
+ d >= t &&
+ (a = !0),
+ a ? (a = !1, e.apply(this, r), o && h.cancel()) : (n && d < t || !n) &&
+ (
+ clearTimeout(s),
+ s = setTimeout(() => {
+ l = Date.now(),
+ e.apply(this, r),
+ o &&
+ h.cancel()
+ }, n ? t - d : t)
+ )
+ }
+ return h.cancel = () => {
+ clearTimeout(s),
+ c = !0
+ },
+ h
+ }
+ function n(e, t = 0, {
+ start: i = !1,
+ middle: o = !1,
+ once: s = !1
+ }
+ = {}) {
+ return r(e, t, {
+ start: i,
+ middle: o,
+ once: s
+ })
+ }
+ i.d(t, {
+ n: () => r,
+ s: () => n
+ })
+ },
+ 75014(e, t, i) {
+ let r;
+ var n,
+ o,
+ s,
+ a,
+ l,
+ c,
+ h,
+ d,
+ u,
+ f,
+ p,
+ m,
+ g,
+ b,
+ v,
+ w,
+ y,
+ E,
+ A,
+ k,
+ L,
+ T,
+ C,
+ x,
+ S,
+ M,
+ I,
+ P,
+ D,
+ O,
+ R,
+ H,
+ q,
+ F,
+ V,
+ j,
+ N,
+ W,
+ _,
+ $,
+ B,
+ z,
+ K,
+ Y,
+ U,
+ X,
+ G,
+ J,
+ Q,
+ Z,
+ ee,
+ et,
+ ei,
+ er,
+ en,
+ eo,
+ es,
+ ea,
+ el,
+ ec,
+ eh,
+ ed,
+ eu,
+ ef,
+ ep,
+ em,
+ eg,
+ eb,
+ ev,
+ ew,
+ ey,
+ eE,
+ eA,
+ ek,
+ eL,
+ eT,
+ eC,
+ ex,
+ eS,
+ eM,
+ eI,
+ eP,
+ eD,
+ eO,
+ eR,
+ eH,
+ eq,
+ eF,
+ eV,
+ ej,
+ eN,
+ eW,
+ e_,
+ e$,
+ eB,
+ ez,
+ eK,
+ eY,
+ eU,
+ eX,
+ eG,
+ eJ,
+ eQ,
+ eZ,
+ e0,
+ e1,
+ e3,
+ e2,
+ e5,
+ e7,
+ e4,
+ e9,
+ e6,
+ e8,
+ te,
+ tt,
+ ti,
+ tr,
+ tn,
+ to,
+ ts,
+ ta,
+ tl,
+ tc,
+ th,
+ td,
+ tu,
+ tf,
+ tp,
+ tm,
+ tg,
+ tb,
+ tv,
+ tw,
+ ty,
+ tE,
+ tA,
+ tk,
+ tL,
+ tT,
+ tC,
+ tx,
+ tS,
+ tM,
+ tI,
+ tP,
+ tD,
+ tO,
+ tR,
+ tH,
+ tq,
+ tF,
+ tV,
+ tj,
+ tN = i(28078);
+ i(27552);
+ var tW = i(94571),
+ t_ = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ t$ = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let ActionListTruncationObserver = class ActionListTruncationObserver {
+ constructor(e) {
+ this.resizeObserver = new ResizeObserver(
+ e => {
+ for (let t of e) {
+ let e = t.target;
+ e instanceof HTMLElement &&
+ this.update(e)
+ }
+ }
+ ),
+ this.resizeObserver.observe(e)
+ }
+ unobserve(e) {
+ this.resizeObserver.unobserve(e)
+ }
+ update(e) {
+ for (let t of e.querySelectorAll('li')) {
+ let e = t.querySelector('.ActionListItem-label');
+ if (!e) continue;
+ let i = t.querySelector('.ActionListItem-truncationTooltip');
+ i &&
+ (
+ e.scrollWidth > e.clientWidth ? i.style.display = '' : i.style.display = 'none'
+ )
+ }
+ }
+ };
+ let tB = class ActionListElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ a.set(this, void 0)
+ }
+ connectedCallback() {
+ t_(this, a, new ActionListTruncationObserver(this), 'f')
+ }
+ disconnectedCallback() {
+ t$(this, a, 'f').unobserve(this)
+ }
+ };
+ a = new WeakMap,
+ tB = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ }([tW.p_], tB);
+ var tz = i(29941),
+ tK = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ tY = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ tU = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let tX = new IntersectionObserver(
+ e => {
+ for (let t of e) {
+ let e = t.target;
+ t.isIntersecting &&
+ e instanceof tJ &&
+ e.update()
+ }
+ }
+ ),
+ tG = new ResizeObserver(e => {
+ for (let t of e) {
+ let e = t.target;
+ e instanceof tJ &&
+ e.update()
+ }
+ });
+ (n = m || (m = {})) [n.Item = 0] = 'Item',
+ n[n.Divider = 1] = 'Divider';
+ let tJ = class ActionBarElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ l.add(this),
+ c.set(this, null)
+ }
+ connectedCallback() {
+ tG.observe(this),
+ tX.observe(this),
+ requestAnimationFrame(() => {
+ this.style.overflow = 'visible',
+ this.update()
+ })
+ }
+ disconnectedCallback() {
+ tG.unobserve(this),
+ tX.unobserve(this)
+ }
+ menuItemClick(e) {
+ let t = e.currentTarget,
+ i = t?.getAttribute('data-for');
+ i &&
+ document.getElementById(i) ?.click()
+ }
+ update() {
+ let e = tY(this, l, 'a', h);
+ if (!e) return;
+ let t = e.getBoundingClientRect().top,
+ i = null;
+ tY(this, l, 'm', p).call(
+ this,
+ (e, r, n) => {
+ let o = e.getBoundingClientRect().top;
+ return n === m.Item &&
+ (
+ o > t ? (
+ tY(this, l, 'm', u).call(this, r),
+ this.moreMenu.hidden &&
+ (this.moreMenu.hidden = !1),
+ i === m.Divider &&
+ tY(this, l, 'm', u).call(this, r - 1)
+ ) : (
+ tY(this, l, 'm', d).call(this, r),
+ r === this.items.length - 1 &&
+ (this.moreMenu.hidden = !0),
+ i === m.Divider &&
+ tY(this, l, 'm', d).call(this, r - 1)
+ )
+ ),
+ i = n,
+ !0
+ }
+ ),
+ tY(this, c, 'f') &&
+ tY(this, c, 'f').abort(),
+ tU(
+ this,
+ c,
+ (0, tz.zB) (
+ this,
+ {
+ bindKeys: tz.z0.ArrowHorizontal | tz.z0.HomeAndEnd,
+ focusOutBehavior: 'wrap',
+ focusableElementFilter: e => {
+ let t = this.items.indexOf(e.parentElement),
+ i = t > - 1 &&
+ 'visible' === this.items[t].style.visibility,
+ r = e === this.moreMenu.invokerElement &&
+ !this.moreMenu.hidden;
+ return i ||
+ r
+ }
+ }
+ ),
+ 'f'
+ )
+ }
+ };
+ c = new WeakMap,
+ l = new WeakSet,
+ h = function () {
+ let e = null;
+ return tY(this, l, 'm', p).call(this, (t, i, r) => r !== m.Item || (e = t, !1)),
+ e
+ },
+ d = function (e) {
+ let t = this.items[e],
+ i = tY(this, l, 'a', f) [e];
+ t &&
+ i &&
+ (t.style.setProperty('visibility', 'visible'), i.hidden = !0)
+ },
+ u = function (e) {
+ let t = this.items[e],
+ i = tY(this, l, 'a', f) [e];
+ t &&
+ i &&
+ (t.style.setProperty('visibility', 'hidden'), i.hidden = !1)
+ },
+ f = function () {
+ return this.moreMenu.querySelectorAll('[role="menu"] > li')
+ },
+ p = function (e) {
+ for (let t = 0; t < this.items.length; t++) {
+ let i = this.items[t],
+ r = i.classList.contains('ActionBar-divider') ? m.Divider : m.Item;
+ if (!e(i, t, r)) break
+ }
+ },
+ tK([tW.zV], tJ.prototype, 'items', void 0),
+ tK([tW.aC], tJ.prototype, 'itemContainer', void 0),
+ tK([tW.aC], tJ.prototype, 'moreMenu', void 0),
+ tJ = tK([tW.p_], tJ),
+ window.ActionBarElement = tJ,
+ i(60612);
+ var tQ = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ tZ = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let t0 = (
+ () => {
+ let e = new Set,
+ t = null,
+ i = null;
+ function r() {
+ for (let t of e) t.update()
+ }
+ return n => {
+ window.addEventListener('resize', r),
+ window.addEventListener('scroll', r),
+ t ||
+ (
+ t = new IntersectionObserver(
+ t => {
+ for (let i of t) {
+ let t = i.target;
+ i.isIntersecting ? (t.update(), e.add(t)) : e.delete(t)
+ }
+ }
+ )
+ ),
+ i ||
+ (i = new ResizeObserver(() => {
+ for (let t of e) t.update()
+ })),
+ i.observe(n.ownerDocument.documentElement),
+ t.observe(n)
+ }
+ }
+ ) ();
+ let AnchoredPositionElement = class AnchoredPositionElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ g.set(this, null),
+ b.set(this, void 0)
+ }
+ get align() {
+ let e = this.getAttribute('align');
+ return 'center' === e ||
+ 'end' === e ? e : 'start'
+ }
+ set align(e) {
+ this.setAttribute('align', `${ e }`)
+ }
+ get side() {
+ let e = this.getAttribute('side');
+ return 'inside-top' === e ||
+ 'inside-bottom' === e ||
+ 'inside-left' === e ||
+ 'inside-right' === e ||
+ 'inside-center' === e ||
+ 'outside-top' === e ||
+ 'outside-left' === e ||
+ 'outside-right' === e ? e : 'outside-bottom'
+ }
+ set side(e) {
+ this.setAttribute('side', `${ e }`)
+ }
+ get anchorOffset() {
+ let e = this.getAttribute('anchor-offset');
+ return 'spacious' === e ||
+ '8' === e ? 8 : 4
+ }
+ set anchorOffset(e) {
+ this.setAttribute('anchor-offset', `${ e }`)
+ }
+ get anchor() {
+ return this.getAttribute('anchor') ||
+ ''
+ }
+ set anchor(e) {
+ this.setAttribute('anchor', `${ e }`)
+ }
+ get anchorElement() {
+ if (tQ(this, g, 'f')) return tQ(this, g, 'f');
+ let e = this.anchor;
+ return e ? this.ownerDocument.getElementById(e) : null
+ }
+ set anchorElement(e) {
+ tZ(this, g, e, 'f'),
+ tQ(this, g, 'f') ||
+ this.removeAttribute('anchor')
+ }
+ get alignmentOffset() {
+ return Number(this.getAttribute('alignment-offset'))
+ }
+ set alignmentOffset(e) {
+ this.setAttribute('alignment-offset', `${ e }`)
+ }
+ get allowOutOfBounds() {
+ return this.hasAttribute('allow-out-of-bounds')
+ }
+ set allowOutOfBounds(e) {
+ this.toggleAttribute('allow-out-of-bounds', e)
+ }
+ connectedCallback() {
+ this.update(),
+ this.addEventListener('beforetoggle', () => this.update()),
+ t0(this)
+ }
+ attributeChangedCallback() {
+ this.update()
+ }
+ update() {
+ this.isConnected &&
+ (
+ cancelAnimationFrame(tQ(this, b, 'f')),
+ tZ(
+ this,
+ b,
+ requestAnimationFrame(
+ () => {
+ let e = this.anchorElement;
+ if (this.classList.toggle('not-anchored', !e), e) {
+ let {
+ left: t,
+ top: i
+ }
+ = (0, tz.uG) (this, e, this);
+ this.style.top = `${ i }px`,
+ this.style.left = `${ t }px`,
+ this.style.bottom = 'auto',
+ this.style.right = 'auto'
+ } else this.style.top = '0',
+ this.style.left = '0',
+ this.style.bottom = '0',
+ this.style.right = '0'
+ }
+ ),
+ 'f'
+ )
+ )
+ }
+ };
+ g = new WeakMap,
+ b = new WeakMap,
+ AnchoredPositionElement.observedAttributes = [
+ 'align',
+ 'side',
+ 'anchor',
+ 'alignment-offset',
+ 'allow-out-of-bounds'
+ ],
+ customElements.get('anchored-position') ||
+ (
+ window.AnchoredPositionElement = AnchoredPositionElement,
+ customElements.define('anchored-position', AnchoredPositionElement)
+ );
+ var t1 = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ t3 = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ function t2(e) {
+ let t = e.target,
+ i = t?.closest('button');
+ if (
+ !i ||
+ i.hasAttribute('disabled') ||
+ 'true' === i.getAttribute('aria-disabled')
+ ) return;
+ let r = i?.getAttribute('data-show-dialog-id');
+ if (r) {
+ let t = document.getElementById(r);
+ if (t instanceof HTMLDialogElement) {
+ t.showModal(),
+ e.preventDefault();
+ let r = i,
+ n = !1;
+ for (; r; ) (r = r.parentElement?.closest('[popover]:not(:popover-open)')) &&
+ 'auto' === r.popover &&
+ (
+ r.classList.add('dialog-inside-popover-fix'),
+ r.popover = 'manual',
+ r.showPopover(),
+ n = !0
+ );
+ n &&
+ (
+ t.addEventListener('close', e => e.stopImmediatePropagation(), {
+ once: !0
+ }),
+ t.close(),
+ t.showModal(),
+ t.addEventListener(
+ 'close',
+ () => {
+ for (
+ let e of t.ownerDocument.querySelectorAll('.dialog-inside-popover-fix')
+ ) e.contains(t) &&
+ (
+ e.classList.remove('dialog-inside-popover-fix'),
+ e.popover = 'auto',
+ e.showPopover()
+ )
+ },
+ {
+ once: !0
+ }
+ )
+ )
+ }
+ }
+ if (
+ r = i.getAttribute('data-close-dialog-id') ||
+ i.getAttribute('data-submit-dialog-id')
+ ) {
+ let e = document.getElementById(r);
+ e instanceof HTMLDialogElement &&
+ e.open &&
+ e.close()
+ }
+ }
+ let DialogHelperElement = class DialogHelperElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ v.add(this),
+ w.set(this, null)
+ }
+ get dialog() {
+ return this.querySelector('dialog')
+ }
+ connectedCallback() {
+ let {
+ signal: e
+ }
+ = t1(this, w, new AbortController, 'f');
+ document.addEventListener('click', t2, !0),
+ document.addEventListener('click', this, {
+ signal: e
+ }),
+ this.ownerDocument.body.style.setProperty(
+ '--dialog-scrollgutter',
+ `${ window.innerWidth - this.ownerDocument.body.clientWidth }px`
+ ),
+ new MutationObserver(
+ e => {
+ for (let t of e) t.target === this.dialog &&
+ t3(this, v, 'm', y).call(this)
+ }
+ ).observe(this, {
+ subtree: !0,
+ attributeFilter: [
+ 'open'
+ ]
+ }),
+ t3(this, v, 'm', y).call(this)
+ }
+ disconnectedCallback() {
+ t3(this, w, 'f') ?.abort()
+ }
+ handleEvent(e) {
+ let t = e.target,
+ i = this.dialog;
+ if (t !== i || !i?.open || i.querySelector('form')) return;
+ let r = i.getBoundingClientRect();
+ r.top <= e.clientY &&
+ e.clientY <= r.top + r.height &&
+ r.left <= e.clientX &&
+ e.clientX <= r.left + r.width ||
+ i.close()
+ }
+ };
+ w = new WeakMap,
+ v = new WeakSet,
+ y = function () {
+ this.dialog &&
+ this.dialog.matches('[open]:not(:modal)') &&
+ (
+ this.dialog.addEventListener('close', e => e.stopImmediatePropagation(), {
+ once: !0
+ }),
+ this.dialog.close(),
+ this.dialog.showModal()
+ )
+ },
+ window.customElements.get('dialog-helper') ||
+ (
+ window.DialogHelperElement = DialogHelperElement,
+ window.customElements.define('dialog-helper', DialogHelperElement)
+ );
+ var t5 = class extends Event {
+ oldState;
+ newState;
+ constructor(e, {
+ oldState: t = '',
+ newState: i = '',
+ ...r
+ }
+ = {}) {
+ super (e, r),
+ this.oldState = String(t || ''),
+ this.newState = String(i || '')
+ }
+ },
+ t7 = new WeakMap;
+ function t4(e, t, i) {
+ t7.set(
+ e,
+ setTimeout(
+ () => {
+ t7.has(e) &&
+ e.dispatchEvent(new t5('toggle', {
+ cancelable: !1,
+ oldState: t,
+ newState: i
+ }))
+ },
+ 0
+ )
+ )
+ }
+ var t9 = globalThis.ShadowRoot ||
+ function () {
+ },
+ t6 = globalThis.HTMLDialogElement ||
+ function () {
+ },
+ t8 = new WeakMap,
+ ie = new WeakMap,
+ it = new WeakMap;
+ function ii(e) {
+ return it.get(e) ||
+ 'hidden'
+ }
+ var ir = new WeakMap;
+ function io(e, t) {
+ return !(
+ 'auto' !== e.popover &&
+ 'manual' !== e.popover ||
+ !e.isConnected ||
+ t &&
+ 'showing' !== ii(e) ||
+ !t &&
+ 'hidden' !== ii(e) ||
+ e instanceof t6 &&
+ e.hasAttribute('open')
+ ) &&
+ document.fullscreenElement !== e
+ }
+ function is(e) {
+ return e ? Array.from(ie.get(e.ownerDocument) || []).indexOf(e) + 1 : 0
+ }
+ function ia(e) {
+ let t = ie.get(e);
+ for (let e of t || []) if (e.isConnected) return e;
+ else t.delete(e);
+ return null
+ }
+ function il(e) {
+ return 'function' == typeof e.getRootNode ? e.getRootNode() : e.parentNode ? il(e.parentNode) : e
+ }
+ function ic(e) {
+ for (; e; ) {
+ if (
+ e instanceof HTMLElement &&
+ 'auto' === e.popover &&
+ 'showing' === it.get(e)
+ ) return e;
+ if (
+ (e = e instanceof Element && e.assignedSlot || e.parentElement || il(e)) instanceof t9 &&
+ (e = e.host),
+ e instanceof Document
+ ) return
+ }
+ }
+ var ih = new WeakMap;
+ function id(e) {
+ if (!io(e, !1)) return;
+ let t = e.ownerDocument;
+ if (
+ !e.dispatchEvent(
+ new t5(
+ 'beforetoggle',
+ {
+ cancelable: !0,
+ oldState: 'closed',
+ newState: 'open'
+ }
+ )
+ ) ||
+ !io(e, !1)
+ ) return;
+ let i = !1;
+ if ('auto' === e.popover) {
+ let i = e.getAttribute('popover');
+ if (
+ im(
+ function (e) {
+ let t = new Map,
+ i = 0;
+ for (let r of ie.get(e.ownerDocument) || []) t.set(r, i),
+ i += 1;
+ t.set(e, i),
+ i += 1;
+ let r = null;
+ return !function (e) {
+ let i = ic(e);
+ if (null === i) return;
+ let n = t.get(i);
+ (null === r || t.get(r) < n) &&
+ (r = i)
+ }(e.parentElement || il(e)),
+ r
+ }(e) ||
+ t,
+ !1,
+ !0
+ ),
+ i !== e.getAttribute('popover') ||
+ !io(e, !1)
+ ) return
+ }
+ ia(t) ||
+ (i = !0),
+ ih.delete(e);
+ let r = t.activeElement;
+ e.classList.add(':popover-open'),
+ it.set(e, 'showing'),
+ t8.has(t) ||
+ t8.set(t, new Set),
+ t8.get(t).add(e),
+ (
+ function (e) {
+ if (e.shadowRoot && !0 !== e.shadowRoot.delegatesFocus) return null;
+ let t = e;
+ t.shadowRoot &&
+ (t = t.shadowRoot);
+ let i = t.querySelector('[autofocus]');
+ if (i) return i;
+ for (let e of t.querySelectorAll('slot')) for (let t of e.assignedElements({
+ flatten: !0
+ })) if (t.hasAttribute('autofocus')) return t;
+ else if (i = t.querySelector('[autofocus]')) return i;
+ let r = e.ownerDocument.createTreeWalker(t, NodeFilter.SHOW_ELEMENT),
+ n = r.currentNode;
+ for (; n; ) {
+ var o;
+ if (
+ !(
+ (o = n).hidden ||
+ o instanceof t9 ||
+ (
+ o instanceof HTMLButtonElement ||
+ o instanceof HTMLInputElement ||
+ o instanceof HTMLSelectElement ||
+ o instanceof HTMLTextAreaElement ||
+ o instanceof HTMLOptGroupElement ||
+ o instanceof HTMLOptionElement ||
+ o instanceof HTMLFieldSetElement
+ ) &&
+ o.disabled ||
+ o instanceof HTMLInputElement &&
+ 'hidden' === o.type ||
+ o instanceof HTMLAnchorElement &&
+ '' === o.href
+ ) &&
+ 'number' == typeof o.tabIndex &&
+ - 1 !== o.tabIndex
+ ) return n;
+ n = r.nextNode()
+ }
+ }
+ ) (e) ?.focus(),
+ 'auto' === e.popover &&
+ (
+ ie.has(t) ||
+ ie.set(t, new Set),
+ ie.get(t).add(e),
+ iw(ir.get(e), !0)
+ ),
+ i &&
+ r &&
+ 'auto' === e.popover &&
+ ih.set(e, r),
+ t4(e, 'closed', 'open')
+ }
+ function iu(e, t = !1, i = !1) {
+ if (!io(e, !0)) return;
+ let r = e.ownerDocument;
+ if (
+ 'auto' === e.popover &&
+ (im(e, t, i), !io(e, !0)) ||
+ (
+ iw(ir.get(e), !1),
+ ir.delete(e),
+ i &&
+ (
+ e.dispatchEvent(new t5('beforetoggle', {
+ oldState: 'open',
+ newState: 'closed'
+ })),
+ !io(e, !0)
+ )
+ )
+ ) return;
+ t8.get(r) ?.delete (e),
+ ie.get(r) ?.delete (e),
+ e.classList.remove(':popover-open'),
+ it.set(e, 'hidden'),
+ i &&
+ t4(e, 'open', 'closed');
+ let n = ih.get(e);
+ n &&
+ (ih.delete(e), t && n.focus())
+ }
+ function ip(e, t = !1, i = !1) {
+ let r = ia(e);
+ for (; r; ) iu(r, t, i),
+ r = ia(e)
+ }
+ function im(e, t, i) {
+ let r = e.ownerDocument ||
+ e;
+ if (e instanceof Document) return ip(r, t, i);
+ let n = null,
+ o = !1;
+ for (let t of ie.get(r) || []) if (t === e) o = !0;
+ else if (o) {
+ n = t;
+ break
+ }
+ if (!o) return ip(r, t, i);
+ for (; n && 'showing' === ii(n) && ie.get(r) ?.size; ) iu(n, t, i)
+ }
+ var ig = new WeakMap;
+ function ib(e) {
+ let t,
+ i;
+ if (!e.isTrusted) return;
+ let r = e.composedPath() [0];
+ if (!r) return;
+ let n = r.ownerDocument;
+ if (!ia(n)) return;
+ let o = (
+ t = ic(r),
+ i = function (e) {
+ for (; e; ) {
+ let t = e.popoverTargetElement;
+ if (t instanceof HTMLElement) return t;
+ if (
+ (e = e.parentElement || il(e)) instanceof t9 &&
+ (e = e.host),
+ e instanceof Document
+ ) return
+ }
+ }(r),
+ is(t) > is(i) ? t : i
+ );
+ if (o && 'pointerdown' === e.type) ig.set(n, o);
+ else if ('pointerup' === e.type) {
+ let e = ig.get(n) === o;
+ ig.delete(n),
+ e &&
+ im(o || n, !1, !0)
+ }
+ }
+ var iv = new WeakMap;
+ function iw(e, t = !1) {
+ if (!e) return;
+ iv.has(e) ||
+ iv.set(e, e.getAttribute('aria-expanded'));
+ let i = e.popoverTargetElement;
+ if (i instanceof HTMLElement && 'auto' === i.popover) e.setAttribute('aria-expanded', String(t));
+ else {
+ let t = iv.get(e);
+ t ? e.setAttribute('aria-expanded', t) : e.removeAttribute('aria-expanded')
+ }
+ }
+ var iy = globalThis.ShadowRoot ||
+ function () {
+ };
+ function iE(e, t, i) {
+ let r = e[t];
+ Object.defineProperty(e, t, {
+ value(e) {
+ return r.call(this, i(e))
+ }
+ })
+ }
+ var iA = /(^|[^\\]):popover-open\b/g,
+ ik = null;
+ function iL(e) {
+ let t,
+ i = (
+ t = 'function' == typeof globalThis.CSSLayerBlockRule,
+ `
+
+ ${ t ? '@layer popover-polyfill {' : '' }
+ :where([popover]) {
+ position: fixed;
+ z-index: 2147483647;
+ inset: 0;
+ padding: 0.25em;
+ width: fit-content;
+ height: fit-content;
+ border-width: initial;
+ border-color: initial;
+ border-image: initial;
+ border-style: solid;
+ background-color: canvas;
+ color: canvastext;
+ overflow: auto;
+ margin: auto;
+ }
+
+ :where([popover]:not(.\\:popover-open)) {
+ display: none;
+ }
+
+ :where(dialog[popover].\\:popover-open) {
+ display: block;
+ }
+
+ :where(dialog[popover][open]) {
+ display: revert;
+ }
+
+ :where([anchor].\\:popover-open) {
+ inset: auto;
+ }
+
+ :where([anchor]:popover-open) {
+ inset: auto;
+ }
+
+ @supports not (background-color: canvas) {
+ :where([popover]) {
+ background-color: white;
+ color: black;
+ }
+ }
+
+ @supports (width: -moz-fit-content) {
+ :where([popover]) {
+ width: -moz-fit-content;
+ height: -moz-fit-content;
+ }
+ }
+
+ @supports not (inset: 0) {
+ :where([popover]) {
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ }
+ }
+
+ ${ t ? '}' : '' }
+
+ `
+ );
+ if (null === ik) try {
+ (ik = new CSSStyleSheet).replaceSync(i)
+ } catch {
+ ik = !1
+ }
+ if (!1 === ik) {
+ let t = document.createElement('style');
+ t.textContent = i,
+ e instanceof Document ? e.head.prepend(t) : e.prepend(t)
+ } else e.adoptedStyleSheets = [
+ ik,
+ ...e.adoptedStyleSheets
+ ]
+ }
+ 'u' > typeof HTMLElement &&
+ 'object' == typeof HTMLElement.prototype &&
+ 'popover' in HTMLElement.prototype ||
+ function () {
+ var e;
+ if ('u' < typeof window) return;
+ function t(e) {
+ return e?.includes(':popover-open') &&
+ (e = e.replace(iA, '$1.\\:popover-open')),
+ e
+ }
+ window.ToggleEvent = window.ToggleEvent ||
+ t5,
+ iE(Document.prototype, 'querySelector', t),
+ iE(Document.prototype, 'querySelectorAll', t),
+ iE(Element.prototype, 'querySelector', t),
+ iE(Element.prototype, 'querySelectorAll', t),
+ iE(Element.prototype, 'matches', t),
+ iE(Element.prototype, 'closest', t),
+ iE(DocumentFragment.prototype, 'querySelectorAll', t),
+ Object.defineProperties(
+ HTMLElement.prototype,
+ {
+ popover: {
+ enumerable: !0,
+ configurable: !0,
+ get() {
+ if (!this.hasAttribute('popover')) return null;
+ let e = (this.getAttribute('popover') || '').toLowerCase();
+ return '' === e ||
+ 'auto' == e ? 'auto' : 'manual'
+ },
+ set(e) {
+ null === e ? this.removeAttribute('popover') : this.setAttribute('popover', e)
+ }
+ },
+ showPopover: {
+ enumerable: !0,
+ configurable: !0,
+ value() {
+ id(this)
+ }
+ },
+ hidePopover: {
+ enumerable: !0,
+ configurable: !0,
+ value() {
+ iu(this, !0, !0)
+ }
+ },
+ togglePopover: {
+ enumerable: !0,
+ configurable: !0,
+ value(e) {
+ 'showing' === it.get(this) &&
+ void 0 === e ||
+ !1 === e ? iu(this, !0, !0) : (void 0 === e || !0 === e) &&
+ id(this)
+ }
+ }
+ }
+ );
+ let i = Element.prototype.attachShadow;
+ i &&
+ Object.defineProperties(
+ Element.prototype,
+ {
+ attachShadow: {
+ enumerable: !0,
+ configurable: !0,
+ writable: !0,
+ value(e) {
+ let t = i.call(this, e);
+ return iL(t),
+ t
+ }
+ }
+ }
+ );
+ let r = HTMLElement.prototype.attachInternals;
+ r &&
+ Object.defineProperties(
+ HTMLElement.prototype,
+ {
+ attachInternals: {
+ enumerable: !0,
+ configurable: !0,
+ writable: !0,
+ value() {
+ let e = r.call(this);
+ return e.shadowRoot &&
+ iL(e.shadowRoot),
+ e
+ }
+ }
+ }
+ );
+ let n = new WeakMap;
+ function o(e) {
+ Object.defineProperties(
+ e.prototype,
+ {
+ popoverTargetElement: {
+ enumerable: !0,
+ configurable: !0,
+ set(e) {
+ if (null === e) this.removeAttribute('popovertarget'),
+ n.delete(this);
+ else if (e instanceof Element) this.setAttribute('popovertarget', ''),
+ n.set(this, e);
+ else throw TypeError('popoverTargetElement must be an element or null')
+ },
+ get() {
+ if (
+ 'button' !== this.localName &&
+ 'input' !== this.localName ||
+ 'input' === this.localName &&
+ 'reset' !== this.type &&
+ 'image' !== this.type &&
+ 'button' !== this.type ||
+ this.disabled ||
+ this.form &&
+ 'submit' === this.type
+ ) return null;
+ let e = n.get(this);
+ if (e && e.isConnected) return e;
+ if (e && !e.isConnected) return n.delete(this),
+ null;
+ let t = il(this),
+ i = this.getAttribute('popovertarget');
+ return (t instanceof Document || t instanceof iy) &&
+ i &&
+ t.getElementById(i) ||
+ null
+ }
+ },
+ popoverTargetAction: {
+ enumerable: !0,
+ configurable: !0,
+ get() {
+ let e = (this.getAttribute('popovertargetaction') || '').toLowerCase();
+ return 'show' === e ||
+ 'hide' === e ? e : 'toggle'
+ },
+ set(e) {
+ this.setAttribute('popovertargetaction', e)
+ }
+ }
+ }
+ )
+ }
+ o(HTMLButtonElement),
+ o(HTMLInputElement);
+ (e = document).addEventListener(
+ 'click',
+ e => {
+ let t = e.composedPath(),
+ i = t[0];
+ if (!(i instanceof Element) || i?.shadowRoot) return;
+ let r = il(i);
+ if (!(r instanceof iy || r instanceof Document)) return;
+ let n = t.find(e => e.matches?.('[popovertargetaction],[popovertarget]'));
+ if (n) {
+ !function (e) {
+ let t = e.popoverTargetElement;
+ if (!(t instanceof HTMLElement)) return;
+ let i = ii(t);
+ 'show' === e.popoverTargetAction &&
+ 'showing' === i ||
+ ('hide' !== e.popoverTargetAction || 'hidden' !== i) &&
+ ('showing' === i ? iu(t, !0, !0) : io(t, !1) && (ir.set(t, e), id(t)))
+ }(n),
+ e.preventDefault();
+ return
+ }
+ }
+ ),
+ e.addEventListener(
+ 'keydown',
+ e => {
+ let t = e.key,
+ i = e.target;
+ !e.defaultPrevented &&
+ i &&
+ ('Escape' === t || 'Esc' === t) &&
+ im(i.ownerDocument, !0, !0)
+ }
+ ),
+ e.addEventListener('pointerdown', ib),
+ e.addEventListener('pointerup', ib),
+ iL(document)
+ }();
+ var iT = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ iC = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let ix = [
+ '[role="menuitem"]',
+ '[role="menuitemcheckbox"]',
+ '[role="menuitemradio"]',
+ '[role="option"]'
+ ].map(e => `:not([hidden]) > ${ e }`).join(', '),
+ iS = e => e.textContent?.trim() [0].toLowerCase(),
+ iM = /^\S$/;
+ let FocusGroupElement = class FocusGroupElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ E.add(this),
+ A.set(this, null),
+ k.set(this, null)
+ }
+ get nowrap() {
+ return this.hasAttribute('nowrap')
+ }
+ set nowrap(e) {
+ this.toggleAttribute('nowrap', e)
+ }
+ get direction() {
+ return 'horizontal' === this.getAttribute('direction') ? 'horizontal' : 'vertical'
+ }
+ set direction(e) {
+ this.setAttribute('direction', `${ e }`)
+ }
+ get retain() {
+ return this.hasAttribute('retain')
+ }
+ set retain(e) {
+ this.toggleAttribute('retain', e)
+ }
+ get mnemonics() {
+ return this.hasAttribute('mnemonics')
+ }
+ connectedCallback() {
+ iT(this, k, new AbortController, 'f');
+ let {
+ signal: e
+ }
+ = iC(this, k, 'f');
+ this.addEventListener('keydown', this, {
+ signal: e
+ }),
+ this.addEventListener('click', this, {
+ signal: e
+ }),
+ this.addEventListener('mouseover', this, {
+ signal: e
+ }),
+ this.addEventListener('focusin', this, {
+ signal: e
+ })
+ }
+ disconnectedCallback() {
+ iC(this, k, 'f') ?.abort()
+ }
+ handleEvent(e) {
+ let {
+ direction: t,
+ nowrap: i
+ }
+ = this;
+ if ('focusin' === e.type) {
+ if (this.retain && e.target instanceof Element && e.target.matches(ix)) {
+ iC(this, A, 'f') ?.abort();
+ let {
+ signal: t
+ }
+ = iT(this, A, new AbortController, 'f');
+ for (let i of iC(this, E, 'a', L)) {
+ i.setAttribute('tabindex', i === e.target ? '0' : '-1');
+ let r = e.target.closest('[popover]');
+ i === e.target &&
+ r?.popover === 'auto' &&
+ r.closest('focus-group') === this &&
+ r.addEventListener(
+ 'toggle',
+ e => {
+ if (
+ e.target instanceof Element &&
+ 'closed' === e.newState &&
+ (iC(this, A, 'f') ?.abort(), i.setAttribute('tabindex', '-1'), r.id)
+ ) {
+ let e = this.querySelector(`[popovertarget="${ r.id }"]`);
+ e ? e.setAttribute('tabindex', '0') : iC(this, E, 'a', L) [0]?.setAttribute('tabindex', '0')
+ }
+ },
+ {
+ signal: t
+ }
+ )
+ }
+ }
+ } else if (e instanceof KeyboardEvent) {
+ let r = Array.from(iC(this, E, 'a', L)),
+ n = r.indexOf(e.target),
+ o = e.key;
+ if ('Up' === o || 'ArrowUp' === o) ('vertical' === t || 'both' === t) &&
+ (n -= n < 0 ? 0 : 1, e.preventDefault());
+ else if ('Down' === o || 'ArrowDown' === o) ('vertical' === t || 'both' === t) &&
+ (n += 1, e.preventDefault());
+ else if ('Left' === e.key || 'ArrowLeft' === e.key) ('horizontal' === t || 'both' === t) &&
+ (n -= 1, e.preventDefault());
+ else if ('Right' === e.key || 'ArrowRight' === e.key) ('horizontal' === t || 'both' === t) &&
+ (n += 1, e.preventDefault());
+ else if ('Home' === e.key || 'PageUp' === e.key) n = 0,
+ e.preventDefault();
+ else if ('End' === e.key || 'PageDown' === e.key) n = r.length - 1,
+ e.preventDefault();
+ else {
+ if (!(this.mnemonics && iM.test(o))) return;
+ let t = o.toLowerCase(),
+ s = n > 0 &&
+ iS(e.target) === t ? n : 0;
+ (n = r.findIndex((e, i) => i > s && iS(e) === t)) < 0 &&
+ !i &&
+ (n = r.findIndex(e => iS(e) === t))
+ }
+ i &&
+ n < 0 &&
+ (n = 0),
+ !i &&
+ n >= r.length &&
+ (n = 0);
+ let s = r.at(Math.min(n, r.length - 1));
+ {
+ let t = s;
+ do t = t.closest('[popover]:not(:popover-open)'),
+ t?.popover !== 'auto' ||
+ [
+ 'ArrowRight',
+ 'ArrowLeft'
+ ].includes(e.key) ||
+ t.showPopover(),
+ t = t?.parentElement ||
+ null;
+ while (t)
+ }
+ s?.focus()
+ }
+ }
+ };
+ A = new WeakMap,
+ k = new WeakMap,
+ E = new WeakSet,
+ L = function () {
+ return this.querySelectorAll(ix)
+ },
+ customElements.get('focus-group') ||
+ (
+ window.FocusGroupElement = FocusGroupElement,
+ customElements.define('focus-group', FocusGroupElement)
+ );
+ var iI = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ };
+ let iP = class ScrollableRegionElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ this.hasOverflow = !1,
+ this.labelledBy = ''
+ }
+ connectedCallback() {
+ this.style.overflow = 'auto',
+ this.observer = new ResizeObserver(
+ e => {
+ for (let t of e) this.hasOverflow = t.target.scrollHeight > t.target.clientHeight ||
+ t.target.scrollWidth > t.target.clientWidth
+ }
+ ),
+ this.observer.observe(this)
+ }
+ disconnectedCallback() {
+ this.observer.disconnect()
+ }
+ attributeChangedCallback(e) {
+ 'data-has-overflow' === e &&
+ (
+ this.hasOverflow ? (
+ this.setAttribute('aria-labelledby', this.labelledBy),
+ this.setAttribute('role', 'region'),
+ this.setAttribute('tabindex', '0')
+ ) : (
+ this.removeAttribute('aria-labelledby'),
+ this.removeAttribute('role'),
+ this.removeAttribute('tabindex')
+ )
+ )
+ }
+ };
+ iI([tW.CF], iP.prototype, 'hasOverflow', void 0),
+ iI([tW.CF], iP.prototype, 'labelledBy', void 0),
+ iP = iI([tW.p_], iP),
+ window.ScrollableRegionElement = iP,
+ i(80147);
+ var iD = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ iO = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ iR = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let iH = class NavListElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ T.add(this),
+ C.set(this, void 0)
+ }
+ connectedCallback() {
+ this.topLevelList &&
+ iO(
+ this,
+ C,
+ new ActionListTruncationObserver(this.topLevelList),
+ 'f'
+ )
+ }
+ disconnectedCallback() {
+ this.topLevelList &&
+ iR(this, C, 'f').unobserve(this.topLevelList)
+ }
+ selectItemById(e) {
+ if (!e) return !1;
+ let t = iR(this, T, 'm', x).call(this, e);
+ return !!t &&
+ (iR(this, T, 'm', I).call(this, t), !0)
+ }
+ selectItemByHref(e) {
+ if (!e) return !1;
+ let t = iR(this, T, 'm', S).call(this, e);
+ return !!t &&
+ (iR(this, T, 'm', I).call(this, t), !0)
+ }
+ selectItemByCurrentLocation() {
+ let e = iR(this, T, 'm', M).call(this);
+ return !!e &&
+ (iR(this, T, 'm', I).call(this, e), !0)
+ }
+ expandItem(e) {
+ e.nextElementSibling?.removeAttribute('data-hidden'),
+ e.setAttribute('aria-expanded', 'true')
+ }
+ collapseItem(e) {
+ e.nextElementSibling?.setAttribute('data-hidden', ''),
+ e.setAttribute('aria-expanded', 'false'),
+ e.focus()
+ }
+ itemIsExpanded(e) {
+ return e?.tagName === 'A' ||
+ e?.getAttribute('aria-expanded') === 'true'
+ }
+ handleItemWithSubItemClick(e) {
+ let t = e.target;
+ if (!(t instanceof HTMLElement)) return;
+ let i = t.closest('button');
+ i &&
+ (
+ this.itemIsExpanded(i) ? this.collapseItem(i) : this.expandItem(i),
+ e.stopPropagation()
+ )
+ }
+ handleItemWithSubItemKeydown(e) {
+ let t = e.currentTarget;
+ if (!(t instanceof HTMLElement)) return;
+ let i = t.closest('button');
+ if (!i) {
+ let e = t.getAttribute('aria-labelledby');
+ if (!e) return;
+ i = document.getElementById(e)
+ }
+ this.itemIsExpanded(i) &&
+ 'Escape' === e.key &&
+ this.collapseItem(i),
+ e.stopPropagation()
+ }
+ };
+ C = new WeakMap,
+ T = new WeakSet,
+ x = function (e) {
+ for (let t of this.items) if (
+ !t.classList.contains('ActionListItem--hasSubItem') &&
+ (t.getAttribute('data-item-id') ?.split(' ') || []).includes(e)
+ ) return t;
+ return null
+ },
+ S = function (e) {
+ let t = this.querySelector(`.ActionListContent[href="${ e }"]`);
+ return t ? t.closest('.ActionListItem') : null
+ },
+ M = function () {
+ return iR(this, T, 'm', S).call(this, window.location.pathname)
+ },
+ I = function (e) {
+ let t = this.querySelector('.ActionListItem--navActive');
+ t &&
+ iR(this, T, 'm', P).call(this, t),
+ e.classList.add('ActionListItem--navActive'),
+ e.children.length > 0 &&
+ e.children[0].setAttribute('aria-current', 'page');
+ let i = iR(this, T, 'm', D).call(this, e);
+ i &&
+ (
+ this.expandItem(i),
+ i.classList.add('ActionListContent--hasActiveSubItem')
+ )
+ },
+ P = function (e) {
+ e.classList.remove('ActionListItem--navActive'),
+ e.children.length > 0 &&
+ e.children[0].removeAttribute('aria-current');
+ let t = iR(this, T, 'm', D).call(this, e);
+ t &&
+ (
+ this.collapseItem(t),
+ t.classList.remove('ActionListContent--hasActiveSubItem')
+ )
+ },
+ D = function (e) {
+ if (!e.classList.contains('ActionListItem--subItem')) return null;
+ let t = e.closest('li.ActionListItem--hasSubItem') ?.querySelector('button.ActionListContent');
+ return t ||
+ null
+ },
+ iD([tW.zV], iH.prototype, 'items', void 0),
+ iD([tW.aC], iH.prototype, 'topLevelList', void 0),
+ iH = iD([tW.p_], iH);
+ var iq = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ iF = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let iV = class NavListGroupElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ O.add(this),
+ H.set(this, new ActionListTruncationObserver(this))
+ }
+ connectedCallback() {
+ this.setShowMoreItemState()
+ }
+ get showMoreDisabled() {
+ return this.showMoreItem.hasAttribute('aria-disabled')
+ }
+ set showMoreDisabled(e) {
+ e ? this.showMoreItem.setAttribute('aria-disabled', 'true') : this.showMoreItem.removeAttribute('aria-disabled'),
+ this.showMoreItem.classList.toggle('disabled', e)
+ }
+ set currentPage(e) {
+ this.showMoreItem.setAttribute('data-current-page', e.toString())
+ }
+ get currentPage() {
+ return parseInt(this.showMoreItem.getAttribute('data-current-page')) ||
+ 1
+ }
+ get totalPages() {
+ return parseInt(this.showMoreItem.getAttribute('data-total-pages')) ||
+ 1
+ }
+ get paginationSrc() {
+ return this.showMoreItem.getAttribute('src') ||
+ ''
+ }
+ async showMore(e) {
+ let t;
+ if (e.preventDefault(), this.showMoreDisabled) return;
+ this.showMoreDisabled = !0;
+ try {
+ let e = new URL(this.paginationSrc, window.location.origin);
+ this.currentPage++,
+ e.searchParams.append('page', this.currentPage.toString());
+ let i = await fetch(e);
+ if (!i.ok) return;
+ t = await i.text(),
+ this.currentPage === this.totalPages &&
+ (this.showMoreItem.hidden = !0)
+ } catch (e) {
+ this.showMoreDisabled = !1,
+ this.currentPage--;
+ return
+ }
+ let i = iF(this, O, 'm', R).call(this, document, t);
+ i?.querySelector('li > a') ?.setAttribute('data-targets', 'nav-list-group.focusMarkers');
+ let r = e.target.closest('button').getAttribute('data-list-id');
+ document.getElementById(r).append(i),
+ this.focusMarkers.pop() ?.focus(),
+ this.showMoreDisabled = !1
+ }
+ setShowMoreItemState() {
+ this.showMoreItem &&
+ (
+ this.currentPage < this.totalPages ? this.showMoreItem.hidden = !1 : this.showMoreItem.hidden = !0
+ )
+ }
+ };
+ H = new WeakMap,
+ O = new WeakSet,
+ R = function (e, t) {
+ let i = e.createElement('template');
+ return i.innerHTML = t,
+ e.importNode(i.content, !0)
+ },
+ iq([tW.aC], iV.prototype, 'showMoreItem', void 0),
+ iq([tW.zV], iV.prototype, 'focusMarkers', void 0),
+ iV = iq([tW.p_], iV),
+ window.NavListGroupElement = iV;
+ var ij = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ iN = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let iW = class SegmentedControlElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ q.add(this)
+ }
+ connectedCallback() {
+ iN(this, q, 'm', F).call(this)
+ }
+ select(e) {
+ let t = e.currentTarget;
+ for (let e of this.items) e.classList.remove('SegmentedControl-item--selected'),
+ e.querySelector('[aria-current]') ?.setAttribute('aria-current', 'false');
+ t.closest('li.SegmentedControl-item') ?.classList.add('SegmentedControl-item--selected'),
+ t.setAttribute('aria-current', 'true')
+ }
+ };
+ q = new WeakSet,
+ F = function () {
+ for (let e of this.querySelectorAll('.Button-label')) e.setAttribute('data-content', e.textContent || '')
+ },
+ ij([tW.zV], iW.prototype, 'items', void 0),
+ iW = ij([tW.p_], iW),
+ window.customElements.get('segmented-control') ||
+ (
+ window.SegmentedControlElement = iW,
+ window.customElements.define('segmented-control', iW)
+ );
+ var i_ = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ };
+ let i$ = class ToggleSwitchElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ this.turbo = !1,
+ this.toggling = !1
+ }
+ get src() {
+ let e = this.getAttribute('src');
+ if (!e) return null;
+ let t = this.ownerDocument.createElement('a');
+ return t.href = e,
+ t.href
+ }
+ get csrf() {
+ let e = this.querySelector('[data-csrf]');
+ return this.getAttribute('data-csrf') ||
+ e instanceof HTMLInputElement &&
+ e.value ||
+ null
+ }
+ get csrfField() {
+ return this.getAttribute('csrf-field') ||
+ 'authenticity_token'
+ }
+ isRemote() {
+ return null != this.src
+ }
+ async toggle() {
+ if (!this.toggling && (this.toggling = !0, !this.isDisabled())) {
+ if (!this.isRemote()) {
+ this.performToggle(),
+ this.toggling = !1;
+ return
+ }
+ this.performToggle(),
+ this.setLoadingState();
+ try {
+ await this.submitForm()
+ } catch (e) {
+ e instanceof Error &&
+ (
+ this.setErrorState(e.message || 'An error occurred, please try again.'),
+ this.performToggle()
+ );
+ return
+ } finally {
+ this.toggling = !1
+ }
+ this.setSuccessState()
+ }
+ }
+ turnOn() {
+ this.isDisabled() ||
+ (
+ this.switch.setAttribute('aria-pressed', 'true'),
+ this.classList.add('ToggleSwitch--checked')
+ )
+ }
+ turnOff() {
+ this.isDisabled() ||
+ (
+ this.switch.setAttribute('aria-pressed', 'false'),
+ this.classList.remove('ToggleSwitch--checked')
+ )
+ }
+ isOn() {
+ return 'true' === this.switch.getAttribute('aria-pressed')
+ }
+ isOff() {
+ return !this.isOn()
+ }
+ isDisabled() {
+ return null != this.switch.getAttribute('disabled')
+ }
+ disable() {
+ this.switch.setAttribute('disabled', 'disabled')
+ }
+ enable() {
+ this.switch.removeAttribute('disabled')
+ }
+ performToggle() {
+ this.isOn() ? this.turnOff() : this.turnOn()
+ }
+ setLoadingState() {
+ this.errorIcon.setAttribute('hidden', 'hidden'),
+ this.loadingSpinner.removeAttribute('hidden');
+ let e = new CustomEvent('toggleSwitchLoading', {
+ bubbles: !0
+ });
+ this.dispatchEvent(e)
+ }
+ setSuccessState() {
+ let e = new CustomEvent('toggleSwitchSuccess', {
+ bubbles: !0
+ });
+ this.dispatchEvent(e),
+ this.setFinishedState(!1)
+ }
+ setErrorState(e) {
+ let t = new CustomEvent('toggleSwitchError', {
+ bubbles: !0,
+ detail: e
+ });
+ this.dispatchEvent(t),
+ this.setFinishedState(!0)
+ }
+ setFinishedState(e) {
+ e &&
+ this.errorIcon.removeAttribute('hidden'),
+ this.loadingSpinner.setAttribute('hidden', 'hidden')
+ }
+ async submitForm() {
+ let e,
+ t = new FormData;
+ if (
+ this.csrf &&
+ t.append(this.csrfField, this.csrf),
+ t.append('value', this.isOn() ? '1' : '0'),
+ !this.src
+ ) throw Error('invalid src');
+ let i = {
+ 'Requested-With': 'XMLHttpRequest',
+ 'X-Requested-With': 'XMLHttpRequest'
+ };
+ this.turbo &&
+ (i.Accept = 'text/vnd.turbo-stream.html');
+ try {
+ e = await fetch(
+ this.src,
+ {
+ credentials: 'same-origin',
+ method: 'POST',
+ headers: i,
+ body: t
+ }
+ )
+ } catch (e) {
+ throw Error('A network error occurred, please try again.')
+ }
+ if (!e.ok) throw Error(await e.text());
+ let r = e.headers.get('Content-Type');
+ window.Turbo &&
+ this.turbo &&
+ r?.startsWith('text/vnd.turbo-stream.html') &&
+ window.Turbo.renderStreamMessage(await e.text())
+ }
+ };
+ i_([tW.aC], i$.prototype, 'switch', void 0),
+ i_([tW.aC], i$.prototype, 'loadingSpinner', void 0),
+ i_([tW.aC], i$.prototype, 'errorIcon', void 0),
+ i_([tW.CF], i$.prototype, 'turbo', void 0),
+ i$ = i_([tW.p_], i$),
+ window.customElements.get('toggle-switch') ||
+ (
+ window.ToggleSwitchElement = i$,
+ window.customElements.define('toggle-switch', i$)
+ );
+ var iB = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ iz = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let iK = e => r ? e.matches(r) : function (e) {
+ try {
+ return r = ':popover-open',
+ e.matches(r)
+ } catch {
+ try {
+ return r = ':open',
+ e.matches(':open')
+ } catch {
+ return r = '.\\:popover-open',
+ e.matches('.\\:popover-open')
+ }
+ }
+ }(e),
+ iY = 'sr-only',
+ iU = [
+ 'tooltip-n',
+ 'tooltip-s',
+ 'tooltip-e',
+ 'tooltip-w',
+ 'tooltip-ne',
+ 'tooltip-se',
+ 'tooltip-nw',
+ 'tooltip-sw'
+ ];
+ function iX(e) {
+ for (let t of iZ) t !== e &&
+ (iK(t) ? t.hidePopover() : iZ.delete(t))
+ }
+ function iG() {
+ iX()
+ }
+ function iJ(e) {
+ setTimeout(
+ () => {
+ for (let t of iZ) iK(t) &&
+ 'focus' === t.showReason &&
+ t.control !== e.target &&
+ t.hidePopover()
+ },
+ 0
+ )
+ }
+ let iQ = new Set,
+ iZ = new Set;
+ let ToolTipElement = class ToolTipElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ V.add(this),
+ j.set(this, void 0),
+ N.set(this, 'center'),
+ W.set(this, 'outside-bottom'),
+ _.set(this, !1),
+ $.set(this, 'mouse'),
+ B.set(this, !1)
+ }
+ styles() {
+ return `
+ :host {
+ --tooltip-top: var(--tool-tip-position-top, 0);
+ --tooltip-left: var(--tool-tip-position-left, 0);
+ padding: var(--overlay-paddingBlock-condensed) var(--overlay-padding-condensed) !important;
+ font: var(--text-body-shorthand-small);
+ color: var(--tooltip-fgColor, var(--fgColor-onEmphasis)) !important;
+ text-align: center;
+ text-decoration: none;
+ text-shadow: none;
+ text-transform: none;
+ letter-spacing: normal;
+ word-wrap: break-word;
+ white-space: pre;
+ background: var(--tooltip-bgColor, var(--bgColor-emphasis)) !important;
+ border-radius: var(--borderRadius-medium);
+ border: 0 !important;
+ opacity: 0;
+ max-width: var(--overlay-width-small);
+ word-wrap: break-word;
+ white-space: normal;
+ width: max-content !important;
+ inset: var(--tooltip-top) auto auto var(--tooltip-left) !important;
+ overflow: visible !important;
+ text-wrap: balance;
+ }
+
+ :host(:is(.tooltip-n, .tooltip-nw, .tooltip-ne)) {
+ --tooltip-top: calc(var(--tool-tip-position-top, 0) - var(--overlay-offset, 0.25rem));
+ --tooltip-left: var(--tool-tip-position-left);
+ }
+
+ :host(:is(.tooltip-s, .tooltip-sw, .tooltip-se)) {
+ --tooltip-top: calc(var(--tool-tip-position-top, 0) + var(--overlay-offset, 0.25rem));
+ --tooltip-left: var(--tool-tip-position-left);
+ }
+
+ :host(.tooltip-w) {
+ --tooltip-top: var(--tool-tip-position-top);
+ --tooltip-left: calc(var(--tool-tip-position-left, 0) - var(--overlay-offset, 0.25rem));
+ }
+
+ :host(.tooltip-e) {
+ --tooltip-top: var(--tool-tip-position-top);
+ --tooltip-left: calc(var(--tool-tip-position-left, 0) + var(--overlay-offset, 0.25rem));
+ }
+
+ :host:after{
+ position: absolute;
+ display: block;
+ right: 0;
+ left: 0;
+ height: var(--overlay-offset, 0.25rem);
+ content: "";
+ }
+
+ :host(.tooltip-s):after,
+ :host(.tooltip-se):after,
+ :host(.tooltip-sw):after {
+ bottom: 100%
+ }
+
+ :host(.tooltip-n):after,
+ :host(.tooltip-ne):after,
+ :host(.tooltip-nw):after {
+ top: 100%;
+ }
+
+ @keyframes tooltip-appear {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+ }
+
+ :host(:popover-open),
+ :host(:popover-open):before {
+ animation-name: tooltip-appear;
+ animation-duration: .1s;
+ animation-fill-mode: forwards;
+ animation-timing-function: ease-in;
+ }
+
+ :host(.\\:popover-open) {
+ animation-name: tooltip-appear;
+ animation-duration: .1s;
+ animation-fill-mode: forwards;
+ animation-timing-function: ease-in;
+ }
+
+ @media (forced-colors: active) {
+ :host {
+ outline: solid 1px transparent;
+ }
+
+ :host:before {
+ display: none;
+ }
+ }
+
+ `
+ }
+ get showReason() {
+ return iB(this, $, 'f')
+ }
+ get htmlFor() {
+ return this.getAttribute('for') ||
+ ''
+ }
+ set htmlFor(e) {
+ this.setAttribute('for', e)
+ }
+ get type() {
+ return 'label' === this.getAttribute('data-type') ? 'label' : 'description'
+ }
+ set type(e) {
+ this.setAttribute('data-type', e)
+ }
+ get direction() {
+ return this.getAttribute('data-direction') ||
+ 's'
+ }
+ set direction(e) {
+ this.setAttribute('data-direction', e)
+ }
+ get control() {
+ return this.ownerDocument.getElementById(this.htmlFor)
+ }
+ set hiddenFromView(e) {
+ e &&
+ iK(this) ? this.hidePopover() : e ||
+ iK(this) ||
+ this.showPopover()
+ }
+ get hiddenFromView() {
+ return !iK(this)
+ }
+ connectedCallback() {
+ if (
+ iQ.add(this),
+ iB(this, V, 'm', Y).call(this),
+ iB(this, V, 'm', U).call(this),
+ !this.shadowRoot
+ ) {
+ let e = this.attachShadow({
+ mode: 'open'
+ });
+ e.appendChild(document.createElement('style')).textContent = this.styles(),
+ e.appendChild(document.createElement('slot'))
+ }
+ iB(this, V, 'm', z).call(this, !1),
+ iz(this, _, !0, 'f'),
+ iB(this, V, 'm', K).call(this)
+ }
+ disconnectedCallback() {
+ iQ.delete(this),
+ iZ.delete(this),
+ iB(this, j, 'f') ?.abort()
+ }
+ async handleEvent(e) {
+ if (!this.control) return;
+ let t = iK(this);
+ 'beforetoggle' === e.type &&
+ e.currentTarget !== this &&
+ iz(this, B, 'open' === e.newState, 'f');
+ let i = (
+ 'mouseenter' === e.type ||
+ 'focus' === e.type &&
+ (navigator.webdriver || this.control.matches(':focus-visible'))
+ ) &&
+ !iB(this, B, 'f'),
+ r = 'mouseleave' === e.type &&
+ e.relatedTarget !== this.control &&
+ e.relatedTarget !== this,
+ n = 'keydown' === e.type &&
+ 'Escape' === e.key,
+ o = 'mousedown' === e.type &&
+ e.currentTarget === this.control,
+ s = 'beforetoggle' === e.type &&
+ e.currentTarget !== this &&
+ 'open' === e.newState;
+ t &&
+ n &&
+ (e.stopImmediatePropagation(), e.preventDefault()),
+ await Promise.resolve(),
+ t ||
+ !i ||
+ iK(this) ? t &&
+ (r || n || o || s) &&
+ iK(this) &&
+ this.hidePopover() : (
+ iz(this, $, 'mouseenter' === e.type ? 'mouse' : 'focus', 'f'),
+ this.showPopover()
+ ),
+ 'toggle' === e.type &&
+ iB(this, V, 'm', z).call(this, 'open' === e.newState)
+ }
+ attributeChangedCallback(e) {
+ this.isConnected &&
+ (
+ 'for' === e ? iB(this, V, 'm', K).call(this) : 'id' === e ||
+ 'data-type' === e ? iB(this, V, 'm', Y).call(this) : 'data-direction' === e &&
+ iB(this, V, 'm', U).call(this)
+ )
+ }
+ };
+ j = new WeakMap,
+ N = new WeakMap,
+ W = new WeakMap,
+ _ = new WeakMap,
+ $ = new WeakMap,
+ B = new WeakMap,
+ V = new WeakSet,
+ z = function (e) {
+ e ? (
+ iZ.add(this),
+ this.classList.remove(iY),
+ iX(this),
+ iB(this, V, 'm', X).call(this)
+ ) : (
+ iZ.delete(this),
+ this.classList.remove(...iU),
+ this.classList.add(iY)
+ )
+ },
+ K = function () {
+ if (!this.control) return;
+ this.setAttribute('role', 'tooltip'),
+ iB(this, j, 'f') ?.abort(),
+ iz(this, j, new AbortController, 'f');
+ let {
+ signal: e
+ }
+ = iB(this, j, 'f');
+ this.addEventListener('mouseleave', this, {
+ signal: e
+ }),
+ this.addEventListener('toggle', this, {
+ signal: e
+ }),
+ this.control.addEventListener('mouseenter', this, {
+ signal: e
+ }),
+ this.control.addEventListener('mouseleave', this, {
+ signal: e
+ }),
+ this.control.addEventListener('focus', this, {
+ signal: e
+ }),
+ this.control.addEventListener('mousedown', this, {
+ signal: e
+ }),
+ this.control.popoverTargetElement?.addEventListener('beforetoggle', this, {
+ signal: e
+ }),
+ this.ownerDocument.addEventListener('focusout', iG),
+ this.ownerDocument.addEventListener('focusin', iJ),
+ this.ownerDocument.addEventListener('keydown', this, {
+ signal: e,
+ capture: !0
+ })
+ },
+ Y = function () {
+ if (this.id && this.control) if ('label' === this.type) {
+ let e = this.control.getAttribute('aria-labelledby');
+ e = e ? e.split(' ').includes(this.id) ? `${ e }` : `${ e } ${ this.id }` : this.id,
+ this.control.setAttribute('aria-labelledby', e),
+ this.setAttribute('aria-hidden', 'true')
+ } else {
+ let e = this.control.getAttribute('aria-describedby');
+ e = e ? e.split(' ').includes(this.id) ? `${ e }` : `${ e } ${ this.id }` : this.id,
+ this.control.setAttribute('aria-describedby', e)
+ }
+ },
+ U = function () {
+ this.classList.remove(...iU);
+ let e = this.direction;
+ 'n' === e ? (iz(this, N, 'center', 'f'), iz(this, W, 'outside-top', 'f')) : 'ne' === e ? (iz(this, N, 'end', 'f'), iz(this, W, 'outside-top', 'f')) : 'e' === e ? (iz(this, N, 'center', 'f'), iz(this, W, 'outside-right', 'f')) : 'se' === e ? (iz(this, N, 'end', 'f'), iz(this, W, 'outside-bottom', 'f')) : 's' === e ? (iz(this, N, 'center', 'f'), iz(this, W, 'outside-bottom', 'f')) : 'sw' === e ? (iz(this, N, 'start', 'f'), iz(this, W, 'outside-bottom', 'f')) : 'w' === e ? (iz(this, N, 'center', 'f'), iz(this, W, 'outside-left', 'f')) : 'nw' === e &&
+ (iz(this, N, 'start', 'f'), iz(this, W, 'outside-top', 'f'))
+ },
+ X = function () {
+ if (!this.control || !iB(this, _, 'f') || !iK(this)) return;
+ let e = (0, tz.uG) (
+ this,
+ this.control,
+ {
+ side: iB(this, W, 'f'),
+ align: iB(this, N, 'f'),
+ anchorOffset: 0
+ }
+ ),
+ t = e.anchorSide,
+ i = e.anchorAlign;
+ this.style.setProperty('--tool-tip-position-top', `${ e.top }px`),
+ this.style.setProperty('--tool-tip-position-left', `${ e.left }px`);
+ let r = 's';
+ r = 'outside-left' === t ? 'w' : 'outside-right' === t ? 'e' : 'outside-top' === t ? 'center' === i ? 'n' : 'start' === i ? 'ne' : 'nw' : 'center' === i ? 's' : 'start' === i ? 'se' : 'sw',
+ this.classList.add(`tooltip-${ r }`)
+ },
+ ToolTipElement.observedAttributes = [
+ 'data-type',
+ 'data-direction',
+ 'id',
+ 'for'
+ ],
+ window.customElements.get('tool-tip') ||
+ (
+ window.ToolTipElement = ToolTipElement,
+ window.customElements.define('tool-tip', ToolTipElement)
+ );
+ var i0 = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ i1 = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let i3 = class XBannerElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ G.add(this)
+ }
+ dismiss() {
+ if ('remove' === i1(this, G, 'a', J)) {
+ let e = this.parentElement;
+ if (!e) return;
+ e.removeChild(this)
+ } else this.hide();
+ this.dispatchEvent(new CustomEvent('banner:dismiss'))
+ }
+ show() {
+ this.style.setProperty('display', 'initial')
+ }
+ hide() {
+ this.style.setProperty('display', 'none')
+ }
+ };
+ function i2(e) {
+ e.style.display = 'inline-block'
+ }
+ function i5(e) {
+ e.style.display = 'none'
+ }
+ G = new WeakSet,
+ J = function () {
+ return this.getAttribute('data-dismiss-scheme')
+ },
+ i0([tW.aC], i3.prototype, 'titleText', void 0),
+ i3 = i0([tW.p_], i3),
+ window.customElements.get('x-banner') ||
+ (
+ window.XBannerElement = i3,
+ window.customElements.define('x-banner', i3)
+ ),
+ i(53464),
+ i(28528);
+ let i7 = new WeakMap;
+ document.addEventListener(
+ 'clipboard-copy',
+ ({
+ target: e
+ }) => {
+ if (
+ !(e instanceof HTMLElement) ||
+ !e.hasAttribute('data-view-component')
+ ) return;
+ let t = i7.get(e),
+ i = e.parentNode?.querySelector('[data-clipboard-copy-feedback]'),
+ r = 'Copied!';
+ t ? (clearTimeout(t), i7.delete(e)) : (
+ !function (e) {
+ let[t,
+ i] = e.querySelectorAll('.octicon');
+ t &&
+ i &&
+ (i5(t), i2(i))
+ }(e),
+ i &&
+ (i.textContent === r ? i.textContent = `${ r } ` : i.textContent = r)
+ ),
+ i7.set(
+ e,
+ setTimeout(
+ () => {
+ !function (e) {
+ let[t,
+ i] = e.querySelectorAll('.octicon');
+ t &&
+ i &&
+ (i2(t), i5(i))
+ }(e),
+ i7.delete(e)
+ },
+ 2000
+ )
+ )
+ }
+ ),
+ i(24052),
+ i(49728);
+ var i4 = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ };
+ let i9 = class PrimerMultiInputElement extends HTMLElement {
+ activateField(e) {
+ let t = this.findField(e);
+ if (t) {
+ for (let e of this.fields) e !== t &&
+ (
+ e.setAttribute('disabled', 'disabled'),
+ e.setAttribute('hidden', 'hidden'),
+ e.parentElement?.setAttribute('hidden', 'hidden')
+ );
+ t.removeAttribute('disabled'),
+ t.removeAttribute('hidden'),
+ t.parentElement?.removeAttribute('hidden')
+ }
+ }
+ findField(e) {
+ for (let t of this.fields) if (t.getAttribute('data-name') === e) return t;
+ return null
+ }
+ };
+ i4([tW.zV], i9.prototype, 'fields', void 0),
+ i9 = i4([tW.p_], i9),
+ window.customElements.get('primer-multi-input') ||
+ (
+ Object.assign(window, {
+ PrimerMultiInputElement: i9
+ }),
+ window.customElements.define('primer-multi-input', i9)
+ ),
+ i(58466);
+ let CharacterCounter = class CharacterCounter {
+ constructor(e, t, i) {
+ this.inputElement = e,
+ this.characterLimitElement = t,
+ this.characterLimitSrElement = i,
+ this.SCREEN_READER_DELAY = 500,
+ this.announceTimeout = null,
+ this.isInitialLoad = !0
+ }
+ initialize(e) {
+ this.inputElement.addEventListener('keyup', () => this.updateCharacterCount(), e ? {
+ signal: e
+ }
+ : void 0),
+ this.inputElement.addEventListener(
+ 'paste',
+ () => setTimeout(() => this.updateCharacterCount(), 50),
+ e ? {
+ signal: e
+ }
+ : void 0
+ ),
+ this.updateCharacterCount(),
+ this.isInitialLoad = !1
+ }
+ cleanup() {
+ this.announceTimeout &&
+ clearTimeout(this.announceTimeout)
+ }
+ pluralize(e, t) {
+ return 1 === e ? t : `${ t }s`
+ }
+ updateCharacterCount() {
+ if (!this.characterLimitElement) return;
+ let e = this.characterLimitElement.getAttribute('data-max-length');
+ if (!e) return;
+ let t = parseInt(e, 10) - this.inputElement.value.length,
+ i = '';
+ if (t >= 0) {
+ let e = this.pluralize(t, 'character');
+ i = `${ t } ${ e } remaining`;
+ let r = this.characterLimitElement.querySelector('.FormControl-caption-text');
+ r &&
+ (r.textContent = i),
+ this.clearError()
+ } else {
+ let e = - t,
+ r = this.pluralize(e, 'character');
+ i = `${ e } ${ r } over`;
+ let n = this.characterLimitElement.querySelector('.FormControl-caption-text');
+ n &&
+ (n.textContent = i),
+ this.setError()
+ }
+ this.isInitialLoad ||
+ this.announceToScreenReader(i)
+ }
+ announceToScreenReader(e) {
+ this.announceTimeout &&
+ clearTimeout(this.announceTimeout),
+ this.announceTimeout = window.setTimeout(
+ () => {
+ this.characterLimitSrElement &&
+ (this.characterLimitSrElement.textContent = e)
+ },
+ this.SCREEN_READER_DELAY
+ )
+ }
+ setError() {
+ this.inputElement.setAttribute('invalid', 'true'),
+ this.inputElement.setAttribute('aria-invalid', 'true'),
+ this.characterLimitElement.classList.add('fgColor-danger');
+ let e = this.characterLimitElement.querySelector('.FormControl-caption-icon');
+ e &&
+ e.removeAttribute('hidden')
+ }
+ clearError() {
+ this.inputElement.removeAttribute('invalid'),
+ this.inputElement.removeAttribute('aria-invalid'),
+ this.characterLimitElement.classList.remove('fgColor-danger');
+ let e = this.characterLimitElement.querySelector('.FormControl-caption-icon');
+ e &&
+ e.setAttribute('hidden', '')
+ }
+ };
+ var i6 = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ i8 = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ re = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let rt = class PrimerTextFieldElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ Q.set(this, void 0),
+ Z.set(this, null)
+ }
+ connectedCallback() {
+ i8(this, Q, 'f') ?.abort();
+ let {
+ signal: e
+ }
+ = re(this, Q, new AbortController, 'f');
+ this.addEventListener(
+ 'auto-check-success',
+ async e => {
+ let t = await e.detail.response.text();
+ t &&
+ t.length > 0 ? this.setSuccess(t) : this.clearError()
+ },
+ {
+ signal: e
+ }
+ ),
+ this.addEventListener(
+ 'auto-check-error',
+ async e => {
+ let t = await e.detail.response.text();
+ this.setError(t)
+ },
+ {
+ signal: e
+ }
+ ),
+ this.characterLimitElement &&
+ (
+ re(
+ this,
+ Z,
+ new CharacterCounter(
+ this.inputElement,
+ this.characterLimitElement,
+ this.characterLimitSrElement
+ ),
+ 'f'
+ ),
+ i8(this, Z, 'f').initialize(e)
+ )
+ }
+ disconnectedCallback() {
+ i8(this, Q, 'f') ?.abort(),
+ i8(this, Z, 'f') ?.cleanup()
+ }
+ clearContents() {
+ this.inputElement.value = '',
+ this.inputElement.focus(),
+ this.inputElement.dispatchEvent(new Event('input', {
+ bubbles: !0,
+ cancelable: !1
+ }))
+ }
+ clearError() {
+ this.inputElement.removeAttribute('invalid'),
+ this.validationElement.hidden = !0,
+ this.validationMessageElement.replaceChildren()
+ }
+ setValidationMessage(e) {
+ let t = document.createElement('template');
+ t.innerHTML = e;
+ let i = document.importNode(t.content, !0);
+ this.validationMessageElement.replaceChildren(i)
+ }
+ toggleValidationStyling(e) {
+ e ? this.validationElement.classList.remove('FormControl-inlineValidation--success') : this.validationElement.classList.add('FormControl-inlineValidation--success'),
+ this.validationSuccessIcon.hidden = e,
+ this.validationErrorIcon.hidden = !e,
+ this.inputElement.setAttribute('invalid', e ? 'true' : 'false')
+ }
+ setSuccess(e) {
+ this.toggleValidationStyling(!1),
+ this.setValidationMessage(e),
+ this.validationElement.hidden = !1
+ }
+ setError(e) {
+ this.toggleValidationStyling(!0),
+ this.setValidationMessage(e),
+ this.validationElement.hidden = !1
+ }
+ showLeadingSpinner() {
+ this.leadingSpinner?.removeAttribute('hidden'),
+ this.leadingVisual?.setAttribute('hidden', '')
+ }
+ hideLeadingSpinner() {
+ this.leadingSpinner?.setAttribute('hidden', ''),
+ this.leadingVisual?.removeAttribute('hidden')
+ }
+ };
+ Q = new WeakMap,
+ Z = new WeakMap,
+ i6([tW.aC], rt.prototype, 'inputElement', void 0),
+ i6([tW.aC], rt.prototype, 'validationElement', void 0),
+ i6([tW.aC], rt.prototype, 'validationMessageElement', void 0),
+ i6([tW.aC], rt.prototype, 'validationSuccessIcon', void 0),
+ i6([tW.aC], rt.prototype, 'validationErrorIcon', void 0),
+ i6([tW.aC], rt.prototype, 'leadingVisual', void 0),
+ i6([tW.aC], rt.prototype, 'leadingSpinner', void 0),
+ i6([tW.aC], rt.prototype, 'characterLimitElement', void 0),
+ i6([tW.aC], rt.prototype, 'characterLimitSrElement', void 0),
+ rt = i6([tW.p_], rt);
+ var ri = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ rr = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ rn = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let ro = class PrimerTextAreaElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ ee.set(this, null)
+ }
+ connectedCallback() {
+ this.characterLimitElement &&
+ (
+ rr(
+ this,
+ ee,
+ new CharacterCounter(
+ this.inputElement,
+ this.characterLimitElement,
+ this.characterLimitSrElement
+ ),
+ 'f'
+ ),
+ rn(this, ee, 'f').initialize()
+ )
+ }
+ disconnectedCallback() {
+ rn(this, ee, 'f') ?.cleanup()
+ }
+ };
+ ee = new WeakMap,
+ ri([tW.aC], ro.prototype, 'inputElement', void 0),
+ ri([tW.aC], ro.prototype, 'characterLimitElement', void 0),
+ ri([tW.aC], ro.prototype, 'characterLimitSrElement', void 0),
+ ro = ri([tW.p_], ro),
+ window.customElements.get('primer-text-area') ||
+ (
+ Object.assign(window, {
+ PrimerTextAreaElement: ro
+ }),
+ window.customElements.define('primer-text-area', ro)
+ );
+ var rs = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ };
+ let ra = class ToggleSwitchInputElement extends HTMLElement {
+ connectedCallback() {
+ this.addEventListener(
+ 'toggleSwitchError',
+ e => {
+ this.validationMessageElement.textContent = e.detail,
+ this.validationElement.removeAttribute('hidden')
+ }
+ ),
+ this.addEventListener(
+ 'toggleSwitchSuccess',
+ () => {
+ this.validationMessageElement.textContent = '',
+ this.validationElement.setAttribute('hidden', 'hidden')
+ }
+ ),
+ this.addEventListener(
+ 'toggleSwitchLoading',
+ () => {
+ this.validationMessageElement.textContent = '',
+ this.validationElement.setAttribute('hidden', 'hidden')
+ }
+ )
+ }
+ };
+ rs([tW.aC], ra.prototype, 'validationElement', void 0),
+ rs([tW.aC], ra.prototype, 'validationMessageElement', void 0),
+ ra = rs([tW.p_], ra);
+ let rl = (e, t, i) => {
+ if (t()) i();
+ else {
+ let r = new MutationObserver(() => {
+ t() &&
+ (i(), r.disconnect())
+ });
+ r.observe(e, {
+ childList: !0,
+ subtree: !0
+ })
+ }
+ };
+ var rc = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ rh = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ rd = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let ru = [
+ '[role="menuitem"]',
+ '[role="menuitemcheckbox"]',
+ '[role="menuitemradio"]'
+ ],
+ rf = ru.map(e => `:not([hidden]) > ${ e }`),
+ rp = class ActionMenuElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ et.add(this),
+ ei.set(this, void 0),
+ er.set(this, ''),
+ en.set(this, ''),
+ eo.set(this, !1),
+ es.set(this, void 0)
+ }
+ get selectVariant() {
+ return this.getAttribute('data-select-variant')
+ }
+ set selectVariant(e) {
+ e ? this.setAttribute('data-select-variant', e) : this.removeAttribute('variant')
+ }
+ get dynamicLabelPrefix() {
+ let e = this.getAttribute('data-dynamic-label-prefix');
+ return e ? `${ e }:` : ''
+ }
+ set dynamicLabelPrefix(e) {
+ this.setAttribute('data-dynamic-label', e)
+ }
+ get dynamicLabel() {
+ return this.hasAttribute('data-dynamic-label')
+ }
+ set dynamicLabel(e) {
+ this.toggleAttribute('data-dynamic-label', e)
+ }
+ get popoverElement() {
+ return this.invokerElement?.popoverTargetElement ||
+ null
+ }
+ get invokerElement() {
+ let e = this.querySelector('[role=menu]') ?.id;
+ if (!e) return null;
+ for (let t of this.querySelectorAll('[aria-controls]')) if (t.getAttribute('aria-controls') === e) return t;
+ return null
+ }
+ get invokerLabel() {
+ return this.invokerElement ? this.invokerElement.querySelector('.Button-label') : null
+ }
+ get selectedItems() {
+ let e = this.querySelectorAll('[aria-checked=true]'),
+ t = [];
+ for (let i of e) {
+ let e = i.querySelector('.ActionListItem-label');
+ t.push({
+ label: e?.textContent,
+ value: i?.getAttribute('data-value'),
+ element: i
+ })
+ }
+ return t
+ }
+ connectedCallback() {
+ let {
+ signal: e
+ }
+ = rh(this, ei, new AbortController, 'f');
+ this.addEventListener('keydown', this, {
+ signal: e
+ }),
+ this.addEventListener('click', this, {
+ signal: e
+ }),
+ this.addEventListener('mouseover', this, {
+ signal: e
+ }),
+ this.addEventListener('focusout', this, {
+ signal: e
+ }),
+ this.addEventListener('mousedown', this, {
+ signal: e
+ }),
+ this.popoverElement?.addEventListener('toggle', this, {
+ signal: e
+ }),
+ rd(this, et, 'm', ew).call(this),
+ rd(this, et, 'm', ey).call(this),
+ rd(this, et, 'm', ea).call(this),
+ this.includeFragment &&
+ this.includeFragment.addEventListener('include-fragment-replaced', this, {
+ signal: e
+ });
+ let t = () => {
+ rd(this, et, 'm', ev).call(this) &&
+ this.overlay?.update()
+ };
+ rh(
+ this,
+ es,
+ new IntersectionObserver(
+ e => {
+ for (let i of e) i.target === this.invokerElement &&
+ (
+ i.isIntersecting ? window.addEventListener('scroll', t, {
+ capture: !0
+ }) : window.removeEventListener('scroll', t, {
+ capture: !0
+ })
+ )
+ }
+ ),
+ 'f'
+ ),
+ rl(
+ this,
+ () => !!this.invokerElement,
+ () => rd(this, es, 'f').observe(this.invokerElement)
+ ),
+ this.includeFragment ||
+ this.setAttribute('data-ready', 'true')
+ }
+ disconnectedCallback() {
+ rd(this, ei, 'f').abort()
+ }
+ handleEvent(e) {
+ let t = this.invokerElement?.contains(e.target),
+ i = rd(this, et, 'm', eh).call(this, e);
+ if (
+ 'toggle' === e.type &&
+ 'open' === e.newState &&
+ window.requestAnimationFrame(() => {
+ rd(this, et, 'a', eE) ?.focus()
+ }),
+ t &&
+ 'mousedown' === e.type
+ ) return void rh(this, eo, !0, 'f');
+ if ('mousedown' === e.type) return void e.preventDefault();
+ if (t && i) {
+ rd(this, et, 'm', ed).call(this, e),
+ rh(this, eo, !1, 'f');
+ return
+ }
+ if ('focusout' === e.type) {
+ if (rd(this, eo, 'f')) return;
+ requestAnimationFrame(
+ () => {
+ this.contains(document.activeElement) &&
+ document.activeElement !== this.invokerElement ||
+ rd(this, et, 'm', em).call(this)
+ }
+ );
+ return
+ }
+ let r = e.target.closest(rf.join(','));
+ if (null !== r && i) {
+ if (rd(this, et, 'm', el).call(this, e)) return;
+ let t = r.closest('[data-show-dialog-id]');
+ if (t) {
+ let i = this.ownerDocument.getElementById(t.getAttribute('data-show-dialog-id') || '');
+ if (i && this.contains(t)) return void rd(this, et, 'm', eu).call(this, e, i)
+ }
+ rd(this, et, 'm', ec).call(this, e) &&
+ (e.preventDefault(), r.click()),
+ rd(this, et, 'm', ef).call(this, r);
+ return
+ }
+ 'include-fragment-replaced' === e.type &&
+ rd(this, et, 'm', ep).call(this)
+ }
+ get items() {
+ return Array.from(this.querySelectorAll(rf.join(',')))
+ }
+ getItemById(e) {
+ return this.querySelector(`li[data-item-id="${ e }"`)
+ }
+ isItemDisabled(e) {
+ return !!e &&
+ e.classList.contains('ActionListItem--disabled')
+ }
+ disableItem(e) {
+ e &&
+ (
+ e.classList.add('ActionListItem--disabled'),
+ e.querySelector('.ActionListContent').setAttribute('aria-disabled', 'true')
+ )
+ }
+ enableItem(e) {
+ e &&
+ (
+ e.classList.remove('ActionListItem--disabled'),
+ e.querySelector('.ActionListContent').removeAttribute('aria-disabled')
+ )
+ }
+ isItemHidden(e) {
+ return !!e &&
+ e.hasAttribute('hidden')
+ }
+ hideItem(e) {
+ e &&
+ e.setAttribute('hidden', 'hidden')
+ }
+ showItem(e) {
+ e &&
+ e.removeAttribute('hidden')
+ }
+ isItemChecked(e) {
+ return !!e &&
+ 'true' === e.querySelector('.ActionListContent').getAttribute('aria-checked')
+ }
+ checkItem(e) {
+ if (
+ e &&
+ (
+ 'single' === this.selectVariant ||
+ 'multiple' === this.selectVariant
+ )
+ ) {
+ let t = e.querySelector('.ActionListContent');
+ 'true' !== t.getAttribute('aria-checked') &&
+ rd(this, et, 'm', ef).call(this, t)
+ }
+ }
+ uncheckItem(e) {
+ if (
+ e &&
+ (
+ 'single' === this.selectVariant ||
+ 'multiple' === this.selectVariant
+ )
+ ) {
+ let t = e.querySelector('.ActionListContent');
+ 'true' === t.getAttribute('aria-checked') &&
+ rd(this, et, 'm', ef).call(this, t)
+ }
+ }
+ };
+ ei = new WeakMap,
+ er = new WeakMap,
+ en = new WeakMap,
+ eo = new WeakMap,
+ es = new WeakMap,
+ et = new WeakSet,
+ ea = function () {
+ let {
+ signal: e
+ }
+ = rd(this, ei, 'f');
+ for (let t of this.querySelectorAll(ru.join(','))) t.addEventListener('click', rd(this, et, 'm', el).bind(this), {
+ signal: e
+ }),
+ t.addEventListener('keydown', rd(this, et, 'm', el).bind(this), {
+ signal: e
+ })
+ },
+ el = function (e) {
+ if (!rd(this, et, 'm', eh).call(this, e)) return !1;
+ let t = e.target.closest(rf.join(','));
+ return !!t &&
+ !!t.getAttribute('aria-disabled') &&
+ (
+ e.preventDefault(),
+ e.stopPropagation(),
+ e.stopImmediatePropagation(),
+ !0
+ )
+ },
+ ec = function (e) {
+ return e.target instanceof HTMLAnchorElement &&
+ e instanceof KeyboardEvent &&
+ 'keydown' === e.type &&
+ !(e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) &&
+ ' ' === e.key
+ },
+ eh = function (e) {
+ return e instanceof MouseEvent &&
+ 'click' === e.type ||
+ rd(this, et, 'm', ec).call(this, e)
+ },
+ ed = function (e) {
+ e.preventDefault(),
+ e.stopPropagation(),
+ rd(this, et, 'm', ev).call(this) ? rd(this, et, 'm', eb).call(this) : rd(this, et, 'm', eg).call(this)
+ },
+ eu = function (e, t) {
+ this.contains(t) &&
+ (this.querySelector('.ActionListWrap').style.display = 'none');
+ let i = new AbortController,
+ {
+ signal: r
+ }
+ = i,
+ n = () => {
+ i.abort(),
+ this.contains(t) &&
+ (
+ this.querySelector('.ActionListWrap').style.display = '',
+ rd(this, et, 'm', ev).call(this) &&
+ rd(this, et, 'm', eb).call(this)
+ );
+ let e = this.ownerDocument.activeElement,
+ r = this.ownerDocument.activeElement === this.ownerDocument.body,
+ n = this.contains(e),
+ o = t.contains(e);
+ (r || n || o) &&
+ setTimeout(
+ () => {
+ let t = this.ownerDocument.activeElement;
+ (t === e || t === this.ownerDocument.body) &&
+ this.invokerElement?.focus()
+ },
+ 0
+ )
+ };
+ t.addEventListener('close', n, {
+ signal: r
+ }),
+ t.addEventListener('cancel', n, {
+ signal: r
+ })
+ },
+ ef = function (e) {
+ if (
+ 'multiple' !== this.selectVariant &&
+ setTimeout(
+ () => {
+ rd(this, et, 'm', ev).call(this) &&
+ rd(this, et, 'm', eb).call(this)
+ }
+ ),
+ 'multiple' !== this.selectVariant &&
+ 'single' !== this.selectVariant
+ ) return;
+ let t = 'true' !== e.getAttribute('aria-checked');
+ if ('single' === this.selectVariant) {
+ for (
+ let i of (
+ t &&
+ e.setAttribute('aria-checked', 'true'),
+ this.querySelectorAll('[aria-checked]')
+ )
+ ) i !== e &&
+ i.setAttribute('aria-checked', 'false');
+ rd(this, et, 'm', ew).call(this)
+ } else e.setAttribute('aria-checked', `${ t }`);
+ rd(this, et, 'm', ey).call(this),
+ this.dispatchEvent(
+ new CustomEvent(
+ 'itemActivated',
+ {
+ bubbles: !0,
+ detail: {
+ item: e.parentElement,
+ checked: this.isItemChecked(e.parentElement)
+ }
+ }
+ )
+ )
+ },
+ ep = function () {
+ rd(this, et, 'a', eE) ?.focus(),
+ rd(this, et, 'm', ea).call(this),
+ this.setAttribute('data-ready', 'true')
+ },
+ em = function () {
+ rd(this, et, 'm', eb).call(this)
+ },
+ eg = function () {
+ this.popoverElement?.showPopover()
+ },
+ eb = function () {
+ this.popoverElement?.hidePopover()
+ },
+ ev = function () {
+ return this.popoverElement?.matches(':popover-open')
+ },
+ ew = function () {
+ if ('single' !== this.selectVariant || !this.dynamicLabel) return;
+ let e = this.invokerLabel;
+ if (!e) return;
+ rh(this, er, rd(this, er, 'f') || e.textContent || '', 'f');
+ let t = this.querySelector('[aria-checked=true] .ActionListItem-label');
+ if (t && this.dynamicLabel) {
+ let i = document.createElement('span');
+ i.classList.add('color-fg-muted');
+ let r = document.createElement('span');
+ i.textContent = this.dynamicLabelPrefix,
+ r.textContent = t.textContent ||
+ '',
+ e.replaceChildren(i, r)
+ } else e.textContent = rd(this, er, 'f')
+ },
+ ey = function () {
+ if ('single' === this.selectVariant) {
+ let e = this.querySelector('[data-list-inputs=true] input');
+ if (!e) return;
+ let t = this.selectedItems[0];
+ t ? (
+ e.value = (t.value || t.label || '').trim(),
+ e.removeAttribute('disabled')
+ ) : e.setAttribute('disabled', 'disabled')
+ } else if ('none' !== this.selectVariant) {
+ let e = this.querySelector('[data-list-inputs=true]');
+ if (!e) return;
+ let t = e.querySelectorAll('input');
+ for (
+ let i of (
+ t.length > 0 &&
+ rh(this, en, rd(this, en, 'f') || t[0].name, 'f'),
+ this.selectedItems
+ )
+ ) {
+ let t = document.createElement('input');
+ t.setAttribute('data-list-input', 'true'),
+ t.type = 'hidden',
+ t.autocomplete = 'off',
+ t.name = rd(this, en, 'f'),
+ t.value = (i.value || i.label || '').trim(),
+ e.append(t)
+ }
+ for (let e of t) e.remove()
+ }
+ },
+ eE = function () {
+ return this.querySelector(rf.join(','))
+ },
+ rc([tW.aC], rp.prototype, 'includeFragment', void 0),
+ rc([tW.aC], rp.prototype, 'overlay', void 0),
+ rp = rc([tW.p_], rp),
+ window.customElements.get('action-menu') ||
+ (
+ window.ActionMenuElement = rp,
+ window.customElements.define('action-menu', rp)
+ );
+ let rm = 'less',
+ rg = 'equal',
+ rb = 'greater';
+ var rv = e => {
+ throw TypeError(e)
+ },
+ rw = (e, t, i) => t.has(e) ||
+ rv('Cannot ' + i),
+ ry = (e, t, i) => (rw(e, t, 'read from private field'), i ? i.call(e) : t.get(e)),
+ rE = (e, t, i) => t.has(e) ? rv('Cannot add the same private member more than once') : t instanceof WeakSet ? t.add(e) : t.set(e, i),
+ rA = (e, t, i, r) => (rw(e, t, 'write to private field'), t.set(e, i), i),
+ rk = (e, t, i) => (rw(e, t, 'access private method'), i);
+ let MinHeap = class MinHeap {
+ constructor({
+ compareFn: e
+ }) {
+ rE(this, eL),
+ rE(this, eA),
+ rE(this, ek),
+ rA(this, eA, e),
+ rA(this, ek, [])
+ }
+ insert(e) {
+ ry(this, ek).push(e),
+ rk(this, eL, eC).call(this)
+ }
+ pop() {
+ let e = ry(this, ek) [0];
+ return ry(this, ek) [ry(this, ek).length - 1] &&
+ (
+ ry(this, ek) [0] = ry(this, ek) [ry(this, ek).length - 1],
+ ry(this, ek).pop()
+ ),
+ rk(this, eL, eT).call(this),
+ e
+ }
+ peek() {
+ return ry(this, ek) [0]
+ }
+ delete (e) {
+ let t = ry(this, ek).indexOf(e);
+ - 1 !== t &&
+ (
+ rT(ry(this, ek), t, ry(this, ek).length - 1),
+ ry(this, ek).pop(),
+ rk(this, eL, eT).call(this)
+ )
+ }
+ clear() {
+ rA(this, ek, [])
+ }
+ get size() {
+ return ry(this, ek).length
+ }
+ };
+ function rL(e) {
+ return Math.floor((e - 1) / 2)
+ }
+ function rT(e, t, i) {
+ let r = e[t];
+ e[t] = e[i],
+ e[i] = r
+ }
+ eA = new WeakMap,
+ ek = new WeakMap,
+ eL = new WeakSet,
+ eT = function () {
+ let e = 0;
+ for (; 2 * e + 1 < ry(this, ek).length; ) {
+ var t,
+ i;
+ let r = 2 * e + 1;
+ if (
+ 2 * e + 2 < ry(this, ek).length &&
+ ry(this, eA).call(this, (t = ry(this, ek), t[2 * e + 2]), (i = ry(this, ek), i[2 * e + 1])) === rm &&
+ (r = 2 * e + 2),
+ ry(this, eA).call(this, ry(this, ek) [e], ry(this, ek) [r]) === rm
+ ) break;
+ rT(ry(this, ek), e, r),
+ e = r
+ }
+ },
+ eC = function () {
+ var e;
+ let t = ry(this, ek).length - 1;
+ for (
+ ;
+ t > 0 &&
+ ry(this, eA).call(this, ry(this, ek) [t], (e = ry(this, ek), e[rL(t)])) === rm;
+ ) rT(ry(this, ek), t, rL(t)),
+ t = rL(t)
+ };
+ var rC = Object.defineProperty,
+ rx = e => {
+ throw TypeError(e)
+ },
+ rS = (e, t, i) => t.has(e) ||
+ rx('Cannot ' + i),
+ rM = (e, t, i) => (rS(e, t, 'read from private field'), i ? i.call(e) : t.get(e)),
+ rI = (e, t, i) => t.has(e) ? rx('Cannot add the same private member more than once') : t instanceof WeakSet ? t.add(e) : t.set(e, i),
+ rP = (e, t, i, r) => (rS(e, t, 'write to private field'), t.set(e, i), i);
+ ex = Symbol.toStringTag;
+ let Deferred = class Deferred {
+ constructor() {
+ (
+ (e, t, i) => {
+ let r;
+ return (r = 'symbol' != typeof t ? t + '' : t) in e ? rC(e, r, {
+ enumerable: !0,
+ configurable: !0,
+ writable: !0,
+ value: i
+ }) : e[r] = i
+ }
+ ) (this, ex, 'Deferred'),
+ rI(this, eS),
+ rI(this, eM),
+ rI(this, eI),
+ rP(this, eS, new Promise((e, t) => {
+ rP(this, eM, e),
+ rP(this, eI, t)
+ }))
+ }
+ then(e, t) {
+ return Promise.prototype.then.apply(rM(this, eS), [
+ e,
+ t
+ ])
+ } catch (e) {
+ return Promise.prototype.catch.apply(rM(this, eS), [
+ e
+ ])
+ } finally (e) {
+ return Promise.prototype.finally.apply(rM(this, eS), [
+ e
+ ])
+ }
+ resolve(e) {
+ rM(this, eM).call(this, e)
+ }
+ reject(e) {
+ rM(this, eI).call(this, e)
+ }
+ getPromise() {
+ return rM(this, eS)
+ }
+ };
+ eS = new WeakMap,
+ eM = new WeakMap,
+ eI = new WeakMap;
+ var rD = e => {
+ throw TypeError(e)
+ },
+ rO = (e, t, i) => t.has(e) ||
+ rD('Cannot ' + i),
+ rR = (e, t, i) => (rO(e, t, 'read from private field'), i ? i.call(e) : t.get(e)),
+ rH = (e, t, i) => t.has(e) ? rD('Cannot add the same private member more than once') : t instanceof WeakSet ? t.add(e) : t.set(e, i),
+ rq = (e, t, i, r) => (rO(e, t, 'write to private field'), t.set(e, i), i),
+ rF = (e, t, i) => (rO(e, t, 'access private method'), i);
+ let LiveRegionElement = class LiveRegionElement extends HTMLElement {
+ constructor() {
+ if (
+ super (),
+ rH(this, eR),
+ rH(this, eP),
+ rH(this, eD),
+ rH(this, eO),
+ !this.shadowRoot
+ ) {
+ const e = (
+ rV ||
+ ((rV = document.createElement('template')).innerHTML = rj),
+ rV
+ );
+ this.attachShadow({
+ mode: 'open'
+ }).appendChild(e.content.cloneNode(!0))
+ }
+ rq(this, eP, !1),
+ rq(this, eO, null),
+ rq(this, eD, new MinHeap({
+ compareFn: rN
+ }))
+ }
+ get delay() {
+ let e = this.getAttribute('delay');
+ return e ? parseInt(e, 10) : 150
+ }
+ set delay(e) {
+ this.setAttribute('delay', `${ e }`)
+ }
+ announce(e, t = {}) {
+ let {
+ delayMs: i,
+ politeness: r = 'polite'
+ }
+ = t,
+ n = Date.now(),
+ o = new Deferred,
+ s = {
+ deferred: o,
+ politeness: r,
+ contents: e,
+ scheduled: void 0 !== i ? n + i : n
+ };
+ return rR(this, eD).insert(s),
+ rF(this, eR, eH).call(this),
+ {
+ ...o.getPromise(),
+ cancel: () => {
+ rR(this, eD).delete(s),
+ o.resolve()
+ }
+ }
+ }
+ announceFromElement(e, t) {
+ var i;
+ let r,
+ n = (
+ r = '',
+ (i = e).hasAttribute('aria-label') ? r = i.getAttribute('aria-label') : i.innerText ? r = i.innerText : i.textContent &&
+ (r = i.textContent),
+ r ? r.trim() : ''
+ );
+ return '' !== n ? this.announce(n, t) : {
+ ...Promise.resolve(),
+ cancel: rW
+ }
+ }
+ getMessage(e = 'polite') {
+ let t = this.shadowRoot?.getElementById(e);
+ if (!t) throw Error('Unable to find container for message');
+ return t.textContent
+ }
+ clear() {
+ null !== rR(this, eO) &&
+ (clearTimeout(rR(this, eO)), rq(this, eO, null)),
+ rq(this, eP, !1),
+ rR(this, eD).clear()
+ }
+ };
+ eP = new WeakMap,
+ eD = new WeakMap,
+ eO = new WeakMap,
+ eR = new WeakSet,
+ eH = function () {
+ if (rR(this, eP)) return;
+ let e = rR(this, eD).peek();
+ if (!e) return;
+ null !== rR(this, eO) &&
+ (clearTimeout(rR(this, eO)), rq(this, eO, null));
+ let t = Date.now();
+ if (e.scheduled <= t) {
+ (e = rR(this, eD).pop()) &&
+ rF(this, eR, eq).call(this, e),
+ rF(this, eR, eH).call(this);
+ return
+ }
+ let i = e.scheduled - t;
+ rq(
+ this,
+ eO,
+ window.setTimeout(() => {
+ rq(this, eO, null),
+ rF(this, eR, eH).call(this)
+ }, i)
+ )
+ },
+ eq = function (e) {
+ rq(this, eP, !0);
+ let {
+ contents: t,
+ deferred: i,
+ politeness: r
+ }
+ = e,
+ n = this.shadowRoot?.getElementById(r);
+ if (!n) throw rq(this, eP, !1),
+ Error(
+ `Unable to find container for message. Expected a container with id="${ r }"`
+ );
+ n.textContent === t ? n.textContent = `${ t } ` : n.textContent = t,
+ null !== rR(this, eO) &&
+ clearTimeout(rR(this, eO)),
+ i.resolve(),
+ this.delay > 0 ? rq(
+ this,
+ eO,
+ window.setTimeout(
+ () => {
+ rq(this, eO, null),
+ rq(this, eP, !1),
+ rF(this, eR, eH).call(this)
+ },
+ this.delay
+ )
+ ) : (rq(this, eO, null), rq(this, eP, !1), rF(this, eR, eH).call(this))
+ };
+ let rV = null,
+ rj = `
+
+
+
+
+ `;
+ function rN(e, t) {
+ return e.politeness === t.politeness ? e.scheduled === t.scheduled ? rg : e.scheduled < t.scheduled ? rm : rb : 'assertive' === e.politeness &&
+ 'assertive' !== t.politeness ? rm : 'assertive' !== e.politeness &&
+ 'assertive' === t.politeness ? rb : rg
+ }
+ function rW() {
+ }
+ customElements.get('live-region') ||
+ customElements.define('live-region', LiveRegionElement);
+ var r_ = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ r$ = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ rB = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let rz = [
+ '[role="option"]'
+ ],
+ rK = rz.join(','),
+ rY = rz.map(e => `:not([hidden]) > ${ e }`).join(',');
+ (o = tf || (tf = {})) [o.REMOTE = 0] = 'REMOTE',
+ o[o.EVENTUALLY_LOCAL = 1] = 'EVENTUALLY_LOCAL',
+ o[o.LOCAL = 2] = 'LOCAL',
+ (s = tp || (tp = {})) [s.BODY = 0] = 'BODY',
+ s[s.BANNER = 1] = 'BANNER';
+ let rU = (
+ () => {
+ let e = new Set,
+ t = null;
+ function i() {
+ for (let t of e) t.updateAnchorPosition()
+ }
+ return r => {
+ window.addEventListener('resize', i),
+ window.addEventListener('scroll', i),
+ t ||
+ (
+ t = new ResizeObserver(() => {
+ for (let t of e) t.updateAnchorPosition()
+ })
+ ),
+ t.observe(r.ownerDocument.documentElement),
+ r.addEventListener(
+ 'dialog:close',
+ () => {
+ r.invokerElement?.setAttribute('aria-expanded', 'false'),
+ e.delete(r)
+ }
+ ),
+ r.addEventListener('dialog:open', () => {
+ e.add(r)
+ })
+ }
+ }
+ ) (),
+ rX = class SelectPanelElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ eF.add(this),
+ eV.set(this, void 0),
+ ej.set(this, void 0),
+ eN.set(this, ''),
+ eW.set(this, ''),
+ e_.set(this, new Map),
+ e$.set(this, null),
+ eB.set(this, null),
+ ez.set(this, !1)
+ }
+ get open() {
+ return this.dialog.open
+ }
+ get selectVariant() {
+ return this.getAttribute('data-select-variant')
+ }
+ get ariaSelectionType() {
+ return 'multiple' === this.selectVariant ? 'aria-checked' : 'aria-selected'
+ }
+ set selectVariant(e) {
+ e ? this.setAttribute('data-select-variant', e) : this.removeAttribute('variant')
+ }
+ get dynamicLabelPrefix() {
+ let e = this.getAttribute('data-dynamic-label-prefix');
+ return e ? `${ e }:` : ''
+ }
+ get dynamicAriaLabelPrefix() {
+ let e = this.getAttribute('data-dynamic-aria-label-prefix');
+ return e ? `${ e }:` : ''
+ }
+ set dynamicLabelPrefix(e) {
+ this.setAttribute('data-dynamic-label', e)
+ }
+ get dynamicLabel() {
+ return this.hasAttribute('data-dynamic-label')
+ }
+ set dynamicLabel(e) {
+ this.toggleAttribute('data-dynamic-label', e)
+ }
+ get invokerElement() {
+ let e = this.querySelector('dialog') ?.id;
+ if (!e) return null;
+ for (let t of this.querySelectorAll('[aria-controls]')) if (t.getAttribute('aria-controls') === e) return t;
+ return null
+ }
+ get closeButton() {
+ return this.querySelector('button[data-close-dialog-id]')
+ }
+ get invokerLabel() {
+ return this.invokerElement ? this.invokerElement.querySelector('.Button-label') : null
+ }
+ get selectedItems() {
+ return Array.from(r$(this, e_, 'f').values())
+ }
+ get align() {
+ return this.getAttribute('anchor-align') ||
+ 'start'
+ }
+ get side() {
+ return this.getAttribute('anchor-side') ||
+ 'outside-bottom'
+ }
+ updateAnchorPosition() {
+ if (
+ this &&
+ null === this.offsetParent &&
+ this.hide(),
+ this.invokerElement
+ ) {
+ let {
+ top: e,
+ left: t
+ }
+ = (0, tz.uG) (
+ this.dialog,
+ this.invokerElement,
+ {
+ align: this.align,
+ side: this.side,
+ anchorOffset: 4
+ }
+ );
+ this.dialog.style.top = `${ e }px`,
+ this.dialog.style.left = `${ t }px`,
+ this.dialog.style.bottom = 'auto',
+ this.dialog.style.right = 'auto'
+ }
+ }
+ connectedCallback() {
+ let {
+ signal: e
+ }
+ = rB(this, ej, new AbortController, 'f');
+ this.addEventListener('keydown', this, {
+ signal: e
+ }),
+ this.addEventListener('click', this, {
+ signal: e
+ }),
+ this.addEventListener('mousedown', this, {
+ signal: e
+ }),
+ this.addEventListener('input', this, {
+ signal: e
+ }),
+ this.addEventListener('remote-input-success', this, {
+ signal: e
+ }),
+ this.addEventListener('remote-input-error', this, {
+ signal: e
+ }),
+ this.addEventListener('loadstart', this, {
+ signal: e
+ }),
+ r$(this, eF, 'm', ta).call(this),
+ r$(this, eF, 'm', tl).call(this),
+ r$(this, eF, 'm', eK).call(this),
+ rU(this),
+ rl(
+ this,
+ () => !!this.remoteInput,
+ () => {
+ this.remoteInput.addEventListener('loadstart', this, {
+ signal: e
+ }),
+ this.remoteInput.addEventListener('loadend', this, {
+ signal: e
+ })
+ }
+ ),
+ rl(
+ this,
+ () => !!this.includeFragment,
+ () => {
+ this.includeFragment.addEventListener('include-fragment-replaced', this, {
+ signal: e
+ }),
+ this.includeFragment.addEventListener('error', this, {
+ signal: e
+ }),
+ this.includeFragment.addEventListener('loadend', this, {
+ signal: e
+ })
+ }
+ ),
+ rB(
+ this,
+ eV,
+ new IntersectionObserver(
+ e => {
+ for (let t of e) {
+ let e = t.target;
+ t.isIntersecting &&
+ e === this.dialog &&
+ (
+ this.filterInputTextField &&
+ document.activeElement !== this.filterInputTextField &&
+ this.filterInputTextField.focus(),
+ this.dialog.setAttribute('data-ready', 'true'),
+ this.updateAnchorPosition(),
+ r$(this, eF, 'a', tt) === tf.LOCAL &&
+ r$(this, eF, 'm', e4).call(this)
+ )
+ }
+ }
+ ),
+ 'f'
+ ),
+ rl(
+ this,
+ () => !!this.dialog,
+ () => {
+ r$(this, eV, 'f').observe(this.dialog),
+ this.dialog.addEventListener('close', this, {
+ signal: e
+ }),
+ 'true' === this.getAttribute('data-open-on-load') &&
+ this.show()
+ }
+ ),
+ r$(this, eF, 'a', tt) === tf.LOCAL &&
+ rl(
+ this,
+ () => this.items.length > 0,
+ () => {
+ r$(this, eF, 'm', e4).call(this),
+ r$(this, eF, 'm', tl).call(this)
+ }
+ )
+ }
+ disconnectedCallback() {
+ r$(this, ej, 'f').abort()
+ }
+ handleEvent(e) {
+ if (e.target === this.filterInputTextField) return void r$(this, eF, 'm', e7).call(this, e);
+ if (e.target === this.remoteInput) return void r$(this, eF, 'm', e2).call(this, e);
+ let t = this.invokerElement?.contains(e.target),
+ i = this.closeButton?.contains(e.target),
+ r = r$(this, eF, 'm', eG).call(this, e);
+ if (
+ t &&
+ 'mousedown' === e.type ||
+ 'mousedown' === e.type &&
+ e.target instanceof HTMLInputElement
+ ) return;
+ if ('mousedown' === e.type) return void e.preventDefault();
+ if (t && r) return void r$(this, eF, 'm', tn).call(this, e);
+ if (i && r) return;
+ if (
+ 'keydown' === e.type &&
+ e instanceof KeyboardEvent &&
+ e.target.closest(rY)
+ ) {
+ let t = e.ctrlKey ||
+ e.altKey ||
+ e.metaKey,
+ i = 1 === e.key.length &&
+ /[a-z\d]/i.test(e.key);
+ !t &&
+ i &&
+ e.stopPropagation()
+ }
+ if (e.target === this.dialog && 'close' === e.type) {
+ if (
+ this.dialog.removeAttribute('data-ready'),
+ this.invokerElement?.setAttribute('aria-expanded', 'false'),
+ this.filterInputTextField
+ ) {
+ let e = this.filterInputTextField.value.length > 0;
+ this.filterInputTextField.value = '',
+ e &&
+ this.filterInputTextField.dispatchEvent(new Event('input'))
+ }
+ this.dispatchEvent(
+ new CustomEvent('panelClosed', {
+ detail: {
+ panel: this
+ },
+ bubbles: !0
+ })
+ );
+ return
+ }
+ let n = e.target.closest(rY) ?.parentElement;
+ if (null != n && r) {
+ if (r$(this, eF, 'm', eU).call(this, e)) return;
+ let t = n.closest('[data-show-dialog-id]');
+ if (t) {
+ let i = this.ownerDocument.getElementById(t.getAttribute('data-show-dialog-id') || '');
+ if (i && this.contains(t) && this.contains(i)) return void r$(this, eF, 'm', to).call(this, e, i)
+ }
+ r$(this, eF, 'm', eX).call(this, e) &&
+ (e.preventDefault(), r$(this, eF, 'm', tu).call(this, n) ?.click()),
+ r$(this, eF, 'm', ts).call(this, n);
+ return
+ }
+ if ('click' === e.type) {
+ let t = this.dialog.getBoundingClientRect();
+ t.top <= e.clientY &&
+ e.clientY <= t.top + t.height &&
+ t.left <= e.clientX &&
+ e.clientX <= t.left + t.width ||
+ this.hide()
+ }
+ e.target instanceof tN.T &&
+ r$(this, eF, 'm', e1).call(this, e)
+ }
+ show() {
+ this.updateAnchorPosition(),
+ this.dialog.showModal(),
+ this.invokerElement?.setAttribute('aria-expanded', 'true');
+ let e = new CustomEvent('dialog:open', {
+ detail: {
+ dialog: this.dialog
+ }
+ });
+ this.dispatchEvent(e)
+ }
+ hide() {
+ this.dialog.close()
+ }
+ get visibleItems() {
+ return Array.from(this.querySelectorAll(rY)).map(e => e.parentElement)
+ }
+ get items() {
+ return Array.from(this.querySelectorAll(rK)).map(e => e.parentElement)
+ }
+ get focusableItem() {
+ for (let e of this.items) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ if (t && '0' === t.getAttribute('tabindex')) return t
+ }
+ }
+ getItemById(e) {
+ return this.querySelector(`li[data-item-id="${ e }"`)
+ }
+ isItemDisabled(e) {
+ return !!e &&
+ e.classList.contains('ActionListItem--disabled')
+ }
+ disableItem(e) {
+ e &&
+ (
+ e.classList.add('ActionListItem--disabled'),
+ r$(this, eF, 'm', tu).call(this, e).setAttribute('aria-disabled', 'true')
+ )
+ }
+ enableItem(e) {
+ e &&
+ (
+ e.classList.remove('ActionListItem--disabled'),
+ r$(this, eF, 'm', tu).call(this, e).removeAttribute('aria-disabled')
+ )
+ }
+ isItemHidden(e) {
+ return !!e &&
+ e.hasAttribute('hidden')
+ }
+ isItemChecked(e) {
+ return !!e &&
+ 'true' === r$(this, eF, 'm', tu).call(this, e).getAttribute(this.ariaSelectionType)
+ }
+ checkItem(e) {
+ e &&
+ (
+ 'single' === this.selectVariant ||
+ 'multiple' === this.selectVariant
+ ) &&
+ !this.isItemChecked(e) &&
+ r$(this, eF, 'm', ts).call(this, e)
+ }
+ uncheckItem(e) {
+ e &&
+ (
+ 'single' === this.selectVariant ||
+ 'multiple' === this.selectVariant
+ ) &&
+ this.isItemChecked(e) &&
+ r$(this, eF, 'm', ts).call(this, e)
+ }
+ };
+ eV = new WeakMap,
+ ej = new WeakMap,
+ eN = new WeakMap,
+ eW = new WeakMap,
+ e_ = new WeakMap,
+ e$ = new WeakMap,
+ eB = new WeakMap,
+ ez = new WeakMap,
+ eF = new WeakSet,
+ eK = function () {
+ let {
+ signal: e
+ }
+ = r$(this, ej, 'f');
+ for (let t of this.querySelectorAll(rz.join(','))) t.addEventListener('click', r$(this, eF, 'm', eU).bind(this), {
+ signal: e
+ }),
+ t.addEventListener('keydown', r$(this, eF, 'm', eU).bind(this), {
+ signal: e
+ })
+ },
+ eY = function () {
+ let e = !1;
+ if ('single' === this.selectVariant) for (let t of this.items) {
+ let i = r$(this, eF, 'm', tu).call(this, t);
+ i &&
+ (
+ !this.isItemHidden(t) &&
+ this.isItemChecked(t) &&
+ !e ? (i.setAttribute('tabindex', '0'), e = !0) : i.setAttribute('tabindex', '-1'),
+ t.removeAttribute('tabindex')
+ )
+ } else for (let e of this.items) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ t &&
+ (
+ t.setAttribute('tabindex', '-1'),
+ e.removeAttribute('tabindex')
+ )
+ }
+ !e &&
+ r$(this, eF, 'a', tc) &&
+ r$(this, eF, 'm', tu).call(this, r$(this, eF, 'a', tc)) ?.setAttribute('tabindex', '0')
+ },
+ eU = function (e) {
+ if (!r$(this, eF, 'm', eG).call(this, e)) return !1;
+ let t = e.target.closest(rY);
+ return !!t &&
+ !!t.getAttribute('aria-disabled') &&
+ (
+ e.preventDefault(),
+ e.stopPropagation(),
+ e.stopImmediatePropagation(),
+ !0
+ )
+ },
+ eX = function (e) {
+ return e.target instanceof HTMLAnchorElement &&
+ e instanceof KeyboardEvent &&
+ 'keydown' === e.type &&
+ !(e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) &&
+ ' ' === e.key
+ },
+ eG = function (e) {
+ return e instanceof MouseEvent &&
+ 'click' === e.type ||
+ r$(this, eF, 'm', eX).call(this, e)
+ },
+ eJ = function () {
+ for (let e of this.items) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ if (!t) continue;
+ let i = t.getAttribute('data-value');
+ i &&
+ r$(this, e_, 'f').has(i) &&
+ t.setAttribute(this.ariaSelectionType, 'true')
+ }
+ r$(this, eF, 'm', tl).call(this)
+ },
+ eQ = function (e) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ if (!t) return;
+ let i = t.getAttribute('data-value');
+ i &&
+ r$(this, e_, 'f').set(
+ i,
+ {
+ value: i,
+ label: t.querySelector('.ActionListItem-label') ?.textContent?.trim(),
+ inputName: t.getAttribute('data-input-name')
+ }
+ )
+ },
+ eZ = function (e) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ if (!t) return;
+ let i = t.getAttribute('data-value');
+ i &&
+ r$(this, e_, 'f').delete(i)
+ },
+ e0 = function () {
+ r$(this, eF, 'a', ti) &&
+ (
+ r$(this, e$, 'f') &&
+ clearTimeout(r$(this, e$, 'f')),
+ r$(this, eB, 'f') &&
+ clearTimeout(r$(this, eB, 'f')),
+ rB(
+ this,
+ eB,
+ setTimeout(() => {
+ this.liveRegion.announce('Loading')
+ }, 2000),
+ 'f'
+ ),
+ rB(
+ this,
+ e$,
+ setTimeout(() => {
+ r$(this, eF, 'a', ti) ?.showLeadingSpinner()
+ }, 1000),
+ 'f'
+ )
+ )
+ },
+ e1 = function (e) {
+ switch (e.type) {
+ case 'include-fragment-replaced':
+ r$(this, eF, 'm', e4).call(this);
+ break;
+ case 'loadstart':
+ r$(this, eF, 'm', e3).call(this, !1);
+ break;
+ case 'loadend':
+ r$(this, eF, 'a', ti) ?.hideLeadingSpinner(),
+ this.dispatchEvent(new CustomEvent('loadend'));
+ break;
+ case 'error':
+ {
+ r$(this, eF, 'm', e3).call(this, !0);
+ let t = this.fragmentErrorElement;
+ throw t &&
+ !t.hasAttribute('hidden') &&
+ this.liveRegion.announceFromElement(t, {
+ politeness: 'assertive'
+ }),
+ Error(e.detail.error)
+ }
+ }
+ },
+ e3 = function (e) {
+ for (
+ let t of this.includeFragment.querySelectorAll('[data-show-on-error]')
+ ) t instanceof HTMLElement &&
+ (t.hidden = !e);
+ for (
+ let t of this.includeFragment.querySelectorAll('[data-hide-on-error]')
+ ) t instanceof HTMLElement &&
+ (t.hidden = e)
+ },
+ e2 = function (e) {
+ switch (e.type) {
+ case 'remote-input-success':
+ r$(this, eF, 'm', e8).call(this),
+ r$(this, eF, 'm', e4).call(this),
+ r$(this, eF, 'm', eJ).call(this);
+ break;
+ case 'remote-input-error':
+ this.bodySpinner?.setAttribute('hidden', ''),
+ this.includeFragment ||
+ 0 === this.visibleItems.length ? r$(this, eF, 'm', e6).call(this, tp.BODY) : r$(this, eF, 'm', e6).call(this, tp.BANNER);
+ break;
+ case 'loadstart':
+ if (!r$(this, eF, 'm', tr).call(this)) {
+ if (
+ r$(this, eF, 'm', e8).call(this),
+ this.bodySpinner?.removeAttribute('hidden'),
+ this.bodySpinner
+ ) break;
+ r$(this, eF, 'm', e0).call(this)
+ }
+ break;
+ case 'loadend':
+ r$(this, eF, 'a', ti) ?.hideLeadingSpinner(),
+ r$(this, eB, 'f') &&
+ clearTimeout(r$(this, eB, 'f')),
+ r$(this, e$, 'f') &&
+ clearTimeout(r$(this, e$, 'f')),
+ this.dispatchEvent(new CustomEvent('loadend'))
+ }
+ },
+ e5 = function (e, t) {
+ return (e.getAttribute('data-filter-string') || e.textContent || '').toLowerCase().indexOf(t.toLowerCase()) > - 1
+ },
+ e7 = function (e) {
+ if ('keydown' === e.type) {
+ let t = e.key;
+ if ('Enter' === t) {
+ let e = this.visibleItems[0];
+ if (e) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ t &&
+ t.click()
+ }
+ } else if ('ArrowDown' === t) {
+ let t = this.focusableItem ||
+ r$(this, eF, 'm', tu).call(this, this.visibleItems[0]);
+ t &&
+ (t.focus(), e.preventDefault())
+ } else if ('Home' === t) {
+ let t = this.visibleItems[0];
+ if (t) {
+ let i = r$(this, eF, 'm', tu).call(this, t);
+ i &&
+ i.focus(),
+ e.preventDefault()
+ }
+ } else if ('End' === t && this.visibleItems.length > 0) {
+ let t = this.visibleItems[this.visibleItems.length - 1],
+ i = r$(this, eF, 'm', tu).call(this, t);
+ i &&
+ i.focus(),
+ e.preventDefault()
+ }
+ }
+ if (
+ 'input' === e.type &&
+ (
+ this.bodySpinner ||
+ r$(this, eF, 'm', tr).call(this) ||
+ r$(this, eF, 'm', e0).call(this),
+ r$(this, eF, 'a', tt) === tf.LOCAL ||
+ r$(this, eF, 'a', tt) === tf.EVENTUALLY_LOCAL
+ )
+ ) {
+ if (this.includeFragment) return void this.includeFragment.refetch();
+ r$(this, eF, 'm', e4).call(this)
+ }
+ },
+ e4 = function () {
+ if (!this.list) return;
+ let e = !1;
+ if (r$(this, eF, 'm', tr).call(this)) {
+ let t = this.filterInputTextField?.value ?? '',
+ i = this.filterFn ||
+ r$(this, eF, 'm', e5);
+ for (let r of this.items) i(r, t) ? (r$(this, eF, 'm', td).call(this, r), e = !0) : r$(this, eF, 'm', th).call(this, r)
+ } else e = this.items.length > 0;
+ for (
+ let e of (
+ r$(this, eF, 'm', eY).call(this),
+ r$(this, eF, 'm', te).call(this),
+ this.items
+ )
+ ) {
+ let t = r$(this, eF, 'm', tu).call(this, e);
+ if (!t) continue;
+ let i = t.getAttribute('data-value');
+ r$(this, ez, 'f') ? i &&
+ !r$(this, e_, 'f').has(i) &&
+ t.setAttribute(this.ariaSelectionType, 'false') : i &&
+ !r$(this, e_, 'f').has(i) &&
+ this.isItemChecked(e) &&
+ r$(this, eF, 'm', eQ).call(this, e)
+ }
+ if (rB(this, ez, !0, 'f'), this.noResults) {
+ if (r$(this, eF, 'm', e9).call(this)) return void this.noResults.setAttribute('hidden', '');
+ e ? (
+ this.noResults.setAttribute('hidden', ''),
+ this.list?.querySelector('.ActionListWrap') ?.removeAttribute('hidden')
+ ) : (
+ this.list?.querySelector('.ActionListWrap') ?.setAttribute('hidden', ''),
+ this.noResults.removeAttribute('hidden')
+ )
+ }
+ },
+ e9 = function () {
+ return !(
+ !this.fragmentErrorElement ||
+ this.fragmentErrorElement.hasAttribute('hidden')
+ ) ||
+ !!this.bannerErrorElement &&
+ !this.bannerErrorElement.hasAttribute('hidden')
+ },
+ e6 = function (e) {
+ let t = this.fragmentErrorElement;
+ if (
+ e === tp.BODY &&
+ this.fragmentErrorElement ? (
+ this.fragmentErrorElement.removeAttribute('hidden'),
+ this.bannerErrorElement.setAttribute('hidden', '')
+ ) : (
+ t = this.bannerErrorElement,
+ this.bannerErrorElement?.removeAttribute('hidden'),
+ this.fragmentErrorElement?.setAttribute('hidden', '')
+ ),
+ t &&
+ !t.hasAttribute('hidden')
+ ) return void this.liveRegion.announceFromElement(t, {
+ politeness: 'assertive'
+ })
+ },
+ e8 = function () {
+ this.fragmentErrorElement?.setAttribute('hidden', ''),
+ this.bannerErrorElement.setAttribute('hidden', '')
+ },
+ te = function () {
+ if (this.open && this.list) {
+ let e = this.visibleItems;
+ if (e.length > 0) this.liveRegion.announce(`${ e.length } result${ 1 === e.length ? '' : 's' } tab for results`);
+ else {
+ let e = this.noResults;
+ e &&
+ this.liveRegion.announceFromElement(e)
+ }
+ }
+ },
+ tt = function () {
+ if (!this.list) return tf.REMOTE;
+ switch (this.list.getAttribute('data-fetch-strategy')) {
+ case 'local':
+ return tf.LOCAL;
+ case 'eventually_local':
+ return tf.EVENTUALLY_LOCAL;
+ default:
+ return tf.REMOTE
+ }
+ },
+ ti = function () {
+ return this.filterInputTextField?.closest('primer-text-field')
+ },
+ tr = function () {
+ return r$(this, eF, 'a', tt) === tf.LOCAL ||
+ r$(this, eF, 'a', tt) === tf.EVENTUALLY_LOCAL
+ },
+ tn = function (e) {
+ e.preventDefault(),
+ e.stopPropagation(),
+ this.open ? this.hide() : this.show()
+ },
+ to = function (e, t) {
+ this.querySelector('.ActionListWrap').style.display = 'none';
+ let i = new AbortController,
+ {
+ signal: r
+ }
+ = i,
+ n = () => {
+ i.abort(),
+ this.querySelector('.ActionListWrap').style.display = '',
+ this.open &&
+ this.hide();
+ let e = this.ownerDocument.activeElement,
+ t = this.ownerDocument.activeElement === this.ownerDocument.body,
+ r = this.contains(e);
+ (t || r) &&
+ setTimeout(() => this.invokerElement?.focus(), 0)
+ };
+ t.addEventListener('close', n, {
+ signal: r
+ }),
+ t.addEventListener('cancel', n, {
+ signal: r
+ })
+ },
+ ts = function (e) {
+ if (
+ 'multiple' !== this.selectVariant &&
+ setTimeout(() => {
+ this.open &&
+ this.hide()
+ }),
+ 'multiple' !== this.selectVariant &&
+ 'single' !== this.selectVariant
+ ) return;
+ let t = this.isItemChecked(e),
+ i = !t;
+ if (
+ !this.dispatchEvent(
+ new CustomEvent(
+ 'beforeItemActivated',
+ {
+ bubbles: !0,
+ cancelable: !0,
+ detail: {
+ item: e,
+ checked: i,
+ value: r$(this, eF, 'm', tu).call(this, e) ?.getAttribute('data-value')
+ }
+ }
+ )
+ )
+ ) return;
+ let r = r$(this, eF, 'm', tu).call(this, e);
+ if ('single' === this.selectVariant) {
+ if (r?.getAttribute('href')) return;
+ if (!t) {
+ for (let e of this.items) r$(this, eF, 'm', tu).call(this, e) ?.setAttribute(this.ariaSelectionType, 'false');
+ r$(this, e_, 'f').clear(),
+ i &&
+ (
+ r$(this, eF, 'm', eQ).call(this, e),
+ r?.setAttribute(this.ariaSelectionType, 'true')
+ ),
+ r$(this, eF, 'm', ta).call(this)
+ }
+ } else r?.setAttribute(this.ariaSelectionType, `${ i }`),
+ i ? r$(this, eF, 'm', eQ).call(this, e) : r$(this, eF, 'm', eZ).call(this, e);
+ r$(this, eF, 'm', tl).call(this),
+ r$(this, eF, 'm', eY).call(this),
+ this.dispatchEvent(
+ new CustomEvent(
+ 'itemActivated',
+ {
+ bubbles: !0,
+ detail: {
+ item: e,
+ checked: i,
+ value: r$(this, eF, 'm', tu).call(this, e) ?.getAttribute('data-value')
+ }
+ }
+ )
+ )
+ },
+ ta = function () {
+ if (!this.dynamicLabel) return;
+ let e = this.invokerLabel;
+ if (!e) return;
+ rB(this, eN, r$(this, eN, 'f') || e.textContent || '', 'f');
+ let t = this.querySelector(`[${ this.ariaSelectionType }=true] .ActionListItem-label`) ?.textContent ||
+ r$(this, eN, 'f');
+ if (t) {
+ let i = document.createElement('span');
+ i.classList.add('color-fg-muted');
+ let r = document.createElement('span');
+ i.textContent = `${ this.dynamicLabelPrefix } `,
+ r.textContent = t,
+ e.replaceChildren(i, r),
+ this.dynamicAriaLabelPrefix &&
+ this.invokerElement?.setAttribute('aria-label', `${ this.dynamicAriaLabelPrefix } ${ t.trim() }`)
+ } else e.textContent = r$(this, eN, 'f')
+ },
+ tl = function () {
+ if ('single' === this.selectVariant) {
+ let e = this.querySelector('[data-select-panel-inputs=true] input') ?? this.querySelector('[data-list-inputs=true] input');
+ if (!e) return;
+ let t = this.selectedItems[0];
+ t ? (
+ e.value = (t.value || t.label || '').trim(),
+ t.inputName &&
+ (e.name = t.inputName),
+ e.removeAttribute('disabled')
+ ) : r$(this, ez, 'f') &&
+ e.setAttribute('disabled', 'disabled')
+ } else if ('none' !== this.selectVariant) {
+ let e = !!this.querySelector('[data-select-panel-inputs=true]'),
+ t = this.querySelector('[data-select-panel-inputs=true]') ?? this.querySelector('[data-list-inputs=true]');
+ if (!t) return;
+ let i = t.querySelectorAll('input');
+ for (
+ let r of (
+ i.length > 0 &&
+ rB(this, eW, r$(this, eW, 'f') || i[0].name, 'f'),
+ this.selectedItems
+ )
+ ) {
+ let i = document.createElement('input');
+ i.setAttribute(`${ e ? 'data-select-panel-input' : 'data-list-input' }`, 'true'),
+ i.type = 'hidden',
+ i.autocomplete = 'off',
+ i.name = r.inputName ||
+ r$(this, eW, 'f'),
+ i.value = (r.value || r.label || '').trim(),
+ t.append(i)
+ }
+ for (let e of i) e.remove()
+ }
+ },
+ tc = function () {
+ return this.querySelector(rY) ?.parentElement ||
+ null
+ },
+ th = function (e) {
+ e &&
+ e.setAttribute('hidden', 'hidden')
+ },
+ td = function (e) {
+ e &&
+ e.removeAttribute('hidden')
+ },
+ tu = function (e) {
+ return e.querySelector('.ActionListContent')
+ },
+ r_([tW.aC], rX.prototype, 'includeFragment', void 0),
+ r_([tW.aC], rX.prototype, 'dialog', void 0),
+ r_([tW.aC], rX.prototype, 'filterInputTextField', void 0),
+ r_([tW.aC], rX.prototype, 'remoteInput', void 0),
+ r_([tW.aC], rX.prototype, 'list', void 0),
+ r_([tW.aC], rX.prototype, 'noResults', void 0),
+ r_([tW.aC], rX.prototype, 'fragmentErrorElement', void 0),
+ r_([tW.aC], rX.prototype, 'bannerErrorElement', void 0),
+ r_([tW.aC], rX.prototype, 'bodySpinner', void 0),
+ r_([tW.aC], rX.prototype, 'liveRegion', void 0),
+ rX = r_([tW.p_], rX),
+ window.customElements.get('select-panel') ||
+ (
+ window.SelectPanelElement = rX,
+ window.customElements.define('select-panel', rX)
+ );
+ var rG = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ };
+ let rJ = class DetailsToggleElement extends HTMLElement {
+ toggle() {
+ if (this.detailsTarget.hasAttribute('open')) {
+ let e = this.summaryTarget.getAttribute('data-aria-label-closed');
+ e &&
+ this.summaryTarget.setAttribute('aria-label', e),
+ this.summaryTarget.setAttribute('aria-expanded', 'false')
+ } else {
+ let e = this.summaryTarget.getAttribute('data-aria-label-open');
+ e &&
+ this.summaryTarget.setAttribute('aria-label', e),
+ this.summaryTarget.setAttribute('aria-expanded', 'true')
+ }
+ }
+ };
+ function rQ(e, t) {
+ let i = e.closest('[role=tree]');
+ if (!i) return;
+ let r = document.createTreeWalker(
+ i,
+ NodeFilter.SHOW_ELEMENT,
+ e => e instanceof HTMLElement &&
+ 'treeitem' === e.getAttribute('role') ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
+ ),
+ n = r.firstChild();
+ for (; n !== e; ) n = r.nextNode();
+ let o = 'next' === t ? r.nextNode() : r.previousNode();
+ for (
+ ;
+ o instanceof HTMLElement &&
+ function (e, t) {
+ for (
+ let i of t.querySelectorAll('[role=treeitem][aria-expanded=false]')
+ ) if (e !== i && i.closest('li') ?.contains(e)) return i;
+ return null
+ }(o, i);
+ ) o = 'next' === t ? r.nextNode() : r.previousNode();
+ return o instanceof HTMLElement ? o : void 0
+ }
+ function rZ(e) {
+ let t = e.closest('[role=group]'),
+ i = t?.closest('[role=treeitem]');
+ return i instanceof HTMLElement ? i : void 0
+ }
+ rG([tW.aC], rJ.prototype, 'detailsTarget', void 0),
+ rG([tW.aC], rJ.prototype, 'summaryTarget', void 0),
+ rJ = rG([tW.p_], rJ),
+ window.DetailsToggleElement = rJ;
+ var r0 = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ r1 = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ },
+ r3 = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let r2 = class TreeViewElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ tm.add(this),
+ tg.set(this, void 0)
+ }
+ connectedCallback() {
+ var e;
+ let {
+ signal: t
+ }
+ = r1(this, tg, new AbortController, 'f');
+ this.addEventListener('click', this, {
+ signal: t
+ }),
+ this.addEventListener('focusin', this, {
+ signal: t
+ }),
+ this.addEventListener('keydown', this, {
+ signal: t
+ }),
+ e = this,
+ (0, tz.zB) (
+ e,
+ {
+ bindKeys: tz.z0.ArrowVertical | tz.z0.ArrowHorizontal | tz.z0.HomeAndEnd | tz.z0.Backspace,
+ getNextFocusable: (e, t, i) => {
+ if (t instanceof HTMLElement) {
+ try {
+ if (t.closest('dialog:modal')) return
+ } catch {
+ }
+ return function (e, t) {
+ let i = function (e) {
+ if ('treeitem' !== e.getAttribute('role')) throw Error('Element is not a treeitem');
+ switch (e.getAttribute('aria-expanded')) {
+ case 'true':
+ return 'open';
+ case 'false':
+ return 'closed';
+ default:
+ return 'end'
+ }
+ }(e);
+ switch (`${ i } ${ t.key }`) {
+ case 'open ArrowRight':
+ let r;
+ return (r = e.querySelector('[role=treeitem]')) instanceof HTMLElement ? r : void 0;
+ case 'open ArrowLeft':
+ case 'closed ArrowRight':
+ case 'end ArrowRight':
+ return;
+ case 'closed ArrowLeft':
+ case 'end ArrowLeft':
+ return rZ(e)
+ }
+ switch (t.key) {
+ case 'ArrowUp':
+ return rQ(e, 'previous');
+ case 'ArrowDown':
+ return rQ(e, 'next');
+ case 'Backspace':
+ return rZ(e)
+ }
+ }(t, i) ?? t
+ }
+ },
+ focusInStrategy: () => {
+ let t = e.querySelector('[aria-current]');
+ t = t?.checkVisibility() ? t : null;
+ let i = e.querySelector('[role="treeitem"]');
+ return t instanceof HTMLElement ? t : document.activeElement instanceof HTMLElement &&
+ e.contains(document.activeElement) &&
+ 'treeitem' === document.activeElement.getAttribute('role') ? document.activeElement : i instanceof HTMLElement ? i : void 0
+ }
+ }
+ ),
+ new MutationObserver(
+ e => {
+ for (let t of e) for (let e of t.addedNodes) e instanceof HTMLElement &&
+ e.querySelector('[aria-expanded=true]') &&
+ r3(this, tm, 'm', tb).call(this, e)
+ }
+ ).observe(this, {
+ childList: !0,
+ subtree: !0
+ }),
+ new MutationObserver(
+ e => {
+ if (
+ !this.formInputContainer ||
+ !e.some(
+ e => e.target instanceof HTMLElement &&
+ e.target.getAttribute('aria-checked') !== e.oldValue
+ )
+ ) return;
+ let t = [];
+ for (
+ let e of this.querySelectorAll('[role=treeitem][aria-checked=true]')
+ ) {
+ let i = this.formInputPrototype.cloneNode();
+ i.removeAttribute('data-target'),
+ i.removeAttribute('form');
+ let r = {
+ path: this.getNodePath(e)
+ },
+ n = this.getFormInputValueForNode(e);
+ n &&
+ (r.value = n),
+ i.value = JSON.stringify(r),
+ t.push(i)
+ }
+ this.formInputContainer.replaceChildren(...t)
+ }
+ ).observe(
+ this,
+ {
+ childList: !0,
+ subtree: !0,
+ attributeFilter: [
+ 'aria-checked'
+ ]
+ }
+ ),
+ customElements.whenDefined('tree-view-sub-tree-node').then(() => {
+ r3(this, tm, 'm', tb).call(this, this)
+ })
+ }
+ disconnectedCallback() {
+ r3(this, tg, 'f').abort()
+ }
+ handleEvent(e) {
+ let t = r3(this, tm, 'm', tw).call(this, e);
+ t &&
+ r3(this, tm, 'm', ty).call(this, t, e)
+ }
+ getFormInputValueForNode(e) {
+ return e.getAttribute('data-value')
+ }
+ getNodePath(e) {
+ let t = e.getAttribute('data-path');
+ return t ? JSON.parse(t) : []
+ }
+ getNodeType(e) {
+ return e.getAttribute('data-node-type')
+ }
+ markCurrentAtPath(e) {
+ let t = JSON.stringify(e),
+ i = this.querySelector(`[data-path="${ CSS.escape(t) }"`);
+ i &&
+ (
+ this.currentNode?.setAttribute('aria-current', 'false'),
+ i.setAttribute('aria-current', 'true')
+ )
+ }
+ get currentNode() {
+ return this.querySelector('[aria-current=true]')
+ }
+ expandAtPath(e) {
+ let t = this.subTreeAtPath(e);
+ t &&
+ t.expand()
+ }
+ collapseAtPath(e) {
+ let t = this.subTreeAtPath(e);
+ t &&
+ t.collapse()
+ }
+ toggleAtPath(e) {
+ let t = this.subTreeAtPath(e);
+ t &&
+ t.toggle()
+ }
+ checkAtPath(e) {
+ let t = this.nodeAtPath(e);
+ t &&
+ this.setNodeCheckedValue(t, 'true')
+ }
+ uncheckAtPath(e) {
+ let t = this.nodeAtPath(e);
+ t &&
+ this.setNodeCheckedValue(t, 'false')
+ }
+ toggleCheckedAtPath(e) {
+ let t = this.nodeAtPath(e);
+ t &&
+ 'leaf' === this.getNodeType(t) &&
+ (
+ 'true' === this.getNodeCheckedValue(t) ? this.uncheckAtPath(e) : this.checkAtPath(e)
+ )
+ }
+ checkedValueAtPath(e) {
+ let t = this.nodeAtPath(e);
+ return t ? this.getNodeCheckedValue(t) : 'false'
+ }
+ disabledValueAtPath(e) {
+ let t = this.nodeAtPath(e);
+ return !!t &&
+ this.getNodeDisabledValue(t)
+ }
+ nodeAtPath(e, t) {
+ let i = JSON.stringify(e);
+ return this.querySelector(`${ t ||
+ '' }[data-path="${ CSS.escape(i) }"]`)
+ }
+ subTreeAtPath(e) {
+ let t = this.nodeAtPath(e, '[data-node-type=sub-tree]');
+ return t ? t.closest('tree-view-sub-tree-node') : null
+ }
+ leafAtPath(e) {
+ return this.nodeAtPath(e, '[data-node-type=leaf]')
+ }
+ setNodeCheckedValue(e, t) {
+ e.setAttribute('aria-checked', t.toString())
+ }
+ getNodeCheckedValue(e) {
+ return e.getAttribute('aria-checked') ||
+ 'false'
+ }
+ getNodeDisabledValue(e) {
+ return 'true' === e.getAttribute('aria-disabled')
+ }
+ setNodeDisabledValue(e, t) {
+ t ? e.setAttribute('aria-disabled', 'true') : e.removeAttribute('aria-disabled')
+ }
+ nodeHasCheckBox(e) {
+ return null !== e.querySelector('.TreeViewItemCheckbox')
+ }
+ nodeHasNativeAction(e) {
+ return e instanceof HTMLAnchorElement ||
+ e instanceof HTMLButtonElement
+ }
+ expandAncestorsForNode(e) {
+ let t = e.closest('tree-view-sub-tree-node');
+ if (t) for (let e of t.eachAncestorSubTreeNode()) e.expanded ||
+ e.expand()
+ }
+ infoFromNode(e, t) {
+ let i = this.getNodeType(e);
+ if (!i) return null;
+ let r = this.getNodeCheckedValue(e);
+ return {
+ node: e,
+ type: i,
+ path: this.getNodePath(e),
+ checkedValue: t ||
+ r,
+ previousCheckedValue: r
+ }
+ }
+ };
+ tg = new WeakMap,
+ tm = new WeakSet,
+ tb = function (e) {
+ for (let t of e.querySelectorAll('[aria-expanded=true]')) this.expandAncestorsForNode(t)
+ },
+ tv = function (e) {
+ return 'click' === e.type
+ },
+ tw = function (e) {
+ let t = e.target,
+ i = t.closest('[role=treeitem]');
+ return !i ||
+ t.closest('.TreeViewItemToggle') ||
+ t.closest('.TreeViewItemLeadingAction') ? null : i
+ },
+ ty = function (e, t) {
+ r3(this, tm, 'm', tE).call(this, t, e) ? r3(this, tm, 'm', tA).call(this, t, e) : r3(this, tm, 'm', tv).call(this, t) ? r3(this, tm, 'm', tk).call(this, t, e) : 'focusin' === t.type ? r3(this, tm, 'm', tL).call(this, e) : t instanceof KeyboardEvent &&
+ r3(this, tm, 'm', tT).call(this, t, e)
+ },
+ tE = function (e, t) {
+ return 'click' === e.type &&
+ this.nodeHasCheckBox(t)
+ },
+ tA = function (e, t) {
+ this.getNodeDisabledValue(t) ? e.preventDefault() : 'leaf' === this.getNodeType(t) &&
+ (
+ 'true' === this.getNodeCheckedValue(t) ? this.setNodeCheckedValue(t, 'false') : this.setNodeCheckedValue(t, 'true')
+ )
+ },
+ tk = function (e, t) {
+ if (this.getNodeDisabledValue(t)) return void e.preventDefault();
+ if (!(t instanceof HTMLDivElement)) return;
+ let i = this.getNodePath(t);
+ this.dispatchEvent(
+ new CustomEvent(
+ 'treeViewBeforeNodeActivated',
+ {
+ bubbles: !0,
+ cancelable: !0,
+ detail: this.infoFromNode(t)
+ }
+ )
+ ) &&
+ (
+ this.nodeHasNativeAction(t) ||
+ this.toggleAtPath(i),
+ this.dispatchEvent(
+ new CustomEvent(
+ 'treeViewNodeActivated',
+ {
+ bubbles: !0,
+ detail: this.infoFromNode(t)
+ }
+ )
+ )
+ )
+ },
+ tL = function (e) {
+ let t = this.querySelector('[aria-selected=true]');
+ t?.setAttribute('aria-selected', 'false'),
+ e.setAttribute('aria-selected', 'true')
+ },
+ tT = function (e, t) {
+ if (t && 'leaf' === this.getNodeType(t)) switch (e.key) {
+ case ' ':
+ case 'Enter':
+ if (this.getNodeDisabledValue(t)) {
+ e.preventDefault();
+ break
+ }
+ this.nodeHasCheckBox(t) ? (
+ e.preventDefault(),
+ 'true' === this.getNodeCheckedValue(t) ? this.setNodeCheckedValue(t, 'false') : this.setNodeCheckedValue(t, 'true')
+ ) : t instanceof HTMLAnchorElement &&
+ t.click()
+ }
+ },
+ r0([tW.aC], r2.prototype, 'formInputContainer', void 0),
+ r0([tW.aC], r2.prototype, 'formInputPrototype', void 0),
+ r2 = r0([tW.p_], r2),
+ window.customElements.get('tree-view') ||
+ (
+ window.TreeViewElement = r2,
+ window.customElements.define('tree-view', r2)
+ );
+ var r5 = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ r7 = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ };
+ let r4 = class TreeViewIconPairElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ tC.add(this)
+ }
+ connectedCallback() {
+ rl(
+ this,
+ () => !!this.collapsedIcon &&
+ !!this.expandedIcon,
+ () => {
+ this.expanded = this.collapsedIcon.hidden
+ }
+ )
+ }
+ showExpanded() {
+ this.expanded = !0,
+ r7(this, tC, 'm', tx).call(this)
+ }
+ showCollapsed() {
+ this.expanded = !1,
+ r7(this, tC, 'm', tx).call(this)
+ }
+ toggle() {
+ this.expanded = !this.expanded,
+ r7(this, tC, 'm', tx).call(this)
+ }
+ };
+ tC = new WeakSet,
+ tx = function () {
+ this.expanded ? (this.expandedIcon.hidden = !1, this.collapsedIcon.hidden = !0) : (this.expandedIcon.hidden = !0, this.collapsedIcon.hidden = !1)
+ },
+ r5([tW.aC], r4.prototype, 'expandedIcon', void 0),
+ r5([tW.aC], r4.prototype, 'collapsedIcon', void 0),
+ r4 = r5([tW.p_], r4),
+ window.customElements.get('tree-view-icon-pair') ||
+ (
+ window.TreeViewIconPairElement = r4,
+ window.customElements.define('tree-view-icon-pair', r4)
+ );
+ var r9 = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ },
+ r6 = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ r8 = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let ne = class TreeViewSubTreeNodeElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ tS.add(this),
+ tM.set(this, null),
+ tI.set(this, 'success'),
+ tP.set(this, void 0),
+ tD.set(this, !1)
+ }
+ connectedCallback() {
+ rl(
+ this,
+ () => !!this.node &&
+ !!this.subTree,
+ () => {
+ r6(this, tS, 'm', tV).call(this)
+ }
+ );
+ let {
+ signal: e
+ }
+ = r8(this, tP, new AbortController, 'f');
+ this.addEventListener('click', this, {
+ signal: e
+ }),
+ this.addEventListener('keydown', this, {
+ signal: e
+ }),
+ rl(
+ this,
+ () => !!this.includeFragment,
+ () => {
+ this.includeFragment.addEventListener('loadstart', this, {
+ signal: e
+ }),
+ this.includeFragment.addEventListener('error', this, {
+ signal: e
+ }),
+ this.includeFragment.addEventListener('include-fragment-replace', this, {
+ signal: e
+ }),
+ this.includeFragment.addEventListener(
+ 'include-fragment-replaced',
+ e => {
+ r6(this, tS, 'm', tR).call(this, e)
+ },
+ {
+ signal: e
+ }
+ )
+ }
+ ),
+ rl(
+ this,
+ () => !!this.retryButton,
+ () => {
+ this.retryButton.addEventListener('click', e => {
+ r6(this, tS, 'm', tH).call(this, e)
+ }, {
+ signal: e
+ })
+ }
+ ),
+ new MutationObserver(
+ () => {
+ if ('mixed_descendants' !== this.selectStrategy) return;
+ let e = 'unknown';
+ for (let t of this.eachDirectDescendantNode()) switch (`${ e } ${ t.getAttribute('aria-checked') ||
+ 'false' }`) {
+ case 'unknown mixed':
+ case 'false mixed':
+ case 'true mixed':
+ case 'false true':
+ case 'true false':
+ e = 'mixed';
+ break;
+ case 'unknown false':
+ e = 'false';
+ break;
+ case 'unknown true':
+ e = 'true'
+ }
+ 'unknown' !== e &&
+ this.node?.getAttribute('aria-checked') !== e &&
+ this.node?.setAttribute('aria-checked', e)
+ }
+ ).observe(
+ this,
+ {
+ childList: !0,
+ subtree: !0,
+ attributeFilter: [
+ 'aria-checked'
+ ]
+ }
+ )
+ }
+ get expanded() {
+ return null === r6(this, tM, 'f') &&
+ r8(this, tM, 'true' === this.node.getAttribute('aria-expanded'), 'f'),
+ r6(this, tM, 'f')
+ }
+ set expanded(e) {
+ r8(this, tM, e, 'f'),
+ r6(this, tS, 'm', tV).call(this)
+ }
+ get loadingState() {
+ return r6(this, tI, 'f')
+ }
+ set loadingState(e) {
+ r8(this, tI, e, 'f'),
+ r6(this, tS, 'm', tV).call(this)
+ }
+ get selectStrategy() {
+ return this.node.getAttribute('data-select-strategy') ||
+ 'descendants'
+ }
+ disconnectedCallback() {
+ r6(this, tP, 'f').abort()
+ }
+ handleEvent(e) {
+ e.target === this.toggleButton ? r6(this, tS, 'm', tO).call(this, e) : e.target === this.includeFragment ? r6(this, tS, 'm', tR).call(this, e) : e instanceof KeyboardEvent ? r6(this, tS, 'm', tq).call(this, e) : e.target.closest('[role=treeitem]') === this.node &&
+ 'click' === e.type &&
+ r6(this, tS, 'a', tj) &&
+ r6(this, tS, 'm', tF).call(this, e)
+ }
+ expand() {
+ let e = this.expanded;
+ this.expanded = !0,
+ !e &&
+ this.treeView &&
+ this.treeView.dispatchEvent(
+ new CustomEvent(
+ 'treeViewNodeExpanded',
+ {
+ bubbles: !0,
+ detail: this.treeView?.infoFromNode(this.node)
+ }
+ )
+ )
+ }
+ collapse() {
+ let e = !this.expanded;
+ if (this.expanded = !1, !e && this.treeView) {
+ let e = this.subTree.querySelector('[tabindex=\'0\']');
+ e?.setAttribute('tabindex', '-1'),
+ this.node.setAttribute('tabindex', '0'),
+ this.treeView.dispatchEvent(
+ new CustomEvent(
+ 'treeViewNodeCollapsed',
+ {
+ bubbles: !0,
+ detail: this.treeView?.infoFromNode(this.node)
+ }
+ )
+ )
+ }
+ }
+ toggle() {
+ this.expanded ? this.collapse() : this.expand()
+ }
+ get nodes() {
+ return this.querySelectorAll(':scope > [role=treeitem]')
+ }
+ * eachDirectDescendantNode() {
+ for (
+ let e of this.subTree.querySelectorAll(':scope > li > .TreeViewItemContainer > [role=treeitem]')
+ ) yield e;
+ for (
+ let e of this.subTree.querySelectorAll(
+ ':scope > tree-view-sub-tree-node > li > .TreeViewItemContainer > [role=treeitem]'
+ )
+ ) yield e
+ }
+ * eachDescendantNode() {
+ for (let e of this.subTree.querySelectorAll('[role=treeitem]')) yield e
+ }
+ * eachAncestorSubTreeNode() {
+ if (!this.treeView) return;
+ let e = this;
+ for (; e && this.treeView.contains(e); ) yield e,
+ e = e.parentElement?.closest('tree-view-sub-tree-node')
+ }
+ get isEmpty() {
+ return 0 === this.nodes.length
+ }
+ get treeView() {
+ return this.closest('tree-view')
+ }
+ toggleChecked() {
+ let e = 'false' === (this.treeView?.getNodeCheckedValue(this.node) || 'false') ? 'true' : 'false',
+ t = [],
+ i = this.treeView?.infoFromNode(this.node, e);
+ if (
+ i &&
+ t.push(i),
+ 'descendants' === this.selectStrategy ||
+ 'mixed_descendants' === this.selectStrategy
+ ) for (let i of this.eachDescendantNode()) {
+ let r = this.treeView?.infoFromNode(i, e);
+ r &&
+ t.push(r)
+ }
+ if (
+ this.dispatchEvent(
+ new CustomEvent(
+ 'treeViewBeforeNodeChecked',
+ {
+ bubbles: !0,
+ cancelable: !0,
+ detail: t
+ }
+ )
+ )
+ ) {
+ for (let i of t) i.node.setAttribute('aria-checked', e);
+ this.dispatchEvent(
+ new CustomEvent('treeViewNodeChecked', {
+ bubbles: !0,
+ cancelable: !0,
+ detail: t
+ })
+ )
+ }
+ }
+ };
+ tM = new WeakMap,
+ tI = new WeakMap,
+ tP = new WeakMap,
+ tD = new WeakMap,
+ tS = new WeakSet,
+ tO = function (e) {
+ 'click' === e.type &&
+ (this.toggle(), e.stopPropagation())
+ },
+ tR = function (e) {
+ switch (e.type) {
+ case 'loadstart':
+ this.loadingState = 'loading';
+ break;
+ case 'error':
+ this.loadingState = 'error';
+ break;
+ case 'include-fragment-replace':
+ r8(
+ this,
+ tD,
+ document.activeElement === this.loadingIndicator.closest('[role=treeitem]'),
+ 'f'
+ ),
+ this.loadingState = 'success';
+ break;
+ case 'include-fragment-replaced':
+ if (this.expanded = !0, r6(this, tD, 'f')) {
+ let e = this.querySelector('[role=group] > :first-child');
+ if (!e) return;
+ let t = e.querySelector('[role=treeitem]');
+ if (!t) return;
+ t.focus()
+ }
+ r8(this, tD, !1, 'f')
+ }
+ },
+ tH = function (e) {
+ 'click' === e.type &&
+ (this.loadingState = 'loading', this.includeFragment.refetch())
+ },
+ tq = function (e) {
+ let t = e.target.closest('[role=treeitem]');
+ if (t && this.treeView?.getNodeType(t) === 'sub-tree') switch (e.key) {
+ case 'Enter':
+ if (this.treeView?.getNodeDisabledValue(t)) {
+ e.preventDefault();
+ break
+ }
+ e.stopPropagation(),
+ r6(this, tS, 'a', tj) ? this.toggleChecked() : this.treeView?.nodeHasNativeAction(t) ||
+ this.toggle();
+ break;
+ case 'ArrowRight':
+ e.stopPropagation(),
+ this.expand();
+ break;
+ case 'ArrowLeft':
+ e.stopPropagation(),
+ this.collapse();
+ break;
+ case ' ':
+ if (this.treeView?.getNodeDisabledValue(t)) {
+ e.preventDefault();
+ break
+ }
+ r6(this, tS, 'a', tj) ? (e.stopPropagation(), e.preventDefault(), this.toggleChecked()) : t instanceof HTMLAnchorElement ? t.click() : this.treeView?.nodeHasNativeAction(t) ||
+ this.toggle()
+ }
+ },
+ tF = function (e) {
+ this.treeView?.getNodeDisabledValue(this.node) ? e.preventDefault() : 'click' === e.type &&
+ (this.toggleChecked(), e.stopPropagation())
+ },
+ tV = function () {
+ switch (
+ this.expanded ? (
+ this.subTree &&
+ (this.subTree.hidden = !1),
+ this.node.setAttribute('aria-expanded', 'true'),
+ this.treeView?.expandAncestorsForNode(this),
+ this.iconPair &&
+ this.iconPair.showExpanded(),
+ this.expandedToggleIcon &&
+ this.collapsedToggleIcon &&
+ (
+ this.expandedToggleIcon.removeAttribute('hidden'),
+ this.collapsedToggleIcon.setAttribute('hidden', 'hidden')
+ )
+ ) : (
+ this.subTree &&
+ (this.subTree.hidden = !0),
+ this.node.setAttribute('aria-expanded', 'false'),
+ this.iconPair &&
+ this.iconPair.showCollapsed(),
+ this.expandedToggleIcon &&
+ this.collapsedToggleIcon &&
+ (
+ this.expandedToggleIcon.setAttribute('hidden', 'hidden'),
+ this.collapsedToggleIcon.removeAttribute('hidden')
+ )
+ ),
+ this.loadingState
+ ) {
+ case 'loading':
+ this.loadingFailureMessage &&
+ (this.loadingFailureMessage.hidden = !0),
+ this.loadingIndicator &&
+ (this.loadingIndicator.hidden = !1);
+ break;
+ case 'error':
+ this.loadingIndicator &&
+ (this.loadingIndicator.hidden = !0),
+ this.loadingFailureMessage &&
+ (this.loadingFailureMessage.hidden = !1);
+ break;
+ default:
+ this.loadingIndicator &&
+ (this.loadingIndicator.hidden = !0),
+ this.loadingFailureMessage &&
+ (this.loadingFailureMessage.hidden = !0)
+ }
+ },
+ tj = function () {
+ return this.querySelector('.TreeViewItemCheckbox')
+ },
+ r9([tW.aC], ne.prototype, 'node', void 0),
+ r9([tW.aC], ne.prototype, 'subTree', void 0),
+ r9([tW.aC], ne.prototype, 'iconPair', void 0),
+ r9([tW.aC], ne.prototype, 'toggleButton', void 0),
+ r9([tW.aC], ne.prototype, 'expandedToggleIcon', void 0),
+ r9([tW.aC], ne.prototype, 'collapsedToggleIcon', void 0),
+ r9([tW.aC], ne.prototype, 'includeFragment', void 0),
+ r9([tW.aC], ne.prototype, 'loadingIndicator', void 0),
+ r9([tW.aC], ne.prototype, 'loadingFailureMessage', void 0),
+ r9([tW.aC], ne.prototype, 'retryButton', void 0),
+ ne = r9([tW.p_], ne),
+ window.customElements.get('tree-view-sub-tree-node') ||
+ (
+ window.TreeViewSubTreeNodeElement = ne,
+ window.customElements.define('tree-view-sub-tree-node', ne)
+ );
+ let nt = class TreeViewIncludeFragmentElement extends tN.T {
+ request() {
+ let e = super.request(),
+ t = new URL(e.url);
+ return t.searchParams.set('path', this.getAttribute('data-path') || ''),
+ new Request(
+ t,
+ {
+ method: e.method,
+ headers: e.headers,
+ credentials: e.credentials
+ }
+ )
+ }
+ };
+ nt = function (e, t, i, r) {
+ var n,
+ o = arguments.length,
+ s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
+ if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
+ else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) &&
+ (s = (o < 3 ? n(s) : o > 3 ? n(t, i, s) : n(t, i)) || s);
+ return o > 3 &&
+ s &&
+ Object.defineProperty(t, i, s),
+ s
+ }([tW.p_], nt),
+ window.customElements.get('tree-view-include-fragment') ||
+ (
+ window.TreeViewIncludeFragmentElement = nt,
+ window.customElements.define('tree-view-include-fragment', nt)
+ )
+ },
+ 21744(e, t, i) {
+ function r() {
+ if (!(this instanceof r)) return new r;
+ this.size = 0,
+ this.uid = 0,
+ this.selectors = [],
+ this.selectorObjects = {},
+ this.indexes = Object.create(this.indexes),
+ this.activeIndexes = []
+ }
+ i.d(t, {
+ h: () => C,
+ on: () => T
+ });
+ var n,
+ o = window.document.documentElement,
+ s = o.matches ||
+ o.webkitMatchesSelector ||
+ o.mozMatchesSelector ||
+ o.oMatchesSelector ||
+ o.msMatchesSelector;
+ r.prototype.matchesSelector = function (e, t) {
+ return s.call(e, t)
+ },
+ r.prototype.querySelectorAll = function (e, t) {
+ return t.querySelectorAll(e)
+ },
+ r.prototype.indexes = [];
+ var a = /^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;
+ r.prototype.indexes.push({
+ name: 'ID',
+ selector: function (e) {
+ var t;
+ if (t = e.match(a)) return t[0].slice(1)
+ },
+ element: function (e) {
+ if (e.id) return [e.id]
+ }
+ });
+ var l = /^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;
+ r.prototype.indexes.push({
+ name: 'CLASS',
+ selector: function (e) {
+ var t;
+ if (t = e.match(l)) return t[0].slice(1)
+ },
+ element: function (e) {
+ var t = e.className;
+ if (t) {
+ if ('string' == typeof t) return t.split(/\s/);
+ else if ('object' == typeof t && 'baseVal' in t) return t.baseVal.split(/\s/)
+ }
+ }
+ });
+ var c = /^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;
+ r.prototype.indexes.push({
+ name: 'TAG',
+ selector: function (e) {
+ var t;
+ if (t = e.match(c)) return t[0].toUpperCase()
+ },
+ element: function (e) {
+ return [e.nodeName.toUpperCase()]
+ }
+ }),
+ r.prototype.indexes.default = {
+ name: 'UNIVERSAL',
+ selector: function () {
+ return !0
+ },
+ element: function () {
+ return [!0]
+ }
+ },
+ n = 'function' == typeof window.Map ? window.Map : function () {
+ function e() {
+ this.map = {}
+ }
+ return e.prototype.get = function (e) {
+ return this.map[e + ' ']
+ },
+ e.prototype.set = function (e, t) {
+ this.map[e + ' '] = t
+ },
+ e
+ }();
+ var h = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;
+ function d(e, t) {
+ var i,
+ r,
+ n,
+ o,
+ s,
+ a,
+ l = (e = e.slice(0).concat(e.default)).length,
+ c = t,
+ d = [];
+ do if (h.exec(''), (n = h.exec(c)) && (c = n[3], n[2] || !c)) {
+ for (i = 0; i < l; i++) if (s = (a = e[i]).selector(n[1])) {
+ for (r = d.length, o = !1; r--; ) if (d[r].index === a && d[r].key === s) {
+ o = !0;
+ break
+ }
+ o ||
+ d.push({
+ index: a,
+ key: s
+ });
+ break
+ }
+ } while (n);
+ return d
+ }
+ function u(e, t) {
+ return e.id - t.id
+ }
+ r.prototype.logDefaultIndexUsed = function () {
+ },
+ r.prototype.add = function (e, t) {
+ var i,
+ r,
+ o,
+ s,
+ a,
+ l,
+ c,
+ h,
+ u = this.activeIndexes,
+ f = this.selectors,
+ p = this.selectorObjects;
+ if ('string' == typeof e) {
+ for (
+ r = 0,
+ p[(i = {
+ id: this.uid++,
+ selector: e,
+ data: t
+ }).id] = i,
+ c = d(this.indexes, e);
+ r < c.length;
+ r++
+ ) s = (h = c[r]).key,
+ (
+ a = function (e, t) {
+ var i,
+ r,
+ n;
+ for (i = 0, r = e.length; i < r; i++) if (n = e[i], t.isPrototypeOf(n)) return n
+ }(u, o = h.index)
+ ) ||
+ ((a = Object.create(o)).map = new n, u.push(a)),
+ o === this.indexes.default &&
+ this.logDefaultIndexUsed(i),
+ (l = a.map.get(s)) ||
+ (l = [], a.map.set(s, l)),
+ l.push(i);
+ this.size++,
+ f.push(e)
+ }
+ },
+ r.prototype.remove = function (e, t) {
+ if ('string' == typeof e) {
+ var i,
+ r,
+ n,
+ o,
+ s,
+ a,
+ l,
+ c,
+ h = this.activeIndexes,
+ u = this.selectors = [],
+ f = this.selectorObjects,
+ p = {},
+ m = 1 == arguments.length;
+ for (n = 0, i = d(this.indexes, e); n < i.length; n++) for (r = i[n], o = h.length; o--; ) if (a = h[o], r.index.isPrototypeOf(a)) {
+ if (l = a.map.get(r.key)) for (s = l.length; s--; ) (c = l[s]).selector === e &&
+ (m || c.data === t) &&
+ (l.splice(s, 1), p[c.id] = !0);
+ break
+ }
+ for (n in p) delete f[n],
+ this.size--;
+ for (n in f) u.push(f[n].selector)
+ }
+ },
+ r.prototype.queryAll = function (e) {
+ if (!this.selectors.length) return [];
+ var t,
+ i,
+ r,
+ n,
+ o,
+ s,
+ a,
+ l,
+ c = {},
+ h = [],
+ d = this.querySelectorAll(this.selectors.join(', '), e);
+ for (t = 0, r = d.length; t < r; t++) for (i = 0, o = d[t], n = (s = this.matches(o)).length; i < n; i++) c[(l = s[i]).id] ? a = c[l.id] : (
+ a = {
+ id: l.id,
+ selector: l.selector,
+ data: l.data,
+ elements: []
+ },
+ c[l.id] = a,
+ h.push(a)
+ ),
+ a.elements.push(o);
+ return h.sort(u)
+ },
+ r.prototype.matches = function (e) {
+ if (!e) return [];
+ var t,
+ i,
+ r,
+ n,
+ o,
+ s,
+ a,
+ l,
+ c,
+ h,
+ d,
+ f = this.activeIndexes,
+ p = {},
+ m = [];
+ for (t = 0, n = f.length; t < n; t++) if (l = (a = f[t]).element(e)) {
+ for (i = 0, o = l.length; i < o; i++) if (c = a.map.get(l[i])) for (r = 0, s = c.length; r < s; r++) !p[d = (h = c[r]).id] &&
+ this.matchesSelector(e, h.selector) &&
+ (p[d] = !0, m.push(h))
+ }
+ return m.sort(u)
+ };
+ var f = {},
+ p = {},
+ m = new WeakMap,
+ g = new WeakMap,
+ b = new WeakMap,
+ v = Object.getOwnPropertyDescriptor(Event.prototype, 'currentTarget');
+ function w(e, t, i) {
+ var r = e[t];
+ return e[t] = function () {
+ return i.apply(e, arguments),
+ r.apply(e, arguments)
+ },
+ e
+ }
+ function y() {
+ m.set(this, !0)
+ }
+ function E() {
+ m.set(this, !0),
+ g.set(this, !0)
+ }
+ function A() {
+ return b.get(this) ||
+ null
+ }
+ function k(e, t) {
+ v &&
+ Object.defineProperty(
+ e,
+ 'currentTarget',
+ {
+ configurable: !0,
+ enumerable: !0,
+ get: t ||
+ v.get
+ }
+ )
+ }
+ function L(e) {
+ if (function (e) {
+ try {
+ return e.eventPhase,
+ !0
+ } catch (e) {
+ return !1
+ }
+ }(e)) {
+ var t = (1 === e.eventPhase ? p : f) [e.type];
+ if (t) {
+ var i = function (e, t, i) {
+ var r = [],
+ n = t;
+ do {
+ if (1 !== n.nodeType) break;
+ var o = e.matches(n);
+ if (o.length) {
+ var s = {
+ node: n,
+ observers: o
+ };
+ i ? r.unshift(s) : r.push(s)
+ }
+ } while (n = n.parentElement);
+ return r
+ }(t, e.target, 1 === e.eventPhase);
+ if (i.length) {
+ w(e, 'stopPropagation', y),
+ w(e, 'stopImmediatePropagation', E),
+ k(e, A);
+ for (var r = 0, n = i.length; r < n && !m.get(e); r++) {
+ var o = i[r];
+ b.set(e, o.node);
+ for (var s = 0, a = o.observers.length; s < a && !g.get(e); s++) o.observers[s].data.call(o.node, e)
+ }
+ b.delete(e),
+ k(e)
+ }
+ }
+ }
+ }
+ function T(e, t, i) {
+ var n = arguments.length > 3 &&
+ void 0 !== arguments[3] ? arguments[3] : {
+ },
+ o = !!n.capture,
+ s = o ? p : f,
+ a = s[e];
+ a ||
+ (a = new r, s[e] = a, document.addEventListener(e, L, o)),
+ a.add(t, i)
+ }
+ function C(e, t, i) {
+ return e.dispatchEvent(new CustomEvent(t, {
+ bubbles: !0,
+ cancelable: !0,
+ detail: i
+ }))
+ }
+ },
+ 58466(e, t, i) {
+ var r,
+ n,
+ o,
+ s = i(70170),
+ a = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ l = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ (r = o || (o = {})).GET = 'GET',
+ r.POST = 'POST';
+ let c = new WeakMap;
+ let AutoCheckEvent = class AutoCheckEvent extends Event {
+ constructor(e) {
+ super (`auto-check-${ e }`, {
+ bubbles: !0
+ }),
+ this.phase = e
+ }
+ get detail() {
+ return this
+ }
+ };
+ let AutoCheckValidationEvent = class AutoCheckValidationEvent extends AutoCheckEvent {
+ constructor(e, t = '') {
+ super (e),
+ this.phase = e,
+ this.message = t,
+ this.setValidity = e => {
+ this.message = e
+ }
+ }
+ };
+ let AutoCheckCompleteEvent = class AutoCheckCompleteEvent extends AutoCheckEvent {
+ constructor() {
+ super ('complete')
+ }
+ };
+ let AutoCheckSuccessEvent = class AutoCheckSuccessEvent extends AutoCheckEvent {
+ constructor(e) {
+ super ('success'),
+ this.response = e
+ }
+ };
+ let AutoCheckStartEvent = class AutoCheckStartEvent extends AutoCheckValidationEvent {
+ constructor() {
+ super ('start', 'Verifying…')
+ }
+ };
+ let AutoCheckErrorEvent = class AutoCheckErrorEvent extends AutoCheckValidationEvent {
+ constructor(e) {
+ super ('error', 'Validation failed'),
+ this.response = e
+ }
+ };
+ let AutoCheckSendEvent = class AutoCheckSendEvent extends AutoCheckEvent {
+ constructor(e) {
+ super ('send'),
+ this.body = e
+ }
+ };
+ let auto_check_element_AutoCheckElement = class auto_check_element_AutoCheckElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ n.set(this, null)
+ }
+ static define(e = 'auto-check', t = customElements) {
+ return t.define(e, this),
+ this
+ }
+ get onloadend() {
+ return a(this, n, 'f')
+ }
+ set onloadend(e) {
+ a(this, n, 'f') &&
+ this.removeEventListener('loadend', a(this, n, 'f')),
+ l(this, n, 'object' == typeof e || 'function' == typeof e ? e : null, 'f'),
+ 'function' == typeof e &&
+ this.addEventListener('loadend', e)
+ }
+ connectedCallback() {
+ let e = this.input;
+ if (!e) return;
+ let t = (0, s.s) (f.bind(null, this), 300);
+ c.set(this, {
+ check: t,
+ controller: null
+ });
+ let i = h.bind(null, t);
+ e.addEventListener('blur', i),
+ e.addEventListener('input', i),
+ e.addEventListener('triggervalidation', i),
+ e.autocomplete = 'off',
+ e.spellcheck = !1
+ }
+ disconnectedCallback() {
+ let e = this.input;
+ if (!e) return;
+ let t = c.get(this);
+ t &&
+ (
+ c.delete(this),
+ e.removeEventListener('input', d),
+ e.removeEventListener('input', t.check),
+ e.setCustomValidity('')
+ )
+ }
+ attributeChangedCallback(e) {
+ if ('required' === e) {
+ let e = this.input;
+ e &&
+ (e.required = this.required)
+ }
+ }
+ triggerValidation() {
+ let e = this.input;
+ e &&
+ e.dispatchEvent(new CustomEvent('triggervalidation'))
+ }
+ static get observedAttributes() {
+ return ['required']
+ }
+ get input() {
+ return this.querySelector('input')
+ }
+ get src() {
+ let e = this.getAttribute('src');
+ if (!e) return '';
+ let t = this.ownerDocument.createElement('a');
+ return t.href = e,
+ t.href
+ }
+ set src(e) {
+ this.setAttribute('src', e)
+ }
+ get csrf() {
+ let e = this.querySelector('[data-csrf]');
+ return this.getAttribute('csrf') ||
+ e instanceof HTMLInputElement &&
+ e.value ||
+ ''
+ }
+ set csrf(e) {
+ this.setAttribute('csrf', e)
+ }
+ get required() {
+ return this.hasAttribute('required')
+ }
+ set required(e) {
+ e ? this.setAttribute('required', '') : this.removeAttribute('required')
+ }
+ get csrfField() {
+ return this.getAttribute('csrf-field') ||
+ 'authenticity_token'
+ }
+ set csrfField(e) {
+ this.setAttribute('csrf-field', e)
+ }
+ get httpMethod() {
+ return o[this.getAttribute('http-method')] ||
+ 'POST'
+ }
+ set validateOnKeystroke(e) {
+ e ? this.setAttribute('validate-on-keystroke', '') : this.removeAttribute('validate-on-keystroke')
+ }
+ get validateOnKeystroke() {
+ let e = this.getAttribute('validate-on-keystroke');
+ return 'true' === e ||
+ '' === e
+ }
+ };
+ function h(e, t) {
+ let i = t.currentTarget;
+ if (!(i instanceof HTMLInputElement)) return;
+ let r = i.closest('auto-check');
+ !(r instanceof auto_check_element_AutoCheckElement) ||
+ (
+ 'input' === t.type &&
+ r.setAttribute('dirty', ''),
+ 0 !== i.value.length &&
+ (
+ 'blur' === t.type &&
+ !r.validateOnKeystroke &&
+ r.hasAttribute('dirty') ||
+ 'input' === t.type &&
+ r.validateOnKeystroke ||
+ 'triggervalidation' === t.type
+ ) &&
+ (d(t), e())
+ )
+ }
+ function d(e) {
+ let t = e.currentTarget;
+ if (!(t instanceof HTMLInputElement)) return;
+ let i = t.closest('auto-check');
+ if (!(i instanceof auto_check_element_AutoCheckElement)) return;
+ let r = i.src,
+ n = i.csrf,
+ o = i.httpMethod,
+ s = c.get(i);
+ if (!r || 'POST' === o && !n || !s) return;
+ let a = new AutoCheckStartEvent;
+ t.dispatchEvent(a),
+ i.required &&
+ t.setCustomValidity(a.message)
+ }
+ async function u(e, t, i) {
+ 'GET' === i.method &&
+ delete i.body;
+ try {
+ let r = await fetch(t, i);
+ return e.dispatchEvent(new Event('load')),
+ e.dispatchEvent(new Event('loadend')),
+ r
+ } catch (t) {
+ throw 'AbortError' !== t.name &&
+ (
+ e.dispatchEvent(new Event('error')),
+ e.dispatchEvent(new Event('loadend'))
+ ),
+ t
+ }
+ }
+ async function f(e) {
+ let t = e.input;
+ if (!t) return;
+ let i = e.csrfField,
+ r = e.src,
+ n = e.csrf,
+ o = c.get(e),
+ s = e.httpMethod;
+ if (!r || 'POST' === s && !n || !o || !t.value.trim()) {
+ e.required &&
+ t.setCustomValidity('');
+ return
+ }
+ let a = new FormData,
+ l = new URL(r, window.location.origin);
+ 'POST' === s ? (a.append(i, n), a.append('value', t.value)) : l.search = new URLSearchParams({
+ value: t.value
+ }).toString(),
+ t.dispatchEvent(new AutoCheckSendEvent(a)),
+ o.controller ? o.controller.abort() : e.dispatchEvent(new Event('loadstart')),
+ o.controller = 'AbortController' in window ? new AbortController : {
+ signal: null,
+ abort() {
+ }
+ },
+ e.removeAttribute('dirty');
+ try {
+ let i = await u(
+ e,
+ l.toString(),
+ {
+ credentials: 'same-origin',
+ signal: o.controller.signal,
+ method: s,
+ body: a
+ }
+ );
+ if (i.ok) e.required &&
+ t.setCustomValidity(''),
+ e.validateOnKeystroke = !1,
+ t.dispatchEvent(new AutoCheckSuccessEvent(i.clone()));
+ else {
+ e.validateOnKeystroke = !0;
+ let r = new AutoCheckErrorEvent(i.clone());
+ t.dispatchEvent(r),
+ e.required &&
+ t.setCustomValidity(r.message)
+ }
+ o.controller = null,
+ t.dispatchEvent(new AutoCheckCompleteEvent)
+ } catch (e) {
+ 'AbortError' !== e.name &&
+ (o.controller = null, t.dispatchEvent(new AutoCheckCompleteEvent))
+ }
+ }
+ n = new WeakMap;
+ let p = 'u' > typeof globalThis ? globalThis : window;
+ try {
+ p.AutoCheckElement = auto_check_element_AutoCheckElement.define()
+ } catch (e) {
+ if (
+ !(
+ p.DOMException &&
+ e instanceof DOMException &&
+ 'NotSupportedError' === e.name
+ ) &&
+ !(e instanceof ReferenceError)
+ ) throw e
+ }
+ },
+ 28528(e, t, i) {
+ function r(e) {
+ if ('clipboard' in navigator) return navigator.clipboard.writeText(e.textContent || '');
+ let t = getSelection();
+ if (null == t) return Promise.reject(Error());
+ t.removeAllRanges();
+ let i = document.createRange();
+ return i.selectNodeContents(e),
+ t.addRange(i),
+ document.execCommand('copy'),
+ t.removeAllRanges(),
+ Promise.resolve()
+ }
+ function n(e) {
+ let t;
+ if ('clipboard' in navigator) return navigator.clipboard.writeText(e);
+ let i = document.body;
+ if (!i) return Promise.reject(Error());
+ let n = (
+ (t = document.createElement('pre')).style.width = '1px',
+ t.style.height = '1px',
+ t.style.position = 'fixed',
+ t.style.top = '5px',
+ t.textContent = e,
+ t
+ );
+ return i.appendChild(n),
+ r(n),
+ i.removeChild(n),
+ Promise.resolve()
+ }
+ async function o(e) {
+ let t = e.getAttribute('for'),
+ i = e.getAttribute('value');
+ function o() {
+ e.dispatchEvent(new CustomEvent('clipboard-copy', {
+ bubbles: !0
+ }))
+ }
+ if ('true' !== e.getAttribute('aria-disabled')) {
+ if (i) await n(i),
+ o();
+ else if (t) {
+ var s;
+ let i = 'getRootNode' in Element.prototype ? e.getRootNode() : e.ownerDocument;
+ if (
+ !(
+ i instanceof Document ||
+ 'ShadowRoot' in window &&
+ i instanceof ShadowRoot
+ )
+ ) return;
+ let a = i.getElementById(t);
+ a &&
+ (
+ await(
+ (s = a) instanceof HTMLInputElement ||
+ s instanceof HTMLTextAreaElement ? n(s.value) : s instanceof HTMLAnchorElement &&
+ s.hasAttribute('href') ? n(s.href) : r(s)
+ ),
+ o()
+ )
+ }
+ }
+ }
+ function s(e) {
+ let t = e.currentTarget;
+ t instanceof HTMLElement &&
+ o(t)
+ }
+ function a(e) {
+ if (' ' === e.key || 'Enter' === e.key) {
+ let t = e.currentTarget;
+ t instanceof HTMLElement &&
+ (e.preventDefault(), o(t))
+ }
+ }
+ function l(e) {
+ e.currentTarget.addEventListener('keydown', a)
+ }
+ function c(e) {
+ e.currentTarget.removeEventListener('keydown', a)
+ }
+ i.d(t, {
+ S: () => clipboard_copy_element_ClipboardCopyElement
+ });
+ let clipboard_copy_element_ClipboardCopyElement = class clipboard_copy_element_ClipboardCopyElement extends HTMLElement {
+ static define(e = 'clipboard-copy', t = customElements) {
+ return t.define(e, this),
+ this
+ }
+ constructor() {
+ super (),
+ this.addEventListener('click', s),
+ this.addEventListener('focus', l),
+ this.addEventListener('blur', c)
+ }
+ connectedCallback() {
+ this.hasAttribute('tabindex') ||
+ this.setAttribute('tabindex', '0'),
+ this.hasAttribute('role') ||
+ this.setAttribute('role', 'button')
+ }
+ get value() {
+ return this.getAttribute('value') ||
+ ''
+ }
+ set value(e) {
+ this.setAttribute('value', e)
+ }
+ };
+ let h = 'u' > typeof globalThis ? globalThis : window;
+ try {
+ h.ClipboardCopyElement = clipboard_copy_element_ClipboardCopyElement.define()
+ } catch (e) {
+ if (
+ !(
+ h.DOMException &&
+ e instanceof DOMException &&
+ 'NotSupportedError' === e.name
+ ) &&
+ !(e instanceof ReferenceError)
+ ) throw e
+ }
+ },
+ 35908(e, t, i) {
+ i.d(t, {
+ A: () => Combobox
+ });
+ let Combobox = class Combobox {
+ constructor(
+ e,
+ t,
+ {
+ tabInsertsSuggestions: i,
+ firstOptionSelectionMode: r,
+ scrollIntoViewOptions: o
+ }
+ = {}
+ ) {
+ this.input = e,
+ this.list = t,
+ this.tabInsertsSuggestions = null == i ||
+ i,
+ this.firstOptionSelectionMode = null != r ? r : 'none',
+ this.scrollIntoViewOptions = null != o ? o : {
+ block: 'nearest',
+ inline: 'nearest'
+ },
+ this.isComposing = !1,
+ t.id ||
+ (t.id = `combobox-${ Math.random().toString().slice(2, 6) }`),
+ this.ctrlBindings = !!navigator.userAgent.match(/Macintosh/),
+ this.keyboardEventHandler = e => (
+ function (e, t) {
+ if (
+ !e.shiftKey &&
+ !e.metaKey &&
+ !e.altKey &&
+ (t.ctrlBindings || !e.ctrlKey) &&
+ !t.isComposing
+ ) switch (e.key) {
+ case 'Enter':
+ n(t.input, t.list) &&
+ e.preventDefault();
+ break;
+ case 'Tab':
+ t.tabInsertsSuggestions &&
+ n(t.input, t.list) &&
+ e.preventDefault();
+ break;
+ case 'Escape':
+ t.clearSelection();
+ break;
+ case 'ArrowDown':
+ t.navigate(1),
+ e.preventDefault();
+ break;
+ case 'ArrowUp':
+ t.navigate( - 1),
+ e.preventDefault();
+ break;
+ case 'n':
+ t.ctrlBindings &&
+ e.ctrlKey &&
+ (t.navigate(1), e.preventDefault());
+ break;
+ case 'p':
+ t.ctrlBindings &&
+ e.ctrlKey &&
+ (t.navigate( - 1), e.preventDefault());
+ break;
+ default:
+ if (e.ctrlKey) break;
+ t.resetSelection()
+ }
+ }
+ ) (e, this),
+ this.compositionEventHandler = e => {
+ var t,
+ i;
+ return t = e,
+ i = this,
+ void (
+ i.isComposing = 'compositionstart' === t.type,
+ document.getElementById(i.input.getAttribute('aria-controls') || '') &&
+ i.clearSelection()
+ )
+ },
+ this.inputHandler = this.clearSelection.bind(this),
+ e.setAttribute('role', 'combobox'),
+ e.setAttribute('aria-controls', t.id),
+ e.setAttribute('aria-expanded', 'false'),
+ e.setAttribute('aria-autocomplete', 'list'),
+ e.setAttribute('aria-haspopup', 'listbox')
+ }
+ destroy() {
+ this.clearSelection(),
+ this.stop(),
+ this.input.removeAttribute('role'),
+ this.input.removeAttribute('aria-controls'),
+ this.input.removeAttribute('aria-expanded'),
+ this.input.removeAttribute('aria-autocomplete'),
+ this.input.removeAttribute('aria-haspopup')
+ }
+ start() {
+ this.input.setAttribute('aria-expanded', 'true'),
+ this.input.addEventListener('compositionstart', this.compositionEventHandler),
+ this.input.addEventListener('compositionend', this.compositionEventHandler),
+ this.input.addEventListener('input', this.inputHandler),
+ this.input.addEventListener('keydown', this.keyboardEventHandler),
+ this.list.addEventListener('click', r),
+ this.resetSelection()
+ }
+ stop() {
+ this.clearSelection(),
+ this.input.setAttribute('aria-expanded', 'false'),
+ this.input.removeEventListener('compositionstart', this.compositionEventHandler),
+ this.input.removeEventListener('compositionend', this.compositionEventHandler),
+ this.input.removeEventListener('input', this.inputHandler),
+ this.input.removeEventListener('keydown', this.keyboardEventHandler),
+ this.list.removeEventListener('click', r)
+ }
+ indicateDefaultOption() {
+ var e;
+ 'active' === this.firstOptionSelectionMode ? null == (
+ e = Array.from(
+ this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')
+ ).filter(o) [0]
+ ) ||
+ e.setAttribute('data-combobox-option-default', 'true') : 'selected' === this.firstOptionSelectionMode &&
+ this.navigate(1)
+ }
+ navigate(e = 1) {
+ let t = Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(o) [0],
+ i = Array.from(this.list.querySelectorAll('[role="option"]')).filter(o),
+ r = i.indexOf(t);
+ if (r === i.length - 1 && 1 === e || 0 === r && - 1 === e) {
+ this.clearSelection(),
+ this.input.focus();
+ return
+ }
+ let n = 1 === e ? 0 : i.length - 1;
+ if (t && r >= 0) {
+ let t = r + e;
+ t >= 0 &&
+ t < i.length &&
+ (n = t)
+ }
+ let s = i[n];
+ if (s) for (let e of i) e.removeAttribute('data-combobox-option-default'),
+ s === e ? (
+ this.input.setAttribute('aria-activedescendant', s.id),
+ s.setAttribute('aria-selected', 'true'),
+ s.dispatchEvent(new Event('combobox-select', {
+ bubbles: !0
+ })),
+ s.scrollIntoView(this.scrollIntoViewOptions)
+ ) : e.removeAttribute('aria-selected')
+ }
+ clearSelection() {
+ for (
+ let e of (
+ this.input.removeAttribute('aria-activedescendant'),
+ this.list.querySelectorAll(
+ '[aria-selected="true"], [data-combobox-option-default="true"]'
+ )
+ )
+ ) e.removeAttribute('aria-selected'),
+ e.removeAttribute('data-combobox-option-default')
+ }
+ resetSelection() {
+ this.clearSelection(),
+ this.indicateDefaultOption()
+ }
+ };
+ function r(e) {
+ var t,
+ i;
+ if (!(e.target instanceof Element)) return;
+ let r = e.target.closest('[role="option"]');
+ r &&
+ 'true' !== r.getAttribute('aria-disabled') &&
+ (
+ t = r,
+ i = {
+ event: e
+ },
+ t.dispatchEvent(new CustomEvent('combobox-commit', {
+ bubbles: !0,
+ detail: i
+ }))
+ )
+ }
+ function n(e, t) {
+ let i = t.querySelector(
+ '[aria-selected="true"], [data-combobox-option-default="true"]'
+ );
+ return !!i &&
+ ('true' === i.getAttribute('aria-disabled') || (i.click(), !0))
+ }
+ function o(e) {
+ return !e.hidden &&
+ !(e instanceof HTMLInputElement && 'hidden' === e.type) &&
+ (e.offsetWidth > 0 || e.offsetHeight > 0)
+ }
+ },
+ 60612() {
+ let DetailsMenuElement = class DetailsMenuElement extends HTMLElement {
+ get preload() {
+ return this.hasAttribute('preload')
+ }
+ set preload(e) {
+ e ? this.setAttribute('preload', '') : this.removeAttribute('preload')
+ }
+ get src() {
+ return this.getAttribute('src') ||
+ ''
+ }
+ set src(e) {
+ this.setAttribute('src', e)
+ }
+ connectedCallback() {
+ var l;
+ let u;
+ this.hasAttribute('role') ||
+ this.setAttribute('role', 'menu');
+ let f = this.parentElement;
+ if (!f) return;
+ let p = f.querySelector('summary');
+ p &&
+ (
+ p.setAttribute('aria-haspopup', 'menu'),
+ p.hasAttribute('role') ||
+ p.setAttribute('role', 'button')
+ );
+ let m = [
+ i(f, 'compositionstart', e => d(this, e)),
+ i(f, 'compositionend', e => d(this, e)),
+ i(f, 'click', e => a(f, e)),
+ i(f, 'change', e => a(f, e)),
+ i(
+ f,
+ 'keydown',
+ t => (
+ function (t, i, r) {
+ if (
+ !(r instanceof KeyboardEvent) ||
+ t.querySelector('details[open]')
+ ) return;
+ let n = e.get(i);
+ if (!n || n.isComposing) return;
+ let a = r.target instanceof Element &&
+ 'SUMMARY' === r.target.tagName;
+ switch (r.key) {
+ case 'Escape':
+ t.hasAttribute('open') &&
+ (h(t), r.preventDefault(), r.stopPropagation());
+ break;
+ case 'ArrowDown':
+ {
+ a &&
+ !t.hasAttribute('open') &&
+ t.setAttribute('open', '');
+ let e = o(t, !0);
+ e &&
+ e.focus(),
+ r.preventDefault()
+ }
+ break;
+ case 'ArrowUp':
+ {
+ a &&
+ !t.hasAttribute('open') &&
+ t.setAttribute('open', '');
+ let e = o(t, !1);
+ e &&
+ e.focus(),
+ r.preventDefault()
+ }
+ break;
+ case 'n':
+ if (s && r.ctrlKey) {
+ let e = o(t, !0);
+ e &&
+ e.focus(),
+ r.preventDefault()
+ }
+ break;
+ case 'p':
+ if (s && r.ctrlKey) {
+ let e = o(t, !1);
+ e &&
+ e.focus(),
+ r.preventDefault()
+ }
+ break;
+ case ' ':
+ case 'Enter':
+ {
+ let e = document.activeElement;
+ e instanceof HTMLElement &&
+ c(e) &&
+ e.closest('details') === t &&
+ (r.preventDefault(), r.stopPropagation(), e.click())
+ }
+ }
+ }
+ ) (f, this, t)
+ ),
+ i(f, 'toggle', () => r(f, this), {
+ once: !0
+ }),
+ i(
+ f,
+ 'toggle',
+ () => (
+ function (e) {
+ if (e.hasAttribute('open')) for (
+ let t of document.querySelectorAll('details[open] > details-menu')
+ ) {
+ let i = t.closest('details');
+ i &&
+ i !== e &&
+ !i.contains(e) &&
+ i.removeAttribute('open')
+ }
+ }
+ ) (f)
+ ),
+ this.preload ? i(f, 'mouseover', () => r(f, this), {
+ once: !0
+ }) : t,
+ ...(
+ u = !1,
+ [
+ i(l = f, 'mousedown', () => u = !0),
+ i(l, 'keydown', () => u = !1),
+ i(
+ l,
+ 'toggle',
+ () => {
+ l.hasAttribute('open') &&
+ !n(l) &&
+ (
+ u ||
+ function (e) {
+ let t = document.activeElement;
+ if (t && c(t) && e.contains(t)) return;
+ let i = o(e, !0);
+ i &&
+ i.focus()
+ }(l)
+ )
+ }
+ )
+ ]
+ )
+ ];
+ e.set(this, {
+ subscriptions: m,
+ loaded: !1,
+ isComposing: !1
+ })
+ }
+ disconnectedCallback() {
+ let t = e.get(this);
+ if (t) for (let i of (e.delete(this), t.subscriptions)) i.unsubscribe()
+ }
+ };
+ let e = new WeakMap,
+ t = {
+ unsubscribe() {
+ }
+ };
+ function i(e, t, r, n = !1) {
+ return e.addEventListener(t, r, n),
+ {
+ unsubscribe: () => {
+ e.removeEventListener(t, r, n)
+ }
+ }
+ }
+ function r(t, i) {
+ let r = i.getAttribute('src');
+ if (!r) return;
+ let o = e.get(i);
+ if (!o || o.loaded) return;
+ o.loaded = !0;
+ let s = i.querySelector('include-fragment');
+ s &&
+ !s.hasAttribute('src') &&
+ (
+ s.addEventListener('loadend', () => n(t)),
+ s.setAttribute('src', r)
+ )
+ }
+ function n(e) {
+ if (!e.hasAttribute('open')) return !1;
+ let t = e.querySelector('details-menu [autofocus]');
+ return !!t &&
+ (t.focus(), !0)
+ }
+ function o(e, t) {
+ let i = Array.from(
+ e.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')
+ ),
+ r = document.activeElement,
+ n = r instanceof HTMLElement ? i.indexOf(r) : - 1,
+ o = t ? i[n + 1] : i[n - 1],
+ s = t ? i[0] : i[i.length - 1];
+ return o ||
+ s
+ }
+ let s = navigator.userAgent.match(/Macintosh/);
+ function a(e, t) {
+ let i = t.target;
+ if (i instanceof Element && i.closest('details') === e) {
+ if ('click' === t.type) {
+ let t = i.closest('[role="menuitem"], [role="menuitemradio"]');
+ if (!t) return;
+ let r = t.querySelector('input');
+ if ('LABEL' === t.tagName && i === r) return;
+ 'LABEL' === t.tagName &&
+ r &&
+ !r.checked ||
+ l(t, e)
+ } else if ('change' === t.type) {
+ let t = i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');
+ t &&
+ l(t, e)
+ }
+ }
+ }
+ function l(e, t) {
+ if (
+ e.hasAttribute('disabled') ||
+ 'true' === e.getAttribute('aria-disabled')
+ ) return;
+ let i = e.closest('details-menu');
+ if (
+ i &&
+ i.dispatchEvent(
+ new CustomEvent(
+ 'details-menu-select',
+ {
+ cancelable: !0,
+ detail: {
+ relatedTarget: e
+ }
+ }
+ )
+ )
+ ) {
+ !function (e, t) {
+ let i = t.querySelector('[data-menu-button]');
+ if (!i) return;
+ let r = function (e) {
+ if (!e) return null;
+ let t = e.hasAttribute('data-menu-button-text') ? e : e.querySelector('[data-menu-button-text]');
+ return t ? t.getAttribute('data-menu-button-text') ||
+ t.textContent : null
+ }(e);
+ if (r) i.textContent = r;
+ else {
+ let t = function (e) {
+ if (!e) return null;
+ let t = e.hasAttribute('data-menu-button-contents') ? e : e.querySelector('[data-menu-button-contents]');
+ return t ? t.innerHTML : null
+ }(e);
+ t &&
+ (i.innerHTML = t)
+ }
+ }(e, t);
+ for (
+ let i of t.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')
+ ) {
+ let t = i.querySelector('input[type="radio"], input[type="checkbox"]'),
+ r = (i === e).toString();
+ t instanceof HTMLInputElement &&
+ (r = t.indeterminate ? 'mixed' : t.checked.toString()),
+ i.setAttribute('aria-checked', r)
+ }
+ 'menuitemcheckbox' !== e.getAttribute('role') &&
+ h(t),
+ i.dispatchEvent(
+ new CustomEvent('details-menu-selected', {
+ detail: {
+ relatedTarget: e
+ }
+ })
+ )
+ }
+ }
+ function c(e) {
+ let t = e.getAttribute('role');
+ return 'menuitem' === t ||
+ 'menuitemcheckbox' === t ||
+ 'menuitemradio' === t
+ }
+ function h(e) {
+ if (!e.hasAttribute('open')) return;
+ e.removeAttribute('open');
+ let t = e.querySelector('summary');
+ t &&
+ t.focus()
+ }
+ function d(t, i) {
+ let r = e.get(t);
+ r &&
+ (r.isComposing = 'compositionstart' === i.type)
+ }
+ window.customElements.get('details-menu') ||
+ (
+ window.DetailsMenuElement = DetailsMenuElement,
+ window.customElements.define('details-menu', DetailsMenuElement)
+ )
+ },
+ 90204(e, t, i) {
+ i.d(t, {
+ R3: () => o
+ });
+ let r = new Set(
+ ['👋',
+ '🤚',
+ '🖐️',
+ '✋',
+ '🖖',
+ '👌',
+ '🤏',
+ '✌️',
+ '🤞',
+ '🤟',
+ '🤘',
+ '🤙',
+ '👈',
+ '👉',
+ '👆',
+ '🖕',
+ '👇',
+ '☝️',
+ '👍',
+ '👎',
+ '✊',
+ '👊',
+ '🤛',
+ '🤜',
+ '👏',
+ '🙌',
+ '👐',
+ '🤲',
+ '🙏',
+ '✍️',
+ '💅',
+ '🤳',
+ '💪',
+ '🦵',
+ '🦶',
+ '👂',
+ '🦻',
+ '👃',
+ '👶',
+ '🧒',
+ '👦',
+ '👧',
+ '🧑',
+ '👱',
+ '👨',
+ '🧔',
+ '👱♂️',
+ '👨🦰',
+ '👨🦱',
+ '👨🦳',
+ '👨🦲',
+ '👩',
+ '👱♀️',
+ '👩🦰',
+ '👩🦱',
+ '👩🦳',
+ '👩🦲',
+ '🧓',
+ '👴',
+ '👵',
+ '🙍',
+ '🙍♂️',
+ '🙍♀️',
+ '🙎',
+ '🙎♂️',
+ '🙎♀️',
+ '🙅',
+ '🙅♂️',
+ '🙅♀️',
+ '🙆',
+ '🙆♂️',
+ '🙆♀️',
+ '💁',
+ '💁♂️',
+ '💁♀️',
+ '🙋',
+ '🙋♂️',
+ '🙋♀️',
+ '🧏',
+ '🧏♂️',
+ '🧏♀️',
+ '🙇',
+ '🙇♂️',
+ '🙇♀️',
+ '🤦',
+ '🤦♂️',
+ '🤦♀️',
+ '🤷',
+ '🤷♂️',
+ '🤷♀️',
+ '👨⚕️',
+ '👩⚕️',
+ '👨🎓',
+ '👩🎓',
+ '👨🏫',
+ '👩🏫',
+ '👨⚖️',
+ '👩⚖️',
+ '👨🌾',
+ '👩🌾',
+ '👨🍳',
+ '👩🍳',
+ '👨🔧',
+ '👩🔧',
+ '👨🏭',
+ '👩🏭',
+ '👨💼',
+ '👩💼',
+ '👨🔬',
+ '👩🔬',
+ '👨💻',
+ '👩💻',
+ '👨🎤',
+ '👩🎤',
+ '👨🎨',
+ '👩🎨',
+ '👨✈️',
+ '👩✈️',
+ '👨🚀',
+ '👩🚀',
+ '👨🚒',
+ '👩🚒',
+ '👮',
+ '👮♂️',
+ '👮♀️',
+ '🕵️',
+ '🕵️♂️',
+ '🕵️♀️',
+ '💂',
+ '💂♂️',
+ '💂♀️',
+ '👷',
+ '👷♂️',
+ '👷♀️',
+ '🤴',
+ '👸',
+ '👳',
+ '👳♂️',
+ '👳♀️',
+ '👲',
+ '🧕',
+ '🤵',
+ '👰',
+ '🤰',
+ '🤱',
+ '👼',
+ '🎅',
+ '🤶',
+ '🦸',
+ '🦸♂️',
+ '🦸♀️',
+ '🦹',
+ '🦹♂️',
+ '🦹♀️',
+ '🧙',
+ '🧙♂️',
+ '🧙♀️',
+ '🧚',
+ '🧚♂️',
+ '🧚♀️',
+ '🧛',
+ '🧛♂️',
+ '🧛♀️',
+ '🧜',
+ '🧜♂️',
+ '🧜♀️',
+ '🧝',
+ '🧝♂️',
+ '🧝♀️',
+ '💆',
+ '💆♂️',
+ '💆♀️',
+ '💇',
+ '💇♂️',
+ '💇♀️',
+ '🚶',
+ '🚶♂️',
+ '🚶♀️',
+ '🧍',
+ '🧍♂️',
+ '🧍♀️',
+ '🧎',
+ '🧎♂️',
+ '🧎♀️',
+ '👨🦯',
+ '👩🦯',
+ '👨🦼',
+ '👩🦼',
+ '👨🦽',
+ '👩🦽',
+ '🏃',
+ '🏃♂️',
+ '🏃♀️',
+ '💃',
+ '🕺',
+ '🕴️',
+ '🧖',
+ '🧖♂️',
+ '🧖♀️',
+ '🧗',
+ '🧗♂️',
+ '🧗♀️',
+ '🏇',
+ '🏂',
+ '🏌️',
+ '🏌️♂️',
+ '🏌️♀️',
+ '🏄',
+ '🏄♂️',
+ '🏄♀️',
+ '🚣',
+ '🚣♂️',
+ '🚣♀️',
+ '🏊',
+ '🏊♂️',
+ '🏊♀️',
+ '⛹️',
+ '⛹️♂️',
+ '⛹️♀️',
+ '🏋️',
+ '🏋️♂️',
+ '🏋️♀️',
+ '🚴',
+ '🚴♂️',
+ '🚴♀️',
+ '🚵',
+ '🚵♂️',
+ '🚵♀️',
+ '🤸',
+ '🤸♂️',
+ '🤸♀️',
+ '🤽',
+ '🤽♂️',
+ '🤽♀️',
+ '🤾',
+ '🤾♂️',
+ '🤾♀️',
+ '🤹',
+ '🤹♂️',
+ '🤹♀️',
+ '🧘',
+ '🧘♂️',
+ '🧘♀️',
+ '🛀',
+ '🛌',
+ '🧑🤝🧑',
+ '👭',
+ '👫',
+ '👬']
+ );
+ function n(e) {
+ return r.has(e)
+ }
+ function o(e, t) {
+ let i = s(e);
+ if (!n(i)) return e;
+ let r = c(t);
+ return r ? i.split('').map(e => n(e) ? a(e, r) : e).join('') : e
+ }
+ function s(e) {
+ return [...e].filter(e => !l(e.codePointAt(0))).join('')
+ }
+ function a(e, t) {
+ let i = [
+ ...e
+ ].map(e => e.codePointAt(0));
+ return i[1] &&
+ (l(i[1]) || 65039 === i[1]) ? i[1] = t : i.splice(1, 0, t),
+ String.fromCodePoint(...i)
+ }
+ function l(e) {
+ return e >= 127995 &&
+ e <= 127999
+ }
+ function c(e) {
+ switch (e) {
+ case 1:
+ return 127995;
+ case 2:
+ return 127996;
+ case 3:
+ return 127997;
+ case 4:
+ return 127998;
+ case 5:
+ return 127999;
+ default:
+ return null
+ }
+ }
+ let GEmojiElement = class GEmojiElement extends HTMLElement {
+ get image() {
+ return this.firstElementChild instanceof HTMLImageElement ? this.firstElementChild : null
+ }
+ get tone() {
+ return (this.getAttribute('tone') || '').split(' ').map(e => {
+ let t = parseInt(e, 10);
+ return t >= 0 &&
+ t <= 5 ? t : 0
+ }).join(' ')
+ }
+ set tone(e) {
+ this.setAttribute('tone', e)
+ }
+ connectedCallback() {
+ if (null === this.image && !GEmojiElement.emojiSupportFunction()) {
+ let t = this.getAttribute('fallback-src');
+ if (t) {
+ var e;
+ let i;
+ this.textContent = '';
+ let r = (
+ e = this,
+ (i = document.createElement('img')).className = 'emoji',
+ i.alt = e.getAttribute('alias') ||
+ '',
+ i.height = 20,
+ i.width = 20,
+ i
+ );
+ r.src = t,
+ this.appendChild(r)
+ }
+ }
+ this.hasAttribute('tone') &&
+ h(this)
+ }
+ static get observedAttributes() {
+ return ['tone']
+ }
+ attributeChangedCallback(e) {
+ 'tone' === e &&
+ h(this)
+ }
+ };
+ function h(e) {
+ if (e.image) return;
+ let t = e.tone.split(' ').map(e => parseInt(e, 10));
+ if (0 === t.length) e.textContent = s(e.textContent || '');
+ else if (1 === t.length) {
+ let i = t[0];
+ e.textContent = 0 === i ? s(e.textContent || '') : o(e.textContent || '', i)
+ } else e.textContent = function (e, t) {
+ let i = s(e);
+ if (!n(i)) return e;
+ let r = t.map(e => c(e));
+ return i.split('').map(e => {
+ if (!n(e)) return e;
+ let t = r.shift();
+ return t ? a(e, t) : e
+ }).join('')
+ }(e.textContent || '', t)
+ }
+ GEmojiElement.emojiSupportFunction = function () {
+ let e = /\bWindows NT 6.1\b/.test(navigator.userAgent),
+ t = /\bWindows NT 6.2\b/.test(navigator.userAgent),
+ i = /\bWindows NT 6.3\b/.test(navigator.userAgent),
+ r = /\bFreeBSD\b/.test(navigator.userAgent),
+ n = /\bLinux\b/.test(navigator.userAgent) &&
+ !/\bAndroid\b/.test(navigator.userAgent);
+ return !(e || t || i || n || r)
+ },
+ window.customElements.get('g-emoji') ||
+ (
+ window.GEmojiElement = GEmojiElement,
+ window.customElements.define('g-emoji', GEmojiElement)
+ )
+ },
+ 92284() {
+ let e = new WeakMap,
+ t = new WeakMap,
+ i = new WeakMap;
+ function r(e) {
+ let r = e.currentTarget;
+ if (!(r instanceof ImageCropElement)) return;
+ let {
+ box: n,
+ image: o
+ }
+ = i.get(r) ||
+ {
+ };
+ if (!n || !o) return;
+ let s = 0,
+ a = 0;
+ if (e instanceof KeyboardEvent) 'ArrowUp' === e.key ? a = - 1 : 'ArrowDown' === e.key ? a = 1 : 'ArrowLeft' === e.key ? s = - 1 : 'ArrowRight' === e.key &&
+ (s = 1);
+ else if (t.has(r) && e instanceof MouseEvent) {
+ let i = t.get(r);
+ s = e.pageX - i.dragStartX,
+ a = e.pageY - i.dragStartY
+ } else if (t.has(r) && e instanceof TouchEvent) {
+ let {
+ pageX: i,
+ pageY: n
+ }
+ = e.changedTouches[0],
+ {
+ dragStartX: o,
+ dragStartY: l
+ }
+ = t.get(r);
+ s = i - o,
+ a = n - l
+ }
+ if (0 !== s || 0 !== a) {
+ let e = Math.min(Math.max(0, n.offsetLeft + s), o.width - n.offsetWidth),
+ t = Math.min(Math.max(0, n.offsetTop + a), o.height - n.offsetHeight);
+ n.style.left = `${ e }px`,
+ n.style.top = `${ t }px`,
+ h(r, {
+ x: e,
+ y: t,
+ width: n.offsetWidth,
+ height: n.offsetHeight
+ })
+ }
+ if (e instanceof MouseEvent) t.set(r, {
+ dragStartX: e.pageX,
+ dragStartY: e.pageY
+ });
+ else if (e instanceof TouchEvent) {
+ let {
+ pageX: i,
+ pageY: n
+ }
+ = e.changedTouches[0];
+ t.set(r, {
+ dragStartX: i,
+ dragStartY: n
+ })
+ }
+ }
+ function n(t) {
+ let r,
+ n,
+ s,
+ c = t.target;
+ if (!(c instanceof HTMLElement)) return;
+ let h = o(c);
+ if (!(h instanceof ImageCropElement)) return;
+ let {
+ box: d
+ }
+ = i.get(h) ||
+ {
+ };
+ if (!d) return;
+ let u = h.getBoundingClientRect();
+ if (t instanceof KeyboardEvent) {
+ if ('Escape' === t.key) return l(h);
+ if ('-' === t.key && (s = - 10), '=' === t.key && (s = 10), !s) return;
+ r = d.offsetWidth + s,
+ n = d.offsetHeight + s,
+ e.set(h, {
+ startX: d.offsetLeft,
+ startY: d.offsetTop
+ })
+ } else if (t instanceof MouseEvent) {
+ let i = e.get(h);
+ if (!i) return;
+ r = t.pageX - i.startX - u.left - window.pageXOffset,
+ n = t.pageY - i.startY - u.top - window.pageYOffset
+ } else if (t instanceof TouchEvent) {
+ let i = e.get(h);
+ if (!i) return;
+ r = t.changedTouches[0].pageX - i.startX - u.left - window.pageXOffset,
+ n = t.changedTouches[0].pageY - i.startY - u.top - window.pageYOffset
+ }
+ r &&
+ n &&
+ a(h, r, n, !(t instanceof KeyboardEvent))
+ }
+ function o(e) {
+ let t = e.getRootNode();
+ return t instanceof ShadowRoot ? t.host : e
+ }
+ function s(t) {
+ let s = t.currentTarget;
+ if (!(s instanceof HTMLElement)) return;
+ let a = o(s);
+ if (!(a instanceof ImageCropElement)) return;
+ let {
+ box: l
+ }
+ = i.get(a) ||
+ {
+ };
+ if (!l) return;
+ let c = t.target;
+ if (c instanceof HTMLElement) if (c.hasAttribute('data-direction')) {
+ let i = c.getAttribute('data-direction') ||
+ '';
+ a.addEventListener('mousemove', n),
+ a.addEventListener('touchmove', n, {
+ passive: !0
+ }),
+ [
+ 'nw',
+ 'se'
+ ].indexOf(i) >= 0 &&
+ a.classList.add('nwse'),
+ [
+ 'ne',
+ 'sw'
+ ].indexOf(i) >= 0 &&
+ a.classList.add('nesw'),
+ e.set(
+ a,
+ {
+ startX: l.offsetLeft + (['se',
+ 'ne'].indexOf(i) >= 0 ? 0 : l.offsetWidth),
+ startY: l.offsetTop + (['se',
+ 'sw'].indexOf(i) >= 0 ? 0 : l.offsetHeight)
+ }
+ ),
+ n(t)
+ } else a.addEventListener('mousemove', r),
+ a.addEventListener('touchmove', r, {
+ passive: !0
+ })
+ }
+ function a(t, r, n, o = !0) {
+ let s = Math.max(Math.abs(r), Math.abs(n), 10),
+ l = e.get(t);
+ if (!l) return;
+ let {
+ box: c,
+ image: d
+ }
+ = i.get(t) ||
+ {
+ };
+ if (!c || !d) return;
+ s = Math.min(
+ s,
+ n > 0 ? d.height - l.startY : l.startY,
+ r > 0 ? d.width - l.startX : l.startX
+ );
+ let u = o ? Math.round(Math.max(0, r > 0 ? l.startX : l.startX - s)) : c.offsetLeft,
+ f = o ? Math.round(Math.max(0, n > 0 ? l.startY : l.startY - s)) : c.offsetTop;
+ c.style.left = `${ u }px`,
+ c.style.top = `${ f }px`,
+ c.style.width = `${ s }px`,
+ c.style.height = `${ s }px`,
+ h(t, {
+ x: u,
+ y: f,
+ width: s,
+ height: s
+ })
+ }
+ function l(t) {
+ let {
+ image: r
+ }
+ = i.get(t) ||
+ {
+ };
+ if (!r) return;
+ let n = Math.round(r.clientWidth > r.clientHeight ? r.clientHeight : r.clientWidth);
+ e.set(t, {
+ startX: (r.clientWidth - n) / 2,
+ startY: (r.clientHeight - n) / 2
+ }),
+ a(t, n, n)
+ }
+ function c(e) {
+ let i = e.currentTarget;
+ i instanceof ImageCropElement &&
+ (
+ t.delete(i),
+ i.classList.remove('nwse', 'nesw'),
+ i.removeEventListener('mousemove', n),
+ i.removeEventListener('mousemove', r),
+ i.removeEventListener('touchmove', n),
+ i.removeEventListener('touchmove', r)
+ )
+ }
+ function h(e, t) {
+ let {
+ image: r
+ }
+ = i.get(e) ||
+ {
+ };
+ if (!r) return;
+ let n = r.naturalWidth / r.width;
+ for (let i in t) {
+ let r = Math.round(t[i] * n);
+ t[i] = r;
+ let o = e.querySelector(`[data-image-crop-input='${ i }']`);
+ o instanceof HTMLInputElement &&
+ (o.value = r.toString())
+ }
+ e.dispatchEvent(new CustomEvent('image-crop-change', {
+ bubbles: !0,
+ detail: t
+ }))
+ }
+ let ImageCropElement = class ImageCropElement extends HTMLElement {
+ connectedCallback() {
+ if (i.has(this)) return;
+ let e = this.attachShadow({
+ mode: 'open'
+ });
+ e.innerHTML = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+ let t = e.querySelector('[data-crop-box]');
+ if (!(t instanceof HTMLElement)) return;
+ let o = e.querySelector('img');
+ o instanceof HTMLImageElement &&
+ (
+ i.set(this, {
+ box: t,
+ image: o
+ }),
+ o.addEventListener('load', () => {
+ this.loaded = !0,
+ l(this)
+ }),
+ this.addEventListener('mouseleave', c),
+ this.addEventListener('touchend', c),
+ this.addEventListener('mouseup', c),
+ t.addEventListener('mousedown', s),
+ t.addEventListener('touchstart', s, {
+ passive: !0
+ }),
+ this.addEventListener('keydown', r),
+ this.addEventListener('keydown', n),
+ this.src &&
+ (o.src = this.src)
+ )
+ }
+ static get observedAttributes() {
+ return ['src']
+ }
+ get src() {
+ return this.getAttribute('src')
+ }
+ set src(e) {
+ e ? this.setAttribute('src', e) : this.removeAttribute('src')
+ }
+ get loaded() {
+ return this.hasAttribute('loaded')
+ }
+ set loaded(e) {
+ e ? this.setAttribute('loaded', '') : this.removeAttribute('loaded')
+ }
+ attributeChangedCallback(e, t, r) {
+ let {
+ image: n
+ }
+ = i.get(this) ||
+ {
+ };
+ 'src' === e &&
+ (this.loaded = !1, n && (n.src = r))
+ }
+ };
+ window.customElements.get('image-crop') ||
+ (
+ window.ImageCropElement = ImageCropElement,
+ window.customElements.define('image-crop', ImageCropElement)
+ )
+ },
+ 28078(e, t, i) {
+ i.d(t, {
+ T: () => include_fragment_element_IncludeFragmentElement
+ });
+ var r,
+ n,
+ o,
+ s,
+ a,
+ l,
+ c,
+ h,
+ d = function (e, t, i, r) {
+ if ('a' === i && !r) throw TypeError('Private accessor was defined without a getter');
+ if ('function' == typeof t ? e !== t ||
+ !r : !t.has(e)) throw TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return 'm' === i ? r : 'a' === i ? r.call(e) : r ? r.value : t.get(e)
+ },
+ u = function (e, t, i, r, n) {
+ if ('m' === r) throw TypeError('Private method is not writable');
+ if ('a' === r && !n) throw TypeError('Private accessor was defined without a setter');
+ if ('function' == typeof t ? e !== t ||
+ !n : !t.has(e)) throw TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return 'a' === r ? n.call(e, i) : n ? n.value = i : t.set(e, i),
+ i
+ };
+ let f = new WeakMap,
+ p = null;
+ let include_fragment_element_IncludeFragmentElement = class include_fragment_element_IncludeFragmentElement extends HTMLElement {
+ constructor() {
+ super (...arguments),
+ r.add(this),
+ n.set(this, !1),
+ o.set(
+ this,
+ new IntersectionObserver(
+ e => {
+ for (let t of e) if (t.isIntersecting) {
+ let {
+ target: e
+ }
+ = t;
+ if (
+ d(this, o, 'f').unobserve(e),
+ !(e instanceof include_fragment_element_IncludeFragmentElement)
+ ) return;
+ 'lazy' === e.loading &&
+ d(this, r, 'm', s).call(this)
+ }
+ },
+ {
+ rootMargin: '0px 0px 256px 0px',
+ threshold: 0.01
+ }
+ )
+ )
+ }
+ static define(e = 'include-fragment', t = customElements) {
+ return t.define(e, this),
+ this
+ }
+ static setCSPTrustedTypesPolicy(e) {
+ p = null === e ? e : Promise.resolve(e)
+ }
+ static get observedAttributes() {
+ return ['src',
+ 'loading']
+ }
+ get src() {
+ let e = this.getAttribute('src');
+ if (!e) return '';
+ {
+ let t = this.ownerDocument.createElement('a');
+ return t.href = e,
+ t.href
+ }
+ }
+ set src(e) {
+ this.setAttribute('src', e)
+ }
+ get loading() {
+ return 'lazy' === this.getAttribute('loading') ? 'lazy' : 'eager'
+ }
+ set loading(e) {
+ this.setAttribute('loading', e)
+ }
+ get accept() {
+ return this.getAttribute('accept') ||
+ ''
+ }
+ set accept(e) {
+ this.setAttribute('accept', e)
+ }
+ get data() {
+ return d(this, r, 'm', l).call(this)
+ }
+ attributeChangedCallback(e, t) {
+ 'src' === e ? this.isConnected &&
+ 'eager' === this.loading &&
+ d(this, r, 'm', s).call(this) : 'loading' === e &&
+ this.isConnected &&
+ 'eager' !== t &&
+ 'eager' === this.loading &&
+ d(this, r, 'm', s).call(this)
+ }
+ connectedCallback() {
+ if (!this.shadowRoot) {
+ this.attachShadow({
+ mode: 'open'
+ });
+ let e = document.createElement('style');
+ e.textContent = ':host {display: block;}',
+ this.shadowRoot.append(e, document.createElement('slot'))
+ }
+ this.src &&
+ 'eager' === this.loading &&
+ d(this, r, 'm', s).call(this),
+ 'lazy' === this.loading &&
+ d(this, o, 'f').observe(this)
+ }
+ request() {
+ let e = this.src;
+ if (!e) throw Error('missing src');
+ return new Request(
+ e,
+ {
+ method: 'GET',
+ credentials: 'same-origin',
+ headers: {
+ Accept: this.accept ||
+ 'text/html'
+ }
+ }
+ )
+ }
+ load() {
+ return d(this, r, 'm', l).call(this)
+ }
+ fetch(e) {
+ return fetch(e)
+ }
+ refetch() {
+ f.delete(this),
+ d(this, r, 'm', s).call(this)
+ }
+ };
+ n = new WeakMap,
+ o = new WeakMap,
+ r = new WeakSet,
+ s = async function () {
+ if (!d(this, n, 'f')) {
+ u(this, n, !0, 'f'),
+ d(this, o, 'f').unobserve(this);
+ try {
+ let e = await d(this, r, 'm', a).call(this);
+ if (e instanceof Error) throw e;
+ let t = document.createElement('template');
+ t.innerHTML = e;
+ let i = document.importNode(t.content, !0);
+ if (
+ !this.dispatchEvent(
+ new CustomEvent(
+ 'include-fragment-replace',
+ {
+ cancelable: !0,
+ detail: {
+ fragment: i
+ }
+ }
+ )
+ )
+ ) return void u(this, n, !1, 'f');
+ this.replaceWith(i),
+ this.dispatchEvent(new CustomEvent('include-fragment-replaced'))
+ } catch (e) {
+ this.classList.add('is-error')
+ } finally {
+ u(this, n, !1, 'f')
+ }
+ }
+ },
+ a = async function () {
+ let e = this.src,
+ t = f.get(this);
+ if (t && t.src === e) return t.data;
+ {
+ let t;
+ return t = e ? d(this, r, 'm', h).call(this) : Promise.reject(Error('missing src')),
+ f.set(this, {
+ src: e,
+ data: t
+ }),
+ t
+ }
+ },
+ l = async function () {
+ let e = await d(this, r, 'm', a).call(this);
+ if (e instanceof Error) throw e;
+ return e.toString()
+ },
+ c = async function (e, t) {
+ for (let i of (await new Promise(e => setTimeout(e, 0)), e)) this.dispatchEvent(t ? new CustomEvent(i, {
+ detail: {
+ error: t
+ }
+ }) : new Event(i))
+ },
+ h = async function () {
+ try {
+ var e;
+ await d(this, r, 'm', c).call(this, [
+ 'loadstart'
+ ]);
+ let t = await this.fetch(this.request()),
+ i = t.headers.get('Content-Type');
+ if (
+ !((e = this.accept) && e.split(',').find(e => e.match(/^\s*\*\/\*/))) &&
+ (!i || !i.includes(this.accept ? this.accept : 'text/html'))
+ ) throw Error(
+ `Failed to load resource: expected ${ this.accept ||
+ 'text/html' } but was ${ i }`
+ );
+ if (200 !== t.status) throw Error(
+ `Failed to load resource: the server responded with a status of ${ t.status }`
+ );
+ let n = await t.text(),
+ o = n;
+ return p &&
+ (o = (await p).createHTML(n, t)),
+ d(this, r, 'm', c).call(this, [
+ 'load',
+ 'loadend'
+ ]),
+ o
+ } catch (e) {
+ throw d(this, r, 'm', c).call(this, [
+ 'error',
+ 'loadend'
+ ], e),
+ e
+ }
+ };
+ let m = 'u' > typeof globalThis ? globalThis : window;
+ try {
+ m.IncludeFragmentElement = include_fragment_element_IncludeFragmentElement.define()
+ } catch (e) {
+ if (
+ !(
+ m.DOMException &&
+ e instanceof DOMException &&
+ 'NotSupportedError' === e.name
+ ) &&
+ !(e instanceof ReferenceError)
+ ) throw e
+ }
+ },
+ 44911() {
+ let e = 'complete' === document.readyState ? Promise.resolve() : new Promise(e => {
+ window.addEventListener('load', e)
+ });
+ let TypingEffectElement = class TypingEffectElement extends HTMLElement {
+ async connectedCallback() {
+ await e,
+ this.content &&
+ await t(this.lines, this.content, this.characterDelay, this.lineDelay),
+ this.cursor &&
+ (this.cursor.hidden = !0),
+ this.dispatchEvent(new CustomEvent('typing:complete', {
+ bubbles: !0,
+ cancelable: !0
+ }))
+ }
+ get content() {
+ return this.querySelector('[data-target="typing-effect.content"]')
+ }
+ get cursor() {
+ return this.querySelector('[data-target="typing-effect.cursor"]')
+ }
+ get lines() {
+ let e = this.getAttribute('data-lines');
+ try {
+ return e ? JSON.parse(e) : []
+ } catch (e) {
+ return []
+ }
+ }
+ get prefersReducedMotion() {
+ return window.matchMedia('(prefers-reduced-motion)').matches
+ }
+ get characterDelay() {
+ return this.prefersReducedMotion ? 0 : Math.max(
+ 0,
+ Math.min(
+ Math.floor(Number(this.getAttribute('data-character-delay'))),
+ 2147483647
+ )
+ ) ||
+ 40
+ }
+ set characterDelay(e) {
+ if (e > 2147483647 || e < 0) throw new DOMException('Value is negative or greater than the allowed amount');
+ this.setAttribute('data-character-delay', String(e))
+ }
+ get lineDelay() {
+ return this.prefersReducedMotion ? 0 : Math.max(
+ 0,
+ Math.min(
+ Math.floor(Number(this.getAttribute('data-line-delay'))),
+ 2147483647
+ )
+ ) ||
+ 40
+ }
+ set lineDelay(e) {
+ if (e > 2147483647 || e < 0) throw new DOMException('Value is negative or greater than the allowed amount');
+ this.setAttribute('data-line-delay', String(e))
+ }
+ };
+ async function t(e, t, r, n) {
+ for (let o = 0; o < e.length; o++) {
+ if (0 === r) t.append(e[o]);
+ else for (let n of e[o].split('')) await i(r),
+ t.innerHTML += n;
+ 0 !== n &&
+ await i(n),
+ o < e.length - 1 &&
+ t.append(document.createElement('br'))
+ }
+ }
+ async function i(e) {
+ return new Promise(t => {
+ setTimeout(t, e)
+ })
+ }
+ window.customElements.get('typing-effect') ||
+ (
+ window.TypingEffectElement = TypingEffectElement,
+ window.customElements.define('typing-effect', TypingEffectElement)
+ )
+ }
+ }
+ ]
+);
+//# sourceMappingURL=20425-e0dc13f26c8ee149-c785a97e9ce4cc2c.js.map
diff --git a/quickeditdevprodcloudflare.js b/quickeditdevprodcloudflare.js
new file mode 100644
index 0000000..d5936c5
--- /dev/null
+++ b/quickeditdevprodcloudflare.js
@@ -0,0 +1,8 @@
+/*! For license information please see htmlServerMain.js.LICENSE.txt */
+var serverExportVar;(()=>{var e={7791:(e,t,n)=>{"use strict";var r;function o(e){if("contents"in e)r="string"==typeof e.contents?JSON.parse(e.contents):e.contents;else if("fsPath"in e){const t=function(e){throw new Error("Unsupported in browser")}(e.fsPath),n=JSON.parse(t);r=c(n)?n.contents.bundle:n}else if(e.uri){let t=e.uri;return"string"==typeof e.uri&&(t=new URL(e.uri)),new Promise(((e,n)=>{e(async function(e){if("http:"===e.protocol||"https:"===e.protocol){const t=await fetch(e);return await t.text()}throw new Error("Unsupported protocol")}(t).then((e=>{try{const t=JSON.parse(e);r=c(t)?t.contents.bundle:t}catch(e){n(e)}})).catch((e=>{n(e)})))}))}}function i(...e){const t=e[0];let n,o,a;if("string"==typeof t)n=t,o=t,e.splice(0,1),a=e&&"object"==typeof e[0]?e[0]:e;else{if(t instanceof Array){const n=e.slice(1);if(t.length!==n.length+1)throw new Error("expected a string as the first argument to l10n.t");let r=t[0];for(let e=1;e0&&(n+=`/${Array.isArray(t.comment)?t.comment.join(""):t.comment}`),a=t.args??{}}const c=r?.[n];return c?"string"==typeof c?s(c,a):c.comment?s(c.message,a):s(o,a):s(o,a)}n.r(t),n.d(t,{config:()=>o,t:()=>i});var a=/{([^}]+)}/g;function s(e,t){return e.replace(a,((e,n)=>t[n]??e))}function c(e){return!("object"!=typeof e?.contents?.bundle||"string"!=typeof e?.version)}},8535:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{ClientCapabilities:()=>Dt,CodeAction:()=>Rt.CodeAction,CodeActionContext:()=>Rt.CodeActionContext,CodeActionKind:()=>Rt.CodeActionKind,Color:()=>Rt.Color,ColorInformation:()=>Rt.ColorInformation,ColorPresentation:()=>Rt.ColorPresentation,Command:()=>Rt.Command,CompletionItem:()=>Rt.CompletionItem,CompletionItemKind:()=>Rt.CompletionItemKind,CompletionItemTag:()=>Rt.CompletionItemTag,CompletionList:()=>Rt.CompletionList,Diagnostic:()=>Rt.Diagnostic,DiagnosticSeverity:()=>Rt.DiagnosticSeverity,DocumentHighlight:()=>Rt.DocumentHighlight,DocumentHighlightKind:()=>Rt.DocumentHighlightKind,DocumentLink:()=>Rt.DocumentLink,DocumentSymbol:()=>Rt.DocumentSymbol,DocumentUri:()=>Rt.DocumentUri,FileType:()=>It,FoldingRange:()=>Rt.FoldingRange,FoldingRangeKind:()=>Rt.FoldingRangeKind,Hover:()=>Rt.Hover,InsertTextFormat:()=>Rt.InsertTextFormat,Location:()=>Rt.Location,MarkedString:()=>Rt.MarkedString,MarkupContent:()=>Rt.MarkupContent,MarkupKind:()=>Rt.MarkupKind,Position:()=>Rt.Position,Range:()=>Rt.Range,SelectionRange:()=>Rt.SelectionRange,SymbolInformation:()=>Rt.SymbolInformation,SymbolKind:()=>Rt.SymbolKind,TextDocument:()=>Nt.TextDocument,TextDocumentEdit:()=>Rt.TextDocumentEdit,TextEdit:()=>Rt.TextEdit,VersionedTextDocumentIdentifier:()=>Rt.VersionedTextDocumentIdentifier,WorkspaceEdit:()=>Rt.WorkspaceEdit,getCSSLanguageService:()=>Fo,getDefaultCSSDataProvider:()=>Mo,getLESSLanguageService:()=>zo,getSCSSLanguageService:()=>Wo,newCSSDataProvider:()=>Po}),function(e){e[e.Ident=0]="Ident",e[e.AtKeyword=1]="AtKeyword",e[e.String=2]="String",e[e.BadString=3]="BadString",e[e.UnquotedString=4]="UnquotedString",e[e.Hash=5]="Hash",e[e.Num=6]="Num",e[e.Percentage=7]="Percentage",e[e.Dimension=8]="Dimension",e[e.UnicodeRange=9]="UnicodeRange",e[e.CDO=10]="CDO",e[e.CDC=11]="CDC",e[e.Colon=12]="Colon",e[e.SemiColon=13]="SemiColon",e[e.CurlyL=14]="CurlyL",e[e.CurlyR=15]="CurlyR",e[e.ParenthesisL=16]="ParenthesisL",e[e.ParenthesisR=17]="ParenthesisR",e[e.BracketL=18]="BracketL",e[e.BracketR=19]="BracketR",e[e.Whitespace=20]="Whitespace",e[e.Includes=21]="Includes",e[e.Dashmatch=22]="Dashmatch",e[e.SubstringOperator=23]="SubstringOperator",e[e.PrefixOperator=24]="PrefixOperator",e[e.SuffixOperator=25]="SuffixOperator",e[e.Delim=26]="Delim",e[e.EMS=27]="EMS",e[e.EXS=28]="EXS",e[e.Length=29]="Length",e[e.Angle=30]="Angle",e[e.Time=31]="Time",e[e.Freq=32]="Freq",e[e.Exclamation=33]="Exclamation",e[e.Resolution=34]="Resolution",e[e.Comma=35]="Comma",e[e.Charset=36]="Charset",e[e.EscapedJavaScript=37]="EscapedJavaScript",e[e.BadEscapedJavaScript=38]="BadEscapedJavaScript",e[e.Comment=39]="Comment",e[e.SingleLineComment=40]="SingleLineComment",e[e.EOF=41]="EOF",e[e.CustomToken=42]="CustomToken",e[e.ContainerQueryLength=43]="ContainerQueryLength"}(r||(r={}));class o{constructor(e){this.source=e,this.len=e.length,this.position=0}substring(e,t=this.position){return this.source.substring(e,t)}eos(){return this.len<=this.position}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}lookbackChar(e=0){return this.source.charCodeAt(this.position-e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)&&(this.position++,!0)}advanceIfChars(e){if(this.position+e.length>this.source.length)return!1;let t=0;for(;t".charCodeAt(0),w="@".charCodeAt(0),A="#".charCodeAt(0),k="$".charCodeAt(0),C="\\".charCodeAt(0),D="/".charCodeAt(0),I="\n".charCodeAt(0),R="\r".charCodeAt(0),N="\f".charCodeAt(0),M='"'.charCodeAt(0),P="'".charCodeAt(0),L=" ".charCodeAt(0),O="\t".charCodeAt(0),F=";".charCodeAt(0),W=":".charCodeAt(0),z="{".charCodeAt(0),j="}".charCodeAt(0),B="[".charCodeAt(0),G="]".charCodeAt(0),V=",".charCodeAt(0),H=".".charCodeAt(0),U="!".charCodeAt(0),q="?".charCodeAt(0),K="+".charCodeAt(0),J={};J[F]=r.SemiColon,J[W]=r.Colon,J[z]=r.CurlyL,J[j]=r.CurlyR,J[G]=r.BracketR,J[B]=r.BracketL,J[S]=r.ParenthesisL,J[x]=r.ParenthesisR,J[V]=r.Comma;const $={};$.em=r.EMS,$.ex=r.EXS,$.px=r.Length,$.cm=r.Length,$.mm=r.Length,$.in=r.Length,$.pt=r.Length,$.pc=r.Length,$.deg=r.Angle,$.rad=r.Angle,$.grad=r.Angle,$.ms=r.Time,$.s=r.Time,$.hz=r.Freq,$.khz=r.Freq,$["%"]=r.Percentage,$.fr=r.Percentage,$.dpi=r.Resolution,$.dpcm=r.Resolution,$.cqw=r.ContainerQueryLength,$.cqh=r.ContainerQueryLength,$.cqi=r.ContainerQueryLength,$.cqb=r.ContainerQueryLength,$.cqmin=r.ContainerQueryLength,$.cqmax=r.ContainerQueryLength;class X{constructor(){this.stream=new o(""),this.ignoreComment=!0,this.ignoreWhitespace=!0,this.inURL=!1}setSource(e){this.stream=new o(e)}finishToken(e,t,n){return{offset:e,len:this.stream.pos()-e,type:t,text:n||this.stream.substring(e)}}substring(e,t){return this.stream.substring(e,e+t)}pos(){return this.stream.pos()}goBackTo(e){this.stream.goBackTo(e)}scanUnquotedString(){const e=this.stream.pos(),t=[];return this._unquotedString(t)?this.finishToken(e,r.UnquotedString,t.join("")):null}scan(){const e=this.trivia();if(null!==e)return e;const t=this.stream.pos();return this.stream.eos()?this.finishToken(t,r.EOF):this.scanNext(t)}tryScanUnicode(){const e=this.stream.pos();if(!this.stream.eos()&&this._unicodeRange())return this.finishToken(e,r.UnicodeRange);this.stream.goBackTo(e)}scanNext(e){if(this.stream.advanceIfChars([E,U,g,g]))return this.finishToken(e,r.CDO);if(this.stream.advanceIfChars([g,g,T]))return this.finishToken(e,r.CDC);let t=[];if(this.ident(t))return this.finishToken(e,r.Ident,t.join(""));if(this.stream.advanceIfChar(w)){if(t=["@"],this._name(t)){const n=t.join("");return"@charset"===n?this.finishToken(e,r.Charset,n):this.finishToken(e,r.AtKeyword,n)}return this.finishToken(e,r.Delim)}if(this.stream.advanceIfChar(A))return t=["#"],this._name(t)?this.finishToken(e,r.Hash,t.join("")):this.finishToken(e,r.Delim);if(this.stream.advanceIfChar(U))return this.finishToken(e,r.Exclamation);if(this._number()){const n=this.stream.pos();if(t=[this.stream.substring(e,n)],this.stream.advanceIfChar(v))return this.finishToken(e,r.Percentage);if(this.ident(t)){const o=this.stream.substring(n).toLowerCase(),i=$[o];return void 0!==i?this.finishToken(e,i,t.join("")):this.finishToken(e,r.Dimension,t.join(""))}return this.finishToken(e,r.Num)}t=[];let n=this._string(t);return null!==n?this.finishToken(e,n,t.join("")):(n=J[this.stream.peekChar()],void 0!==n?(this.stream.advance(1),this.finishToken(e,n)):this.stream.peekChar(0)===m&&this.stream.peekChar(1)===h?(this.stream.advance(2),this.finishToken(e,r.Includes)):this.stream.peekChar(0)===_&&this.stream.peekChar(1)===h?(this.stream.advance(2),this.finishToken(e,r.Dashmatch)):this.stream.peekChar(0)===b&&this.stream.peekChar(1)===h?(this.stream.advance(2),this.finishToken(e,r.SubstringOperator)):this.stream.peekChar(0)===f&&this.stream.peekChar(1)===h?(this.stream.advance(2),this.finishToken(e,r.PrefixOperator)):this.stream.peekChar(0)===k&&this.stream.peekChar(1)===h?(this.stream.advance(2),this.finishToken(e,r.SuffixOperator)):(this.stream.nextChar(),this.finishToken(e,r.Delim)))}trivia(){for(;;){const e=this.stream.pos();if(this._whitespace()){if(!this.ignoreWhitespace)return this.finishToken(e,r.Whitespace)}else{if(!this.comment())return null;if(!this.ignoreComment)return this.finishToken(e,r.Comment)}}}comment(){if(this.stream.advanceIfChars([D,b])){let e=!1,t=!1;return this.stream.advanceWhileChar((n=>t&&n===D?(e=!0,!1):(t=n===b,!0))),e&&this.stream.advance(1),!0}return!1}_number(){let e,t=0;return this.stream.peekChar()===H&&(t=1),e=this.stream.peekChar(t),e>=u&&e<=p&&(this.stream.advance(t+1),this.stream.advanceWhileChar((e=>e>=u&&e<=p||0===t&&e===H)),!0)}_newline(e){const t=this.stream.peekChar();switch(t){case R:case N:case I:return this.stream.advance(1),e.push(String.fromCharCode(t)),t===R&&this.stream.advanceIfChar(I)&&e.push("\n"),!0}return!1}_escape(e,t){let n=this.stream.peekChar();if(n===C){this.stream.advance(1),n=this.stream.peekChar();let r=0;for(;r<6&&(n>=u&&n<=p||n>=i&&n<=a||n>=c&&n<=l);)this.stream.advance(1),n=this.stream.peekChar(),r++;if(r>0){try{const t=parseInt(this.stream.substring(this.stream.pos()-r),16);t&&e.push(String.fromCharCode(t))}catch(e){}return n===L||n===O?this.stream.advance(1):this._newline([]),!0}if(n!==R&&n!==N&&n!==I)return this.stream.advance(1),e.push(String.fromCharCode(n)),!0;if(t)return this._newline(e)}return!1}_stringChar(e,t){const n=this.stream.peekChar();return 0!==n&&n!==e&&n!==C&&n!==R&&n!==N&&n!==I&&(this.stream.advance(1),t.push(String.fromCharCode(n)),!0)}_string(e){if(this.stream.peekChar()===P||this.stream.peekChar()===M){const t=this.stream.nextChar();for(e.push(String.fromCharCode(t));this._stringChar(t,e)||this._escape(e,!0););return this.stream.peekChar()===t?(this.stream.nextChar(),e.push(String.fromCharCode(t)),r.String):r.BadString}return null}_unquotedChar(e){const t=this.stream.peekChar();return 0!==t&&t!==C&&t!==P&&t!==M&&t!==S&&t!==x&&t!==L&&t!==O&&t!==I&&t!==N&&t!==R&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_unquotedString(e){let t=!1;for(;this._unquotedChar(e)||this._escape(e);)t=!0;return t}_whitespace(){return this.stream.advanceWhileChar((e=>e===L||e===O||e===I||e===N||e===R))>0}_name(e){let t=!1;for(;this._identChar(e)||this._escape(e);)t=!0;return t}ident(e){const t=this.stream.pos();if(this._minus(e)){if(this._minus(e)||this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}}else if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}return this.stream.goBackTo(t),!1}_identFirstChar(e){const t=this.stream.peekChar();return(t===y||t>=i&&t<=s||t>=c&&t<=d||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_minus(e){const t=this.stream.peekChar();return t===g&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_identChar(e){const t=this.stream.peekChar();return(t===y||t===g||t>=i&&t<=s||t>=c&&t<=d||t>=u&&t<=p||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_unicodeRange(){if(this.stream.advanceIfChar(K)){const e=e=>e>=u&&e<=p||e>=i&&e<=a||e>=c&&e<=l,t=this.stream.advanceWhileChar(e)+this.stream.advanceWhileChar((e=>e===q));if(t>=1&&t<=6){if(!this.stream.advanceIfChar(g))return!0;{const t=this.stream.advanceWhileChar(e);if(t>=1&&t<=6)return!0}}}return!1}}function Q(e,t){if(e.length0?e.lastIndexOf(t)===n:0===n&&e===t}function Z(e,t=!0){return e?e.length<140?e:e.slice(0,140)+(t?"…":""):""}function ee(e,t){let n="";for(;t>0;)1==(1&t)&&(n+=e),e+=e,t>>>=1;return n}var te,ne;function re(e,t){let n=null;return!e||te.end?null:(e.accept((e=>-1===e.offset&&-1===e.length||e.offset<=t&&e.end>=t&&(n?e.length<=n.length&&(n=e):n=e,!0))),n)}function oe(e,t){let n=re(e,t);const r=[];for(;n;)r.unshift(n),n=n.parent;return r}!function(e){e[e.Undefined=0]="Undefined",e[e.Identifier=1]="Identifier",e[e.Stylesheet=2]="Stylesheet",e[e.Ruleset=3]="Ruleset",e[e.Selector=4]="Selector",e[e.SimpleSelector=5]="SimpleSelector",e[e.SelectorInterpolation=6]="SelectorInterpolation",e[e.SelectorCombinator=7]="SelectorCombinator",e[e.SelectorCombinatorParent=8]="SelectorCombinatorParent",e[e.SelectorCombinatorSibling=9]="SelectorCombinatorSibling",e[e.SelectorCombinatorAllSiblings=10]="SelectorCombinatorAllSiblings",e[e.SelectorCombinatorShadowPiercingDescendant=11]="SelectorCombinatorShadowPiercingDescendant",e[e.Page=12]="Page",e[e.PageBoxMarginBox=13]="PageBoxMarginBox",e[e.ClassSelector=14]="ClassSelector",e[e.IdentifierSelector=15]="IdentifierSelector",e[e.ElementNameSelector=16]="ElementNameSelector",e[e.PseudoSelector=17]="PseudoSelector",e[e.AttributeSelector=18]="AttributeSelector",e[e.Declaration=19]="Declaration",e[e.Declarations=20]="Declarations",e[e.Property=21]="Property",e[e.Expression=22]="Expression",e[e.BinaryExpression=23]="BinaryExpression",e[e.Term=24]="Term",e[e.Operator=25]="Operator",e[e.Value=26]="Value",e[e.StringLiteral=27]="StringLiteral",e[e.URILiteral=28]="URILiteral",e[e.EscapedValue=29]="EscapedValue",e[e.Function=30]="Function",e[e.NumericValue=31]="NumericValue",e[e.HexColorValue=32]="HexColorValue",e[e.RatioValue=33]="RatioValue",e[e.MixinDeclaration=34]="MixinDeclaration",e[e.MixinReference=35]="MixinReference",e[e.VariableName=36]="VariableName",e[e.VariableDeclaration=37]="VariableDeclaration",e[e.Prio=38]="Prio",e[e.Interpolation=39]="Interpolation",e[e.NestedProperties=40]="NestedProperties",e[e.ExtendsReference=41]="ExtendsReference",e[e.SelectorPlaceholder=42]="SelectorPlaceholder",e[e.Debug=43]="Debug",e[e.If=44]="If",e[e.Else=45]="Else",e[e.For=46]="For",e[e.Each=47]="Each",e[e.While=48]="While",e[e.MixinContentReference=49]="MixinContentReference",e[e.MixinContentDeclaration=50]="MixinContentDeclaration",e[e.Media=51]="Media",e[e.Keyframe=52]="Keyframe",e[e.FontFace=53]="FontFace",e[e.Import=54]="Import",e[e.Namespace=55]="Namespace",e[e.Invocation=56]="Invocation",e[e.FunctionDeclaration=57]="FunctionDeclaration",e[e.ReturnStatement=58]="ReturnStatement",e[e.MediaQuery=59]="MediaQuery",e[e.MediaCondition=60]="MediaCondition",e[e.MediaFeature=61]="MediaFeature",e[e.FunctionParameter=62]="FunctionParameter",e[e.FunctionArgument=63]="FunctionArgument",e[e.KeyframeSelector=64]="KeyframeSelector",e[e.ViewPort=65]="ViewPort",e[e.Document=66]="Document",e[e.AtApplyRule=67]="AtApplyRule",e[e.CustomPropertyDeclaration=68]="CustomPropertyDeclaration",e[e.CustomPropertySet=69]="CustomPropertySet",e[e.ListEntry=70]="ListEntry",e[e.Supports=71]="Supports",e[e.SupportsCondition=72]="SupportsCondition",e[e.NamespacePrefix=73]="NamespacePrefix",e[e.GridLine=74]="GridLine",e[e.Plugin=75]="Plugin",e[e.UnknownAtRule=76]="UnknownAtRule",e[e.Use=77]="Use",e[e.ModuleConfiguration=78]="ModuleConfiguration",e[e.Forward=79]="Forward",e[e.ForwardVisibility=80]="ForwardVisibility",e[e.Module=81]="Module",e[e.UnicodeRange=82]="UnicodeRange",e[e.Layer=83]="Layer",e[e.LayerNameList=84]="LayerNameList",e[e.LayerName=85]="LayerName",e[e.PropertyAtRule=86]="PropertyAtRule",e[e.Container=87]="Container"}(te||(te={})),function(e){e[e.Mixin=0]="Mixin",e[e.Rule=1]="Rule",e[e.Variable=2]="Variable",e[e.Function=3]="Function",e[e.Keyframe=4]="Keyframe",e[e.Unknown=5]="Unknown",e[e.Module=6]="Module",e[e.Forward=7]="Forward",e[e.ForwardVisibility=8]="ForwardVisibility",e[e.Property=9]="Property"}(ne||(ne={}));class ie{get end(){return this.offset+this.length}constructor(e=-1,t=-1,n){this.parent=null,this.offset=e,this.length=t,n&&(this.nodeType=n)}set type(e){this.nodeType=e}get type(){return this.nodeType||te.Undefined}getTextProvider(){let e=this;for(;e&&!e.textProvider;)e=e.parent;return e?e.textProvider:()=>"unknown"}getText(){return this.getTextProvider()(this.offset,this.length)}matches(e){return this.length===e.length&&this.getTextProvider()(this.offset,this.length)===e}startsWith(e){return this.length>=e.length&&this.getTextProvider()(this.offset,e.length)===e}endsWith(e){return this.length>=e.length&&this.getTextProvider()(this.end-e.length,e.length)===e}accept(e){if(e(this)&&this.children)for(const t of this.children)t.accept(e)}acceptVisitor(e){this.accept(e.visitNode.bind(e))}adoptChild(e,t=-1){if(e.parent&&e.parent.children){const t=e.parent.children.indexOf(e);t>=0&&e.parent.children.splice(t,1)}e.parent=this;let n=this.children;return n||(n=this.children=[]),-1!==t?n.splice(t,0,e):n.push(e),e}attachTo(e,t=-1){return e&&e.adoptChild(this,t),this}collectIssues(e){this.issues&&e.push.apply(e,this.issues)}addIssue(e){this.issues||(this.issues=[]),this.issues.push(e)}hasIssue(e){return Array.isArray(this.issues)&&this.issues.some((t=>t.getRule()===e))}isErroneous(e=!1){return!!(this.issues&&this.issues.length>0)||e&&Array.isArray(this.children)&&this.children.some((e=>e.isErroneous(!0)))}setNode(e,t,n=-1){return!!t&&(t.attachTo(this,n),this[e]=t,!0)}addChild(e){return!!e&&(this.children||(this.children=[]),e.attachTo(this),this.updateOffsetAndLength(e),!0)}updateOffsetAndLength(e){(e.offsetthis.end||-1===this.length)&&(this.length=t-this.offset)}hasChildren(){return!!this.children&&this.children.length>0}getChildren(){return this.children?this.children.slice(0):[]}getChild(e){return this.children&&e=0;n--)if(t=this.children[n],t.offset<=e)return t}return null}findChildAtOffset(e,t){const n=this.findFirstChildBeforeOffset(e);return n&&n.end>=e?t&&n.findChildAtOffset(e,!0)||n:null}encloses(e){return this.offset<=e.offset&&this.offset+this.length>=e.offset+e.length}getParent(){let e=this.parent;for(;e instanceof ae;)e=e.parent;return e}findParent(e){let t=this;for(;t&&t.type!==e;)t=t.parent;return t}findAParent(...e){let t=this;for(;t&&!e.some((e=>t.type===e));)t=t.parent;return t}setData(e,t){this.options||(this.options={}),this.options[e]=t}getData(e){return this.options&&this.options.hasOwnProperty(e)?this.options[e]:null}}class ae extends ie{constructor(e,t=-1){super(-1,-1),this.attachTo(e,t),this.offset=-1,this.length=-1}}class se extends ie{constructor(e,t){super(e,t)}get type(){return te.UnicodeRange}setRangeStart(e){return this.setNode("rangeStart",e)}getRangeStart(){return this.rangeStart}setRangeEnd(e){return this.setNode("rangeEnd",e)}getRangeEnd(){return this.rangeEnd}}class ce extends ie{constructor(e,t){super(e,t),this.isCustomProperty=!1}get type(){return te.Identifier}containsInterpolation(){return this.hasChildren()}}class le extends ie{constructor(e,t){super(e,t)}get type(){return te.Stylesheet}}class de extends ie{constructor(e,t){super(e,t)}get type(){return te.Declarations}}class ue extends ie{constructor(e,t){super(e,t)}getDeclarations(){return this.declarations}setDeclarations(e){return this.setNode("declarations",e)}}class pe extends ue{constructor(e,t){super(e,t)}get type(){return te.Ruleset}getSelectors(){return this.selectors||(this.selectors=new ae(this)),this.selectors}isNested(){return!!this.parent&&null!==this.parent.findParent(te.Declarations)}}class me extends ie{constructor(e,t){super(e,t)}get type(){return te.Selector}}class fe extends ie{constructor(e,t){super(e,t)}get type(){return te.SimpleSelector}}class he extends ie{constructor(e,t){super(e,t)}}class _e extends ue{constructor(e,t){super(e,t)}get type(){return te.CustomPropertySet}}class ge extends he{constructor(e,t){super(e,t),this.property=null}get type(){return te.Declaration}setProperty(e){return this.setNode("property",e)}getProperty(){return this.property}getFullPropertyName(){const e=this.property?this.property.getName():"unknown";if(this.parent instanceof de&&this.parent.getParent()instanceof Ne){const t=this.parent.getParent().getParent();if(t instanceof ge)return t.getFullPropertyName()+e}return e}getNonPrefixedPropertyName(){const e=this.getFullPropertyName();if(e&&"-"===e.charAt(0)){const t=e.indexOf("-",1);if(-1!==t)return e.substring(t+1)}return e}setValue(e){return this.setNode("value",e)}getValue(){return this.value}setNestedProperties(e){return this.setNode("nestedProperties",e)}getNestedProperties(){return this.nestedProperties}}class ye extends ge{constructor(e,t){super(e,t)}get type(){return te.CustomPropertyDeclaration}setPropertySet(e){return this.setNode("propertySet",e)}getPropertySet(){return this.propertySet}}class ve extends ie{constructor(e,t){super(e,t)}get type(){return te.Property}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}getName(){return function(e,t){const n=/[_\+]+$/.exec(e);return n&&n[0].length?e.substr(0,e.length-n[0].length):e}(this.getText())}isCustomProperty(){return!!this.identifier&&this.identifier.isCustomProperty}}class be extends ie{constructor(e,t){super(e,t)}get type(){return te.Invocation}getArguments(){return this.arguments||(this.arguments=new ae(this)),this.arguments}}class Se extends be{constructor(e,t){super(e,t)}get type(){return te.Function}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class xe extends ie{constructor(e,t){super(e,t)}get type(){return te.FunctionParameter}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setDefaultValue(e){return this.setNode("defaultValue",e,0)}getDefaultValue(){return this.defaultValue}}class Ee extends ie{constructor(e,t){super(e,t)}get type(){return te.FunctionArgument}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class Te extends ue{constructor(e,t){super(e,t)}get type(){return te.If}setExpression(e){return this.setNode("expression",e,0)}setElseClause(e){return this.setNode("elseClause",e)}}class we extends ue{constructor(e,t){super(e,t)}get type(){return te.For}setVariable(e){return this.setNode("variable",e,0)}}class Ae extends ue{constructor(e,t){super(e,t)}get type(){return te.Each}getVariables(){return this.variables||(this.variables=new ae(this)),this.variables}}class ke extends ue{constructor(e,t){super(e,t)}get type(){return te.While}}class Ce extends ue{constructor(e,t){super(e,t)}get type(){return te.Else}}class De extends ue{constructor(e,t){super(e,t)}get type(){return te.FunctionDeclaration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}getParameters(){return this.parameters||(this.parameters=new ae(this)),this.parameters}}class Ie extends ue{constructor(e,t){super(e,t)}get type(){return te.ViewPort}}class Re extends ue{constructor(e,t){super(e,t)}get type(){return te.FontFace}}class Ne extends ue{constructor(e,t){super(e,t)}get type(){return te.NestedProperties}}class Me extends ue{constructor(e,t){super(e,t)}get type(){return te.Keyframe}setKeyword(e){return this.setNode("keyword",e,0)}getKeyword(){return this.keyword}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class Pe extends ue{constructor(e,t){super(e,t)}get type(){return te.KeyframeSelector}}class Le extends ie{constructor(e,t){super(e,t)}get type(){return te.Import}setMedialist(e){return!!e&&(e.attachTo(this),!0)}}class Oe extends ie{get type(){return te.Use}getParameters(){return this.parameters||(this.parameters=new ae(this)),this.parameters}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class Fe extends ie{get type(){return te.ModuleConfiguration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class We extends ie{get type(){return te.Forward}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getMembers(){return this.members||(this.members=new ae(this)),this.members}getParameters(){return this.parameters||(this.parameters=new ae(this)),this.parameters}}class ze extends ie{get type(){return te.ForwardVisibility}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class je extends ie{constructor(e,t){super(e,t)}get type(){return te.Namespace}}class Be extends ue{constructor(e,t){super(e,t)}get type(){return te.Media}}class Ge extends ue{constructor(e,t){super(e,t)}get type(){return te.Supports}}class Ve extends ue{constructor(e,t){super(e,t)}get type(){return te.Layer}setNames(e){return this.setNode("names",e)}getNames(){return this.names}}class He extends ue{constructor(e,t){super(e,t)}get type(){return te.PropertyAtRule}setName(e){return!!e&&(e.attachTo(this),this.name=e,!0)}getName(){return this.name}}class Ue extends ue{constructor(e,t){super(e,t)}get type(){return te.Document}}class qe extends ue{constructor(e,t){super(e,t)}get type(){return te.Container}}class Ke extends ie{constructor(e,t){super(e,t)}}class Je extends ie{constructor(e,t){super(e,t)}get type(){return te.MediaQuery}}class $e extends ie{constructor(e,t){super(e,t)}get type(){return te.MediaCondition}}class Xe extends ie{constructor(e,t){super(e,t)}get type(){return te.MediaFeature}}class Qe extends ie{constructor(e,t){super(e,t)}get type(){return te.SupportsCondition}}class Ye extends ue{constructor(e,t){super(e,t)}get type(){return te.Page}}class Ze extends ue{constructor(e,t){super(e,t)}get type(){return te.PageBoxMarginBox}}class et extends ie{constructor(e,t){super(e,t)}get type(){return te.Expression}}class tt extends ie{constructor(e,t){super(e,t)}get type(){return te.BinaryExpression}setLeft(e){return this.setNode("left",e)}getLeft(){return this.left}setRight(e){return this.setNode("right",e)}getRight(){return this.right}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}}class nt extends ie{constructor(e,t){super(e,t)}get type(){return te.Term}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setExpression(e){return this.setNode("expression",e)}getExpression(){return this.expression}}class rt extends ie{constructor(e,t){super(e,t)}get type(){return te.AttributeSelector}setNamespacePrefix(e){return this.setNode("namespacePrefix",e)}getNamespacePrefix(){return this.namespacePrefix}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setValue(e){return this.setNode("value",e)}getValue(){return this.value}}class ot extends ie{constructor(e,t){super(e,t)}get type(){return te.HexColorValue}}class it extends ie{constructor(e,t){super(e,t)}get type(){return te.RatioValue}}const at=".".charCodeAt(0),st="0".charCodeAt(0),ct="9".charCodeAt(0);class lt extends ie{constructor(e,t){super(e,t)}get type(){return te.NumericValue}getValue(){const e=this.getText();let t,n=0;for(let r=0,o=e.length;r/g,">")}function Ft(e,t){if(!e.description||""===e.description)return"";if("string"!=typeof e.description)return e.description.value;let n="";if(!1!==t?.documentation){e.status&&(n+=Pt(e.status)),n+=e.description;const t=zt(e.browsers);t&&(n+="\n("+t+")"),"syntax"in e&&(n+=`\n\nSyntax: ${e.syntax}`)}return e.references&&e.references.length>0&&!1!==t?.references&&(n.length>0&&(n+="\n\n"),n+=e.references.map((e=>`${e.name}: ${e.url}`)).join(" | ")),n}function Wt(e,t){if(!e.description||""===e.description)return"";let n="";if(!1!==t?.documentation){e.status&&(n+=Pt(e.status)),"string"==typeof e.description?n+=Ot(e.description):n+=e.description.kind===Rt.MarkupKind.Markdown?e.description.value:Ot(e.description.value);const t=zt(e.browsers);t&&(n+="\n\n("+Ot(t)+")"),"syntax"in e&&e.syntax&&(n+=`\n\nSyntax: ${Ot(e.syntax)}`)}return e.references&&e.references.length>0&&!1!==t?.references&&(n.length>0&&(n+="\n\n"),n+=e.references.map((e=>`[${e.name}](${e.url})`)).join(" | ")),n}function zt(e=[]){return 0===e.length?null:e.map((e=>{let t="";const n=e.match(/([A-Z]+)(\d+)?/),r=n[1],o=n[2];return r in Mt&&(t+=Mt[r]),o&&(t+=" "+o),t})).join(", ")}const jt=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,Bt=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(${1:red}, ${2:green}, ${3:blue})",desc:At.t("Creates a Color from red, green, and blue values.")},{label:"rgba",func:"rgba($red, $green, $blue, $alpha)",insertText:"rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha})",desc:At.t("Creates a Color from red, green, blue, and alpha values.")},{label:"rgb relative",func:"rgb(from $color $red $green $blue)",insertText:"rgb(from ${1:color} ${2:r} ${3:g} ${4:b})",desc:At.t("Creates a Color from the red, green, and blue values of another Color.")},{label:"hsl",func:"hsl($hue, $saturation, $lightness)",insertText:"hsl(${1:hue}, ${2:saturation}, ${3:lightness})",desc:At.t("Creates a Color from hue, saturation, and lightness values.")},{label:"hsla",func:"hsla($hue, $saturation, $lightness, $alpha)",insertText:"hsla(${1:hue}, ${2:saturation}, ${3:lightness}, ${4:alpha})",desc:At.t("Creates a Color from hue, saturation, lightness, and alpha values.")},{label:"hsl relative",func:"hsl(from $color $hue $saturation $lightness)",insertText:"hsl(from ${1:color} ${2:h} ${3:s} ${4:l})",desc:At.t("Creates a Color from the hue, saturation, and lightness values of another Color.")},{label:"hwb",func:"hwb($hue $white $black)",insertText:"hwb(${1:hue} ${2:white} ${3:black})",desc:At.t("Creates a Color from hue, white, and black values.")},{label:"hwb relative",func:"hwb(from $color $hue $white $black)",insertText:"hwb(from ${1:color} ${2:h} ${3:w} ${4:b})",desc:At.t("Creates a Color from the hue, white, and black values of another Color.")},{label:"lab",func:"lab($lightness $a $b)",insertText:"lab(${1:lightness} ${2:a} ${3:b})",desc:At.t("Creates a Color from lightness, a, and b values.")},{label:"lab relative",func:"lab(from $color $lightness $a $b)",insertText:"lab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:At.t("Creates a Color from the lightness, a, and b values of another Color.")},{label:"oklab",func:"oklab($lightness $a $b)",insertText:"oklab(${1:lightness} ${2:a} ${3:b})",desc:At.t("Creates a Color from lightness, a, and b values.")},{label:"oklab relative",func:"oklab(from $color $lightness $a $b)",insertText:"oklab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:At.t("Creates a Color from the lightness, a, and b values of another Color.")},{label:"lch",func:"lch($lightness $chroma $hue)",insertText:"lch(${1:lightness} ${2:chroma} ${3:hue})",desc:At.t("Creates a Color from lightness, chroma, and hue values.")},{label:"lch relative",func:"lch(from $color $lightness $chroma $hue)",insertText:"lch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:At.t("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"oklch",func:"oklch($lightness $chroma $hue)",insertText:"oklch(${1:lightness} ${2:chroma} ${3:hue})",desc:At.t("Creates a Color from lightness, chroma, and hue values.")},{label:"oklch relative",func:"oklch(from $color $lightness $chroma $hue)",insertText:"oklch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:At.t("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"color",func:"color($color-space $red $green $blue)",insertText:"color(${1|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${2:red} ${3:green} ${4:blue})",desc:At.t("Creates a Color in a specific color space from red, green, and blue values.")},{label:"color relative",func:"color(from $color $color-space $red $green $blue)",insertText:"color(from ${1:color} ${2|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${3:r} ${4:g} ${5:b})",desc:At.t("Creates a Color in a specific color space from the red, green, and blue values of another Color.")},{label:"color-mix",func:"color-mix(in $color-space, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|srgb,srgb-linear,lab,oklab,xyz,xyz-d50,xyz-d65|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:At.t("Mix two colors together in a rectangular color space.")},{label:"color-mix hue",func:"color-mix(in $color-space $interpolation-method hue, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|hsl,hwb,lch,oklch|} ${2|shorter hue,longer hue,increasing hue,decreasing hue|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:At.t("Mix two colors together in a polar color space.")}],Gt=/^(rgb|rgba|hsl|hsla|hwb)$/i,Vt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ht=new RegExp(`^(${Object.keys(Vt).join("|")})$`,"i"),Ut={currentColor:"The value of the 'color' property. The computed value of the 'currentColor' keyword is the computed value of the 'color' property. If the 'currentColor' keyword is set on the 'color' property itself, it is treated as 'color:inherit' at parse time.",transparent:"Fully transparent. This keyword can be considered a shorthand for rgba(0,0,0,0) which is its computed value."},qt=new RegExp(`^(${Object.keys(Ut).join("|")})$`,"i");function Kt(e,t){const n=e.getText().match(/^([-+]?[0-9]*\.?[0-9]+)(%?)$/);if(n){n[2]&&(t=100);const e=parseFloat(n[1])/t;if(e>=0&&e<=1)return e}throw new Error}function Jt(e){const t=e.getText(),n=t.match(/^([-+]?[0-9]*\.?[0-9]+)(deg|rad|grad|turn)?$/);if(n)switch(n[2]){case"deg":return parseFloat(t)%360;case"rad":return 180*parseFloat(t)/Math.PI%360;case"grad":return.9*parseFloat(t)%360;case"turn":return 360*parseFloat(t)%360;default:if(void 0===n[2])return parseFloat(t)%360}throw new Error}function $t(e){return jt.test(e)||Ht.test(e)||qt.test(e)}function Xt(e){return e<48?0:e<=57?e-48:(e<97&&(e+=32),e>=97&&e<=102?e-97+10:0)}function Qt(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*Xt(e.charCodeAt(1))/255,green:17*Xt(e.charCodeAt(2))/255,blue:17*Xt(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*Xt(e.charCodeAt(1))/255,green:17*Xt(e.charCodeAt(2))/255,blue:17*Xt(e.charCodeAt(3))/255,alpha:17*Xt(e.charCodeAt(4))/255};case 7:return{red:(16*Xt(e.charCodeAt(1))+Xt(e.charCodeAt(2)))/255,green:(16*Xt(e.charCodeAt(3))+Xt(e.charCodeAt(4)))/255,blue:(16*Xt(e.charCodeAt(5))+Xt(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*Xt(e.charCodeAt(1))+Xt(e.charCodeAt(2)))/255,green:(16*Xt(e.charCodeAt(3))+Xt(e.charCodeAt(4)))/255,blue:(16*Xt(e.charCodeAt(5))+Xt(e.charCodeAt(6)))/255,alpha:(16*Xt(e.charCodeAt(7))+Xt(e.charCodeAt(8)))/255}}return null}function Yt(e,t,n,r=1){if(0===t)return{red:n,green:n,blue:n,alpha:r};{const o=(e,t,n)=>{for(;n<0;)n+=6;for(;n>=6;)n-=6;return n<1?(t-e)*n+e:n<3?t:n<4?(t-e)*(4-n)+e:e},i=n<=.5?n*(t+1):n+t-n*t,a=2*n-i;return{red:o(a,i,2+(e/=60)),green:o(a,i,e),blue:o(a,i,e-2),alpha:r}}}function Zt(e){const t=e.red,n=e.green,r=e.blue,o=e.alpha,i=Math.max(t,n,r),a=Math.min(t,n,r);let s=0,c=0;const l=(a+i)/2,d=i-a;if(d>0){switch(c=Math.min(l<=.5?d/(2*l):d/(2-2*l),1),i){case t:s=(n-r)/d+(ne[t]))}function gn(e){return void 0!==e}class yn{constructor(e=new X){this.keyframeRegex=/^@(\-(webkit|ms|moz|o)\-)?keyframes$/i,this.scanner=e,this.token={type:r.EOF,offset:-1,len:0,text:""},this.prevToken=void 0}peekIdent(e){return r.Ident===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekKeyword(e){return r.AtKeyword===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekDelim(e){return r.Delim===this.token.type&&e===this.token.text}peek(e){return e===this.token.type}peekOne(...e){return-1!==e.indexOf(this.token.type)}peekRegExp(e,t){return e===this.token.type&&t.test(this.token.text)}hasWhitespace(){return!!this.prevToken&&this.prevToken.offset+this.prevToken.len!==this.token.offset}consumeToken(){this.prevToken=this.token,this.token=this.scanner.scan()}acceptUnicodeRange(){const e=this.scanner.tryScanUnicode();return!!e&&(this.prevToken=e,this.token=this.scanner.scan(),!0)}mark(){return{prev:this.prevToken,curr:this.token,pos:this.scanner.pos()}}restoreAtMark(e){this.prevToken=e.prev,this.token=e.curr,this.scanner.goBackTo(e.pos)}try(e){const t=this.mark();return e()||(this.restoreAtMark(t),null)}acceptOneKeyword(e){if(r.AtKeyword===this.token.type)for(const t of e)if(t.length===this.token.text.length&&t===this.token.text.toLowerCase())return this.consumeToken(),!0;return!1}accept(e){return e===this.token.type&&(this.consumeToken(),!0)}acceptIdent(e){return!!this.peekIdent(e)&&(this.consumeToken(),!0)}acceptKeyword(e){return!!this.peekKeyword(e)&&(this.consumeToken(),!0)}acceptDelim(e){return!!this.peekDelim(e)&&(this.consumeToken(),!0)}acceptRegexp(e){return!!e.test(this.token.text)&&(this.consumeToken(),!0)}_parseRegexp(e){let t=this.createNode(te.Identifier);do{}while(this.acceptRegexp(e));return this.finish(t)}acceptUnquotedString(){const e=this.scanner.pos();this.scanner.goBackTo(this.token.offset);const t=this.scanner.scanUnquotedString();return t?(this.token=t,this.consumeToken(),!0):(this.scanner.goBackTo(e),!1)}resync(e,t){for(;;){if(e&&-1!==e.indexOf(this.token.type))return this.consumeToken(),!0;if(t&&-1!==t.indexOf(this.token.type))return!0;if(this.token.type===r.EOF)return!1;this.token=this.scanner.scan()}}createNode(e){return new ie(this.token.offset,this.token.len,e)}create(e){return new e(this.token.offset,this.token.len)}finish(e,t,n,r){if(!(e instanceof ae)&&(t&&this.markError(e,t,n,r),this.prevToken)){const t=this.prevToken.offset+this.prevToken.len;e.length=t>e.offset?t-e.offset:0}return e}markError(e,t,n,r){this.token!==this.lastErrorToken&&(e.addIssue(new Tt(e,t,Et.Error,void 0,this.token.offset,this.token.len)),this.lastErrorToken=this.token),(n||r)&&this.resync(n,r)}parseStylesheet(e){const t=e.version,n=e.getText();return this.internalParse(n,this._parseStylesheet,((r,o)=>{if(e.version!==t)throw new Error("Underlying model has changed, AST is no longer valid");return n.substr(r,o)}))}internalParse(e,t,n){this.scanner.setSource(e),this.token=this.scanner.scan();const r=t.bind(this)();return r&&(r.textProvider=n||((t,n)=>e.substr(t,n))),r}_parseStylesheet(){const e=this.create(le);for(;e.addChild(this._parseStylesheetStart()););let t=!1;do{let n=!1;do{n=!1;const o=this._parseStylesheetStatement();for(o&&(e.addChild(o),n=!0,t=!1,this.peek(r.EOF)||!this._needsSemicolonAfter(o)||this.accept(r.SemiColon)||this.markError(e,Ct.SemiColonExpected));this.accept(r.SemiColon)||this.accept(r.CDO)||this.accept(r.CDC);)n=!0,t=!1}while(n);if(this.peek(r.EOF))break;t||(this.peek(r.AtKeyword)?this.markError(e,Ct.UnknownAtRule):this.markError(e,Ct.RuleOrSelectorExpected),t=!0),this.consumeToken()}while(!this.peek(r.EOF));return this.finish(e)}_parseStylesheetStart(){return this._parseCharset()}_parseStylesheetStatement(e=!1){return this.peek(r.AtKeyword)?this._parseStylesheetAtStatement(e):this._parseRuleset(e)}_parseStylesheetAtStatement(e=!1){return this._parseImport()||this._parseMedia(e)||this._parsePage()||this._parseFontFace()||this._parseKeyframe()||this._parseSupports(e)||this._parseLayer(e)||this._parsePropertyAtRule()||this._parseViewPort()||this._parseNamespace()||this._parseDocument()||this._parseContainer()||this._parseUnknownAtRule()}_tryParseRuleset(e){const t=this.mark();if(this._parseSelector(e)){for(;this.accept(r.Comma)&&this._parseSelector(e););if(this.accept(r.CurlyL))return this.restoreAtMark(t),this._parseRuleset(e)}return this.restoreAtMark(t),null}_parseRuleset(e=!1){const t=this.create(pe),n=t.getSelectors();if(!n.addChild(this._parseSelector(e)))return null;for(;this.accept(r.Comma);)if(!n.addChild(this._parseSelector(e)))return this.finish(t,Ct.SelectorExpected);return this._parseBody(t,this._parseRuleSetDeclaration.bind(this))}_parseRuleSetDeclarationAtStatement(){return this._parseMedia(!0)||this._parseSupports(!0)||this._parseLayer(!0)||this._parseUnknownAtRule()}_parseRuleSetDeclaration(){return this.peek(r.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this.peek(r.Ident)?this._tryParseRuleset(!0)||this._parseDeclaration():this._parseRuleset(!0)}_needsSemicolonAfter(e){switch(e.type){case te.Keyframe:case te.ViewPort:case te.Media:case te.Ruleset:case te.Namespace:case te.If:case te.For:case te.Each:case te.While:case te.MixinDeclaration:case te.FunctionDeclaration:case te.MixinContentDeclaration:return!1;case te.ExtendsReference:case te.MixinContentReference:case te.ReturnStatement:case te.MediaQuery:case te.Debug:case te.Import:case te.AtApplyRule:case te.CustomPropertyDeclaration:return!0;case te.VariableDeclaration:return e.needsSemicolon;case te.MixinReference:return!e.getContent();case te.Declaration:return!e.getNestedProperties()}return!1}_parseDeclarations(e){const t=this.create(de);if(!this.accept(r.CurlyL))return null;let n=e();for(;t.addChild(n)&&!this.peek(r.CurlyR);){if(this._needsSemicolonAfter(n)&&!this.accept(r.SemiColon))return this.finish(t,Ct.SemiColonExpected,[r.SemiColon,r.CurlyR]);for(n&&this.prevToken&&this.prevToken.type===r.SemiColon&&(n.semicolonPosition=this.prevToken.offset);this.accept(r.SemiColon););n=e()}return this.accept(r.CurlyR)?this.finish(t):this.finish(t,Ct.RightCurlyExpected,[r.CurlyR,r.SemiColon])}_parseBody(e,t){return e.setDeclarations(this._parseDeclarations(t))?this.finish(e):this.finish(e,Ct.LeftCurlyExpected,[r.CurlyR,r.SemiColon])}_parseSelector(e){const t=this.create(me);let n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());)n=!0,t.addChild(this._parseCombinator());return n?this.finish(t):null}_parseDeclaration(e){const t=this._tryParseCustomPropertyDeclaration(e);if(t)return t;const n=this.create(ge);return n.setProperty(this._parseProperty())?this.accept(r.Colon)?(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseExpr())?(n.addChild(this._parsePrio()),this.peek(r.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)):this.finish(n,Ct.PropertyValueExpected)):this.finish(n,Ct.ColonExpected,[r.Colon],e||[r.SemiColon]):null}_tryParseCustomPropertyDeclaration(e){if(!this.peekRegExp(r.Ident,/^--/))return null;const t=this.create(ye);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(r.Colon))return this.finish(t,Ct.ColonExpected,[r.Colon]);this.prevToken&&(t.colonPosition=this.prevToken.offset);const n=this.mark();if(this.peek(r.CurlyL)){const e=this.create(_e),o=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(e.setDeclarations(o)&&!o.isErroneous(!0)&&(e.addChild(this._parsePrio()),this.peek(r.SemiColon)))return this.finish(e),t.setPropertySet(e),t.semicolonPosition=this.token.offset,this.finish(t);this.restoreAtMark(n)}const o=this._parseExpr();return o&&!o.isErroneous(!0)&&(this._parsePrio(),this.peekOne(...e||[],r.SemiColon,r.EOF))?(t.setValue(o),this.peek(r.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)):(this.restoreAtMark(n),t.addChild(this._parseCustomPropertyValue(e)),t.addChild(this._parsePrio()),gn(t.colonPosition)&&this.token.offset===t.colonPosition+1?this.finish(t,Ct.PropertyValueExpected):this.finish(t))}_parseCustomPropertyValue(e=[r.CurlyR]){const t=this.create(ie),n=()=>-1!==e.indexOf(this.token.type);let o=0,i=0,a=0;e:for(;;){switch(this.token.type){case r.SemiColon:case r.Exclamation:if(0===o&&0===i&&0===a)break e;break;case r.CurlyL:o++;break;case r.CurlyR:if(o--,o<0){if(n()&&0===i&&0===a)break e;return this.finish(t,Ct.LeftCurlyExpected)}break;case r.ParenthesisL:i++;break;case r.ParenthesisR:if(i--,i<0){if(n()&&0===a&&0===o)break e;return this.finish(t,Ct.LeftParenthesisExpected)}break;case r.BracketL:a++;break;case r.BracketR:if(a--,a<0)return this.finish(t,Ct.LeftSquareBracketExpected);break;case r.BadString:break e;case r.EOF:let e=Ct.RightCurlyExpected;return a>0?e=Ct.RightSquareBracketExpected:i>0&&(e=Ct.RightParenthesisExpected),this.finish(t,e)}this.consumeToken()}return this.finish(t)}_tryToParseDeclaration(e){const t=this.mark();return this._parseProperty()&&this.accept(r.Colon)?(this.restoreAtMark(t),this._parseDeclaration(e)):(this.restoreAtMark(t),null)}_parseProperty(){const e=this.create(ve),t=this.mark();return(this.acceptDelim("*")||this.acceptDelim("_"))&&this.hasWhitespace()?(this.restoreAtMark(t),null):e.setIdentifier(this._parsePropertyIdentifier())?this.finish(e):null}_parsePropertyIdentifier(){return this._parseIdent()}_parseCharset(){if(!this.peek(r.Charset))return null;const e=this.create(ie);return this.consumeToken(),this.accept(r.String)?this.accept(r.SemiColon)?this.finish(e):this.finish(e,Ct.SemiColonExpected):this.finish(e,Ct.IdentifierExpected)}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Le);if(this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Ct.URIOrStringExpected);if(this.acceptIdent("layer")&&this.accept(r.ParenthesisL)){if(!e.addChild(this._parseLayerName()))return this.finish(e,Ct.IdentifierExpected,[r.SemiColon]);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[r.ParenthesisR],[])}return this.acceptIdent("supports")&&this.accept(r.ParenthesisL)&&(e.addChild(this._tryToParseDeclaration()||this._parseSupportsCondition()),!this.accept(r.ParenthesisR))?this.finish(e,Ct.RightParenthesisExpected,[r.ParenthesisR],[]):(this.peek(r.SemiColon)||this.peek(r.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e))}_parseNamespace(){if(!this.peekKeyword("@namespace"))return null;const e=this.create(je);return this.consumeToken(),e.addChild(this._parseURILiteral())||(e.addChild(this._parseIdent()),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral()))?this.accept(r.SemiColon)?this.finish(e):this.finish(e,Ct.SemiColonExpected):this.finish(e,Ct.URIExpected,[r.SemiColon])}_parseFontFace(){if(!this.peekKeyword("@font-face"))return null;const e=this.create(Re);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseViewPort(){if(!this.peekKeyword("@-ms-viewport")&&!this.peekKeyword("@-o-viewport")&&!this.peekKeyword("@viewport"))return null;const e=this.create(Ie);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseKeyframe(){if(!this.peekRegExp(r.AtKeyword,this.keyframeRegex))return null;const e=this.create(Me),t=this.create(ie);return this.consumeToken(),e.setKeyword(this.finish(t)),t.matches("@-ms-keyframes")&&this.markError(t,Ct.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,Ct.IdentifierExpected,[r.CurlyR])}_parseKeyframeIdent(){return this._parseIdent([ne.Keyframe])}_parseKeyframeSelector(){const e=this.create(Pe);let t=!1;if(e.addChild(this._parseIdent())&&(t=!0),this.accept(r.Percentage)&&(t=!0),!t)return null;for(;this.accept(r.Comma);)if(t=!1,e.addChild(this._parseIdent())&&(t=!0),this.accept(r.Percentage)&&(t=!0),!t)return this.finish(e,Ct.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_tryParseKeyframeSelector(){const e=this.create(Pe),t=this.mark();let n=!1;if(e.addChild(this._parseIdent())&&(n=!0),this.accept(r.Percentage)&&(n=!0),!n)return null;for(;this.accept(r.Comma);)if(n=!1,e.addChild(this._parseIdent())&&(n=!0),this.accept(r.Percentage)&&(n=!0),!n)return this.restoreAtMark(t),null;return this.peek(r.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(t),null)}_parsePropertyAtRule(){if(!this.peekKeyword("@property"))return null;const e=this.create(He);return this.consumeToken(),this.peekRegExp(r.Ident,/^--/)&&e.setName(this._parseIdent([ne.Property]))?this._parseBody(e,this._parseDeclaration.bind(this)):this.finish(e,Ct.IdentifierExpected)}_parseLayer(e=!1){if(!this.peekKeyword("@layer"))return null;const t=this.create(Ve);this.consumeToken();const n=this._parseLayerNameList();return n&&t.setNames(n),n&&1!==n.getChildren().length||!this.peek(r.CurlyL)?this.accept(r.SemiColon)?this.finish(t):this.finish(t,Ct.SemiColonExpected):this._parseBody(t,this._parseLayerDeclaration.bind(this,e))}_parseLayerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseLayerNameList(){const e=this.createNode(te.LayerNameList);if(!e.addChild(this._parseLayerName()))return null;for(;this.accept(r.Comma);)if(!e.addChild(this._parseLayerName()))return this.finish(e,Ct.IdentifierExpected);return this.finish(e)}_parseLayerName(){if(!this.peek(r.Ident))return null;const e=this.createNode(te.LayerName);for(e.addChild(this._parseIdent());!this.hasWhitespace()&&this.acceptDelim(".");)if(this.hasWhitespace()||!e.addChild(this._parseIdent()))return this.finish(e,Ct.IdentifierExpected);return this.finish(e)}_parseSupports(e=!1){if(!this.peekKeyword("@supports"))return null;const t=this.create(Ge);return this.consumeToken(),t.addChild(this._parseSupportsCondition()),this._parseBody(t,this._parseSupportsDeclaration.bind(this,e))}_parseSupportsDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseSupportsCondition(){const e=this.create(Qe);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(r.Ident,/^(and|or)$/i)){const t=this.token.text.toLowerCase();for(;this.acceptIdent(t);)e.addChild(this._parseSupportsConditionInParens())}return this.finish(e)}_parseSupportsConditionInParens(){const e=this.create(Qe);if(this.accept(r.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),e.addChild(this._tryToParseDeclaration([r.ParenthesisR]))||this._parseSupportsCondition()?this.accept(r.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,Ct.RightParenthesisExpected,[r.ParenthesisR],[]):this.finish(e,Ct.ConditionExpected);if(this.peek(r.Ident)){const t=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(r.ParenthesisL)){let t=1;for(;this.token.type!==r.EOF&&0!==t;)this.token.type===r.ParenthesisL?t++:this.token.type===r.ParenthesisR&&t--,this.consumeToken();return this.finish(e)}this.restoreAtMark(t)}return this.finish(e,Ct.LeftParenthesisExpected,[],[r.ParenthesisL])}_parseMediaDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseMedia(e=!1){if(!this.peekKeyword("@media"))return null;const t=this.create(Be);return this.consumeToken(),t.addChild(this._parseMediaQueryList())?this._parseBody(t,this._parseMediaDeclaration.bind(this,e)):this.finish(t,Ct.MediaQueryExpected)}_parseMediaQueryList(){const e=this.create(Ke);if(!e.addChild(this._parseMediaQuery()))return this.finish(e,Ct.MediaQueryExpected);for(;this.accept(r.Comma);)if(!e.addChild(this._parseMediaQuery()))return this.finish(e,Ct.MediaQueryExpected);return this.finish(e)}_parseMediaQuery(){const e=this.create(Je),t=this.mark();if(this.acceptIdent("not"),this.peek(r.ParenthesisL))this.restoreAtMark(t),e.addChild(this._parseMediaCondition());else{if(this.acceptIdent("only"),!e.addChild(this._parseIdent()))return null;this.acceptIdent("and")&&e.addChild(this._parseMediaCondition())}return this.finish(e)}_parseRatio(){const e=this.mark(),t=this.create(it);return this._parseNumeric()?this.acceptDelim("/")?this._parseNumeric()?this.finish(t):this.finish(t,Ct.NumberExpected):(this.restoreAtMark(e),null):null}_parseMediaCondition(){const e=this.create($e);this.acceptIdent("not");let t=!0;for(;t;){if(!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected,[],[r.CurlyL]);if(this.peek(r.ParenthesisL)||this.peekIdent("not")?e.addChild(this._parseMediaCondition()):e.addChild(this._parseMediaFeature()),!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[],[r.CurlyL]);t=this.acceptIdent("and")||this.acceptIdent("or")}return this.finish(e)}_parseMediaFeature(){const e=[r.ParenthesisR],t=this.create(Xe);if(t.addChild(this._parseMediaFeatureName())){if(this.accept(r.Colon)){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Ct.TermExpected,[],e)}else if(this._parseMediaFeatureRangeOperator()){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Ct.TermExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Ct.TermExpected,[],e)}}else{if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Ct.IdentifierExpected,[],e);if(!this._parseMediaFeatureRangeOperator())return this.finish(t,Ct.OperatorExpected,[],e);if(!t.addChild(this._parseMediaFeatureName()))return this.finish(t,Ct.IdentifierExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Ct.TermExpected,[],e)}return this.finish(t)}_parseMediaFeatureRangeOperator(){return this.acceptDelim("<")||this.acceptDelim(">")?(this.hasWhitespace()||this.acceptDelim("="),!0):!!this.acceptDelim("=")}_parseMediaFeatureName(){return this._parseIdent()}_parseMediaFeatureValue(){return this._parseRatio()||this._parseTermExpression()}_parseMedium(){const e=this.create(ie);return e.addChild(this._parseIdent())?this.finish(e):null}_parsePageDeclaration(){return this._parsePageMarginBox()||this._parseRuleSetDeclaration()}_parsePage(){if(!this.peekKeyword("@page"))return null;const e=this.create(Ye);if(this.consumeToken(),e.addChild(this._parsePageSelector()))for(;this.accept(r.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,Ct.IdentifierExpected);return this._parseBody(e,this._parsePageDeclaration.bind(this))}_parsePageMarginBox(){if(!this.peek(r.AtKeyword))return null;const e=this.create(Ze);return this.acceptOneKeyword(hn)||this.markError(e,Ct.UnknownAtRule,[],[r.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parsePageSelector(){if(!this.peek(r.Ident)&&!this.peek(r.Colon))return null;const e=this.create(ie);return e.addChild(this._parseIdent()),this.accept(r.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,Ct.IdentifierExpected):this.finish(e)}_parseDocument(){if(!this.peekKeyword("@-moz-document"))return null;const e=this.create(Ue);return this.consumeToken(),this.resync([],[r.CurlyL]),this._parseBody(e,this._parseStylesheetStatement.bind(this))}_parseContainer(){if(!this.peekKeyword("@container"))return null;const e=this.create(qe);return this.consumeToken(),e.addChild(this._parseIdent()),e.addChild(this._parseContainerQuery()),this._parseBody(e,this._parseStylesheetStatement.bind(this))}_parseContainerQuery(){const e=this.create(ie);if(this.acceptIdent("not"))e.addChild(this._parseContainerQueryInParens());else if(e.addChild(this._parseContainerQueryInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseContainerQueryInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseContainerQueryInParens());return this.finish(e)}_parseContainerQueryInParens(){const e=this.create(ie);if(this.accept(r.ParenthesisL)){if(this.peekIdent("not")||this.peek(r.ParenthesisL)?e.addChild(this._parseContainerQuery()):e.addChild(this._parseMediaFeature()),!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[],[r.CurlyL])}else{if(!this.acceptIdent("style"))return this.finish(e,Ct.LeftParenthesisExpected,[],[r.CurlyL]);if(this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected,[],[r.CurlyL]);if(e.addChild(this._parseStyleQuery()),!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[],[r.CurlyL])}return this.finish(e)}_parseStyleQuery(){const e=this.create(ie);if(this.acceptIdent("not"))e.addChild(this._parseStyleInParens());else if(this.peek(r.ParenthesisL)){if(e.addChild(this._parseStyleInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseStyleInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseStyleInParens())}else e.addChild(this._parseDeclaration([r.ParenthesisR]));return this.finish(e)}_parseStyleInParens(){const e=this.create(ie);return this.accept(r.ParenthesisL)?(e.addChild(this._parseStyleQuery()),this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Ct.RightParenthesisExpected,[],[r.CurlyL])):this.finish(e,Ct.LeftParenthesisExpected,[],[r.CurlyL])}_parseUnknownAtRule(){if(!this.peek(r.AtKeyword))return null;const e=this.create(yt);e.addChild(this._parseUnknownAtRuleName());let t=0,n=0,o=0,i=0;e:for(;;){switch(this.token.type){case r.SemiColon:if(0===n&&0===o&&0===i)break e;break;case r.EOF:return n>0?this.finish(e,Ct.RightCurlyExpected):i>0?this.finish(e,Ct.RightSquareBracketExpected):o>0?this.finish(e,Ct.RightParenthesisExpected):this.finish(e);case r.CurlyL:t++,n++;break;case r.CurlyR:if(n--,t>0&&0===n){if(this.consumeToken(),i>0)return this.finish(e,Ct.RightSquareBracketExpected);if(o>0)return this.finish(e,Ct.RightParenthesisExpected);break e}if(n<0){if(0===o&&0===i)break e;return this.finish(e,Ct.LeftCurlyExpected)}break;case r.ParenthesisL:o++;break;case r.ParenthesisR:if(o--,o<0)return this.finish(e,Ct.LeftParenthesisExpected);break;case r.BracketL:i++;break;case r.BracketR:if(i--,i<0)return this.finish(e,Ct.LeftSquareBracketExpected)}this.consumeToken()}return e}_parseUnknownAtRuleName(){const e=this.create(ie);return this.accept(r.AtKeyword)?this.finish(e):e}_parseOperator(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(r.Dashmatch)||this.peek(r.Includes)||this.peek(r.SubstringOperator)||this.peek(r.PrefixOperator)||this.peek(r.SuffixOperator)||this.peekDelim("=")){const e=this.createNode(te.Operator);return this.consumeToken(),this.finish(e)}return null}_parseUnaryOperator(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;const e=this.create(ie);return this.consumeToken(),this.finish(e)}_parseCombinator(){if(this.peekDelim(">")){const e=this.create(ie);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=te.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return e.type=te.SelectorCombinatorParent,this.finish(e)}if(this.peekDelim("+")){const e=this.create(ie);return this.consumeToken(),e.type=te.SelectorCombinatorSibling,this.finish(e)}if(this.peekDelim("~")){const e=this.create(ie);return this.consumeToken(),e.type=te.SelectorCombinatorAllSiblings,this.finish(e)}if(this.peekDelim("/")){const e=this.create(ie);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=te.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return null}_parseSimpleSelector(){const e=this.create(fe);let t=0;for(e.addChild(this._parseElementName()||this._parseNestingSelector())&&t++;(0===t||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)t++;return t>0?this.finish(e):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);return this.consumeToken(),this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parsePseudo()||this._parseHash()||this._parseClass()||this._parseAttrib()}_parseSelectorIdent(){return this._parseIdent()}_parseHash(){if(!this.peek(r.Hash)&&!this.peekDelim("#"))return null;const e=this.createNode(te.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,Ct.IdentifierExpected)}else this.consumeToken();return this.finish(e)}_parseClass(){if(!this.peekDelim("."))return null;const e=this.createNode(te.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,Ct.IdentifierExpected):this.finish(e)}_parseElementName(){const e=this.mark(),t=this.createNode(te.ElementNameSelector);return t.addChild(this._parseNamespacePrefix()),t.addChild(this._parseSelectorIdent())||this.acceptDelim("*")?this.finish(t):(this.restoreAtMark(e),null)}_parseNamespacePrefix(){const e=this.mark(),t=this.createNode(te.NamespacePrefix);return!t.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(t):(this.restoreAtMark(e),null)}_parseAttrib(){if(!this.peek(r.BracketL))return null;const e=this.create(rt);return this.consumeToken(),e.setNamespacePrefix(this._parseNamespacePrefix()),e.setIdentifier(this._parseIdent())?(e.setOperator(this._parseOperator())&&(e.setValue(this._parseBinaryExpr()),this.acceptIdent("i"),this.acceptIdent("s")),this.accept(r.BracketR)?this.finish(e):this.finish(e,Ct.RightSquareBracketExpected)):this.finish(e,Ct.IdentifierExpected)}_parsePseudo(){const e=this._tryParsePseudoIdentifier();if(e){if(!this.hasWhitespace()&&this.accept(r.ParenthesisL)){const t=()=>{const e=this.create(ie);if(!e.addChild(this._parseSelector(!0)))return null;for(;this.accept(r.Comma)&&e.addChild(this._parseSelector(!0)););return this.peek(r.ParenthesisR)?this.finish(e):null};if(!e.addChild(this.try(t))&&e.addChild(this._parseBinaryExpr())&&this.acceptIdent("of")&&!e.addChild(this.try(t)))return this.finish(e,Ct.SelectorExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected)}return this.finish(e)}return null}_tryParsePseudoIdentifier(){if(!this.peek(r.Colon))return null;const e=this.mark(),t=this.createNode(te.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(r.Colon),this.hasWhitespace()||!t.addChild(this._parseIdent())?this.finish(t,Ct.IdentifierExpected):this.finish(t))}_tryParsePrio(){const e=this.mark();return this._parsePrio()||(this.restoreAtMark(e),null)}_parsePrio(){if(!this.peek(r.Exclamation))return null;const e=this.createNode(te.Prio);return this.accept(r.Exclamation)&&this.acceptIdent("important")?this.finish(e):null}_parseExpr(e=!1){const t=this.create(et);if(!t.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(r.Comma)){if(e)return this.finish(t);this.consumeToken()}if(!t.addChild(this._parseBinaryExpr()))break}return this.finish(t)}_parseUnicodeRange(){if(!this.peekIdent("u"))return null;const e=this.create(se);return this.acceptUnicodeRange()?this.finish(e):null}_parseNamedLine(){if(!this.peek(r.BracketL))return null;const e=this.createNode(te.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(r.BracketR)?this.finish(e):this.finish(e,Ct.RightSquareBracketExpected)}_parseBinaryExpr(e,t){let n=this.create(tt);if(!n.setLeft(e||this._parseTerm()))return null;if(!n.setOperator(t||this._parseOperator()))return this.finish(n);if(!n.setRight(this._parseTerm()))return this.finish(n,Ct.TermExpected);n=this.finish(n);const r=this._parseOperator();return r&&(n=this._parseBinaryExpr(n,r)),this.finish(n)}_parseTerm(){let e=this.create(nt);return e.setOperator(this._parseUnaryOperator()),e.setExpression(this._parseTermExpression())?this.finish(e):null}_parseTermExpression(){return this._parseURILiteral()||this._parseUnicodeRange()||this._parseFunction()||this._parseIdent()||this._parseStringLiteral()||this._parseNumeric()||this._parseHexColor()||this._parseOperation()||this._parseNamedLine()}_parseOperation(){if(!this.peek(r.ParenthesisL))return null;const e=this.create(ie);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Ct.RightParenthesisExpected)}_parseNumeric(){if(this.peek(r.Num)||this.peek(r.Percentage)||this.peek(r.Resolution)||this.peek(r.Length)||this.peek(r.EMS)||this.peek(r.EXS)||this.peek(r.Angle)||this.peek(r.Time)||this.peek(r.Dimension)||this.peek(r.ContainerQueryLength)||this.peek(r.Freq)){const e=this.create(lt);return this.consumeToken(),this.finish(e)}return null}_parseStringLiteral(){if(!this.peek(r.String)&&!this.peek(r.BadString))return null;const e=this.createNode(te.StringLiteral);return this.consumeToken(),this.finish(e)}_parseURILiteral(){if(!this.peekRegExp(r.Ident,/^url(-prefix)?$/i))return null;const e=this.mark(),t=this.createNode(te.URILiteral);return this.accept(r.Ident),this.hasWhitespace()||!this.peek(r.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),t.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Ct.RightParenthesisExpected))}_parseURLArgument(){const e=this.create(ie);return this.accept(r.String)||this.accept(r.BadString)||this.acceptUnquotedString()?this.finish(e):null}_parseIdent(e){if(!this.peek(r.Ident))return null;const t=this.create(ce);return e&&(t.referenceTypes=e),t.isCustomProperty=this.peekRegExp(r.Ident,/^--/),this.consumeToken(),this.finish(t)}_parseFunction(){const e=this.mark(),t=this.create(Se);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)t.getArguments().addChild(this._parseFunctionArgument())||this.markError(t,Ct.ExpressionExpected);return this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Ct.RightParenthesisExpected)}_parseFunctionIdentifier(){if(!this.peek(r.Ident))return null;const e=this.create(ce);if(e.referenceTypes=[ne.Function],this.acceptIdent("progid")){if(this.accept(r.Colon))for(;this.accept(r.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)}_parseFunctionArgument(){const e=this.create(Ee);return e.setValue(this._parseExpr(!0))?this.finish(e):null}_parseHexColor(){if(this.peekRegExp(r.Hash,/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)){const e=this.create(ot);return this.consumeToken(),this.finish(e)}return null}}function vn(e,t){return-1!==e.indexOf(t)}function bn(...e){const t=[];for(const n of e)for(const e of n)vn(t,e)||t.push(e);return t}class Sn{constructor(e,t){this.offset=e,this.length=t,this.symbols=[],this.parent=null,this.children=[]}addChild(e){this.children.push(e),e.setParent(this)}setParent(e){this.parent=e}findScope(e,t=0){return this.offset<=e&&this.offset+this.length>e+t||this.offset===e&&this.length===t?this.findInScope(e,t):null}findInScope(e,t=0){const n=e+t,r=function(e,t){let r=0,o=e.length;if(0===o)return 0;for(;rn?o=t:r=t+1}return r}(this.children);if(0===r)return this;const o=this.children[r-1];return o.offset<=e&&o.offset+o.length>=e+t?o.findInScope(e,t):this}addSymbol(e){this.symbols.push(e)}getSymbol(e,t){for(let n=0;n{Q(e.label,"_")&&Y(e.label,".scss")&&(e.textEdit?e.textEdit.newText=e.label.slice(1,-5):e.label=e.label.slice(1,-5))}));for(let e of i)n.items.push(e)}}return n}async providePathSuggestions(e,t,n,r,o){const i=Rn(e),a=Q(e,"'")||Q(e,'"'),s=a?i.slice(0,t.character-(n.start.character+1)):i.slice(0,t.character-n.start.character),c=r.uri,l=function(e,t,n){let r;const o=e.lastIndexOf("/");if(-1===o)r=n;else{const e=t.slice(o+1),i=Pn(n.end,-e.length),a=e.indexOf(" ");let s;s=-1!==a?Pn(i,a):n.end,r=Rt.Range.create(i,s)}return r}(s,i,a?function(e,t,n){const r=Pn(e.start,1),o=Pn(e.end,-1);return Rt.Range.create(r,o)}(n):n),d=s.substring(0,s.lastIndexOf("/")+1);let u=o.resolveReference(d||".",c);if(u)try{const e=[],t=await this.readDirectory(u);for(const[n,r]of t)n.charCodeAt(0)===In||r!==It.Directory&&Cn(u,n)===c||e.push(Nn(n,r===It.Directory,l));return e}catch(e){}return[]}}const In=".".charCodeAt(0);function Rn(e){return Q(e,"'")||Q(e,'"')?e.slice(1,-1):e}function Nn(e,t,n){return t?{label:Mn(e+="/"),kind:Rt.CompletionItemKind.Folder,textEdit:Rt.TextEdit.replace(n,Mn(e)),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}:{label:Mn(e),kind:Rt.CompletionItemKind.File,textEdit:Rt.TextEdit.replace(n,Mn(e))}}function Mn(e){return e.replace(/(\s|\(|\)|,|"|')/g,"\\$1")}function Pn(e,t){return Rt.Position.create(e.line,e.character+t)}const Ln=Rt.InsertTextFormat.Snippet,On={title:"Suggest",command:"editor.action.triggerSuggest"};var Fn,Wn;!function(e){e.Enums=" ",e.Normal="d",e.VendorPrefixed="x",e.Term="y",e.Variable="z"}(Fn||(Fn={}));class zn{constructor(e=null,t,n){this.variablePrefix=e,this.lsOptions=t,this.cssDataManager=n,this.completionParticipants=[]}configure(e){this.defaultSettings=e}getSymbolContext(){return this.symbolContext||(this.symbolContext=new wn(this.styleSheet)),this.symbolContext}setCompletionParticipants(e){this.completionParticipants=e||[]}async doComplete2(e,t,n,r,o=this.defaultSettings){if(!this.lsOptions.fileSystemProvider||!this.lsOptions.fileSystemProvider.readDirectory)return this.doComplete(e,t,n,o);const i=new Dn(this.lsOptions.fileSystemProvider.readDirectory),a=this.completionParticipants;this.completionParticipants=[i].concat(a);const s=this.doComplete(e,t,n,o);try{const t=await i.computeCompletions(e,r);return{isIncomplete:s.isIncomplete||t.isIncomplete,itemDefaults:s.itemDefaults,items:t.items.concat(s.items)}}finally{this.completionParticipants=a}}doComplete(e,t,n,r){this.offset=e.offsetAt(t),this.position=t,this.currentWord=function(e,t){let n=t-1;const r=e.getText();for(;n>=0&&-1===' \t\n\r":{[()]},*>+'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)}(e,this.offset),this.defaultReplaceRange=Rt.Range.create(Rt.Position.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=n,this.documentSettings=r;try{const e={isIncomplete:!1,itemDefaults:{editRange:{start:{line:t.line,character:t.character-this.currentWord.length},end:t}},items:[]};this.nodePath=oe(this.styleSheet,this.offset);for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(n instanceof ve)this.getCompletionsForDeclarationProperty(n.getParent(),e);else if(n instanceof et)n.parent instanceof ut?this.getVariableProposals(null,e):this.getCompletionsForExpression(n,e);else if(n instanceof fe){const t=n.findAParent(te.ExtendsReference,te.Ruleset);if(t)if(t.type===te.ExtendsReference)this.getCompletionsForExtendsReference(t,n,e);else{const n=t;this.getCompletionsForSelector(n,n&&n.isNested(),e)}}else if(n instanceof Ee)this.getCompletionsForFunctionArgument(n,n.getParent(),e);else if(n instanceof de)this.getCompletionsForDeclarations(n,e);else if(n instanceof dt)this.getCompletionsForVariableDeclaration(n,e);else if(n instanceof pe)this.getCompletionsForRuleSet(n,e);else if(n instanceof ut)this.getCompletionsForInterpolation(n,e);else if(n instanceof De)this.getCompletionsForFunctionDeclaration(n,e);else if(n instanceof _t)this.getCompletionsForMixinReference(n,e);else if(n instanceof Se)this.getCompletionsForFunctionArgument(null,n,e);else if(n instanceof Ge)this.getCompletionsForSupports(n,e);else if(n instanceof Qe)this.getCompletionsForSupportsCondition(n,e);else if(n instanceof mt)this.getCompletionsForExtendsReference(n,null,e);else if(n.type===te.URILiteral)this.getCompletionForUriLiteralValue(n,e);else if(null===n.parent)this.getCompletionForTopLevel(e);else{if(n.type!==te.StringLiteral||!this.isImportPathParent(n.parent.type))continue;this.getCompletionForImportPath(n,e)}if(e.items.length>0||this.offset>n.offset)return this.finalize(e)}return this.getCompletionsForStylesheet(e),0===e.items.length&&this.variablePrefix&&0===this.currentWord.indexOf(this.variablePrefix)&&this.getVariableProposals(null,e),this.finalize(e)}finally{this.position=null,this.currentWord=null,this.textDocument=null,this.styleSheet=null,this.symbolContext=null,this.defaultReplaceRange=null,this.nodePath=null}}isImportPathParent(e){return e===te.Import}finalize(e){return e}findInNodePath(...e){for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(-1!==e.indexOf(n.type))return n}return null}getCompletionsForDeclarationProperty(e,t){return this.getPropertyProposals(e,t)}getPropertyProposals(e,t){const n=this.isTriggerPropertyValueCompletionEnabled,r=this.isCompletePropertyWithSemicolonEnabled;return this.cssDataManager.getProperties().forEach((o=>{let i,a,s=!1;e?(i=this.getCompletionRange(e.getProperty()),a=o.name,gn(e.colonPosition)||(a+=": ",s=!0)):(i=this.getCompletionRange(null),a=o.name+": ",s=!0),!e&&r&&(a+="$0;"),e&&!e.semicolonPosition&&r&&this.offset>=this.textDocument.offsetAt(i.end)&&(a+="$0;");const c={label:o.name,documentation:Lt(o,this.doesSupportMarkdown()),tags:jn(o)?[Rt.CompletionItemTag.Deprecated]:[],textEdit:Rt.TextEdit.replace(i,a),insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Property};o.restrictions||(s=!1),n&&s&&(c.command=On);const l=(255-("number"==typeof o.relevance?Math.min(Math.max(o.relevance,0),99):50)).toString(16),d=Q(o.name,"-")?Fn.VendorPrefixed:Fn.Normal;c.sortText=d+"_"+l,t.items.push(c)})),this.completionParticipants.forEach((e=>{e.onCssProperty&&e.onCssProperty({propertyName:this.currentWord,range:this.defaultReplaceRange})})),t}get isTriggerPropertyValueCompletionEnabled(){return this.documentSettings?.triggerPropertyValueCompletion??!0}get isCompletePropertyWithSemicolonEnabled(){return this.documentSettings?.completePropertyWithSemicolon??!0}getCompletionsForDeclarationValue(e,t){const n=e.getFullPropertyName(),r=this.cssDataManager.getProperty(n);let o=e.getValue()||null;for(;o&&o.hasChildren();)o=o.findChildAtOffset(this.offset,!1);if(this.completionParticipants.forEach((e=>{e.onCssPropertyValue&&e.onCssPropertyValue({propertyName:n,propertyValue:this.currentWord,range:this.getCompletionRange(o)})})),r){if(r.restrictions)for(const e of r.restrictions)switch(e){case"color":this.getColorProposals(r,o,t);break;case"position":this.getPositionProposals(r,o,t);break;case"repeat":this.getRepeatStyleProposals(r,o,t);break;case"line-style":this.getLineStyleProposals(r,o,t);break;case"line-width":this.getLineWidthProposals(r,o,t);break;case"geometry-box":this.getGeometryBoxProposals(r,o,t);break;case"box":this.getBoxProposals(r,o,t);break;case"image":this.getImageProposals(r,o,t);break;case"timing-function":this.getTimingFunctionProposals(r,o,t);break;case"shape":this.getBasicShapeProposals(r,o,t)}this.getValueEnumProposals(r,o,t),this.getCSSWideKeywordProposals(r,o,t),this.getUnitProposals(r,o,t)}else{const n=function(e,t){const n=t.getFullPropertyName(),r=new Bn;function o(e){return(e instanceof ce||e instanceof lt||e instanceof ot)&&r.add(e.getText()),!0}return e.accept((function(e){if(e instanceof ge&&e!==t&&function(e){const t=e.getFullPropertyName();return n===t}(e)){const t=e.getValue();t&&t.accept(o)}return!0})),r}(this.styleSheet,e);for(const e of n.getEntries())t.items.push({label:e,textEdit:Rt.TextEdit.replace(this.getCompletionRange(o),e),kind:Rt.CompletionItemKind.Value})}return this.getVariableProposals(o,t),this.getTermProposals(r,o,t),t}getValueEnumProposals(e,t,n){if(e.values)for(const r of e.values){let o,i=r.name;if(Y(i,")")){const e=i.lastIndexOf("(");-1!==e&&(i=i.substring(0,e+1)+"$1"+i.substring(e+1),o=Ln)}let a=Fn.Enums;Q(r.name,"-")&&(a+=Fn.VendorPrefixed);const s={label:r.name,documentation:Lt(r,this.doesSupportMarkdown()),tags:jn(e)?[Rt.CompletionItemTag.Deprecated]:[],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),i),sortText:a,kind:Rt.CompletionItemKind.Value,insertTextFormat:o};n.items.push(s)}return n}getCSSWideKeywordProposals(e,t,n){for(const e in sn)n.items.push({label:e,documentation:sn[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});for(const e in cn){const r=Gn(e);n.items.push({label:e,documentation:cn[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),r),kind:Rt.CompletionItemKind.Function,insertTextFormat:Ln,command:Q(e,"var")?On:void 0})}return n}getCompletionsForInterpolation(e,t){return this.offset>=e.offset+2&&this.getVariableProposals(null,t),t}getVariableProposals(e,t){const n=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Variable);for(const r of n){const n=Q(r.name,"--")?`var(${r.name})`:r.name,o={label:r.name,documentation:r.value?Z(r.value):r.value,textEdit:Rt.TextEdit.replace(this.getCompletionRange(e),n),kind:Rt.CompletionItemKind.Variable,sortText:Fn.Variable};if("string"==typeof o.documentation&&$t(o.documentation)&&(o.kind=Rt.CompletionItemKind.Color),r.node.type===te.FunctionParameter){const e=r.node.getParent();e.type===te.MixinDeclaration&&(o.detail=At.t("argument from '{0}'",e.getName()))}t.items.push(o)}return t}getVariableProposalsForCSSVarFunction(e){const t=new Bn;this.styleSheet.acceptVisitor(new Hn(t,this.offset));let n=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Variable);for(const r of n){if(Q(r.name,"--")){const t={label:r.name,documentation:r.value?Z(r.value):r.value,textEdit:Rt.TextEdit.replace(this.getCompletionRange(null),r.name),kind:Rt.CompletionItemKind.Variable};"string"==typeof t.documentation&&$t(t.documentation)&&(t.kind=Rt.CompletionItemKind.Color),e.items.push(t)}t.remove(r.name)}for(const n of t.getEntries())if(Q(n,"--")){const t={label:n,textEdit:Rt.TextEdit.replace(this.getCompletionRange(null),n),kind:Rt.CompletionItemKind.Variable};e.items.push(t)}return e}getUnitProposals(e,t,n){let r="0";if(this.currentWord.length>0){const e=this.currentWord.match(/^-?\d[\.\d+]*/);e&&(r=e[0],n.isIncomplete=r.length===this.currentWord.length)}else 0===this.currentWord.length&&(n.isIncomplete=!0);if(t&&t.parent&&t.parent.type===te.Term&&(t=t.getParent()),e.restrictions)for(const o of e.restrictions){const e=pn[o];if(e)for(const o of e){const e=r+o;n.items.push({label:e,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Unit})}}return n}getCompletionRange(e){if(e&&e.offset<=this.offset&&this.offset<=e.end){const t=-1!==e.end?this.textDocument.positionAt(e.end):this.position,n=this.textDocument.positionAt(e.offset);if(n.line===t.line)return Rt.Range.create(n,t)}return this.defaultReplaceRange}getColorProposals(e,t,n){for(const e in Vt)n.items.push({label:e,documentation:Vt[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Color});for(const e in Ut)n.items.push({label:e,documentation:Ut[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});const r=new Bn;this.styleSheet.acceptVisitor(new Vn(r,this.offset));for(const e of r.getEntries())n.items.push({label:e,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Color});for(const e of Bt)n.items.push({label:e.label,detail:e.func,documentation:e.desc,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e.insertText),insertTextFormat:Ln,kind:Rt.CompletionItemKind.Function});return n}getPositionProposals(e,t,n){for(const e in en)n.items.push({label:e,documentation:en[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});return n}getRepeatStyleProposals(e,t,n){for(const e in tn)n.items.push({label:e,documentation:tn[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});return n}getLineStyleProposals(e,t,n){for(const e in nn)n.items.push({label:e,documentation:nn[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});return n}getLineWidthProposals(e,t,n){for(const e of rn)n.items.push({label:e,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});return n}getGeometryBoxProposals(e,t,n){for(const e in an)n.items.push({label:e,documentation:an[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});return n}getBoxProposals(e,t,n){for(const e in on)n.items.push({label:e,documentation:on[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),kind:Rt.CompletionItemKind.Value});return n}getImageProposals(e,t,n){for(const e in ln){const r=Gn(e);n.items.push({label:e,documentation:ln[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),r),kind:Rt.CompletionItemKind.Function,insertTextFormat:e!==r?Ln:void 0})}return n}getTimingFunctionProposals(e,t,n){for(const e in dn){const r=Gn(e);n.items.push({label:e,documentation:dn[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),r),kind:Rt.CompletionItemKind.Function,insertTextFormat:e!==r?Ln:void 0})}return n}getBasicShapeProposals(e,t,n){for(const e in un){const r=Gn(e);n.items.push({label:e,documentation:un[e],textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),r),kind:Rt.CompletionItemKind.Function,insertTextFormat:e!==r?Ln:void 0})}return n}getCompletionsForStylesheet(e){const t=this.styleSheet.findFirstChildBeforeOffset(this.offset);return t?t instanceof pe?this.getCompletionsForRuleSet(t,e):t instanceof Ge?this.getCompletionsForSupports(t,e):e:this.getCompletionForTopLevel(e)}getCompletionForTopLevel(e){return this.cssDataManager.getAtDirectives().forEach((t=>{e.items.push({label:t.name,textEdit:Rt.TextEdit.replace(this.getCompletionRange(null),t.name),documentation:Lt(t,this.doesSupportMarkdown()),tags:jn(t)?[Rt.CompletionItemTag.Deprecated]:[],kind:Rt.CompletionItemKind.Keyword})})),this.getCompletionsForSelector(null,!1,e),e}getCompletionsForRuleSet(e,t){const n=e.getDeclarations();return n&&n.endsWith("}")&&this.offset>=n.end?this.getCompletionForTopLevel(t):!n||this.offset<=n.offset?this.getCompletionsForSelector(e,e.isNested(),t):this.getCompletionsForDeclarations(e.getDeclarations(),t)}getCompletionsForSelector(e,t,n){const r=this.findInNodePath(te.PseudoSelector,te.IdentifierSelector,te.ClassSelector,te.ElementNameSelector);if(!r&&this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord,this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord),this.defaultReplaceRange=Rt.Range.create(Rt.Position.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach((e=>{const t=Gn(e.name),o={label:e.name,textEdit:Rt.TextEdit.replace(this.getCompletionRange(r),t),documentation:Lt(e,this.doesSupportMarkdown()),tags:jn(e)?[Rt.CompletionItemTag.Deprecated]:[],kind:Rt.CompletionItemKind.Function,insertTextFormat:e.name!==t?Ln:void 0};Q(e.name,":-")&&(o.sortText=Fn.VendorPrefixed),n.items.push(o)})),this.cssDataManager.getPseudoElements().forEach((e=>{const t=Gn(e.name),o={label:e.name,textEdit:Rt.TextEdit.replace(this.getCompletionRange(r),t),documentation:Lt(e,this.doesSupportMarkdown()),tags:jn(e)?[Rt.CompletionItemTag.Deprecated]:[],kind:Rt.CompletionItemKind.Function,insertTextFormat:e.name!==t?Ln:void 0};Q(e.name,"::-")&&(o.sortText=Fn.VendorPrefixed),n.items.push(o)})),!t){for(const e of mn)n.items.push({label:e,textEdit:Rt.TextEdit.replace(this.getCompletionRange(r),e),kind:Rt.CompletionItemKind.Keyword});for(const e of fn)n.items.push({label:e,textEdit:Rt.TextEdit.replace(this.getCompletionRange(r),e),kind:Rt.CompletionItemKind.Keyword})}const o={};o[this.currentWord]=!0;const i=this.textDocument.getText();if(this.styleSheet.accept((e=>{if(e.type===te.SimpleSelector&&e.length>0){const t=i.substr(e.offset,e.length);return"."!==t.charAt(0)||o[t]||(o[t]=!0,n.items.push({label:t,textEdit:Rt.TextEdit.replace(this.getCompletionRange(r),t),kind:Rt.CompletionItemKind.Keyword})),!1}return!0})),e&&e.isNested()){const t=e.getSelectors().findFirstChildBeforeOffset(this.offset);t&&0===e.getSelectors().getChildren().indexOf(t)&&this.getPropertyProposals(null,n)}return n}getCompletionsForDeclarations(e,t){if(!e||this.offset===e.offset)return t;const n=e.findFirstChildBeforeOffset(this.offset);if(!n)return this.getCompletionsForDeclarationProperty(null,t);if(n instanceof he){const e=n;if(!gn(e.colonPosition)||this.offset<=e.colonPosition)return this.getCompletionsForDeclarationProperty(e,t);if(gn(e.semicolonPosition)&&e.semicolonPositione.colonPosition&&this.getVariableProposals(e.getValue()||null,t),t}getCompletionsForExpression(e,t){const n=e.getParent();if(n instanceof Ee)return this.getCompletionsForFunctionArgument(n,n.getParent(),t),t;const r=e.findParent(te.Declaration);if(!r)return this.getTermProposals(void 0,null,t),t;const o=e.findChildAtOffset(this.offset,!0);return o?o instanceof lt||o instanceof ce?this.getCompletionsForDeclarationValue(r,t):t:this.getCompletionsForDeclarationValue(r,t)}getCompletionsForFunctionArgument(e,t,n){const r=t.getIdentifier();return r&&r.matches("var")&&(t.getArguments().hasChildren()&&t.getArguments().getChild(0)!==e||this.getVariableProposalsForCSSVarFunction(n)),n}getCompletionsForFunctionDeclaration(e,t){const n=e.getDeclarations();return n&&this.offset>n.offset&&this.offset{e.onCssMixinReference&&e.onCssMixinReference({mixinName:this.currentWord,range:this.getCompletionRange(r)})})),t}getTermProposals(e,t,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Function);for(const e of r)e.node instanceof De&&n.items.push(this.makeTermProposal(e,e.node.getParameters(),t));return n}makeTermProposal(e,t,n){e.node;const r=t.getChildren().map((e=>e instanceof xe?e.getName():e.getText())),o=e.name+"("+r.map(((e,t)=>"${"+(t+1)+":"+e+"}")).join(", ")+")";return{label:e.name,detail:e.name+"("+r.join(", ")+")",textEdit:Rt.TextEdit.replace(this.getCompletionRange(n),o),insertTextFormat:Ln,kind:Rt.CompletionItemKind.Function,sortText:Fn.Term}}getCompletionsForSupportsCondition(e,t){const n=e.findFirstChildBeforeOffset(this.offset);if(n){if(n instanceof ge)return!gn(n.colonPosition)||this.offset<=n.colonPosition?this.getCompletionsForDeclarationProperty(n,t):this.getCompletionsForDeclarationValue(n,t);if(n instanceof Qe)return this.getCompletionsForSupportsCondition(n,t)}return gn(e.lParent)&&this.offset>e.lParent&&(!gn(e.rParent)||this.offset<=e.rParent)?this.getCompletionsForDeclarationProperty(null,t):t}getCompletionsForSupports(e,t){const n=e.getDeclarations();if(!n||this.offset<=n.offset){const n=e.findFirstChildBeforeOffset(this.offset);return n instanceof Qe?this.getCompletionsForSupportsCondition(n,t):t}return this.getCompletionForTopLevel(t)}getCompletionsForExtendsReference(e,t,n){return n}getCompletionForUriLiteralValue(e,t){let n,r,o;if(e.hasChildren()){const t=e.getChild(0);n=t.getText(),r=this.position,o=this.getCompletionRange(t)}else{n="",r=this.position;const t=this.textDocument.positionAt(e.offset+"url(".length);o=Rt.Range.create(t,t)}return this.completionParticipants.forEach((e=>{e.onCssURILiteralValue&&e.onCssURILiteralValue({uriValue:n,position:r,range:o})})),t}getCompletionForImportPath(e,t){return this.completionParticipants.forEach((t=>{t.onCssImportPath&&t.onCssImportPath({pathValue:e.getText(),position:this.position,range:this.getCompletionRange(e)})})),t}hasCharacterAtPosition(e,t){const n=this.textDocument.getText();return e>=0&&e"),this.writeLine(t,r.join(""))}}!function(e){function t(e){const t=e.match(/^['"](.*)["']$/);return t?t[1]:e}e.ensure=function(e,n){return n+t(e)+n},e.remove=t}(Wn||(Wn={}));class $n{constructor(){this.id=0,this.attr=0,this.tag=0}}function Xn(e,t){let n=new Un;for(const r of e.getChildren())switch(r.type){case te.SelectorCombinator:if(t){const e=r.getText().split("&");if(1===e.length){n.addAttr("name",e[0]);break}n=t.cloneWithParent(),e[0]&&n.findRoot().prepend(e[0]);for(let r=1;r1){const e=t.cloneWithParent();n.addChild(e.findRoot()),n=e}n.append(e[r])}}break;case te.SelectorPlaceholder:if(r.matches("@at-root"))return n;case te.ElementNameSelector:const e=r.getText();n.addAttr("name","*"===e?"element":Qn(e));break;case te.ClassSelector:n.addAttr("class",Qn(r.getText().substring(1)));break;case te.IdentifierSelector:n.addAttr("id",Qn(r.getText().substring(1)));break;case te.MixinDeclaration:n.addAttr("class",r.getName());break;case te.PseudoSelector:n.addAttr(Qn(r.getText()),"");break;case te.AttributeSelector:const o=r,i=o.getIdentifier();if(i){const e=o.getValue(),t=o.getOperator();let r;if(e&&t)switch(Qn(t.getText())){case"|=":r=`${Wn.remove(Qn(e.getText()))}-…`;break;case"^=":r=`${Wn.remove(Qn(e.getText()))}…`;break;case"$=":r=`…${Wn.remove(Qn(e.getText()))}`;break;case"~=":r=` … ${Wn.remove(Qn(e.getText()))} … `;break;case"*=":r=`…${Wn.remove(Qn(e.getText()))}…`;break;default:r=Wn.remove(Qn(e.getText()))}n.addAttr(Qn(i.getText()),r)}}return n}function Qn(e){const t=new X;t.setSource(e);const n=t.scanUnquotedString();return n?n.text:e}class Yn{constructor(e){this.cssDataManager=e}selectorToMarkedString(e){const t=function(e){if(e.matches("@at-root"))return null;const t=new qn,n=[],r=e.getParent();if(r instanceof pe){let e=r.getParent();for(;e&&!er(e);){if(e instanceof pe){if(e.getSelectors().matches("@at-root"))break;n.push(e)}e=e.getParent()}}const o=new Zn(t);for(let e=n.length-1;e>=0;e--){const t=n[e].getSelectors().getChild(0);t&&o.processSelector(t)}return o.processSelector(e),t}(e);if(t){const n=new Jn('"').print(t);return n.push(this.selectorToSpecificityMarkedString(e)),n}return[]}simpleSelectorToMarkedString(e){const t=Xn(e),n=new Jn('"').print(t);return n.push(this.selectorToSpecificityMarkedString(e)),n}isPseudoElementIdentifier(e){const t=e.match(/^::?([\w-]+)/);return!!t&&!!this.cssDataManager.getPseudoElement("::"+t[1])}selectorToSpecificityMarkedString(e){const t=e=>{const t=new $n;let r=new $n;for(const t of e)for(const e of t.getChildren()){const t=n(e);t.id>r.id?r=t:t.idr.attr?r=t:t.attrr.tag&&(r=t))}return t.id+=r.id,t.attr+=r.attr,t.tag+=r.tag,t},n=e=>{const r=new $n;e:for(const o of e.getChildren()){switch(o.type){case te.IdentifierSelector:r.id++;break;case te.ClassSelector:case te.AttributeSelector:r.attr++;break;case te.ElementNameSelector:if(o.matches("*"))break;r.tag++;break;case te.PseudoSelector:const e=o.getText(),n=o.getChildren();if(this.isPseudoElementIdentifier(e)){if(e.match(/^::slotted/i)&&n.length>0){r.tag++;let e=t(n);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}r.tag++;continue e}if(e.match(/^:where/i))continue e;if(e.match(/^:(?:not|has|is)/i)&&n.length>0){let e=t(n);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}if(e.match(/^:(?:nth-child|nth-last-child|host|host-context)/i)&&n.length>0){r.attr++;let e=t(n);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag;continue e}r.attr++;continue e}if(o.getChildren().length>0){const e=n(o);r.id+=e.id,r.attr+=e.attr,r.tag+=e.tag}}return r},r=n(e);return`[${At.t("Selector Specificity")}](https://developer.mozilla.org/docs/Web/CSS/Specificity): (${r.id}, ${r.attr}, ${r.tag})`}}class Zn{constructor(e){this.prev=null,this.element=e}processSelector(e){let t=null;if(!(this.element instanceof qn)&&e.getChildren().some((e=>e.hasChildren()&&e.getChild(0).type===te.SelectorCombinator))){const e=this.element.findRoot();e.parent instanceof qn&&(t=this.element,this.element=e.parent,this.element.removeChild(e),this.prev=null)}for(const n of e.getChildren()){if(n instanceof fe){if(this.prev instanceof fe){const e=new Kn("…");this.element.addChild(e),this.element=e}else this.prev&&(this.prev.matches("+")||this.prev.matches("~"))&&this.element.parent&&(this.element=this.element.parent);this.prev&&this.prev.matches("~")&&this.element.addChild(new Kn("⋮"));const e=Xn(n,t),r=e.findRoot();this.element.addChild(r),this.element=e}(n instanceof fe||n.type===te.SelectorCombinatorParent||n.type===te.SelectorCombinatorShadowPiercingDescendant||n.type===te.SelectorCombinatorSibling||n.type===te.SelectorCombinatorAllSiblings)&&(this.prev=n)}}}function er(e){switch(e.type){case te.MixinDeclaration:case te.Stylesheet:return!0}return!1}class tr{constructor(e,t){this.clientCapabilities=e,this.cssDataManager=t,this.selectorPrinting=new Yn(t)}configure(e){this.defaultSettings=e}doHover(e,t,n,r=this.defaultSettings){function o(t){return Rt.Range.create(e.positionAt(t.offset),e.positionAt(t.end))}const i=oe(n,e.offsetAt(t));let a=null;for(let e=0;e"string"==typeof e?e:e.value)):e.value}doesSupportMarkdown(){if(!gn(this.supportsMarkdown)){if(!gn(this.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;const e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.hover;this.supportsMarkdown=e&&e.contentFormat&&Array.isArray(e.contentFormat)&&-1!==e.contentFormat.indexOf(Rt.MarkupKind.Markdown)}return this.supportsMarkdown}}const nr=/^\w+:\/\//,rr=/^data:/;class or{constructor(e,t){this.fileSystemProvider=e,this.resolveModuleReferences=t}findDefinition(e,t,n){const r=new wn(n),o=re(n,e.offsetAt(t));if(!o)return null;const i=r.findSymbolFromNode(o);return i?{uri:e.uri,range:ir(i.node,e)}:null}findReferences(e,t,n){return this.findDocumentHighlights(e,t,n).map((t=>({uri:e.uri,range:t.range})))}getHighlightNode(e,t,n){let r=re(n,e.offsetAt(t));if(r&&r.type!==te.Stylesheet&&r.type!==te.Declarations)return r.type===te.Identifier&&r.parent&&r.parent.type===te.ClassSelector&&(r=r.parent),r}findDocumentHighlights(e,t,n){const r=[],o=this.getHighlightNode(e,t,n);if(!o)return r;const i=new wn(n),a=i.findSymbolFromNode(o),s=o.getText();return n.accept((t=>{if(a){if(i.matchesSymbol(t,a))return r.push({kind:sr(t),range:ir(t,e)}),!1}else o&&o.type===t.type&&t.matches(s)&&r.push({kind:sr(t),range:ir(t,e)});return!0})),r}isRawStringDocumentLinkNode(e){return e.type===te.Import}findDocumentLinks(e,t,n){const r=this.findUnresolvedLinks(e,t),o=[];for(let t of r){const r=t.link,i=r.target;if(!i||rr.test(i));else if(nr.test(i))o.push(r);else{const t=n.resolveReference(i,e.uri);t&&(r.target=t),o.push(r)}}return o}async findDocumentLinks2(e,t,n){const r=this.findUnresolvedLinks(e,t),o=[];for(let t of r){const r=t.link,i=r.target;if(!i||rr.test(i));else if(nr.test(i))o.push(r);else{const a=await this.resolveReference(i,e.uri,n,t.isRawLink);void 0!==a&&(r.target=a,o.push(r))}}return o}findUnresolvedLinks(e,t){const n=[],r=t=>{let r=t.getText();const o=ir(t,e);if(o.start.line===o.end.line&&o.start.character===o.end.character)return;(Q(r,"'")||Q(r,'"'))&&(r=r.slice(1,-1));const i=!!t.parent&&this.isRawStringDocumentLinkNode(t.parent);n.push({link:{target:r,range:o},isRawLink:i})};return t.accept((e=>{if(e.type===te.URILiteral){const t=e.getChild(0);return t&&r(t),!1}if(e.parent&&this.isRawStringDocumentLinkNode(e.parent)){const t=e.getText();return(Q(t,"'")||Q(t,'"'))&&r(e),!1}return!0})),n}findSymbolInformations(e,t){const n=[];return this.collectDocumentSymbols(e,t,((t,r,o)=>{const i=o instanceof ie?ir(o,e):o,a={name:t||At.t(""),kind:r,location:Rt.Location.create(e.uri,i)};n.push(a)})),n}findDocumentSymbols(e,t){const n=[],r=[];return this.collectDocumentSymbols(e,t,((t,o,i,a,s)=>{const c=i instanceof ie?ir(i,e):i;let l=a instanceof ie?ir(a,e):a;l&&ar(c,l)||(l=Rt.Range.create(c.start,c.start));const d={name:t||At.t(""),kind:o,range:c,selectionRange:l};let u=r.pop();for(;u&&!ar(u[1],c);)u=r.pop();if(u){const e=u[0];e.children||(e.children=[]),e.children.push(d),r.push(u)}else n.push(d);s&&r.push([d,ir(s,e)])})),n}collectDocumentSymbols(e,t,n){t.accept((t=>{if(t instanceof pe){for(const r of t.getSelectors().getChildren())if(r instanceof me){const o=Rt.Range.create(e.positionAt(r.offset),e.positionAt(t.end));n(r.getText(),Rt.SymbolKind.Class,o,r,t.getDeclarations())}}else if(t instanceof dt)n(t.getName(),Rt.SymbolKind.Variable,t,t.getVariable(),void 0);else if(t instanceof gt)n(t.getName(),Rt.SymbolKind.Method,t,t.getIdentifier(),t.getDeclarations());else if(t instanceof De)n(t.getName(),Rt.SymbolKind.Function,t,t.getIdentifier(),t.getDeclarations());else if(t instanceof Me){const e=At.t("@keyframes {0}",t.getName());n(e,Rt.SymbolKind.Class,t,t.getIdentifier(),t.getDeclarations())}else if(t instanceof Re){const e=At.t("@font-face");n(e,Rt.SymbolKind.Class,t,void 0,t.getDeclarations())}else if(t instanceof Be){const e=t.getChild(0);if(e instanceof Ke){const r="@media "+e.getText();n(r,Rt.SymbolKind.Module,t,e,t.getDeclarations())}}return!0}))}findDocumentColors(e,t){const n=[];return t.accept((t=>{const r=function(e,t){const n=function(e){if(e.type===te.HexColorValue)return Qt(e.getText());if(e.type===te.Function){const t=e,n=t.getName();let r=t.getArguments().getChildren();if(1===r.length){const e=r[0].getChildren();if(1===e.length&&e[0].type===te.Expression&&(r=e[0].getChildren(),3===r.length)){const e=r[2];if(e instanceof tt){const t=e.getLeft(),n=e.getRight(),o=e.getOperator();t&&n&&o&&o.matches("/")&&(r=[r[0],r[1],t,n])}}}if(!n||r.length<3||r.length>4)return null;try{const e=4===r.length?Kt(r[3],1):1;if("rgb"===n||"rgba"===n)return{red:Kt(r[0],255),green:Kt(r[1],255),blue:Kt(r[2],255),alpha:e};if("hsl"===n||"hsla"===n){return Yt(Jt(r[0]),Kt(r[1],100),Kt(r[2],100),e)}if("hwb"===n){return function(e,t,n,r=1){if(t+n>=1){const e=t/(t+n);return{red:e,green:e,blue:e,alpha:r}}const o=Yt(e,1,.5,r);let i=o.red;i*=1-t-n,i+=t;let a=o.green;a*=1-t-n,a+=t;let s=o.blue;return s*=1-t-n,s+=t,{red:i,green:a,blue:s,alpha:r}}(Jt(r[0]),Kt(r[1],100),Kt(r[2],100),e)}}catch(e){return null}}else if(e.type===te.Identifier){if(e.parent&&e.parent.type!==te.Term)return null;const t=e.parent;if(t&&t.parent&&t.parent.type===te.BinaryExpression){const e=t.parent;if(e.parent&&e.parent.type===te.ListEntry&&e.parent.key===e)return null}const n=e.getText().toLowerCase();if("none"===n)return null;const r=Vt[n];if(r)return Qt(r)}return null}(e);return n?{color:n,range:ir(e,t)}:null}(t,e);return r&&n.push(r),!0})),n}getColorPresentations(e,t,n,r){const o=[],i=Math.round(255*n.red),a=Math.round(255*n.green),s=Math.round(255*n.blue);let c;c=1===n.alpha?`rgb(${i}, ${a}, ${s})`:`rgba(${i}, ${a}, ${s}, ${n.alpha})`,o.push({label:c,textEdit:Rt.TextEdit.replace(r,c)}),c=1===n.alpha?`#${cr(i)}${cr(a)}${cr(s)}`:`#${cr(i)}${cr(a)}${cr(s)}${cr(Math.round(255*n.alpha))}`,o.push({label:c,textEdit:Rt.TextEdit.replace(r,c)});const l=Zt(n);c=1===l.a?`hsl(${l.h}, ${Math.round(100*l.s)}%, ${Math.round(100*l.l)}%)`:`hsla(${l.h}, ${Math.round(100*l.s)}%, ${Math.round(100*l.l)}%, ${l.a})`,o.push({label:c,textEdit:Rt.TextEdit.replace(r,c)});const d=function(e){const t=Zt(e),n=Math.min(e.red,e.green,e.blue),r=1-Math.max(e.red,e.green,e.blue);return{h:t.h,w:n,b:r,a:t.a}}(n);return c=1===d.a?`hwb(${d.h} ${Math.round(100*d.w)}% ${Math.round(100*d.b)}%)`:`hwb(${d.h} ${Math.round(100*d.w)}% ${Math.round(100*d.b)}% / ${d.a})`,o.push({label:c,textEdit:Rt.TextEdit.replace(r,c)}),o}prepareRename(e,t,n){const r=this.getHighlightNode(e,t,n);if(r)return Rt.Range.create(e.positionAt(r.offset),e.positionAt(r.end))}doRename(e,t,n,r){const o=this.findDocumentHighlights(e,t,r).map((e=>Rt.TextEdit.replace(e.range,n)));return{changes:{[e.uri]:o}}}async resolveModuleReference(e,t,n){if(Q(t,"file://")){const r=function(e){const t=e.indexOf("/");if(-1===t)return"";if("@"===e[0]){const n=e.indexOf("/",t+1);return-1===n?e:e.substring(0,n)}return e.substring(0,t)}(e);if(r&&"."!==r&&".."!==r){const o=n.resolveReference("/",t),i=kn(t),a=await this.resolvePathToModule(r,i,o);if(a)return Cn(a,e.substring(r.length+1))}}}async mapReference(e,t){return e}async resolveReference(e,t,n,r=!1){if("~"===e[0]&&"/"!==e[1]&&this.fileSystemProvider)return e=e.substring(1),this.mapReference(await this.resolveModuleReference(e,t,n),r);const o=await this.mapReference(n.resolveReference(e,t),r);if(this.resolveModuleReferences){if(o&&await this.fileExists(o))return o;const i=await this.mapReference(await this.resolveModuleReference(e,t,n),r);if(i)return i}return o}async resolvePathToModule(e,t,n){const r=Cn(t,"node_modules",e,"package.json");return await this.fileExists(r)?kn(r):n&&t.startsWith(n)&&t.length!==n.length?this.resolvePathToModule(e,kn(t),n):void 0}async fileExists(e){if(!this.fileSystemProvider)return!1;try{const t=await this.fileSystemProvider.stat(e);return t.type!==It.Unknown||-1!==t.size}catch(e){return!1}}}function ir(e,t){return Rt.Range.create(t.positionAt(e.offset),t.positionAt(e.end))}function ar(e,t){const n=t.start.line,r=t.end.line,o=e.start.line,i=e.end.line;return!(ni||r>i||n===o&&t.start.charactere.end.character)}function sr(e){if(e.type===te.Selector)return Rt.DocumentHighlightKind.Write;if(e instanceof ce&&e.parent&&e.parent instanceof ve&&e.isCustomProperty)return Rt.DocumentHighlightKind.Write;if(e.parent)switch(e.parent.type){case te.FunctionDeclaration:case te.MixinDeclaration:case te.Keyframe:case te.VariableDeclaration:case te.FunctionParameter:return Rt.DocumentHighlightKind.Write}return Rt.DocumentHighlightKind.Read}function cr(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}const lr=Et.Warning,dr=Et.Error,ur=Et.Ignore;class pr{constructor(e,t,n){this.id=e,this.message=t,this.defaultValue=n}}const mr={AllVendorPrefixes:new pr("compatibleVendorPrefixes",At.t("When using a vendor-specific prefix make sure to also include all other vendor-specific properties"),ur),IncludeStandardPropertyWhenUsingVendorPrefix:new pr("vendorPrefix",At.t("When using a vendor-specific prefix also include the standard property"),lr),DuplicateDeclarations:new pr("duplicateProperties",At.t("Do not use duplicate style definitions"),ur),EmptyRuleSet:new pr("emptyRules",At.t("Do not use empty rulesets"),lr),ImportStatemement:new pr("importStatement",At.t("Import statements do not load in parallel"),ur),BewareOfBoxModelSize:new pr("boxModel",At.t("Do not use width or height when using padding or border"),ur),UniversalSelector:new pr("universalSelector",At.t("The universal selector (*) is known to be slow"),ur),ZeroWithUnit:new pr("zeroUnits",At.t("No unit for zero needed"),ur),RequiredPropertiesForFontFace:new pr("fontFaceProperties",At.t("@font-face rule must define 'src' and 'font-family' properties"),lr),HexColorLength:new pr("hexColorLength",At.t("Hex colors must consist of three, four, six or eight hex numbers"),dr),ArgsInColorFunction:new pr("argumentsInColorFunction",At.t("Invalid number of parameters"),dr),UnknownProperty:new pr("unknownProperties",At.t("Unknown property."),lr),UnknownAtRules:new pr("unknownAtRules",At.t("Unknown at-rule."),lr),IEStarHack:new pr("ieHack",At.t("IE hacks are only necessary when supporting IE7 and older"),ur),UnknownVendorSpecificProperty:new pr("unknownVendorSpecificProperties",At.t("Unknown vendor specific property."),ur),PropertyIgnoredDueToDisplay:new pr("propertyIgnoredDueToDisplay",At.t("Property is ignored due to the display."),lr),AvoidImportant:new pr("important",At.t("Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."),ur),AvoidFloat:new pr("float",At.t("Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."),ur),AvoidIdSelector:new pr("idSelector",At.t("Selectors should not contain IDs because these rules are too tightly coupled with the HTML."),ur)},fr={ValidProperties:new class{constructor(e,t,n){this.id=e,this.message=t,this.defaultValue=n}}("validProperties",At.t("A list of properties that are not validated against the `unknownProperties` rule."),[])};class hr{constructor(e={}){this.conf=e}getRule(e){if(this.conf.hasOwnProperty(e.id)){const t=function(e){switch(e){case"ignore":return Et.Ignore;case"warning":return Et.Warning;case"error":return Et.Error}return null}(this.conf[e.id]);if(t)return t}return e.defaultValue}getSetting(e){return this.conf[e.id]}}class _r{constructor(e){this.cssDataManager=e}doCodeActions(e,t,n,r){return this.doCodeActions2(e,t,n,r).map((t=>{const n=t.edit&&t.edit.documentChanges&&t.edit.documentChanges[0];return Rt.Command.create(t.title,"_css.applyCodeAction",e.uri,e.version,n&&n.edits)}))}doCodeActions2(e,t,n,r){const o=[];if(n.diagnostics)for(const t of n.diagnostics)this.appendFixesForMarker(e,r,t,o);return o}getFixesForUnknownProperty(e,t,n,r){const o=t.getName(),i=[];this.cssDataManager.getProperties().forEach((e=>{const t=function(e,t,n=4){let r=Math.abs(e.length-t.length);if(r>n)return 0;let o,i,a=[],s=[];for(o=0;o=o.length/2&&i.push({property:e.name,score:t})})),i.sort(((e,t)=>t.score-e.score||e.property.localeCompare(t.property)));let a=3;for(const t of i){const o=t.property,i=At.t("Rename to '{0}'",o),s=Rt.TextEdit.replace(n.range,o),c=Rt.VersionedTextDocumentIdentifier.create(e.uri,e.version),l={documentChanges:[Rt.TextDocumentEdit.create(c,[s])]},d=Rt.CodeAction.create(i,l,Rt.CodeActionKind.QuickFix);if(d.diagnostics=[n],r.push(d),--a<=0)return}}appendFixesForMarker(e,t,n,r){if(n.code!==mr.UnknownProperty.id)return;const o=e.offsetAt(n.range.start),i=e.offsetAt(n.range.end),a=oe(t,o);for(let t=a.length-1;t>=0;t--){const s=a[t];if(s instanceof ge){const t=s.getProperty();if(t&&t.offset===o&&t.end===i)return void this.getFixesForUnknownProperty(e,t,n,r)}}}}class gr{constructor(e){this.fullPropertyName=e.getFullPropertyName().toLowerCase(),this.node=e}}function yr(e,t,n,r){const o=e[t];o.value=n,n&&(vn(o.properties,r)||o.properties.push(r))}function vr(e,t,n,r){"top"===t||"right"===t||"bottom"===t||"left"===t?yr(e,t,n,r):function(e,t,n){yr(e,"top",t,n),yr(e,"right",t,n),yr(e,"bottom",t,n),yr(e,"left",t,n)}(e,n,r)}function br(e,t,n){switch(t.length){case 1:vr(e,void 0,t[0],n);break;case 2:vr(e,"top",t[0],n),vr(e,"bottom",t[0],n),vr(e,"right",t[1],n),vr(e,"left",t[1],n);break;case 3:vr(e,"top",t[0],n),vr(e,"right",t[1],n),vr(e,"left",t[1],n),vr(e,"bottom",t[2],n);break;case 4:vr(e,"top",t[0],n),vr(e,"right",t[1],n),vr(e,"bottom",t[2],n),vr(e,"left",t[3],n)}}function Sr(e,t){for(let n of t)if(e.matches(n))return!0;return!1}function xr(e,t=!0){return!(t&&Sr(e,["initial","unset"])||0===parseFloat(e.getText()))}function Er(e,t=!0){return e.map((e=>xr(e,t)))}function Tr(e,t=!0){return!(Sr(e,["none","hidden"])||t&&Sr(e,["initial","unset"]))}function wr(e,t=!0){return e.map((e=>Tr(e,t)))}function Ar(e){const t=e.getChildren();if(1===t.length){const e=t[0];return xr(e)&&Tr(e)}for(const e of t){const t=e;if(!xr(t,!1)||!Tr(t,!1))return!1}return!0}class kr{constructor(){this.data={}}add(e,t,n){let r=this.data[e];r||(r={nodes:[],names:[]},this.data[e]=r),r.names.push(t),n&&r.nodes.push(n)}}class Cr{static entries(e,t,n,r,o){const i=new Cr(t,n,r);return e.acceptVisitor(i),i.completeValidations(),i.getEntries(o)}constructor(e,t,n){this.cssDataManager=n,this.warnings=[],this.settings=t,this.documentText=e.getText(),this.keyframes=new kr,this.validProperties={};const r=t.getSetting(fr.ValidProperties);Array.isArray(r)&&r.forEach((e=>{if("string"==typeof e){const t=e.trim().toLowerCase();t.length&&(this.validProperties[t]=!0)}}))}isValidPropertyDeclaration(e){const t=e.fullPropertyName;return this.validProperties[t]}fetch(e,t){const n=[];for(const r of e)r.fullPropertyName===t&&n.push(r);return n}fetchWithValue(e,t,n){const r=[];for(const o of e)if(o.fullPropertyName===t){const e=o.node.getValue();e&&this.findValueInExpression(e,n)&&r.push(o)}return r}findValueInExpression(e,t){let n=!1;return e.accept((e=>(e.type===te.Identifier&&e.matches(t)&&(n=!0),!n))),n}getEntries(e=Et.Warning|Et.Error){return this.warnings.filter((t=>0!=(t.getLevel()&e)))}addEntry(e,t,n){const r=new Tt(e,t,this.settings.getRule(t),n);this.warnings.push(r)}getMissingNames(e,t){const n=e.slice(0);for(let e=0;e0){const e=this.fetch(n,"float");for(let t=0;t0){const e=this.fetch(n,"vertical-align");for(let t=0;t1)for(let n=0;ne.startsWith(o)))&&a.delete(e)}}const s=[];for(let e=0,t=Cr.prefixes.length;e!(e instanceof tt&&(r+=1,1)))),r!==n&&this.addEntry(e,mr.ArgsInColorFunction)),!0}}Cr.prefixes=["-ms-","-moz-","-o-","-webkit-"];class Dr{constructor(e){this.cssDataManager=e}configure(e){this.settings=e}doValidation(e,t,n=this.settings){if(n&&!1===n.validate)return[];const r=[];r.push.apply(r,wt.entries(t)),r.push.apply(r,Cr.entries(t,e,new hr(n&&n.lint),this.cssDataManager));const o=[];for(const e in mr)o.push(mr[e].id);return r.filter((e=>e.getLevel()!==Et.Ignore)).map((function(t){const n=Rt.Range.create(e.positionAt(t.getOffset()),e.positionAt(t.getOffset()+t.getLength())),r=e.languageId;return{code:t.getRule().id,source:r,message:t.getMessage(),severity:t.getLevel()===Et.Warning?Rt.DiagnosticSeverity.Warning:Rt.DiagnosticSeverity.Error,range:n}}))}}const Ir="/".charCodeAt(0),Rr="\n".charCodeAt(0),Nr="\r".charCodeAt(0),Mr="\f".charCodeAt(0),Pr="$".charCodeAt(0),Lr="#".charCodeAt(0),Or="{".charCodeAt(0),Fr="=".charCodeAt(0),Wr="!".charCodeAt(0),zr="<".charCodeAt(0),jr=">".charCodeAt(0),Br=".".charCodeAt(0);"@".charCodeAt(0);let Gr=r.CustomToken;const Vr=Gr++,Hr=Gr++,Ur=(Gr++,Gr++),qr=Gr++,Kr=Gr++,Jr=Gr++,$r=Gr++;Gr++;class Xr extends X{scanNext(e){if(this.stream.advanceIfChar(Pr)){const t=["$"];if(this.ident(t))return this.finishToken(e,Vr,t.join(""));this.stream.goBackTo(e)}return this.stream.advanceIfChars([Lr,Or])?this.finishToken(e,Hr):this.stream.advanceIfChars([Fr,Fr])?this.finishToken(e,Ur):this.stream.advanceIfChars([Wr,Fr])?this.finishToken(e,qr):this.stream.advanceIfChar(zr)?this.stream.advanceIfChar(Fr)?this.finishToken(e,Jr):this.finishToken(e,r.Delim):this.stream.advanceIfChar(jr)?this.stream.advanceIfChar(Fr)?this.finishToken(e,Kr):this.finishToken(e,r.Delim):this.stream.advanceIfChars([Br,Br,Br])?this.finishToken(e,$r):super.scanNext(e)}comment(){return!!super.comment()||!(this.inURL||!this.stream.advanceIfChars([Ir,Ir]))&&(this.stream.advanceWhileChar((e=>{switch(e){case Rr:case Nr:case Mr:return!1;default:return!0}})),!0)}}class Qr{constructor(e,t){this.id=e,this.message=t}}const Yr={FromExpected:new Qr("scss-fromexpected",At.t("'from' expected")),ThroughOrToExpected:new Qr("scss-throughexpected",At.t("'through' or 'to' expected")),InExpected:new Qr("scss-fromexpected",At.t("'in' expected"))};class Zr extends yn{constructor(){super(new Xr)}_parseStylesheetStatement(e=!1){return this.peek(r.AtKeyword)?this._parseWarnAndDebug()||this._parseControlStatement()||this._parseMixinDeclaration()||this._parseMixinContent()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseForward()||this._parseUse()||this._parseRuleset(e)||super._parseStylesheetAtStatement(e):this._parseRuleset(!0)||this._parseVariableDeclaration()}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Le);if(this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Ct.URIOrStringExpected);for(;this.accept(r.Comma);)if(!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Ct.URIOrStringExpected);return this.peek(r.SemiColon)||this.peek(r.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e)}_parseVariableDeclaration(e=[]){if(!this.peek(Vr))return null;const t=this.create(dt);if(!t.setVariable(this._parseVariable()))return null;if(!this.accept(r.Colon))return this.finish(t,Ct.ColonExpected);if(this.prevToken&&(t.colonPosition=this.prevToken.offset),!t.setValue(this._parseExpr()))return this.finish(t,Ct.VariableValueExpected,[],e);for(;this.peek(r.Exclamation);)if(t.addChild(this._tryParsePrio()));else{if(this.consumeToken(),!this.peekRegExp(r.Ident,/^(default|global)$/))return this.finish(t,Ct.UnknownKeyword);this.consumeToken()}return this.peek(r.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)}_parseMediaCondition(){return this._parseInterpolation()||super._parseMediaCondition()}_parseMediaFeatureRangeOperator(){return this.accept(Jr)||this.accept(Kr)||super._parseMediaFeatureRangeOperator()}_parseMediaFeatureName(){return this._parseModuleMember()||this._parseFunction()||this._parseIdent()||this._parseVariable()}_parseKeyframeSelector(){return this._tryParseKeyframeSelector()||this._parseControlStatement(this._parseKeyframeSelector.bind(this))||this._parseVariableDeclaration()||this._parseMixinContent()}_parseVariable(){if(!this.peek(Vr))return null;const e=this.create(pt);return this.consumeToken(),e}_parseModuleMember(){const e=this.mark(),t=this.create(xt);return t.setIdentifier(this._parseIdent([ne.Module]))?this.hasWhitespace()||!this.acceptDelim(".")||this.hasWhitespace()?(this.restoreAtMark(e),null):t.addChild(this._parseVariable()||this._parseFunction())?t:this.finish(t,Ct.IdentifierOrVariableExpected):null}_parseIdent(e){if(!this.peek(r.Ident)&&!this.peek(Hr)&&!this.peekDelim("-"))return null;const t=this.create(ce);t.referenceTypes=e,t.isCustomProperty=this.peekRegExp(r.Ident,/^--/);let n=!1;const o=()=>{const e=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(e),null):this._parseInterpolation()};for(;(this.accept(r.Ident)||t.addChild(o())||n&&this.acceptRegexp(/^[\w-]/))&&(n=!0,!this.hasWhitespace()););return n?this.finish(t):null}_parseTermExpression(){return this._parseModuleMember()||this._parseVariable()||this._parseNestingSelector()||super._parseTermExpression()}_parseInterpolation(){if(this.peek(Hr)){const e=this.create(ut);return this.consumeToken(),e.addChild(this._parseExpr())||this._parseNestingSelector()?this.accept(r.CurlyR)?this.finish(e):this.finish(e,Ct.RightCurlyExpected):this.accept(r.CurlyR)?this.finish(e):this.finish(e,Ct.ExpressionExpected)}return null}_parseOperator(){if(this.peek(Ur)||this.peek(qr)||this.peek(Kr)||this.peek(Jr)||this.peekDelim(">")||this.peekDelim("<")||this.peekIdent("and")||this.peekIdent("or")||this.peekDelim("%")){const e=this.createNode(te.Operator);return this.consumeToken(),this.finish(e)}return super._parseOperator()}_parseUnaryOperator(){if(this.peekIdent("not")){const e=this.create(ie);return this.consumeToken(),this.finish(e)}return super._parseUnaryOperator()}_parseRuleSetDeclaration(){return this.peek(r.AtKeyword)?this._parseKeyframe()||this._parseImport()||this._parseMedia(!0)||this._parseFontFace()||this._parseWarnAndDebug()||this._parseControlStatement()||this._parseFunctionDeclaration()||this._parseExtends()||this._parseMixinReference()||this._parseMixinContent()||this._parseMixinDeclaration()||this._parseRuleset(!0)||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseRuleSetDeclarationAtStatement():this._parseVariableDeclaration()||this._tryParseRuleset(!0)||this._parseDeclaration()}_parseDeclaration(e){const t=this._tryParseCustomPropertyDeclaration(e);if(t)return t;const n=this.create(ge);if(!n.setProperty(this._parseProperty()))return null;if(!this.accept(r.Colon))return this.finish(n,Ct.ColonExpected,[r.Colon],e||[r.SemiColon]);this.prevToken&&(n.colonPosition=this.prevToken.offset);let o=!1;if(n.setValue(this._parseExpr())&&(o=!0,n.addChild(this._parsePrio())),this.peek(r.CurlyL))n.setNestedProperties(this._parseNestedProperties());else if(!o)return this.finish(n,Ct.PropertyValueExpected);return this.peek(r.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)}_parseNestedProperties(){const e=this.create(Ne);return this._parseBody(e,this._parseDeclaration.bind(this))}_parseExtends(){if(this.peekKeyword("@extend")){const e=this.create(mt);if(this.consumeToken(),!e.getSelectors().addChild(this._parseSimpleSelector()))return this.finish(e,Ct.SelectorExpected);for(;this.accept(r.Comma);)e.getSelectors().addChild(this._parseSimpleSelector());return this.accept(r.Exclamation)&&!this.acceptIdent("optional")?this.finish(e,Ct.UnknownKeyword):this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parseSelectorPlaceholder()||super._parseSimpleSelectorBody()}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(r.Num)||this.accept(r.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorPlaceholder(){if(this.peekDelim("%")){const e=this.createNode(te.SelectorPlaceholder);return this.consumeToken(),this._parseIdent(),this.finish(e)}if(this.peekKeyword("@at-root")){const e=this.createNode(te.SelectorPlaceholder);if(this.consumeToken(),this.accept(r.ParenthesisL)){if(!this.acceptIdent("with")&&!this.acceptIdent("without"))return this.finish(e,Ct.IdentifierExpected);if(!this.accept(r.Colon))return this.finish(e,Ct.ColonExpected);if(!e.addChild(this._parseIdent()))return this.finish(e,Ct.IdentifierExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[r.CurlyR])}return this.finish(e)}return null}_parseElementName(){const e=this.mark(),t=super._parseElementName();return t&&!this.hasWhitespace()&&this.peek(r.ParenthesisL)?(this.restoreAtMark(e),null):t}_tryParsePseudoIdentifier(){return this._parseInterpolation()||super._tryParsePseudoIdentifier()}_parseWarnAndDebug(){if(!this.peekKeyword("@debug")&&!this.peekKeyword("@warn")&&!this.peekKeyword("@error"))return null;const e=this.createNode(te.Debug);return this.consumeToken(),e.addChild(this._parseExpr()),this.finish(e)}_parseControlStatement(e=this._parseRuleSetDeclaration.bind(this)){return this.peek(r.AtKeyword)?this._parseIfStatement(e)||this._parseForStatement(e)||this._parseEachStatement(e)||this._parseWhileStatement(e):null}_parseIfStatement(e){return this.peekKeyword("@if")?this._internalParseIfStatement(e):null}_internalParseIfStatement(e){const t=this.create(Te);if(this.consumeToken(),!t.setExpression(this._parseExpr(!0)))return this.finish(t,Ct.ExpressionExpected);if(this._parseBody(t,e),this.acceptKeyword("@else"))if(this.peekIdent("if"))t.setElseClause(this._internalParseIfStatement(e));else if(this.peek(r.CurlyL)){const n=this.create(Ce);this._parseBody(n,e),t.setElseClause(n)}return this.finish(t)}_parseForStatement(e){if(!this.peekKeyword("@for"))return null;const t=this.create(we);return this.consumeToken(),t.setVariable(this._parseVariable())?this.acceptIdent("from")?t.addChild(this._parseBinaryExpr())?this.acceptIdent("to")||this.acceptIdent("through")?t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,Ct.ExpressionExpected,[r.CurlyR]):this.finish(t,Yr.ThroughOrToExpected,[r.CurlyR]):this.finish(t,Ct.ExpressionExpected,[r.CurlyR]):this.finish(t,Yr.FromExpected,[r.CurlyR]):this.finish(t,Ct.VariableNameExpected,[r.CurlyR])}_parseEachStatement(e){if(!this.peekKeyword("@each"))return null;const t=this.create(Ae);this.consumeToken();const n=t.getVariables();if(!n.addChild(this._parseVariable()))return this.finish(t,Ct.VariableNameExpected,[r.CurlyR]);for(;this.accept(r.Comma);)if(!n.addChild(this._parseVariable()))return this.finish(t,Ct.VariableNameExpected,[r.CurlyR]);return this.finish(n),this.acceptIdent("in")?t.addChild(this._parseExpr())?this._parseBody(t,e):this.finish(t,Ct.ExpressionExpected,[r.CurlyR]):this.finish(t,Yr.InExpected,[r.CurlyR])}_parseWhileStatement(e){if(!this.peekKeyword("@while"))return null;const t=this.create(ke);return this.consumeToken(),t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,Ct.ExpressionExpected,[r.CurlyR])}_parseFunctionBodyDeclaration(){return this._parseVariableDeclaration()||this._parseReturnStatement()||this._parseWarnAndDebug()||this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this))}_parseFunctionDeclaration(){if(!this.peekKeyword("@function"))return null;const e=this.create(De);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([ne.Function])))return this.finish(e,Ct.IdentifierExpected,[r.CurlyR]);if(!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected,[r.CurlyR]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Ct.VariableNameExpected);return this.accept(r.ParenthesisR)?this._parseBody(e,this._parseFunctionBodyDeclaration.bind(this)):this.finish(e,Ct.RightParenthesisExpected,[r.CurlyR])}_parseReturnStatement(){if(!this.peekKeyword("@return"))return null;const e=this.createNode(te.ReturnStatement);return this.consumeToken(),e.addChild(this._parseExpr())?this.finish(e):this.finish(e,Ct.ExpressionExpected)}_parseMixinDeclaration(){if(!this.peekKeyword("@mixin"))return null;const e=this.create(gt);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([ne.Mixin])))return this.finish(e,Ct.IdentifierExpected,[r.CurlyR]);if(this.accept(r.ParenthesisL)){if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Ct.VariableNameExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[r.CurlyR])}return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseParameterDeclaration(){const e=this.create(xe);return e.setIdentifier(this._parseVariable())?(this.accept($r),this.accept(r.Colon)&&!e.setDefaultValue(this._parseExpr(!0))?this.finish(e,Ct.VariableValueExpected,[],[r.Comma,r.ParenthesisR]):this.finish(e)):null}_parseMixinContent(){if(!this.peekKeyword("@content"))return null;const e=this.create(ft);if(this.consumeToken(),this.accept(r.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,Ct.ExpressionExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected)}return this.finish(e)}_parseMixinReference(){if(!this.peekKeyword("@include"))return null;const e=this.create(_t);this.consumeToken();const t=this._parseIdent([ne.Mixin]);if(!e.setIdentifier(t))return this.finish(e,Ct.IdentifierExpected,[r.CurlyR]);if(!this.hasWhitespace()&&this.acceptDelim(".")&&!this.hasWhitespace()){const n=this._parseIdent([ne.Mixin]);if(!n)return this.finish(e,Ct.IdentifierExpected,[r.CurlyR]);const o=this.create(xt);t.referenceTypes=[ne.Module],o.setIdentifier(t),e.setIdentifier(n),e.addChild(o)}if(this.accept(r.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,Ct.ExpressionExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected)}return(this.peekIdent("using")||this.peek(r.CurlyL))&&e.setContent(this._parseMixinContentDeclaration()),this.finish(e)}_parseMixinContentDeclaration(){const e=this.create(ht);if(this.acceptIdent("using")){if(!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected,[r.CurlyL]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Ct.VariableNameExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[r.CurlyL])}return this.peek(r.CurlyL)&&this._parseBody(e,this._parseMixinReferenceBodyStatement.bind(this)),this.finish(e)}_parseMixinReferenceBodyStatement(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_parseFunctionArgument(){const e=this.create(Ee),t=this.mark(),n=this._parseVariable();if(n)if(this.accept(r.Colon))e.setIdentifier(n);else{if(this.accept($r))return e.setValue(n),this.finish(e);this.restoreAtMark(t)}return e.setValue(this._parseExpr(!0))?(this.accept($r),e.addChild(this._parsePrio()),this.finish(e)):e.setValue(this._tryParsePrio())?this.finish(e):null}_parseURLArgument(){const e=this.mark(),t=super._parseURLArgument();if(!t||!this.peek(r.ParenthesisR)){this.restoreAtMark(e);const t=this.create(ie);return t.addChild(this._parseBinaryExpr()),this.finish(t)}return t}_parseOperation(){if(!this.peek(r.ParenthesisL))return null;const e=this.create(ie);for(this.consumeToken();e.addChild(this._parseListElement());)this.accept(r.Comma);return this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Ct.RightParenthesisExpected)}_parseListElement(){const e=this.create(vt),t=this._parseBinaryExpr();if(!t)return null;if(this.accept(r.Colon)){if(e.setKey(t),!e.setValue(this._parseBinaryExpr()))return this.finish(e,Ct.ExpressionExpected)}else e.setValue(t);return this.finish(e)}_parseUse(){if(!this.peekKeyword("@use"))return null;const e=this.create(Oe);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,Ct.StringLiteralExpected);if(!this.peek(r.SemiColon)&&!this.peek(r.EOF)){if(!this.peekRegExp(r.Ident,/as|with/))return this.finish(e,Ct.UnknownKeyword);if(this.acceptIdent("as")&&!e.setIdentifier(this._parseIdent([ne.Module]))&&!this.acceptDelim("*"))return this.finish(e,Ct.IdentifierOrWildcardExpected);if(this.acceptIdent("with")){if(!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected,[r.ParenthesisR]);if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Ct.VariableNameExpected);for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Ct.VariableNameExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected)}}return this.accept(r.SemiColon)||this.accept(r.EOF)?this.finish(e):this.finish(e,Ct.SemiColonExpected)}_parseModuleConfigDeclaration(){const e=this.create(Fe);return e.setIdentifier(this._parseVariable())?this.accept(r.Colon)&&e.setValue(this._parseExpr(!0))?!this.accept(r.Exclamation)||!this.hasWhitespace()&&this.acceptIdent("default")?this.finish(e):this.finish(e,Ct.UnknownKeyword):this.finish(e,Ct.VariableValueExpected,[],[r.Comma,r.ParenthesisR]):null}_parseForward(){if(!this.peekKeyword("@forward"))return null;const e=this.create(We);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,Ct.StringLiteralExpected);if(this.acceptIdent("as")){const t=this._parseIdent([ne.Forward]);if(!e.setIdentifier(t))return this.finish(e,Ct.IdentifierExpected);if(this.hasWhitespace()||!this.acceptDelim("*"))return this.finish(e,Ct.WildcardExpected)}if(this.acceptIdent("with")){if(!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected,[r.ParenthesisR]);if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Ct.VariableNameExpected);for(;this.accept(r.Comma)&&!this.peek(r.ParenthesisR);)if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Ct.VariableNameExpected);if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected)}else if((this.peekIdent("hide")||this.peekIdent("show"))&&!e.addChild(this._parseForwardVisibility()))return this.finish(e,Ct.IdentifierOrVariableExpected);return this.accept(r.SemiColon)||this.accept(r.EOF)?this.finish(e):this.finish(e,Ct.SemiColonExpected)}_parseForwardVisibility(){const e=this.create(ze);for(e.setIdentifier(this._parseIdent());e.addChild(this._parseVariable()||this._parseIdent());)this.accept(r.Comma);return e.getChildren().length>1?e:null}_parseSupportsCondition(){return this._parseInterpolation()||super._parseSupportsCondition()}}const eo=At.t("Sass documentation");class to extends zn{constructor(e,t){super("$",e,t),no(to.scssModuleLoaders),no(to.scssModuleBuiltIns)}isImportPathParent(e){return e===te.Forward||e===te.Use||super.isImportPathParent(e)}getCompletionForImportPath(e,t){const n=e.getParent().type;if(n===te.Forward||n===te.Use)for(let n of to.scssModuleBuiltIns){const r={label:n.label,documentation:n.documentation,textEdit:Rt.TextEdit.replace(this.getCompletionRange(e),`'${n.label}'`),kind:Rt.CompletionItemKind.Module};t.items.push(r)}return super.getCompletionForImportPath(e,t)}createReplaceFunction(){let e=1;return(t,n)=>"\\"+n+": ${"+e+++":"+(to.variableDefaults[n]||"")+"}"}createFunctionProposals(e,t,n,r){for(const o of e){const e=o.func.replace(/\[?(\$\w+)\]?/g,this.createReplaceFunction()),i={label:o.func.substr(0,o.func.indexOf("(")),detail:o.func,documentation:o.desc,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e),insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Function};n&&(i.sortText="z"),r.items.push(i)}return r}getCompletionsForSelector(e,t,n){return this.createFunctionProposals(to.selectorFuncs,null,!0,n),super.getCompletionsForSelector(e,t,n)}getTermProposals(e,t,n){let r=to.builtInFuncs;return e&&(r=r.filter((t=>!t.type||!e.restrictions||-1!==e.restrictions.indexOf(t.type)))),this.createFunctionProposals(r,t,!0,n),super.getTermProposals(e,t,n)}getColorProposals(e,t,n){return this.createFunctionProposals(to.colorProposals,t,!1,n),super.getColorProposals(e,t,n)}getCompletionsForDeclarationProperty(e,t){return this.getCompletionForAtDirectives(t),this.getCompletionsForSelector(null,!0,t),super.getCompletionsForDeclarationProperty(e,t)}getCompletionsForExtendsReference(e,t,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Rule);for(const e of r){const r={label:e.name,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),e.name),kind:Rt.CompletionItemKind.Function};n.items.push(r)}return n}getCompletionForAtDirectives(e){return e.items.push(...to.scssAtDirectives),e}getCompletionForTopLevel(e){return this.getCompletionForAtDirectives(e),this.getCompletionForModuleLoaders(e),super.getCompletionForTopLevel(e),e}getCompletionForModuleLoaders(e){return e.items.push(...to.scssModuleLoaders),e}}function no(e){e.forEach((e=>{if(e.documentation&&e.references&&e.references.length>0){const t="string"==typeof e.documentation?{kind:"markdown",value:e.documentation}:{kind:"markdown",value:e.documentation.value};t.value+="\n\n",t.value+=e.references.map((e=>`[${e.name}](${e.url})`)).join(" | "),e.documentation=t}}))}to.variableDefaults={$red:"1",$green:"2",$blue:"3",$alpha:"1.0",$color:"#000000",$weight:"0.5",$hue:"0",$saturation:"0%",$lightness:"0%",$degrees:"0",$amount:"0",$string:'""',$substring:'"s"',$number:"0",$limit:"1"},to.colorProposals=[{func:"red($color)",desc:At.t("Gets the red component of a color.")},{func:"green($color)",desc:At.t("Gets the green component of a color.")},{func:"blue($color)",desc:At.t("Gets the blue component of a color.")},{func:"mix($color, $color, [$weight])",desc:At.t("Mixes two colors together.")},{func:"hue($color)",desc:At.t("Gets the hue component of a color.")},{func:"saturation($color)",desc:At.t("Gets the saturation component of a color.")},{func:"lightness($color)",desc:At.t("Gets the lightness component of a color.")},{func:"adjust-hue($color, $degrees)",desc:At.t("Changes the hue of a color.")},{func:"lighten($color, $amount)",desc:At.t("Makes a color lighter.")},{func:"darken($color, $amount)",desc:At.t("Makes a color darker.")},{func:"saturate($color, $amount)",desc:At.t("Makes a color more saturated.")},{func:"desaturate($color, $amount)",desc:At.t("Makes a color less saturated.")},{func:"grayscale($color)",desc:At.t("Converts a color to grayscale.")},{func:"complement($color)",desc:At.t("Returns the complement of a color.")},{func:"invert($color)",desc:At.t("Returns the inverse of a color.")},{func:"alpha($color)",desc:At.t("Gets the opacity component of a color.")},{func:"opacity($color)",desc:"Gets the alpha component (opacity) of a color."},{func:"rgba($color, $alpha)",desc:At.t("Changes the alpha component for a color.")},{func:"opacify($color, $amount)",desc:At.t("Makes a color more opaque.")},{func:"fade-in($color, $amount)",desc:At.t("Makes a color more opaque.")},{func:"transparentize($color, $amount)",desc:At.t("Makes a color more transparent.")},{func:"fade-out($color, $amount)",desc:At.t("Makes a color more transparent.")},{func:"adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:At.t("Increases or decreases one or more components of a color.")},{func:"scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])",desc:At.t("Fluidly scales one or more properties of a color.")},{func:"change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:At.t("Changes one or more properties of a color.")},{func:"ie-hex-str($color)",desc:At.t("Converts a color into the format understood by IE filters.")}],to.selectorFuncs=[{func:"selector-nest($selectors…)",desc:At.t("Nests selector beneath one another like they would be nested in the stylesheet.")},{func:"selector-append($selectors…)",desc:At.t("Appends selectors to one another without spaces in between.")},{func:"selector-extend($selector, $extendee, $extender)",desc:At.t("Extends $extendee with $extender within $selector.")},{func:"selector-replace($selector, $original, $replacement)",desc:At.t("Replaces $original with $replacement within $selector.")},{func:"selector-unify($selector1, $selector2)",desc:At.t("Unifies two selectors to produce a selector that matches elements matched by both.")},{func:"is-superselector($super, $sub)",desc:At.t("Returns whether $super matches all the elements $sub does, and possibly more.")},{func:"simple-selectors($selector)",desc:At.t("Returns the simple selectors that comprise a compound selector.")},{func:"selector-parse($selector)",desc:At.t("Parses a selector into the format returned by &.")}],to.builtInFuncs=[{func:"unquote($string)",desc:At.t("Removes quotes from a string.")},{func:"quote($string)",desc:At.t("Adds quotes to a string.")},{func:"str-length($string)",desc:At.t("Returns the number of characters in a string.")},{func:"str-insert($string, $insert, $index)",desc:At.t("Inserts $insert into $string at $index.")},{func:"str-index($string, $substring)",desc:At.t("Returns the index of the first occurance of $substring in $string.")},{func:"str-slice($string, $start-at, [$end-at])",desc:At.t("Extracts a substring from $string.")},{func:"to-upper-case($string)",desc:At.t("Converts a string to upper case.")},{func:"to-lower-case($string)",desc:At.t("Converts a string to lower case.")},{func:"percentage($number)",desc:At.t("Converts a unitless number to a percentage."),type:"percentage"},{func:"round($number)",desc:At.t("Rounds a number to the nearest whole number.")},{func:"ceil($number)",desc:At.t("Rounds a number up to the next whole number.")},{func:"floor($number)",desc:At.t("Rounds a number down to the previous whole number.")},{func:"abs($number)",desc:At.t("Returns the absolute value of a number.")},{func:"min($numbers)",desc:At.t("Finds the minimum of several numbers.")},{func:"max($numbers)",desc:At.t("Finds the maximum of several numbers.")},{func:"random([$limit])",desc:At.t("Returns a random number.")},{func:"length($list)",desc:At.t("Returns the length of a list.")},{func:"nth($list, $n)",desc:At.t("Returns a specific item in a list.")},{func:"set-nth($list, $n, $value)",desc:At.t("Replaces the nth item in a list.")},{func:"join($list1, $list2, [$separator])",desc:At.t("Joins together two lists into one.")},{func:"append($list1, $val, [$separator])",desc:At.t("Appends a single value onto the end of a list.")},{func:"zip($lists)",desc:At.t("Combines several lists into a single multidimensional list.")},{func:"index($list, $value)",desc:At.t("Returns the position of a value within a list.")},{func:"list-separator(#list)",desc:At.t("Returns the separator of a list.")},{func:"map-get($map, $key)",desc:At.t("Returns the value in a map associated with a given key.")},{func:"map-merge($map1, $map2)",desc:At.t("Merges two maps together into a new map.")},{func:"map-remove($map, $keys)",desc:At.t("Returns a new map with keys removed.")},{func:"map-keys($map)",desc:At.t("Returns a list of all keys in a map.")},{func:"map-values($map)",desc:At.t("Returns a list of all values in a map.")},{func:"map-has-key($map, $key)",desc:At.t("Returns whether a map has a value associated with a given key.")},{func:"keywords($args)",desc:At.t("Returns the keywords passed to a function that takes variable arguments.")},{func:"feature-exists($feature)",desc:At.t("Returns whether a feature exists in the current Sass runtime.")},{func:"variable-exists($name)",desc:At.t("Returns whether a variable with the given name exists in the current scope.")},{func:"global-variable-exists($name)",desc:At.t("Returns whether a variable with the given name exists in the global scope.")},{func:"function-exists($name)",desc:At.t("Returns whether a function with the given name exists.")},{func:"mixin-exists($name)",desc:At.t("Returns whether a mixin with the given name exists.")},{func:"inspect($value)",desc:At.t("Returns the string representation of a value as it would be represented in Sass.")},{func:"type-of($value)",desc:At.t("Returns the type of a value.")},{func:"unit($number)",desc:At.t("Returns the unit(s) associated with a number.")},{func:"unitless($number)",desc:At.t("Returns whether a number has units.")},{func:"comparable($number1, $number2)",desc:At.t("Returns whether two numbers can be added, subtracted, or compared.")},{func:"call($name, $args…)",desc:At.t("Dynamically calls a Sass function.")}],to.scssAtDirectives=[{label:"@extend",documentation:At.t("Inherits the styles of another selector."),kind:Rt.CompletionItemKind.Keyword},{label:"@at-root",documentation:At.t("Causes one or more rules to be emitted at the root of the document."),kind:Rt.CompletionItemKind.Keyword},{label:"@debug",documentation:At.t("Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),kind:Rt.CompletionItemKind.Keyword},{label:"@warn",documentation:At.t("Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."),kind:Rt.CompletionItemKind.Keyword},{label:"@error",documentation:At.t("Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),kind:Rt.CompletionItemKind.Keyword},{label:"@if",documentation:At.t("Includes the body if the expression does not evaluate to `false` or `null`."),insertText:"@if ${1:expr} {\n\t$0\n}",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword},{label:"@for",documentation:At.t("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),insertText:"@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword},{label:"@each",documentation:At.t("Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),insertText:"@each \\$${1:var} in ${2:list} {\n\t$0\n}",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword},{label:"@while",documentation:At.t("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),insertText:"@while ${1:condition} {\n\t$0\n}",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword},{label:"@mixin",documentation:At.t("Defines styles that can be re-used throughout the stylesheet with `@include`."),insertText:"@mixin ${1:name} {\n\t$0\n}",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword},{label:"@include",documentation:At.t("Includes the styles defined by another mixin into the current rule."),kind:Rt.CompletionItemKind.Keyword},{label:"@function",documentation:At.t("Defines complex operations that can be re-used throughout stylesheets."),kind:Rt.CompletionItemKind.Keyword}],to.scssModuleLoaders=[{label:"@use",documentation:At.t("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),references:[{name:eo,url:"https://sass-lang.com/documentation/at-rules/use"}],insertText:"@use $0;",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword},{label:"@forward",documentation:At.t("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),references:[{name:eo,url:"https://sass-lang.com/documentation/at-rules/forward"}],insertText:"@forward $0;",insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Keyword}],to.scssModuleBuiltIns=[{label:"sass:math",documentation:At.t("Provides functions that operate on numbers."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/math"}]},{label:"sass:string",documentation:At.t("Makes it easy to combine, search, or split apart strings."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/string"}]},{label:"sass:color",documentation:At.t("Generates new colors based on existing ones, making it easy to build color themes."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/color"}]},{label:"sass:list",documentation:At.t("Lets you access and modify values in lists."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/list"}]},{label:"sass:map",documentation:At.t("Makes it possible to look up the value associated with a key in a map, and much more."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/map"}]},{label:"sass:selector",documentation:At.t("Provides access to Sass’s powerful selector engine."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/selector"}]},{label:"sass:meta",documentation:At.t("Exposes the details of Sass’s inner workings."),references:[{name:eo,url:"https://sass-lang.com/documentation/modules/meta"}]}];const ro="/".charCodeAt(0),oo="\n".charCodeAt(0),io="\r".charCodeAt(0),ao="\f".charCodeAt(0),so="`".charCodeAt(0),co=".".charCodeAt(0);let lo=r.CustomToken;const uo=lo++;class po extends X{scanNext(e){const t=this.escapedJavaScript();return null!==t?this.finishToken(e,t):this.stream.advanceIfChars([co,co,co])?this.finishToken(e,uo):super.scanNext(e)}comment(){return!!super.comment()||!(this.inURL||!this.stream.advanceIfChars([ro,ro]))&&(this.stream.advanceWhileChar((e=>{switch(e){case oo:case io:case ao:return!1;default:return!0}})),!0)}escapedJavaScript(){return this.stream.peekChar()===so?(this.stream.advance(1),this.stream.advanceWhileChar((e=>e!==so)),this.stream.advanceIfChar(so)?r.EscapedJavaScript:r.BadEscapedJavaScript):null}}class mo extends yn{constructor(){super(new po)}_parseStylesheetStatement(e=!1){return this.peek(r.AtKeyword)?this._parseVariableDeclaration()||this._parsePlugin()||super._parseStylesheetAtStatement(e):this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseFunction()||this._parseRuleset(!0)}_parseImport(){if(!this.peekKeyword("@import")&&!this.peekKeyword("@import-once"))return null;const e=this.create(Le);if(this.consumeToken(),this.accept(r.ParenthesisL)){if(!this.accept(r.Ident))return this.finish(e,Ct.IdentifierExpected,[r.SemiColon]);do{if(!this.accept(r.Comma))break}while(this.accept(r.Ident));if(!this.accept(r.ParenthesisR))return this.finish(e,Ct.RightParenthesisExpected,[r.SemiColon])}return e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?(this.peek(r.SemiColon)||this.peek(r.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e)):this.finish(e,Ct.URIOrStringExpected,[r.SemiColon])}_parsePlugin(){if(!this.peekKeyword("@plugin"))return null;const e=this.createNode(te.Plugin);return this.consumeToken(),e.addChild(this._parseStringLiteral())?this.accept(r.SemiColon)?this.finish(e):this.finish(e,Ct.SemiColonExpected):this.finish(e,Ct.StringLiteralExpected)}_parseMediaQuery(){const e=super._parseMediaQuery();if(!e){const e=this.create(Je);return e.addChild(this._parseVariable())?this.finish(e):null}return e}_parseMediaDeclaration(e=!1){return this._tryParseRuleset(e)||this._tryToParseDeclaration()||this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseDetachedRuleSetMixin()||this._parseStylesheetStatement(e)}_parseMediaFeatureName(){return this._parseIdent()||this._parseVariable()}_parseVariableDeclaration(e=[]){const t=this.create(dt),n=this.mark();if(!t.setVariable(this._parseVariable(!0)))return null;if(!this.accept(r.Colon))return this.restoreAtMark(n),null;if(this.prevToken&&(t.colonPosition=this.prevToken.offset),t.setValue(this._parseDetachedRuleSet()))t.needsSemicolon=!1;else if(!t.setValue(this._parseExpr()))return this.finish(t,Ct.VariableValueExpected,[],e);return t.addChild(this._parsePrio()),this.peek(r.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)}_parseDetachedRuleSet(){let e=this.mark();if(this.peekDelim("#")||this.peekDelim(".")){if(this.consumeToken(),this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;{let t=this.create(gt);if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,Ct.IdentifierExpected,[],[r.ParenthesisR]);if(!this.accept(r.ParenthesisR))return this.restoreAtMark(e),null}}if(!this.peek(r.CurlyL))return null;const t=this.create(ue);return this._parseBody(t,this._parseDetachedRuleSetBody.bind(this)),this.finish(t)}_parseDetachedRuleSetBody(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_addLookupChildren(e){if(!e.addChild(this._parseLookupValue()))return!1;let t=!1;for(;this.peek(r.BracketL)&&(t=!0),e.addChild(this._parseLookupValue());)t=!1;return!t}_parseLookupValue(){const e=this.create(ie),t=this.mark();return this.accept(r.BracketL)&&((e.addChild(this._parseVariable(!1,!0))||e.addChild(this._parsePropertyIdentifier()))&&this.accept(r.BracketR)||this.accept(r.BracketR))?e:(this.restoreAtMark(t),null)}_parseVariable(e=!1,t=!1){const n=!e&&this.peekDelim("$");if(!this.peekDelim("@")&&!n&&!this.peek(r.AtKeyword))return null;const o=this.create(pt),i=this.mark();for(;this.acceptDelim("@")||!e&&this.acceptDelim("$");)if(this.hasWhitespace())return this.restoreAtMark(i),null;return!this.accept(r.AtKeyword)&&!this.accept(r.Ident)||!t&&this.peek(r.BracketL)&&!this._addLookupChildren(o)?(this.restoreAtMark(i),null):o}_parseTermExpression(){return this._parseVariable()||this._parseEscaped()||super._parseTermExpression()||this._tryParseMixinReference(!1)}_parseEscaped(){if(this.peek(r.EscapedJavaScript)||this.peek(r.BadEscapedJavaScript)){const e=this.createNode(te.EscapedValue);return this.consumeToken(),this.finish(e)}if(this.peekDelim("~")){const e=this.createNode(te.EscapedValue);return this.consumeToken(),this.accept(r.String)||this.accept(r.EscapedJavaScript)?this.finish(e):this.finish(e,Ct.TermExpected)}return null}_parseOperator(){return this._parseGuardOperator()||super._parseOperator()}_parseGuardOperator(){if(this.peekDelim(">")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("="),e}if(this.peekDelim("=")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("<"),e}if(this.peekDelim("<")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("="),e}return null}_parseRuleSetDeclaration(){return this.peek(r.AtKeyword)?this._parseKeyframe()||this._parseMedia(!0)||this._parseImport()||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseDetachedRuleSetMixin()||this._parseVariableDeclaration()||this._parseRuleSetDeclarationAtStatement():this._tryParseMixinDeclaration()||this._tryParseRuleset(!0)||this._tryParseMixinReference()||this._parseFunction()||this._parseExtend()||this._parseDeclaration()}_parseKeyframeIdent(){return this._parseIdent([ne.Keyframe])||this._parseVariable()}_parseKeyframeSelector(){return this._parseDetachedRuleSetMixin()||super._parseKeyframeSelector()}_parseSelector(e){const t=this.create(me);let n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());){n=!0;const e=this.mark();if(t.addChild(this._parseGuard())&&this.peek(r.CurlyL))break;this.restoreAtMark(e),t.addChild(this._parseCombinator())}return n?this.finish(t):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(r.Num)||this.accept(r.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorIdent(){if(!this.peekInterpolatedIdent())return null;const e=this.createNode(te.SelectorInterpolation);return this._acceptInterpolatedIdent(e)?this.finish(e):null}_parsePropertyIdentifier(e=!1){const t=/^[\w-]+/;if(!this.peekInterpolatedIdent()&&!this.peekRegExp(this.token.type,t))return null;const n=this.mark(),r=this.create(ce);r.isCustomProperty=this.acceptDelim("-")&&this.acceptDelim("-");let o=!1;return o=e?r.isCustomProperty?r.addChild(this._parseIdent()):r.addChild(this._parseRegexp(t)):r.isCustomProperty?this._acceptInterpolatedIdent(r):this._acceptInterpolatedIdent(r,t),o?(e||this.hasWhitespace()||(this.acceptDelim("+"),this.hasWhitespace()||this.acceptIdent("_")),this.finish(r)):(this.restoreAtMark(n),null)}peekInterpolatedIdent(){return this.peek(r.Ident)||this.peekDelim("@")||this.peekDelim("$")||this.peekDelim("-")}_acceptInterpolatedIdent(e,t){let n=!1;const o=()=>{const e=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(e),null):this._parseInterpolation()},i=t?()=>this.acceptRegexp(t):()=>this.accept(r.Ident);for(;(i()||e.addChild(this._parseInterpolation()||this.try(o)))&&(n=!0,!this.hasWhitespace()););return n}_parseInterpolation(){const e=this.mark();if(this.peekDelim("@")||this.peekDelim("$")){const t=this.createNode(te.Interpolation);return this.consumeToken(),this.hasWhitespace()||!this.accept(r.CurlyL)?(this.restoreAtMark(e),null):t.addChild(this._parseIdent())?this.accept(r.CurlyR)?this.finish(t):this.finish(t,Ct.RightCurlyExpected):this.finish(t,Ct.IdentifierExpected)}return null}_tryParseMixinDeclaration(){const e=this.mark(),t=this.create(gt);if(!t.setIdentifier(this._parseMixinDeclarationIdentifier())||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,Ct.IdentifierExpected,[],[r.ParenthesisR]);return this.accept(r.ParenthesisR)?(t.setGuard(this._parseGuard()),this.peek(r.CurlyL)?this._parseBody(t,this._parseMixInBodyDeclaration.bind(this)):(this.restoreAtMark(e),null)):(this.restoreAtMark(e),null)}_parseMixInBodyDeclaration(){return this._parseFontFace()||this._parseRuleSetDeclaration()}_parseMixinDeclarationIdentifier(){let e;if(this.peekDelim("#")||this.peekDelim(".")){if(e=this.create(ce),this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseIdent()))return null}else{if(!this.peek(r.Hash))return null;e=this.create(ce),this.consumeToken()}return e.referenceTypes=[ne.Mixin],this.finish(e)}_parsePseudo(){if(!this.peek(r.Colon))return null;const e=this.mark(),t=this.create(mt);return this.consumeToken(),this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),super._parsePseudo())}_parseExtend(){if(!this.peekDelim("&"))return null;const e=this.mark(),t=this.create(mt);return this.consumeToken(),!this.hasWhitespace()&&this.accept(r.Colon)&&this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),null)}_completeExtends(e){if(!this.accept(r.ParenthesisL))return this.finish(e,Ct.LeftParenthesisExpected);const t=e.getSelectors();if(!t.addChild(this._parseSelector(!0)))return this.finish(e,Ct.SelectorExpected);for(;this.accept(r.Comma);)if(!t.addChild(this._parseSelector(!0)))return this.finish(e,Ct.SelectorExpected);return this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Ct.RightParenthesisExpected)}_parseDetachedRuleSetMixin(){if(!this.peek(r.AtKeyword))return null;const e=this.mark(),t=this.create(_t);return!t.addChild(this._parseVariable(!0))||!this.hasWhitespace()&&this.accept(r.ParenthesisL)?this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Ct.RightParenthesisExpected):(this.restoreAtMark(e),null)}_tryParseMixinReference(e=!0){const t=this.mark(),n=this.create(_t);let o=this._parseMixinDeclarationIdentifier();for(;o;){this.acceptDelim(">");const e=this._parseMixinDeclarationIdentifier();if(!e)break;n.getNamespaces().addChild(o),o=e}if(!n.setIdentifier(o))return this.restoreAtMark(t),null;let i=!1;if(this.accept(r.ParenthesisL)){if(i=!0,n.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)if(!n.getArguments().addChild(this._parseMixinArgument()))return this.finish(n,Ct.ExpressionExpected);if(!this.accept(r.ParenthesisR))return this.finish(n,Ct.RightParenthesisExpected);o.referenceTypes=[ne.Mixin]}else o.referenceTypes=[ne.Mixin,ne.Rule];return this.peek(r.BracketL)?e||this._addLookupChildren(n):n.addChild(this._parsePrio()),i||this.peek(r.SemiColon)||this.peek(r.CurlyR)||this.peek(r.EOF)?this.finish(n):(this.restoreAtMark(t),null)}_parseMixinArgument(){const e=this.create(Ee),t=this.mark(),n=this._parseVariable();return n&&(this.accept(r.Colon)?e.setIdentifier(n):this.restoreAtMark(t)),e.setValue(this._parseDetachedRuleSet()||this._parseExpr(!0))?this.finish(e):(this.restoreAtMark(t),null)}_parseMixinParameter(){const e=this.create(xe);if(this.peekKeyword("@rest")){const t=this.create(ie);return this.consumeToken(),this.accept(uo)?(e.setIdentifier(this.finish(t)),this.finish(e)):this.finish(e,Ct.DotExpected,[],[r.Comma,r.ParenthesisR])}if(this.peek(uo)){const t=this.create(ie);return this.consumeToken(),e.setIdentifier(this.finish(t)),this.finish(e)}let t=!1;return e.setIdentifier(this._parseVariable())&&(this.accept(r.Colon),t=!0),e.setDefaultValue(this._parseDetachedRuleSet()||this._parseExpr(!0))||t?this.finish(e):null}_parseGuard(){if(!this.peekIdent("when"))return null;const e=this.create(bt);if(this.consumeToken(),e.isNegated=this.acceptIdent("not"),!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,Ct.ConditionExpected);for(;this.acceptIdent("and")||this.accept(r.Comma);)if(!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,Ct.ConditionExpected);return this.finish(e)}_parseGuardCondition(){if(!this.peek(r.ParenthesisL))return null;const e=this.create(St);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(r.ParenthesisR)?this.finish(e):this.finish(e,Ct.RightParenthesisExpected)}_parseFunction(){const e=this.mark(),t=this.create(Se);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(r.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(r.Comma)||this.accept(r.SemiColon))&&!this.peek(r.ParenthesisR);)if(!t.getArguments().addChild(this._parseMixinArgument()))return this.finish(t,Ct.ExpressionExpected);return this.accept(r.ParenthesisR)?this.finish(t):this.finish(t,Ct.RightParenthesisExpected)}_parseFunctionIdentifier(){if(this.peekDelim("%")){const e=this.create(ce);return e.referenceTypes=[ne.Function],this.consumeToken(),this.finish(e)}return super._parseFunctionIdentifier()}_parseURLArgument(){const e=this.mark(),t=super._parseURLArgument();if(!t||!this.peek(r.ParenthesisR)){this.restoreAtMark(e);const t=this.create(ie);return t.addChild(this._parseBinaryExpr()),this.finish(t)}return t}}class fo extends zn{constructor(e,t){super("@",e,t)}createFunctionProposals(e,t,n,r){for(const o of e){const e={label:o.name,detail:o.example,documentation:o.description,textEdit:Rt.TextEdit.replace(this.getCompletionRange(t),o.name+"($0)"),insertTextFormat:Rt.InsertTextFormat.Snippet,kind:Rt.CompletionItemKind.Function};n&&(e.sortText="z"),r.items.push(e)}return r}getTermProposals(e,t,n){let r=fo.builtInProposals;return e&&(r=r.filter((t=>!t.type||!e.restrictions||-1!==e.restrictions.indexOf(t.type)))),this.createFunctionProposals(r,t,!0,n),super.getTermProposals(e,t,n)}getColorProposals(e,t,n){return this.createFunctionProposals(fo.colorProposals,t,!1,n),super.getColorProposals(e,t,n)}getCompletionsForDeclarationProperty(e,t){return this.getCompletionsForSelector(null,!0,t),super.getCompletionsForDeclarationProperty(e,t)}}function ho(e,t){return function(e,t){const n=t&&t.rangeLimit||Number.MAX_VALUE,r=e.sort(((e,t)=>{let n=e.startLine-t.startLine;return 0===n&&(n=e.endLine-t.endLine),n})),o=[];let i=-1;return r.forEach((e=>{e.startLine"#region"===e?{line:t(c),type:"comment",isStart:!0}:{line:n(c),type:"comment",isStart:!1},s=(t=>{const n=t.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//);if(n)return r(n[1]);if("scss"===e.languageId||"less"===e.languageId){const e=t.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/);if(e)return r(e[1])}return null})(c);if(s)if(s.isStart)a.push(s);else{const e=_o(a,"comment");if(!e)break;"comment"===e.type&&e.line!==s.line&&i.push({startLine:e.line,endLine:s.line,kind:"region"})}else{const e=o(c,"comment");e&&i.push(e)}break}}l=c,c=s.scan()}return i}(e),t)}function _o(e,t){if(0===e.length)return null;for(let n=e.length-1;n>=0;n--)if(e[n].type===t&&e[n].isStart)return e.splice(n,1)[0];return null}var go;fo.builtInProposals=[{name:"if",example:"if(condition, trueValue [, falseValue]);",description:At.t("returns one of two values depending on a condition.")},{name:"boolean",example:"boolean(condition);",description:At.t('"store" a boolean test for later evaluation in a guard or if().')},{name:"length",example:"length(@list);",description:At.t("returns the number of elements in a value list")},{name:"extract",example:"extract(@list, index);",description:At.t("returns a value at the specified position in the list")},{name:"range",example:"range([start, ] end [, step]);",description:At.t("generate a list spanning a range of values")},{name:"each",example:"each(@list, ruleset);",description:At.t("bind the evaluation of a ruleset to each member of a list.")},{name:"escape",example:"escape(@string);",description:At.t("URL encodes a string")},{name:"e",example:"e(@string);",description:At.t("escape string content")},{name:"replace",example:"replace(@string, @pattern, @replacement[, @flags]);",description:At.t("string replace")},{name:"unit",example:"unit(@dimension, [@unit: '']);",description:At.t("remove or change the unit of a dimension")},{name:"color",example:"color(@string);",description:At.t("parses a string to a color"),type:"color"},{name:"convert",example:"convert(@value, unit);",description:At.t("converts numbers from one type into another")},{name:"data-uri",example:"data-uri([mimetype,] url);",description:At.t("inlines a resource and falls back to `url()`"),type:"url"},{name:"abs",description:At.t("absolute value of a number"),example:"abs(number);"},{name:"acos",description:At.t("arccosine - inverse of cosine function"),example:"acos(number);"},{name:"asin",description:At.t("arcsine - inverse of sine function"),example:"asin(number);"},{name:"ceil",example:"ceil(@number);",description:At.t("rounds up to an integer")},{name:"cos",description:At.t("cosine function"),example:"cos(number);"},{name:"floor",description:At.t("rounds down to an integer"),example:"floor(@number);"},{name:"percentage",description:At.t("converts to a %, e.g. 0.5 > 50%"),example:"percentage(@number);",type:"percentage"},{name:"round",description:At.t("rounds a number to a number of places"),example:"round(number, [places: 0]);"},{name:"sqrt",description:At.t("calculates square root of a number"),example:"sqrt(number);"},{name:"sin",description:At.t("sine function"),example:"sin(number);"},{name:"tan",description:At.t("tangent function"),example:"tan(number);"},{name:"atan",description:At.t("arctangent - inverse of tangent function"),example:"atan(number);"},{name:"pi",description:At.t("returns pi"),example:"pi();"},{name:"pow",description:At.t("first argument raised to the power of the second argument"),example:"pow(@base, @exponent);"},{name:"mod",description:At.t("first argument modulus second argument"),example:"mod(number, number);"},{name:"min",description:At.t("returns the lowest of one or more values"),example:"min(@x, @y);"},{name:"max",description:At.t("returns the lowest of one or more values"),example:"max(@x, @y);"}],fo.colorProposals=[{name:"argb",example:"argb(@color);",description:At.t("creates a #AARRGGBB")},{name:"hsl",example:"hsl(@hue, @saturation, @lightness);",description:At.t("creates a color")},{name:"hsla",example:"hsla(@hue, @saturation, @lightness, @alpha);",description:At.t("creates a color")},{name:"hsv",example:"hsv(@hue, @saturation, @value);",description:At.t("creates a color")},{name:"hsva",example:"hsva(@hue, @saturation, @value, @alpha);",description:At.t("creates a color")},{name:"hue",example:"hue(@color);",description:At.t("returns the `hue` channel of `@color` in the HSL space")},{name:"saturation",example:"saturation(@color);",description:At.t("returns the `saturation` channel of `@color` in the HSL space")},{name:"lightness",example:"lightness(@color);",description:At.t("returns the `lightness` channel of `@color` in the HSL space")},{name:"hsvhue",example:"hsvhue(@color);",description:At.t("returns the `hue` channel of `@color` in the HSV space")},{name:"hsvsaturation",example:"hsvsaturation(@color);",description:At.t("returns the `saturation` channel of `@color` in the HSV space")},{name:"hsvvalue",example:"hsvvalue(@color);",description:At.t("returns the `value` channel of `@color` in the HSV space")},{name:"red",example:"red(@color);",description:At.t("returns the `red` channel of `@color`")},{name:"green",example:"green(@color);",description:At.t("returns the `green` channel of `@color`")},{name:"blue",example:"blue(@color);",description:At.t("returns the `blue` channel of `@color`")},{name:"alpha",example:"alpha(@color);",description:At.t("returns the `alpha` channel of `@color`")},{name:"luma",example:"luma(@color);",description:At.t("returns the `luma` value (perceptual brightness) of `@color`")},{name:"saturate",example:"saturate(@color, 10%);",description:At.t("return `@color` 10% points more saturated")},{name:"desaturate",example:"desaturate(@color, 10%);",description:At.t("return `@color` 10% points less saturated")},{name:"lighten",example:"lighten(@color, 10%);",description:At.t("return `@color` 10% points lighter")},{name:"darken",example:"darken(@color, 10%);",description:At.t("return `@color` 10% points darker")},{name:"fadein",example:"fadein(@color, 10%);",description:At.t("return `@color` 10% points less transparent")},{name:"fadeout",example:"fadeout(@color, 10%);",description:At.t("return `@color` 10% points more transparent")},{name:"fade",example:"fade(@color, 50%);",description:At.t("return `@color` with 50% transparency")},{name:"spin",example:"spin(@color, 10);",description:At.t("return `@color` with a 10 degree larger in hue")},{name:"mix",example:"mix(@color1, @color2, [@weight: 50%]);",description:At.t("return a mix of `@color1` and `@color2`")},{name:"greyscale",example:"greyscale(@color);",description:At.t("returns a grey, 100% desaturated color")},{name:"contrast",example:"contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);",description:At.t("return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes")},{name:"multiply",example:"multiply(@color1, @color2);"},{name:"screen",example:"screen(@color1, @color2);"},{name:"overlay",example:"overlay(@color1, @color2);"},{name:"softlight",example:"softlight(@color1, @color2);"},{name:"hardlight",example:"hardlight(@color1, @color2);"},{name:"difference",example:"difference(@color1, @color2);"},{name:"exclusion",example:"exclusion(@color1, @color2);"},{name:"average",example:"average(@color1, @color2);"},{name:"negation",example:"negation(@color1, @color2);"}],function(){var e=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function r(e,r){this.__indent_cache=new n(e,r),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),(n+=e*this.__indent_size)+t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},r.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline()||(this.raw||this.__add_outputline(),0))},r.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(e,n){for(var r=this.__lines.length-2;r>=0;){var o=this.__lines[r];if(o.is_empty())break;if(0!==o.item(0).indexOf(e)&&o.item(-1)!==n){this.__lines.splice(r+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=r},,,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,o={};for(n in e=r(e))n!==t&&(o[n]=e[n]);if(t&&e[t])for(n in e[t])o[n]=e[t][n];return o}function r(e){var t,n={};for(t in e)n[t.replace(/-/g,"_")]=e[t];return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},t.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=r,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},,,,,function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},,function(e,t,n){var r=n(16).Beautifier,o=n(17).Options;e.exports=function(e,t){return new r(e,t).beautify()},e.exports.defaultOptions=function(){return new o}},function(e,t,n){var r=n(17).Options,o=n(2).Output,i=n(8).InputScanner,a=new(0,n(13).Directives)(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,l=/\s/,d=/(?:\s|\n)+/g,u=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(e,t){this._source_text=e||"",this._options=new r(t),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}m.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},m.prototype.eatWhitespace=function(e){for(var t=l.test(this._input.peek()),n=0;l.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&s.test(e||"")&&(t=e.match(s)[0]));var n=(e=e.replace(c,"\n")).match(/^[\t ]*/)[0];this._output=new o(this._options,n),this._input=new i(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r,m,f=0,h=!1,_=!1,g=!1,y=!1,v=!1,b=this._ch,S=!1;r=""!==this._input.read(d),m=b,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),b=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var x=this._input.read(u),E=a.get_directives(x);E&&"start"===E.ignore&&(x+=a.readIgnored(this._input)),this.print_string(x),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(r),this.print_string(this._ch);var T=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);T.match(/[ :]$/)&&(T=this.eatString(": ").replace(/\s$/,""),this.print_string(T),this._output.space_before_token=!0),T=T.replace(/\s$/,""),0===f&&-1!==T.indexOf(":")&&(_=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(r),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var w=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);w.match(/[ :]$/)&&(w=this.eatString(": ").replace(/\s$/,""),this.print_string(w),this._output.space_before_token=!0),w=w.replace(/\s$/,""),0===f&&-1!==w.indexOf(":")?(_=!0,this.indent()):w in this.NESTED_AT_RULE?(this._nestedLevel+=1,w in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==f||_||(y=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(r),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)_&&(_=!1,this.outdent()),y=!1,g?(g=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===m?this._output.space_before_token=!1:","!==m&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===m&&this._output.trim(!0),_&&(this.outdent(),_=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var A=0;A"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||_||0!==f)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(r),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),l.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var D='"'===m||"'"===m;this.preserveSingleSpace(D||r),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&S&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&l.test(this._ch)&&(this._ch=""));return this._output.get_code(t)},e.exports.Beautifier=m},function(e,t,n){var r=n(6).Options;function o(e){r.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o0&&wo(r,c-1);)c--;0===c||To(r,c-1)?s=c:c=0;){const n=e.charCodeAt(t);if(n===So)return!0;if(n===xo)return!1;t--}return!1}(r,s),o=l===r.length,r=r.substring(s,l),0!==s){const r=e.offsetAt(Rt.Position.create(t.start.line,0));i=function(e,t,n){let r=t,o=0;const i=n.tabSize||4;for(;r0){const e=n.insertSpaces?ee(" ",s*i):ee("\t",i);l=l.split("\n").join("\n"+e),0===t.start.character&&(l=e+l)}return[{range:t,newText:l}]}function bo(e){return e.replace(/^\s+/,"")}const So="{".charCodeAt(0),xo="}".charCodeAt(0);function Eo(e,t,n){if(e&&e.hasOwnProperty(t)){const n=e[t];if(null!==n)return n}return n}function To(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}function wo(e,t){return-1!==" \t".indexOf(e.charAt(t))}const Ao={version:1.1,properties:[{name:"additive-symbols",browsers:["FF33"],atRule:"@counter-style",syntax:"[ && ]#",relevance:50,description:"@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.",restrictions:["integer","string","image","identifier"]},{name:"align-content",browsers:["E12","FF28","S9","C29","IE11","O16"],values:[{name:"center",description:"Lines are packed toward the center of the flex container."},{name:"flex-end",description:"Lines are packed toward the end of the flex container."},{name:"flex-start",description:"Lines are packed toward the start of the flex container."},{name:"space-around",description:"Lines are evenly distributed in the flex container, with half-size spaces on either end."},{name:"space-between",description:"Lines are evenly distributed in the flex container."},{name:"stretch",description:"Lines stretch to take up the remaining space."},{name:"start"},{name:"end"},{name:"normal"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"space-around"},{name:"space-between"},{name:"space-evenly"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | | | ? ",relevance:65,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-content"}],description:"Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.",restrictions:["enum"]},{name:"align-items",browsers:["E12","FF20","S9","C29","IE11","O16"],values:[{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"normal"},{name:"start"},{name:"end"},{name:"self-start"},{name:"self-end"},{name:"first baseline"},{name:"last baseline"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | stretch | | [ ? ]",relevance:86,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-items"}],description:"Aligns flex items along the cross axis of the current line of the flex container.",restrictions:["enum"]},{name:"justify-items",browsers:["E12","FF20","S9","C52","IE11","O12.1"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"safe"},{name:"unsafe"},{name:"legacy"}],syntax:"normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]",relevance:54,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-items"}],description:"Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis",restrictions:["enum"]},{name:"justify-self",browsers:["E16","FF45","S10.1","C57","IE10","O44"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"save"},{name:"unsave"}],syntax:"auto | normal | stretch | | ? [ | left | right ]",relevance:56,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-self"}],description:"Defines the way of justifying a box inside its container along the appropriate axis.",restrictions:["enum"]},{name:"align-self",browsers:["E12","FF20","S9","C29","IE10","O12.1"],values:[{name:"auto",description:"Computes to the value of 'align-items' on the element's parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself."},{name:"normal"},{name:"self-end"},{name:"self-start"},{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"safe"},{name:"unsafe"}],syntax:"auto | normal | stretch | | ? ",relevance:73,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-self"}],description:"Allows the default alignment along the cross axis to be overridden for individual flex items.",restrictions:["enum"]},{name:"all",browsers:["E79","FF27","S9.1","C37","O24"],values:[],syntax:"initial | inherit | unset | revert | revert-layer",relevance:53,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/all"}],description:"Shorthand that resets all properties except 'direction' and 'unicode-bidi'.",restrictions:["enum"]},{name:"alt",browsers:["S9"],values:[],relevance:50,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/alt"}],description:"Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.",restrictions:["string","enum"]},{name:"animation",browsers:["E12","FF16","S9","C43","IE10","O30"],values:[{name:"alternate",description:"The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction."},{name:"alternate-reverse",description:"The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction."},{name:"backwards",description:"The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'."},{name:"both",description:"Both forwards and backwards fill modes are applied."},{name:"forwards",description:"The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes."},{name:"infinite",description:"Causes the animation to repeat forever."},{name:"none",description:"No animation is performed"},{name:"normal",description:"Normal playback."},{name:"reverse",description:"All iterations of the animation are played in the reverse direction from the way they were specified."}],syntax:"#",relevance:82,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/animation"}],description:"Shorthand property combines six of the animation properties into a single property.",restrictions:["time","timing-function","enum","identifier","number"]},{name:"animation-delay",browsers:["E12","FF16","S9","C43","IE10","O30"],syntax:"