cmd-dialog
Version:
Command dialog and keyboard shortcuts palette for web apps
1,147 lines • 75.1 kB
JavaScript
import { unsafeCSS as dt, LitElement as ht, html as D, nothing as V } from "lit";
import { property as M, customElement as ut, state as et } from "lit/decorators.js";
import { live as _t } from "lit/directives/live.js";
import { repeat as pt } from "lit/directives/repeat.js";
import { unsafeHTML as gt } from "lit/directives/unsafe-html.js";
import { classMap as Bt } from "lit/directives/class-map.js";
function E(e) {
return Array.isArray ? Array.isArray(e) : vt(e) === "[object Array]";
}
function Ft(e) {
if (typeof e == "string")
return e;
let t = e + "";
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
}
function Dt(e) {
return e == null ? "" : Ft(e);
}
function k(e) {
return typeof e == "string";
}
function ft(e) {
return typeof e == "number";
}
function St(e) {
return e === !0 || e === !1 || zt(e) && vt(e) == "[object Boolean]";
}
function wt(e) {
return typeof e == "object";
}
function zt(e) {
return wt(e) && e !== null;
}
function v(e) {
return e != null;
}
function H(e) {
return !e.trim().length;
}
function vt(e) {
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
}
const It = "Incorrect 'index' type", $t = (e) => `Invalid value for key ${e}`, jt = (e) => `Pattern length exceeds max of ${e}.`, Lt = (e) => `Missing ${e} property in key`, Rt = (e) => `Property 'weight' in key '${e}' must be a positive integer`, at = Object.prototype.hasOwnProperty;
class Ot {
constructor(t) {
this._keys = [], this._keyMap = {};
let r = 0;
t.forEach((i) => {
let o = bt(i);
this._keys.push(o), this._keyMap[o.id] = o, r += o.weight;
}), this._keys.forEach((i) => {
i.weight /= r;
});
}
get(t) {
return this._keyMap[t];
}
keys() {
return this._keys;
}
toJSON() {
return JSON.stringify(this._keys);
}
}
function bt(e) {
let t = null, r = null, i = null, o = 1, a = null;
if (k(e) || E(e))
i = e, t = nt(e), r = Y(e);
else {
if (!at.call(e, "name"))
throw new Error(Lt("name"));
const n = e.name;
if (i = n, at.call(e, "weight") && (o = e.weight, o <= 0))
throw new Error(Rt(n));
t = nt(n), r = Y(n), a = e.getFn;
}
return { path: t, id: r, weight: o, src: i, getFn: a };
}
function nt(e) {
return E(e) ? e : e.split(".");
}
function Y(e) {
return E(e) ? e.join(".") : e;
}
function Nt(e, t) {
let r = [], i = !1;
const o = (a, n, s) => {
if (v(a))
if (!n[s])
r.push(a);
else {
let l = n[s];
const c = a[l];
if (!v(c))
return;
if (s === n.length - 1 && (k(c) || ft(c) || St(c)))
r.push(Dt(c));
else if (E(c)) {
i = !0;
for (let d = 0, u = c.length; d < u; d += 1)
o(c[d], n, s + 1);
} else n.length && o(c, n, s + 1);
}
};
return o(e, k(t) ? t.split(".") : t, 0), i ? r : r[0];
}
const Pt = {
// Whether the matches should be included in the result set. When `true`, each record in the result
// set will include the indices of the matched characters.
// These can consequently be used for highlighting purposes.
includeMatches: !1,
// When `true`, the matching function will continue to the end of a search pattern even if
// a perfect match has already been located in the string.
findAllMatches: !1,
// Minimum number of characters that must be matched before a result is considered a match
minMatchCharLength: 1
}, Tt = {
// When `true`, the algorithm continues searching to the end of the input even if a perfect
// match is found before the end of the same input.
isCaseSensitive: !1,
// When `true`, the algorithm will ignore diacritics (accents) in comparisons
ignoreDiacritics: !1,
// When true, the matching function will continue to the end of a search pattern even if
includeScore: !1,
// List of properties that will be searched. This also supports nested properties.
keys: [],
// Whether to sort the result list, by score
shouldSort: !0,
// Default sort function: sort by ascending score, ascending index
sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1
}, Kt = {
// Approximately where in the text is the pattern expected to be found?
location: 0,
// At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
// (of both letters and location), a threshold of '1.0' would match anything.
threshold: 0.6,
// Determines how close the match must be to the fuzzy location (specified above).
// An exact letter match which is 'distance' characters away from the fuzzy location
// would score as a complete mismatch. A distance of '0' requires the match be at
// the exact location specified, a threshold of '1000' would require a perfect match
// to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
distance: 100
}, Ut = {
// When `true`, it enables the use of unix-like search commands
useExtendedSearch: !1,
// The get function to use when fetching an object's properties.
// The default will search nested paths *ie foo.bar.baz*
getFn: Nt,
// When `true`, search will ignore `location` and `distance`, so it won't matter
// where in the string the pattern appears.
// More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
ignoreLocation: !1,
// When `true`, the calculation for the relevance score (used for sorting) will
// ignore the field-length norm.
// More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
ignoreFieldNorm: !1,
// The weight to determine how much field length norm effects scoring.
fieldNormWeight: 1
};
var h = {
...Tt,
...Pt,
...Kt,
...Ut
};
const Wt = /[^ ]+/g;
function Vt(e = 1, t = 3) {
const r = /* @__PURE__ */ new Map(), i = Math.pow(10, t);
return {
get(o) {
const a = o.match(Wt).length;
if (r.has(a))
return r.get(a);
const n = 1 / Math.pow(a, 0.5 * e), s = parseFloat(Math.round(n * i) / i);
return r.set(a, s), s;
},
clear() {
r.clear();
}
};
}
class rt {
constructor({
getFn: t = h.getFn,
fieldNormWeight: r = h.fieldNormWeight
} = {}) {
this.norm = Vt(r, 3), this.getFn = t, this.isCreated = !1, this.setIndexRecords();
}
setSources(t = []) {
this.docs = t;
}
setIndexRecords(t = []) {
this.records = t;
}
setKeys(t = []) {
this.keys = t, this._keysMap = {}, t.forEach((r, i) => {
this._keysMap[r.id] = i;
});
}
create() {
this.isCreated || !this.docs.length || (this.isCreated = !0, k(this.docs[0]) ? this.docs.forEach((t, r) => {
this._addString(t, r);
}) : this.docs.forEach((t, r) => {
this._addObject(t, r);
}), this.norm.clear());
}
// Adds a doc to the end of the index
add(t) {
const r = this.size();
k(t) ? this._addString(t, r) : this._addObject(t, r);
}
// Removes the doc at the specified index of the index
removeAt(t) {
this.records.splice(t, 1);
for (let r = t, i = this.size(); r < i; r += 1)
this.records[r].i -= 1;
}
getValueForItemAtKeyId(t, r) {
return t[this._keysMap[r]];
}
size() {
return this.records.length;
}
_addString(t, r) {
if (!v(t) || H(t))
return;
let i = {
v: t,
i: r,
n: this.norm.get(t)
};
this.records.push(i);
}
_addObject(t, r) {
let i = { i: r, $: {} };
this.keys.forEach((o, a) => {
let n = o.getFn ? o.getFn(t) : this.getFn(t, o.path);
if (v(n)) {
if (E(n)) {
let s = [];
const l = [{ nestedArrIndex: -1, value: n }];
for (; l.length; ) {
const { nestedArrIndex: c, value: d } = l.pop();
if (v(d))
if (k(d) && !H(d)) {
let u = {
v: d,
i: c,
n: this.norm.get(d)
};
s.push(u);
} else E(d) && d.forEach((u, p) => {
l.push({
nestedArrIndex: p,
value: u
});
});
}
i.$[a] = s;
} else if (k(n) && !H(n)) {
let s = {
v: n,
n: this.norm.get(n)
};
i.$[a] = s;
}
}
}), this.records.push(i);
}
toJSON() {
return {
keys: this.keys,
records: this.records
};
}
}
function mt(e, t, { getFn: r = h.getFn, fieldNormWeight: i = h.fieldNormWeight } = {}) {
const o = new rt({ getFn: r, fieldNormWeight: i });
return o.setKeys(e.map(bt)), o.setSources(t), o.create(), o;
}
function Ht(e, { getFn: t = h.getFn, fieldNormWeight: r = h.fieldNormWeight } = {}) {
const { keys: i, records: o } = e, a = new rt({ getFn: t, fieldNormWeight: r });
return a.setKeys(i), a.setIndexRecords(o), a;
}
function N(e, {
errors: t = 0,
currentLocation: r = 0,
expectedLocation: i = 0,
distance: o = h.distance,
ignoreLocation: a = h.ignoreLocation
} = {}) {
const n = t / e.length;
if (a)
return n;
const s = Math.abs(i - r);
return o ? n + s / o : s ? 1 : n;
}
function Gt(e = [], t = h.minMatchCharLength) {
let r = [], i = -1, o = -1, a = 0;
for (let n = e.length; a < n; a += 1) {
let s = e[a];
s && i === -1 ? i = a : !s && i !== -1 && (o = a - 1, o - i + 1 >= t && r.push([i, o]), i = -1);
}
return e[a - 1] && a - i >= t && r.push([i, a - 1]), r;
}
const I = 32;
function Yt(e, t, r, {
location: i = h.location,
distance: o = h.distance,
threshold: a = h.threshold,
findAllMatches: n = h.findAllMatches,
minMatchCharLength: s = h.minMatchCharLength,
includeMatches: l = h.includeMatches,
ignoreLocation: c = h.ignoreLocation
} = {}) {
if (t.length > I)
throw new Error(jt(I));
const d = t.length, u = e.length, p = Math.max(0, Math.min(i, u));
let g = a, f = p;
const w = s > 1 || l, x = w ? Array(u) : [];
let _;
for (; (_ = e.indexOf(t, f)) > -1; ) {
let b = N(t, {
currentLocation: _,
expectedLocation: p,
distance: o,
ignoreLocation: c
});
if (g = Math.min(b, g), f = _ + d, w) {
let B = 0;
for (; B < d; )
x[_ + B] = 1, B += 1;
}
}
f = -1;
let C = [], $ = 1, z = d + u;
const Mt = 1 << d - 1;
for (let b = 0; b < d; b += 1) {
let B = 0, F = z;
for (; B < F; )
N(t, {
errors: b,
currentLocation: p + F,
expectedLocation: p,
distance: o,
ignoreLocation: c
}) <= g ? B = F : z = F, F = Math.floor((z - B) / 2 + B);
z = F;
let it = Math.max(1, p - F + 1), W = n ? u : Math.min(p + F, u) + d, j = Array(W + 2);
j[W + 1] = (1 << b) - 1;
for (let y = W; y >= it; y -= 1) {
let O = y - 1, ot = r[e.charAt(O)];
if (w && (x[O] = +!!ot), j[y] = (j[y + 1] << 1 | 1) & ot, b && (j[y] |= (C[y + 1] | C[y]) << 1 | 1 | C[y + 1]), j[y] & Mt && ($ = N(t, {
errors: b,
currentLocation: O,
expectedLocation: p,
distance: o,
ignoreLocation: c
}), $ <= g)) {
if (g = $, f = O, f <= p)
break;
it = Math.max(1, 2 * p - f);
}
}
if (N(t, {
errors: b + 1,
currentLocation: p,
expectedLocation: p,
distance: o,
ignoreLocation: c
}) > g)
break;
C = j;
}
const U = {
isMatch: f >= 0,
// Count exact matches (those with a score of 0) to be "almost" exact
score: Math.max(1e-3, $)
};
if (w) {
const b = Gt(x, s);
b.length ? l && (U.indices = b) : U.isMatch = !1;
}
return U;
}
function Qt(e) {
let t = {};
for (let r = 0, i = e.length; r < i; r += 1) {
const o = e.charAt(r);
t[o] = (t[o] || 0) | 1 << i - r - 1;
}
return t;
}
const P = String.prototype.normalize ? (e) => e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "") : (e) => e;
class xt {
constructor(t, {
location: r = h.location,
threshold: i = h.threshold,
distance: o = h.distance,
includeMatches: a = h.includeMatches,
findAllMatches: n = h.findAllMatches,
minMatchCharLength: s = h.minMatchCharLength,
isCaseSensitive: l = h.isCaseSensitive,
ignoreDiacritics: c = h.ignoreDiacritics,
ignoreLocation: d = h.ignoreLocation
} = {}) {
if (this.options = {
location: r,
threshold: i,
distance: o,
includeMatches: a,
findAllMatches: n,
minMatchCharLength: s,
isCaseSensitive: l,
ignoreDiacritics: c,
ignoreLocation: d
}, t = l ? t : t.toLowerCase(), t = c ? P(t) : t, this.pattern = t, this.chunks = [], !this.pattern.length)
return;
const u = (g, f) => {
this.chunks.push({
pattern: g,
alphabet: Qt(g),
startIndex: f
});
}, p = this.pattern.length;
if (p > I) {
let g = 0;
const f = p % I, w = p - f;
for (; g < w; )
u(this.pattern.substr(g, I), g), g += I;
if (f) {
const x = p - I;
u(this.pattern.substr(x), x);
}
} else
u(this.pattern, 0);
}
searchIn(t) {
const { isCaseSensitive: r, ignoreDiacritics: i, includeMatches: o } = this.options;
if (t = r ? t : t.toLowerCase(), t = i ? P(t) : t, this.pattern === t) {
let w = {
isMatch: !0,
score: 0
};
return o && (w.indices = [[0, t.length - 1]]), w;
}
const {
location: a,
distance: n,
threshold: s,
findAllMatches: l,
minMatchCharLength: c,
ignoreLocation: d
} = this.options;
let u = [], p = 0, g = !1;
this.chunks.forEach(({ pattern: w, alphabet: x, startIndex: _ }) => {
const { isMatch: C, score: $, indices: z } = Yt(t, w, x, {
location: a + _,
distance: n,
threshold: s,
findAllMatches: l,
minMatchCharLength: c,
includeMatches: o,
ignoreLocation: d
});
C && (g = !0), p += $, C && z && (u = [...u, ...z]);
});
let f = {
isMatch: g,
score: g ? p / this.chunks.length : 1
};
return g && o && (f.indices = u), f;
}
}
class S {
constructor(t) {
this.pattern = t;
}
static isMultiMatch(t) {
return st(t, this.multiRegex);
}
static isSingleMatch(t) {
return st(t, this.singleRegex);
}
search() {
}
}
function st(e, t) {
const r = e.match(t);
return r ? r[1] : null;
}
class Jt extends S {
constructor(t) {
super(t);
}
static get type() {
return "exact";
}
static get multiRegex() {
return /^="(.*)"$/;
}
static get singleRegex() {
return /^=(.*)$/;
}
search(t) {
const r = t === this.pattern;
return {
isMatch: r,
score: r ? 0 : 1,
indices: [0, this.pattern.length - 1]
};
}
}
class Xt extends S {
constructor(t) {
super(t);
}
static get type() {
return "inverse-exact";
}
static get multiRegex() {
return /^!"(.*)"$/;
}
static get singleRegex() {
return /^!(.*)$/;
}
search(t) {
const i = t.indexOf(this.pattern) === -1;
return {
isMatch: i,
score: i ? 0 : 1,
indices: [0, t.length - 1]
};
}
}
class Zt extends S {
constructor(t) {
super(t);
}
static get type() {
return "prefix-exact";
}
static get multiRegex() {
return /^\^"(.*)"$/;
}
static get singleRegex() {
return /^\^(.*)$/;
}
search(t) {
const r = t.startsWith(this.pattern);
return {
isMatch: r,
score: r ? 0 : 1,
indices: [0, this.pattern.length - 1]
};
}
}
class qt extends S {
constructor(t) {
super(t);
}
static get type() {
return "inverse-prefix-exact";
}
static get multiRegex() {
return /^!\^"(.*)"$/;
}
static get singleRegex() {
return /^!\^(.*)$/;
}
search(t) {
const r = !t.startsWith(this.pattern);
return {
isMatch: r,
score: r ? 0 : 1,
indices: [0, t.length - 1]
};
}
}
class te extends S {
constructor(t) {
super(t);
}
static get type() {
return "suffix-exact";
}
static get multiRegex() {
return /^"(.*)"\$$/;
}
static get singleRegex() {
return /^(.*)\$$/;
}
search(t) {
const r = t.endsWith(this.pattern);
return {
isMatch: r,
score: r ? 0 : 1,
indices: [t.length - this.pattern.length, t.length - 1]
};
}
}
class ee extends S {
constructor(t) {
super(t);
}
static get type() {
return "inverse-suffix-exact";
}
static get multiRegex() {
return /^!"(.*)"\$$/;
}
static get singleRegex() {
return /^!(.*)\$$/;
}
search(t) {
const r = !t.endsWith(this.pattern);
return {
isMatch: r,
score: r ? 0 : 1,
indices: [0, t.length - 1]
};
}
}
class yt extends S {
constructor(t, {
location: r = h.location,
threshold: i = h.threshold,
distance: o = h.distance,
includeMatches: a = h.includeMatches,
findAllMatches: n = h.findAllMatches,
minMatchCharLength: s = h.minMatchCharLength,
isCaseSensitive: l = h.isCaseSensitive,
ignoreDiacritics: c = h.ignoreDiacritics,
ignoreLocation: d = h.ignoreLocation
} = {}) {
super(t), this._bitapSearch = new xt(t, {
location: r,
threshold: i,
distance: o,
includeMatches: a,
findAllMatches: n,
minMatchCharLength: s,
isCaseSensitive: l,
ignoreDiacritics: c,
ignoreLocation: d
});
}
static get type() {
return "fuzzy";
}
static get multiRegex() {
return /^"(.*)"$/;
}
static get singleRegex() {
return /^(.*)$/;
}
search(t) {
return this._bitapSearch.searchIn(t);
}
}
class kt extends S {
constructor(t) {
super(t);
}
static get type() {
return "include";
}
static get multiRegex() {
return /^'"(.*)"$/;
}
static get singleRegex() {
return /^'(.*)$/;
}
search(t) {
let r = 0, i;
const o = [], a = this.pattern.length;
for (; (i = t.indexOf(this.pattern, r)) > -1; )
r = i + a, o.push([i, r - 1]);
const n = !!o.length;
return {
isMatch: n,
score: n ? 0 : 1,
indices: o
};
}
}
const Q = [
Jt,
kt,
Zt,
qt,
ee,
te,
Xt,
yt
], lt = Q.length, re = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, ie = "|";
function oe(e, t = {}) {
return e.split(ie).map((r) => {
let i = r.trim().split(re).filter((a) => a && !!a.trim()), o = [];
for (let a = 0, n = i.length; a < n; a += 1) {
const s = i[a];
let l = !1, c = -1;
for (; !l && ++c < lt; ) {
const d = Q[c];
let u = d.isMultiMatch(s);
u && (o.push(new d(u, t)), l = !0);
}
if (!l)
for (c = -1; ++c < lt; ) {
const d = Q[c];
let u = d.isSingleMatch(s);
if (u) {
o.push(new d(u, t));
break;
}
}
}
return o;
});
}
const ae = /* @__PURE__ */ new Set([yt.type, kt.type]);
class ne {
constructor(t, {
isCaseSensitive: r = h.isCaseSensitive,
ignoreDiacritics: i = h.ignoreDiacritics,
includeMatches: o = h.includeMatches,
minMatchCharLength: a = h.minMatchCharLength,
ignoreLocation: n = h.ignoreLocation,
findAllMatches: s = h.findAllMatches,
location: l = h.location,
threshold: c = h.threshold,
distance: d = h.distance
} = {}) {
this.query = null, this.options = {
isCaseSensitive: r,
ignoreDiacritics: i,
includeMatches: o,
minMatchCharLength: a,
findAllMatches: s,
ignoreLocation: n,
location: l,
threshold: c,
distance: d
}, t = r ? t : t.toLowerCase(), t = i ? P(t) : t, this.pattern = t, this.query = oe(this.pattern, this.options);
}
static condition(t, r) {
return r.useExtendedSearch;
}
searchIn(t) {
const r = this.query;
if (!r)
return {
isMatch: !1,
score: 1
};
const { includeMatches: i, isCaseSensitive: o, ignoreDiacritics: a } = this.options;
t = o ? t : t.toLowerCase(), t = a ? P(t) : t;
let n = 0, s = [], l = 0;
for (let c = 0, d = r.length; c < d; c += 1) {
const u = r[c];
s.length = 0, n = 0;
for (let p = 0, g = u.length; p < g; p += 1) {
const f = u[p], { isMatch: w, indices: x, score: _ } = f.search(t);
if (w) {
if (n += 1, l += _, i) {
const C = f.constructor.type;
ae.has(C) ? s = [...s, ...x] : s.push(x);
}
} else {
l = 0, n = 0, s.length = 0;
break;
}
}
if (n) {
let p = {
isMatch: !0,
score: l / n
};
return i && (p.indices = s), p;
}
}
return {
isMatch: !1,
score: 1
};
}
}
const J = [];
function se(...e) {
J.push(...e);
}
function X(e, t) {
for (let r = 0, i = J.length; r < i; r += 1) {
let o = J[r];
if (o.condition(e, t))
return new o(e, t);
}
return new xt(e, t);
}
const T = {
AND: "$and",
OR: "$or"
}, Z = {
PATH: "$path",
PATTERN: "$val"
}, q = (e) => !!(e[T.AND] || e[T.OR]), le = (e) => !!e[Z.PATH], ce = (e) => !E(e) && wt(e) && !q(e), ct = (e) => ({
[T.AND]: Object.keys(e).map((t) => ({
[t]: e[t]
}))
});
function At(e, t, { auto: r = !0 } = {}) {
const i = (o) => {
let a = Object.keys(o);
const n = le(o);
if (!n && a.length > 1 && !q(o))
return i(ct(o));
if (ce(o)) {
const l = n ? o[Z.PATH] : a[0], c = n ? o[Z.PATTERN] : o[l];
if (!k(c))
throw new Error($t(l));
const d = {
keyId: Y(l),
pattern: c
};
return r && (d.searcher = X(c, t)), d;
}
let s = {
children: [],
operator: a[0]
};
return a.forEach((l) => {
const c = o[l];
E(c) && c.forEach((d) => {
s.children.push(i(d));
});
}), s;
};
return q(e) || (e = ct(e)), i(e);
}
function de(e, { ignoreFieldNorm: t = h.ignoreFieldNorm }) {
e.forEach((r) => {
let i = 1;
r.matches.forEach(({ key: o, norm: a, score: n }) => {
const s = o ? o.weight : null;
i *= Math.pow(
n === 0 && s ? Number.EPSILON : n,
(s || 1) * (t ? 1 : a)
);
}), r.score = i;
});
}
function he(e, t) {
const r = e.matches;
t.matches = [], v(r) && r.forEach((i) => {
if (!v(i.indices) || !i.indices.length)
return;
const { indices: o, value: a } = i;
let n = {
indices: o,
value: a
};
i.key && (n.key = i.key.src), i.idx > -1 && (n.refIndex = i.idx), t.matches.push(n);
});
}
function ue(e, t) {
t.score = e.score;
}
function pe(e, t, {
includeMatches: r = h.includeMatches,
includeScore: i = h.includeScore
} = {}) {
const o = [];
return r && o.push(he), i && o.push(ue), e.map((a) => {
const { idx: n } = a, s = {
item: t[n],
refIndex: n
};
return o.length && o.forEach((l) => {
l(a, s);
}), s;
});
}
class R {
constructor(t, r = {}, i) {
this.options = { ...h, ...r }, this.options.useExtendedSearch, this._keyStore = new Ot(this.options.keys), this.setCollection(t, i);
}
setCollection(t, r) {
if (this._docs = t, r && !(r instanceof rt))
throw new Error(It);
this._myIndex = r || mt(this.options.keys, this._docs, {
getFn: this.options.getFn,
fieldNormWeight: this.options.fieldNormWeight
});
}
add(t) {
v(t) && (this._docs.push(t), this._myIndex.add(t));
}
remove(t = () => !1) {
const r = [];
for (let i = 0, o = this._docs.length; i < o; i += 1) {
const a = this._docs[i];
t(a, i) && (this.removeAt(i), i -= 1, o -= 1, r.push(a));
}
return r;
}
removeAt(t) {
this._docs.splice(t, 1), this._myIndex.removeAt(t);
}
getIndex() {
return this._myIndex;
}
search(t, { limit: r = -1 } = {}) {
const {
includeMatches: i,
includeScore: o,
shouldSort: a,
sortFn: n,
ignoreFieldNorm: s
} = this.options;
let l = k(t) ? k(this._docs[0]) ? this._searchStringList(t) : this._searchObjectList(t) : this._searchLogical(t);
return de(l, { ignoreFieldNorm: s }), a && l.sort(n), ft(r) && r > -1 && (l = l.slice(0, r)), pe(l, this._docs, {
includeMatches: i,
includeScore: o
});
}
_searchStringList(t) {
const r = X(t, this.options), { records: i } = this._myIndex, o = [];
return i.forEach(({ v: a, i: n, n: s }) => {
if (!v(a))
return;
const { isMatch: l, score: c, indices: d } = r.searchIn(a);
l && o.push({
item: a,
idx: n,
matches: [{ score: c, value: a, norm: s, indices: d }]
});
}), o;
}
_searchLogical(t) {
const r = At(t, this.options), i = (s, l, c) => {
if (!s.children) {
const { keyId: u, searcher: p } = s, g = this._findMatches({
key: this._keyStore.get(u),
value: this._myIndex.getValueForItemAtKeyId(l, u),
searcher: p
});
return g && g.length ? [
{
idx: c,
item: l,
matches: g
}
] : [];
}
const d = [];
for (let u = 0, p = s.children.length; u < p; u += 1) {
const g = s.children[u], f = i(g, l, c);
if (f.length)
d.push(...f);
else if (s.operator === T.AND)
return [];
}
return d;
}, o = this._myIndex.records, a = {}, n = [];
return o.forEach(({ $: s, i: l }) => {
if (v(s)) {
let c = i(r, s, l);
c.length && (a[l] || (a[l] = { idx: l, item: s, matches: [] }, n.push(a[l])), c.forEach(({ matches: d }) => {
a[l].matches.push(...d);
}));
}
}), n;
}
_searchObjectList(t) {
const r = X(t, this.options), { keys: i, records: o } = this._myIndex, a = [];
return o.forEach(({ $: n, i: s }) => {
if (!v(n))
return;
let l = [];
i.forEach((c, d) => {
l.push(
...this._findMatches({
key: c,
value: n[d],
searcher: r
})
);
}), l.length && a.push({
idx: s,
item: n,
matches: l
});
}), a;
}
_findMatches({ key: t, value: r, searcher: i }) {
if (!v(r))
return [];
let o = [];
if (E(r))
r.forEach(({ v: a, i: n, n: s }) => {
if (!v(a))
return;
const { isMatch: l, score: c, indices: d } = i.searchIn(a);
l && o.push({
score: c,
key: t,
value: a,
idx: n,
norm: s,
indices: d
});
});
else {
const { v: a, n } = r, { isMatch: s, score: l, indices: c } = i.searchIn(a);
s && o.push({ score: l, key: t, value: a, norm: n, indices: c });
}
return o;
}
}
R.version = "7.1.0";
R.createIndex = mt;
R.parseIndex = Ht;
R.config = h;
R.parseQuery = At;
se(ne);
var ge = ["Shift", "Meta", "Alt", "Control"], Ct = typeof navigator == "object" ? navigator.platform : "", Et = /Mac|iPod|iPhone|iPad/.test(Ct), fe = Et ? "Meta" : "Control", we = Ct === "Win32" ? ["Control", "Alt"] : Et ? ["Alt"] : [];
function tt(e, t) {
return typeof e.getModifierState == "function" && (e.getModifierState(t) || we.includes(t) && e.getModifierState("AltGraph"));
}
function ve(e) {
return e.trim().split(" ").map(function(t) {
var r = t.split(/\b\+/), i = r.pop(), o = i.match(/^\((.+)\)$/);
return o && (i = new RegExp("^" + o[1] + "$")), [r = r.map(function(a) {
return a === "$mod" ? fe : a;
}), i];
});
}
function be(e, t) {
var r = t[0], i = t[1];
return !((i instanceof RegExp ? !i.test(e.key) && !i.test(e.code) : i.toUpperCase() !== e.key.toUpperCase() && i !== e.code) || r.find(function(o) {
return !tt(e, o);
}) || ge.find(function(o) {
return !r.includes(o) && i !== o && tt(e, o);
}));
}
function me(e, t) {
var r;
t === void 0 && (t = {});
var i = (r = t.timeout) != null ? r : 1e3, o = Object.keys(e).map(function(s) {
return [ve(s), e[s]];
}), a = /* @__PURE__ */ new Map(), n = null;
return function(s) {
s instanceof KeyboardEvent && (o.forEach(function(l) {
var c = l[0], d = l[1], u = a.get(c) || c;
be(s, u[0]) ? u.length > 1 ? a.set(c, u.slice(1)) : (a.delete(c), d(s)) : tt(s, s.key) || a.delete(c);
}), n && clearTimeout(n), n = setTimeout(a.clear.bind(a), i));
};
}
function G(e, t, r) {
var i = {}, o = i.event, a = o === void 0 ? "keydown" : o, n = i.capture, s = me(t, { timeout: i.timeout });
return e.addEventListener(a, s, n), function() {
e.removeEventListener(a, s, n);
};
}
const xe = '/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-border-style:solid;--tw-divide-y-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-50:oklch(97% .014 254.604);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}dialog::backdrop{--tw-backdrop-brightness:brightness(75%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}dialog{padding:calc(var(--spacing)*0);font-family:var(--font-sans);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:var(--leading-normal);line-height:var(--leading-normal);--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-shadow-color:#1717171a}@supports (color:color-mix(in lab,red,red)){dialog{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-neutral-900)10%,transparent)var(--tw-shadow-alpha),transparent)}}dialog{width:100%;max-width:var(--container-2xl);border-radius:var(--radius-xl);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-neutral-200);margin-inline:auto;overflow:hidden}:where(dialog>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)));border-color:#e5e5e5cc}@supports (color:color-mix(in lab,red,red)){:where(dialog>:not(:last-child)){border-color:color-mix(in oklab,var(--color-neutral-200)80%,transparent)}}dialog{background-color:var(--color-neutral-50);margin-inline:auto;margin-top:20vh;position:absolute}dialog:where(.dark,.dark *){background-color:var(--color-neutral-900);color:var(--color-neutral-300);border-color:var(--color-neutral-800)}:where(dialog:where(.dark,.dark *)>:not(:last-child)){border-color:var(--color-neutral-800)}dialog:where(.dark,.dark *){--tw-shadow-color:#7373731a}@supports (color:color-mix(in lab,red,red)){dialog:where(.dark,.dark *){--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-neutral-500)10%,transparent)var(--tw-shadow-alpha),transparent)}}dialog form{flex-direction:row;justify-content:space-between;align-items:center;display:flex}dialog button[type=button]{padding-right:calc(var(--spacing)*4)}dialog input[type=text]{border-style:var(--tw-border-style);width:100%;padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*3);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal);background-color:#0000;border-width:0}dialog input[type=text]::placeholder{color:var(--color-neutral-500)}dialog input[type=text]{border-top-left-radius:var(--radius-lg)}dialog input[type=text]:where(.dark,.dark *){color:var(--color-white)}dialog input[type=text]:focus{--tw-outline-style:none;outline-style:none}[name=footer]{padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-neutral-700);justify-content:space-between;display:flex}[name=footer]:where(.dark,.dark *){color:var(--color-neutral-400)}ul{max-height:calc(var(--spacing)*80);overflow-y:auto}ul:first-child{margin-top:calc(var(--spacing)*2)}ul:last-child{margin-bottom:calc(var(--spacing)*2)}li{cursor:default;align-items:center;gap:calc(var(--spacing)*4);padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*3.5);-webkit-user-select:none;user-select:none;margin-inline:calc(var(--spacing)*2);cursor:pointer;display:flex}li.selected{--tw-outline-style:none;background-color:var(--color-neutral-200);border-radius:var(--radius-md);outline-style:none}li.selected.dark{background-color:var(--color-neutral-800)}li strong{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex-grow:1}li strong small{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal);color:var(--color-neutral-500);display:block}li svg,li img{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}kbd{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-200);background-color:var(--color-gray-300);padding-inline:calc(var(--spacing)*1.5);padding-block:calc(var(--spacing)*1);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-gray-800)}kbd:where(.dark,.dark *){border-color:var(--color-neutral-500);background-color:var(--color-neutral-600);color:var(--color-neutral-100)}kbd{justify-content:center;align-items:center;display:inline-flex}}@layer components;@layer utilities{.static{position:static}.block{display:block}.contents{display:contents}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-5{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.h-screen{height:100vh}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-xl{border-radius:var(--radius-xl)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-800{background-color:var(--color-neutral-800)}.p-4{padding:calc(var(--spacing)*4)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-\\[8rem\\]{font-size:8rem}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.text-gray-300{color:var(--color-gray-300)}.text-neutral-300{color:var(--color-neutral-300)}.text-neutral-800{color:var(--color-neutral-800)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (hover:hover){.hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\\:text-current:hover{color:currentColor}.hover\\:no-underline:hover{text-decoration-line:none}}@media (min-width:64rem){.lg\\:size-14{width:calc(var(--spacing)*14);height:calc(var(--spacing)*14)}.lg\\:text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}}@media (min-width:80rem){.xl\\:size-20{width:calc(var(--spacing)*20);height:calc(var(--spacing)*20)}.xl\\:text-8xl{font-size:var(--text-8xl);line-height:var(--tw-leading,var(--text-8xl--line-height))}}.dark\\:bg-\\[radial-gradient\\(circle\\,rgb\\(15\\,23\\,42\\)\\,rgb\\(2\\,6\\,23\\)\\)\\]:where(.dark,.dark *){background-image:radial-gradient(circle,#0f172a,#020617)}.dark\\:text-blue-50:where(.dark,.dark *){color:var(--color-blue-50)}}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}';
var ye = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, K = (e, t, r, i) => {
for (var o = i > 1 ? void 0 : i ? ke(t, r) : t, a = e.length - 1, n; a >= 0; a--)
(n = e[a]) && (o = (i ? n(t, r, o) : n(o)) || o);
return i && o && ye(t, r, o), o;
};
let L = class extends ht {
constructor() {
super(), this.theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", this.selected = !1, this.addEventListener("click", this.click);
}
/**
* Get hotkeys
* @private
*/
get hotkeys() {
if (this.action?.hotkey) {
const e = this.action.hotkey.replaceAll("$mod", /Mac|iPod|iPhone|iPad/.test(window.navigator.userAgent) ? "⌘" : "Ctrl").replaceAll("Meta", "<span>⌘</span>").replaceAll("Control", "⌃").replaceAll("Shift", "⇧").replaceAll("Alt", "⌥").replaceAll("Control", "⌃").replaceAll("+", "").replaceAll(" ", "").split("|");
return e.length > 0 ? D`<span>${pt(e, (t) => D`<kbd part="kbd">${t}</kbd>`)}</span>` : "";
}
return V;
}
/**
* Get description
* @private
*/
get description() {
return this.action.description ? D`<small part="description">${this.action.description}</small>` : V;
}
/**
* Get icon
* @private
*/
get img() {
return this.action.img ? D`<span>${gt(this.action.img)}</span>` : V;
}
/**
* Scroll to show element
*/
ensureInView() {
requestAnimationFrame(() => {
this.scrollIntoView({ block: "nearest" });
});
}
/**
* Click event
*/
click() {
this.dispatchEvent(
new CustomEvent("actionSelected", {
detail: this.action,
bubbles: !0,
composed: !0
})
);
}
/**
* Updated
* @param changedProperties
*/
updated(e) {
e.has("selected") && this.selected && this.ensureInView();
}
render() {
const e = {
selected: this.selected,
dark: this.theme === "dark"
};
return D`
<li class=${Bt(e)} part="action ${this.selected ? "selected" : ""}">
${this.img}
<strong part="title">
${this.action.title}
${this.description}
</strong>
${this.hotkeys}
</li>
`;
}
};
L.styles = dt(xe);
K([
M({ type: String })
],