@vibe-flags/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +95 -0
- package/dist/vibe-flags.cdn.js +427 -0
- package/dist/vibe-flags.cdn.mjs +1216 -0
- package/dist/vibe-flags.js +647 -0
- package/package.json +41 -0
|
@@ -0,0 +1,1216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const F = globalThis, W = F.ShadowRoot && (F.ShadyCSS === void 0 || F.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, q = Symbol(), G = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let ct = class {
|
|
8
|
+
constructor(t, e, s) {
|
|
9
|
+
if (this._$cssResult$ = !0, s !== q) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
|
+
this.cssText = t, this.t = e;
|
|
11
|
+
}
|
|
12
|
+
get styleSheet() {
|
|
13
|
+
let t = this.o;
|
|
14
|
+
const e = this.t;
|
|
15
|
+
if (W && t === void 0) {
|
|
16
|
+
const s = e !== void 0 && e.length === 1;
|
|
17
|
+
s && (t = G.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && G.set(e, t));
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return this.cssText;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const vt = (i) => new ct(typeof i == "string" ? i : i + "", void 0, q), dt = (i, ...t) => {
|
|
26
|
+
const e = i.length === 1 ? i[0] : t.reduce((s, r, o) => s + ((n) => {
|
|
27
|
+
if (n._$cssResult$ === !0) return n.cssText;
|
|
28
|
+
if (typeof n == "number") return n;
|
|
29
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
|
+
})(r) + i[o + 1], i[0]);
|
|
31
|
+
return new ct(e, i, q);
|
|
32
|
+
}, $t = (i, t) => {
|
|
33
|
+
if (W) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
34
|
+
else for (const e of t) {
|
|
35
|
+
const s = document.createElement("style"), r = F.litNonce;
|
|
36
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
|
|
37
|
+
}
|
|
38
|
+
}, Q = W ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
|
|
39
|
+
let e = "";
|
|
40
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
41
|
+
return vt(e);
|
|
42
|
+
})(i) : i;
|
|
43
|
+
/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2017 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/
|
|
48
|
+
const { is: bt, defineProperty: yt, getOwnPropertyDescriptor: mt, getOwnPropertyNames: _t, getOwnPropertySymbols: xt, getPrototypeOf: wt } = Object, D = globalThis, tt = D.trustedTypes, At = tt ? tt.emptyScript : "", St = D.reactiveElementPolyfillSupport, M = (i, t) => i, j = { toAttribute(i, t) {
|
|
49
|
+
switch (t) {
|
|
50
|
+
case Boolean:
|
|
51
|
+
i = i ? At : null;
|
|
52
|
+
break;
|
|
53
|
+
case Object:
|
|
54
|
+
case Array:
|
|
55
|
+
i = i == null ? i : JSON.stringify(i);
|
|
56
|
+
}
|
|
57
|
+
return i;
|
|
58
|
+
}, fromAttribute(i, t) {
|
|
59
|
+
let e = i;
|
|
60
|
+
switch (t) {
|
|
61
|
+
case Boolean:
|
|
62
|
+
e = i !== null;
|
|
63
|
+
break;
|
|
64
|
+
case Number:
|
|
65
|
+
e = i === null ? null : Number(i);
|
|
66
|
+
break;
|
|
67
|
+
case Object:
|
|
68
|
+
case Array:
|
|
69
|
+
try {
|
|
70
|
+
e = JSON.parse(i);
|
|
71
|
+
} catch {
|
|
72
|
+
e = null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return e;
|
|
76
|
+
} }, J = (i, t) => !bt(i, t), et = { attribute: !0, type: String, converter: j, reflect: !1, useDefault: !1, hasChanged: J };
|
|
77
|
+
Symbol.metadata ??= Symbol("metadata"), D.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
|
+
let S = class extends HTMLElement {
|
|
79
|
+
static addInitializer(t) {
|
|
80
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
81
|
+
}
|
|
82
|
+
static get observedAttributes() {
|
|
83
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
|
+
}
|
|
85
|
+
static createProperty(t, e = et) {
|
|
86
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
87
|
+
const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
88
|
+
r !== void 0 && yt(this.prototype, t, r);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
static getPropertyDescriptor(t, e, s) {
|
|
92
|
+
const { get: r, set: o } = mt(this.prototype, t) ?? { get() {
|
|
93
|
+
return this[e];
|
|
94
|
+
}, set(n) {
|
|
95
|
+
this[e] = n;
|
|
96
|
+
} };
|
|
97
|
+
return { get: r, set(n) {
|
|
98
|
+
const l = r?.call(this);
|
|
99
|
+
o?.call(this, n), this.requestUpdate(t, l, s);
|
|
100
|
+
}, configurable: !0, enumerable: !0 };
|
|
101
|
+
}
|
|
102
|
+
static getPropertyOptions(t) {
|
|
103
|
+
return this.elementProperties.get(t) ?? et;
|
|
104
|
+
}
|
|
105
|
+
static _$Ei() {
|
|
106
|
+
if (this.hasOwnProperty(M("elementProperties"))) return;
|
|
107
|
+
const t = wt(this);
|
|
108
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
109
|
+
}
|
|
110
|
+
static finalize() {
|
|
111
|
+
if (this.hasOwnProperty(M("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
113
|
+
const e = this.properties, s = [..._t(e), ...xt(e)];
|
|
114
|
+
for (const r of s) this.createProperty(r, e[r]);
|
|
115
|
+
}
|
|
116
|
+
const t = this[Symbol.metadata];
|
|
117
|
+
if (t !== null) {
|
|
118
|
+
const e = litPropertyMetadata.get(t);
|
|
119
|
+
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
120
|
+
}
|
|
121
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const [e, s] of this.elementProperties) {
|
|
123
|
+
const r = this._$Eu(e, s);
|
|
124
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
125
|
+
}
|
|
126
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
|
+
}
|
|
128
|
+
static finalizeStyles(t) {
|
|
129
|
+
const e = [];
|
|
130
|
+
if (Array.isArray(t)) {
|
|
131
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
132
|
+
for (const r of s) e.unshift(Q(r));
|
|
133
|
+
} else t !== void 0 && e.push(Q(t));
|
|
134
|
+
return e;
|
|
135
|
+
}
|
|
136
|
+
static _$Eu(t, e) {
|
|
137
|
+
const s = e.attribute;
|
|
138
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
139
|
+
}
|
|
140
|
+
constructor() {
|
|
141
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
142
|
+
}
|
|
143
|
+
_$Ev() {
|
|
144
|
+
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
|
|
145
|
+
}
|
|
146
|
+
addController(t) {
|
|
147
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
|
|
148
|
+
}
|
|
149
|
+
removeController(t) {
|
|
150
|
+
this._$EO?.delete(t);
|
|
151
|
+
}
|
|
152
|
+
_$E_() {
|
|
153
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
154
|
+
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
155
|
+
t.size > 0 && (this._$Ep = t);
|
|
156
|
+
}
|
|
157
|
+
createRenderRoot() {
|
|
158
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
159
|
+
return $t(t, this.constructor.elementStyles), t;
|
|
160
|
+
}
|
|
161
|
+
connectedCallback() {
|
|
162
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
163
|
+
}
|
|
164
|
+
enableUpdating(t) {
|
|
165
|
+
}
|
|
166
|
+
disconnectedCallback() {
|
|
167
|
+
this._$EO?.forEach((t) => t.hostDisconnected?.());
|
|
168
|
+
}
|
|
169
|
+
attributeChangedCallback(t, e, s) {
|
|
170
|
+
this._$AK(t, s);
|
|
171
|
+
}
|
|
172
|
+
_$ET(t, e) {
|
|
173
|
+
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
174
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
175
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : j).toAttribute(e, s.type);
|
|
176
|
+
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
_$AK(t, e) {
|
|
180
|
+
const s = this.constructor, r = s._$Eh.get(t);
|
|
181
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
182
|
+
const o = s.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : j;
|
|
183
|
+
this._$Em = r;
|
|
184
|
+
const l = n.fromAttribute(e, o.type);
|
|
185
|
+
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
requestUpdate(t, e, s, r = !1, o) {
|
|
189
|
+
if (t !== void 0) {
|
|
190
|
+
const n = this.constructor;
|
|
191
|
+
if (r === !1 && (o = this[t]), s ??= n.getPropertyOptions(t), !((s.hasChanged ?? J)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, s)))) return;
|
|
192
|
+
this.C(t, e, s);
|
|
193
|
+
}
|
|
194
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
195
|
+
}
|
|
196
|
+
C(t, e, { useDefault: s, reflect: r, wrapped: o }, n) {
|
|
197
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
198
|
+
}
|
|
199
|
+
async _$EP() {
|
|
200
|
+
this.isUpdatePending = !0;
|
|
201
|
+
try {
|
|
202
|
+
await this._$ES;
|
|
203
|
+
} catch (e) {
|
|
204
|
+
Promise.reject(e);
|
|
205
|
+
}
|
|
206
|
+
const t = this.scheduleUpdate();
|
|
207
|
+
return t != null && await t, !this.isUpdatePending;
|
|
208
|
+
}
|
|
209
|
+
scheduleUpdate() {
|
|
210
|
+
return this.performUpdate();
|
|
211
|
+
}
|
|
212
|
+
performUpdate() {
|
|
213
|
+
if (!this.isUpdatePending) return;
|
|
214
|
+
if (!this.hasUpdated) {
|
|
215
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
216
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
217
|
+
this._$Ep = void 0;
|
|
218
|
+
}
|
|
219
|
+
const s = this.constructor.elementProperties;
|
|
220
|
+
if (s.size > 0) for (const [r, o] of s) {
|
|
221
|
+
const { wrapped: n } = o, l = this[r];
|
|
222
|
+
n !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, o, l);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
let t = !1;
|
|
226
|
+
const e = this._$AL;
|
|
227
|
+
try {
|
|
228
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(e)) : this._$EM();
|
|
229
|
+
} catch (s) {
|
|
230
|
+
throw t = !1, this._$EM(), s;
|
|
231
|
+
}
|
|
232
|
+
t && this._$AE(e);
|
|
233
|
+
}
|
|
234
|
+
willUpdate(t) {
|
|
235
|
+
}
|
|
236
|
+
_$AE(t) {
|
|
237
|
+
this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
238
|
+
}
|
|
239
|
+
_$EM() {
|
|
240
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
241
|
+
}
|
|
242
|
+
get updateComplete() {
|
|
243
|
+
return this.getUpdateComplete();
|
|
244
|
+
}
|
|
245
|
+
getUpdateComplete() {
|
|
246
|
+
return this._$ES;
|
|
247
|
+
}
|
|
248
|
+
shouldUpdate(t) {
|
|
249
|
+
return !0;
|
|
250
|
+
}
|
|
251
|
+
update(t) {
|
|
252
|
+
this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
|
|
253
|
+
}
|
|
254
|
+
updated(t) {
|
|
255
|
+
}
|
|
256
|
+
firstUpdated(t) {
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[M("elementProperties")] = /* @__PURE__ */ new Map(), S[M("finalized")] = /* @__PURE__ */ new Map(), St?.({ ReactiveElement: S }), (D.reactiveElementVersions ??= []).push("2.1.2");
|
|
260
|
+
/**
|
|
261
|
+
* @license
|
|
262
|
+
* Copyright 2017 Google LLC
|
|
263
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
264
|
+
*/
|
|
265
|
+
const K = globalThis, st = (i) => i, z = K.trustedTypes, it = z ? z.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, pt = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, ft = "?" + $, Et = `<${ft}>`, w = document, U = () => w.createComment(""), T = (i) => i === null || typeof i != "object" && typeof i != "function", X = Array.isArray, kt = (i) => X(i) || typeof i?.[Symbol.iterator] == "function", B = `[
|
|
266
|
+
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, ot = />/g, y = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
267
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, at = /"/g, ut = /^(?:script|style|textarea|title)$/i, Ct = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), f = Ct(1), E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), lt = /* @__PURE__ */ new WeakMap(), _ = w.createTreeWalker(w, 129);
|
|
268
|
+
function gt(i, t) {
|
|
269
|
+
if (!X(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
270
|
+
return it !== void 0 ? it.createHTML(t) : t;
|
|
271
|
+
}
|
|
272
|
+
const Pt = (i, t) => {
|
|
273
|
+
const e = i.length - 1, s = [];
|
|
274
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = P;
|
|
275
|
+
for (let l = 0; l < e; l++) {
|
|
276
|
+
const a = i[l];
|
|
277
|
+
let d, p, h = -1, u = 0;
|
|
278
|
+
for (; u < a.length && (n.lastIndex = u, p = n.exec(a), p !== null); ) u = n.lastIndex, n === P ? p[1] === "!--" ? n = rt : p[1] !== void 0 ? n = ot : p[2] !== void 0 ? (ut.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = y) : p[3] !== void 0 && (n = y) : n === y ? p[0] === ">" ? (n = r ?? P, h = -1) : p[1] === void 0 ? h = -2 : (h = n.lastIndex - p[2].length, d = p[1], n = p[3] === void 0 ? y : p[3] === '"' ? at : nt) : n === at || n === nt ? n = y : n === rt || n === ot ? n = P : (n = y, r = void 0);
|
|
279
|
+
const v = n === y && i[l + 1].startsWith("/>") ? " " : "";
|
|
280
|
+
o += n === P ? a + Et : h >= 0 ? (s.push(d), a.slice(0, h) + pt + a.slice(h) + $ + v) : a + $ + (h === -2 ? l : v);
|
|
281
|
+
}
|
|
282
|
+
return [gt(i, o + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
283
|
+
};
|
|
284
|
+
class N {
|
|
285
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
286
|
+
let r;
|
|
287
|
+
this.parts = [];
|
|
288
|
+
let o = 0, n = 0;
|
|
289
|
+
const l = t.length - 1, a = this.parts, [d, p] = Pt(t, e);
|
|
290
|
+
if (this.el = N.createElement(d, s), _.currentNode = this.el.content, e === 2 || e === 3) {
|
|
291
|
+
const h = this.el.content.firstChild;
|
|
292
|
+
h.replaceWith(...h.childNodes);
|
|
293
|
+
}
|
|
294
|
+
for (; (r = _.nextNode()) !== null && a.length < l; ) {
|
|
295
|
+
if (r.nodeType === 1) {
|
|
296
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(pt)) {
|
|
297
|
+
const u = p[n++], v = r.getAttribute(h).split($), R = /([.?@])?(.*)/.exec(u);
|
|
298
|
+
a.push({ type: 1, index: o, name: R[2], strings: v, ctor: R[1] === "." ? Mt : R[1] === "?" ? Ut : R[1] === "@" ? Tt : I }), r.removeAttribute(h);
|
|
299
|
+
} else h.startsWith($) && (a.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
300
|
+
if (ut.test(r.tagName)) {
|
|
301
|
+
const h = r.textContent.split($), u = h.length - 1;
|
|
302
|
+
if (u > 0) {
|
|
303
|
+
r.textContent = z ? z.emptyScript : "";
|
|
304
|
+
for (let v = 0; v < u; v++) r.append(h[v], U()), _.nextNode(), a.push({ type: 2, index: ++o });
|
|
305
|
+
r.append(h[u], U());
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
} else if (r.nodeType === 8) if (r.data === ft) a.push({ type: 2, index: o });
|
|
309
|
+
else {
|
|
310
|
+
let h = -1;
|
|
311
|
+
for (; (h = r.data.indexOf($, h + 1)) !== -1; ) a.push({ type: 7, index: o }), h += $.length - 1;
|
|
312
|
+
}
|
|
313
|
+
o++;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
static createElement(t, e) {
|
|
317
|
+
const s = w.createElement("template");
|
|
318
|
+
return s.innerHTML = t, s;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function k(i, t, e = i, s) {
|
|
322
|
+
if (t === E) return t;
|
|
323
|
+
let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
324
|
+
const o = T(t) ? void 0 : t._$litDirective$;
|
|
325
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = k(i, r._$AS(i, t.values), r, s)), t;
|
|
326
|
+
}
|
|
327
|
+
class Ot {
|
|
328
|
+
constructor(t, e) {
|
|
329
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
330
|
+
}
|
|
331
|
+
get parentNode() {
|
|
332
|
+
return this._$AM.parentNode;
|
|
333
|
+
}
|
|
334
|
+
get _$AU() {
|
|
335
|
+
return this._$AM._$AU;
|
|
336
|
+
}
|
|
337
|
+
u(t) {
|
|
338
|
+
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? w).importNode(e, !0);
|
|
339
|
+
_.currentNode = r;
|
|
340
|
+
let o = _.nextNode(), n = 0, l = 0, a = s[0];
|
|
341
|
+
for (; a !== void 0; ) {
|
|
342
|
+
if (n === a.index) {
|
|
343
|
+
let d;
|
|
344
|
+
a.type === 2 ? d = new H(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Nt(o, this, t)), this._$AV.push(d), a = s[++l];
|
|
345
|
+
}
|
|
346
|
+
n !== a?.index && (o = _.nextNode(), n++);
|
|
347
|
+
}
|
|
348
|
+
return _.currentNode = w, r;
|
|
349
|
+
}
|
|
350
|
+
p(t) {
|
|
351
|
+
let e = 0;
|
|
352
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
class H {
|
|
356
|
+
get _$AU() {
|
|
357
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
358
|
+
}
|
|
359
|
+
constructor(t, e, s, r) {
|
|
360
|
+
this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
361
|
+
}
|
|
362
|
+
get parentNode() {
|
|
363
|
+
let t = this._$AA.parentNode;
|
|
364
|
+
const e = this._$AM;
|
|
365
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
366
|
+
}
|
|
367
|
+
get startNode() {
|
|
368
|
+
return this._$AA;
|
|
369
|
+
}
|
|
370
|
+
get endNode() {
|
|
371
|
+
return this._$AB;
|
|
372
|
+
}
|
|
373
|
+
_$AI(t, e = this) {
|
|
374
|
+
t = k(this, t, e), T(t) ? t === c || t == null || t === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : kt(t) ? this.k(t) : this._(t);
|
|
375
|
+
}
|
|
376
|
+
O(t) {
|
|
377
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
378
|
+
}
|
|
379
|
+
T(t) {
|
|
380
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
381
|
+
}
|
|
382
|
+
_(t) {
|
|
383
|
+
this._$AH !== c && T(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
384
|
+
}
|
|
385
|
+
$(t) {
|
|
386
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = N.createElement(gt(s.h, s.h[0]), this.options)), s);
|
|
387
|
+
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
388
|
+
else {
|
|
389
|
+
const o = new Ot(r, this), n = o.u(this.options);
|
|
390
|
+
o.p(e), this.T(n), this._$AH = o;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
_$AC(t) {
|
|
394
|
+
let e = lt.get(t.strings);
|
|
395
|
+
return e === void 0 && lt.set(t.strings, e = new N(t)), e;
|
|
396
|
+
}
|
|
397
|
+
k(t) {
|
|
398
|
+
X(this._$AH) || (this._$AH = [], this._$AR());
|
|
399
|
+
const e = this._$AH;
|
|
400
|
+
let s, r = 0;
|
|
401
|
+
for (const o of t) r === e.length ? e.push(s = new H(this.O(U()), this.O(U()), this, this.options)) : s = e[r], s._$AI(o), r++;
|
|
402
|
+
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
403
|
+
}
|
|
404
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
405
|
+
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
406
|
+
const s = st(t).nextSibling;
|
|
407
|
+
st(t).remove(), t = s;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
setConnected(t) {
|
|
411
|
+
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
class I {
|
|
415
|
+
get tagName() {
|
|
416
|
+
return this.element.tagName;
|
|
417
|
+
}
|
|
418
|
+
get _$AU() {
|
|
419
|
+
return this._$AM._$AU;
|
|
420
|
+
}
|
|
421
|
+
constructor(t, e, s, r, o) {
|
|
422
|
+
this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
|
|
423
|
+
}
|
|
424
|
+
_$AI(t, e = this, s, r) {
|
|
425
|
+
const o = this.strings;
|
|
426
|
+
let n = !1;
|
|
427
|
+
if (o === void 0) t = k(this, t, e, 0), n = !T(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
|
|
428
|
+
else {
|
|
429
|
+
const l = t;
|
|
430
|
+
let a, d;
|
|
431
|
+
for (t = o[0], a = 0; a < o.length - 1; a++) d = k(this, l[s + a], e, a), d === E && (d = this._$AH[a]), n ||= !T(d) || d !== this._$AH[a], d === c ? t = c : t !== c && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d;
|
|
432
|
+
}
|
|
433
|
+
n && !r && this.j(t);
|
|
434
|
+
}
|
|
435
|
+
j(t) {
|
|
436
|
+
t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
class Mt extends I {
|
|
440
|
+
constructor() {
|
|
441
|
+
super(...arguments), this.type = 3;
|
|
442
|
+
}
|
|
443
|
+
j(t) {
|
|
444
|
+
this.element[this.name] = t === c ? void 0 : t;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
class Ut extends I {
|
|
448
|
+
constructor() {
|
|
449
|
+
super(...arguments), this.type = 4;
|
|
450
|
+
}
|
|
451
|
+
j(t) {
|
|
452
|
+
this.element.toggleAttribute(this.name, !!t && t !== c);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
class Tt extends I {
|
|
456
|
+
constructor(t, e, s, r, o) {
|
|
457
|
+
super(t, e, s, r, o), this.type = 5;
|
|
458
|
+
}
|
|
459
|
+
_$AI(t, e = this) {
|
|
460
|
+
if ((t = k(this, t, e, 0) ?? c) === E) return;
|
|
461
|
+
const s = this._$AH, r = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== c && (s === c || r);
|
|
462
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
463
|
+
}
|
|
464
|
+
handleEvent(t) {
|
|
465
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
class Nt {
|
|
469
|
+
constructor(t, e, s) {
|
|
470
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
471
|
+
}
|
|
472
|
+
get _$AU() {
|
|
473
|
+
return this._$AM._$AU;
|
|
474
|
+
}
|
|
475
|
+
_$AI(t) {
|
|
476
|
+
k(this, t);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const Ht = K.litHtmlPolyfillSupport;
|
|
480
|
+
Ht?.(N, H), (K.litHtmlVersions ??= []).push("3.3.2");
|
|
481
|
+
const Rt = (i, t, e) => {
|
|
482
|
+
const s = e?.renderBefore ?? t;
|
|
483
|
+
let r = s._$litPart$;
|
|
484
|
+
if (r === void 0) {
|
|
485
|
+
const o = e?.renderBefore ?? null;
|
|
486
|
+
s._$litPart$ = r = new H(t.insertBefore(U(), o), o, void 0, e ?? {});
|
|
487
|
+
}
|
|
488
|
+
return r._$AI(i), r;
|
|
489
|
+
};
|
|
490
|
+
/**
|
|
491
|
+
* @license
|
|
492
|
+
* Copyright 2017 Google LLC
|
|
493
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
494
|
+
*/
|
|
495
|
+
const Z = globalThis;
|
|
496
|
+
class x extends S {
|
|
497
|
+
constructor() {
|
|
498
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
499
|
+
}
|
|
500
|
+
createRenderRoot() {
|
|
501
|
+
const t = super.createRenderRoot();
|
|
502
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
503
|
+
}
|
|
504
|
+
update(t) {
|
|
505
|
+
const e = this.render();
|
|
506
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Rt(e, this.renderRoot, this.renderOptions);
|
|
507
|
+
}
|
|
508
|
+
connectedCallback() {
|
|
509
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
510
|
+
}
|
|
511
|
+
disconnectedCallback() {
|
|
512
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
513
|
+
}
|
|
514
|
+
render() {
|
|
515
|
+
return E;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
x._$litElement$ = !0, x.finalized = !0, Z.litElementHydrateSupport?.({ LitElement: x });
|
|
519
|
+
const Ft = Z.litElementPolyfillSupport;
|
|
520
|
+
Ft?.({ LitElement: x });
|
|
521
|
+
(Z.litElementVersions ??= []).push("4.2.2");
|
|
522
|
+
/**
|
|
523
|
+
* @license
|
|
524
|
+
* Copyright 2017 Google LLC
|
|
525
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
526
|
+
*/
|
|
527
|
+
const Y = (i) => (t, e) => {
|
|
528
|
+
e !== void 0 ? e.addInitializer(() => {
|
|
529
|
+
customElements.define(i, t);
|
|
530
|
+
}) : customElements.define(i, t);
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* @license
|
|
534
|
+
* Copyright 2017 Google LLC
|
|
535
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
536
|
+
*/
|
|
537
|
+
const jt = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: J }, zt = (i = jt, t, e) => {
|
|
538
|
+
const { kind: s, metadata: r } = e;
|
|
539
|
+
let o = globalThis.litPropertyMetadata.get(r);
|
|
540
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(e.name, i), s === "accessor") {
|
|
541
|
+
const { name: n } = e;
|
|
542
|
+
return { set(l) {
|
|
543
|
+
const a = t.get.call(this);
|
|
544
|
+
t.set.call(this, l), this.requestUpdate(n, a, i, !0, l);
|
|
545
|
+
}, init(l) {
|
|
546
|
+
return l !== void 0 && this.C(n, void 0, i, l), l;
|
|
547
|
+
} };
|
|
548
|
+
}
|
|
549
|
+
if (s === "setter") {
|
|
550
|
+
const { name: n } = e;
|
|
551
|
+
return function(l) {
|
|
552
|
+
const a = this[n];
|
|
553
|
+
t.call(this, l), this.requestUpdate(n, a, i, !0, l);
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
throw Error("Unsupported decorator location: " + s);
|
|
557
|
+
};
|
|
558
|
+
function A(i) {
|
|
559
|
+
return (t, e) => typeof e == "object" ? zt(i, t, e) : ((s, r, o) => {
|
|
560
|
+
const n = r.hasOwnProperty(o);
|
|
561
|
+
return r.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
|
|
562
|
+
})(i, t, e);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* @license
|
|
566
|
+
* Copyright 2017 Google LLC
|
|
567
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
568
|
+
*/
|
|
569
|
+
function L(i) {
|
|
570
|
+
return A({ ...i, state: !0, attribute: !1 });
|
|
571
|
+
}
|
|
572
|
+
var Dt = Object.getOwnPropertyDescriptor, It = (i, t, e, s) => {
|
|
573
|
+
for (var r = s > 1 ? void 0 : s ? Dt(t, e) : t, o = i.length - 1, n; o >= 0; o--)
|
|
574
|
+
(n = i[o]) && (r = n(r) || r);
|
|
575
|
+
return r;
|
|
576
|
+
};
|
|
577
|
+
let ht = class extends x {
|
|
578
|
+
render() {
|
|
579
|
+
return f`<slot></slot>`;
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
ht = It([
|
|
583
|
+
Y("vibe-flags")
|
|
584
|
+
], ht);
|
|
585
|
+
const O = "vibe-flags:";
|
|
586
|
+
class Lt extends EventTarget {
|
|
587
|
+
constructor() {
|
|
588
|
+
super(...arguments), this.configs = /* @__PURE__ */ new Map(), this.state = {}, this.listening = !1, this.onStorageEvent = (t) => {
|
|
589
|
+
if (!t.key?.startsWith(O)) return;
|
|
590
|
+
const e = t.key.slice(O.length);
|
|
591
|
+
if (this.configs.has(e))
|
|
592
|
+
try {
|
|
593
|
+
const s = t.newValue ? JSON.parse(t.newValue) : this.configs.get(e).default;
|
|
594
|
+
this.state[e] = s, this.dispatch(e);
|
|
595
|
+
} catch {
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
register(t) {
|
|
600
|
+
this.configs.set(t.key, t);
|
|
601
|
+
const e = this.readFromStorage(t.key);
|
|
602
|
+
this.state[t.key] = e ?? t.default, this.listening || (this.listening = !0, typeof window < "u" && window.addEventListener("storage", this.onStorageEvent)), this.dispatch(t.key);
|
|
603
|
+
}
|
|
604
|
+
unregister(t) {
|
|
605
|
+
this.configs.delete(t), delete this.state[t], this.dispatch();
|
|
606
|
+
}
|
|
607
|
+
get(t) {
|
|
608
|
+
return this.state[t];
|
|
609
|
+
}
|
|
610
|
+
set(t, e) {
|
|
611
|
+
const s = this.configs.get(t);
|
|
612
|
+
s && (s.type === "boolean" && typeof e != "boolean" || s.type === "select" && (typeof e != "string" || !s.options.includes(e)) || (this.state[t] = e, this.writeToStorage(t, e), this.dispatch(t)));
|
|
613
|
+
}
|
|
614
|
+
getAll() {
|
|
615
|
+
return { ...this.state };
|
|
616
|
+
}
|
|
617
|
+
getConfig() {
|
|
618
|
+
return Array.from(this.configs.values());
|
|
619
|
+
}
|
|
620
|
+
getConfigForKey(t) {
|
|
621
|
+
return this.configs.get(t);
|
|
622
|
+
}
|
|
623
|
+
reset() {
|
|
624
|
+
for (const [t, e] of this.configs)
|
|
625
|
+
this.state[t] = e.default, this.removeFromStorage(t);
|
|
626
|
+
this.dispatch();
|
|
627
|
+
}
|
|
628
|
+
readFromStorage(t) {
|
|
629
|
+
if (typeof window > "u") return null;
|
|
630
|
+
try {
|
|
631
|
+
const e = localStorage.getItem(O + t);
|
|
632
|
+
return e === null ? null : JSON.parse(e);
|
|
633
|
+
} catch {
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
writeToStorage(t, e) {
|
|
638
|
+
if (!(typeof window > "u"))
|
|
639
|
+
try {
|
|
640
|
+
localStorage.setItem(O + t, JSON.stringify(e));
|
|
641
|
+
} catch {
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
removeFromStorage(t) {
|
|
645
|
+
if (!(typeof window > "u"))
|
|
646
|
+
try {
|
|
647
|
+
localStorage.removeItem(O + t);
|
|
648
|
+
} catch {
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
dispatch(t) {
|
|
652
|
+
const e = { key: t, state: this.getAll() }, s = new CustomEvent("vibe-flags-changed", {
|
|
653
|
+
detail: e,
|
|
654
|
+
bubbles: !0
|
|
655
|
+
});
|
|
656
|
+
this.dispatchEvent(s), typeof window < "u" && window.dispatchEvent(new CustomEvent("vibe-flags-changed", { detail: e }));
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
const m = new Lt();
|
|
660
|
+
var Vt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, b = (i, t, e, s) => {
|
|
661
|
+
for (var r = s > 1 ? void 0 : s ? Bt(t, e) : t, o = i.length - 1, n; o >= 0; o--)
|
|
662
|
+
(n = i[o]) && (r = (s ? n(t, e, r) : n(r)) || r);
|
|
663
|
+
return s && r && Vt(t, e, r), r;
|
|
664
|
+
};
|
|
665
|
+
let g = class extends x {
|
|
666
|
+
constructor() {
|
|
667
|
+
super(...arguments), this.key = "", this.description = "", this.type = "boolean", this.value = "true", this.defaultValue = "", this.options = "", this.isMatch = !1, this.registered = !1, this.onFlagChange = () => {
|
|
668
|
+
this.evaluate();
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
connectedCallback() {
|
|
672
|
+
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), this.registerFlag(), this.evaluate();
|
|
673
|
+
}
|
|
674
|
+
disconnectedCallback() {
|
|
675
|
+
super.disconnectedCallback(), window.removeEventListener("vibe-flags-changed", this.onFlagChange);
|
|
676
|
+
}
|
|
677
|
+
willUpdate(i) {
|
|
678
|
+
["key", "description", "type", "defaultValue", "options"].some((e) => i.has(e)) && this.registerFlag();
|
|
679
|
+
}
|
|
680
|
+
registerFlag() {
|
|
681
|
+
if (!this.key) return;
|
|
682
|
+
const i = this.type === "select" ? {
|
|
683
|
+
key: this.key,
|
|
684
|
+
type: "select",
|
|
685
|
+
default: this.defaultValue || this.parseOptions()[0] || "",
|
|
686
|
+
options: this.parseOptions(),
|
|
687
|
+
label: this.description || void 0
|
|
688
|
+
} : {
|
|
689
|
+
key: this.key,
|
|
690
|
+
type: "boolean",
|
|
691
|
+
default: this.defaultValue ? this.defaultValue === "true" : !1,
|
|
692
|
+
label: this.description || void 0
|
|
693
|
+
};
|
|
694
|
+
m.register(i), this.registered = !0, this.evaluate();
|
|
695
|
+
}
|
|
696
|
+
parseOptions() {
|
|
697
|
+
return this.options.split(",").map((i) => i.trim()).filter(Boolean);
|
|
698
|
+
}
|
|
699
|
+
evaluate() {
|
|
700
|
+
const i = m.get(this.key);
|
|
701
|
+
if (i === void 0) {
|
|
702
|
+
this.isMatch = !1;
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
this.isMatch = String(i) === this.value;
|
|
706
|
+
}
|
|
707
|
+
render() {
|
|
708
|
+
return this.isMatch ? f`<slot></slot>` : c;
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
b([
|
|
712
|
+
A({ type: String })
|
|
713
|
+
], g.prototype, "key", 2);
|
|
714
|
+
b([
|
|
715
|
+
A({ type: String })
|
|
716
|
+
], g.prototype, "description", 2);
|
|
717
|
+
b([
|
|
718
|
+
A({ type: String })
|
|
719
|
+
], g.prototype, "type", 2);
|
|
720
|
+
b([
|
|
721
|
+
A({ type: String })
|
|
722
|
+
], g.prototype, "value", 2);
|
|
723
|
+
b([
|
|
724
|
+
A({ type: String, attribute: "default" })
|
|
725
|
+
], g.prototype, "defaultValue", 2);
|
|
726
|
+
b([
|
|
727
|
+
A({ type: String })
|
|
728
|
+
], g.prototype, "options", 2);
|
|
729
|
+
b([
|
|
730
|
+
L()
|
|
731
|
+
], g.prototype, "isMatch", 2);
|
|
732
|
+
g = b([
|
|
733
|
+
Y("vibe-flag")
|
|
734
|
+
], g);
|
|
735
|
+
const Wt = dt`
|
|
736
|
+
:host {
|
|
737
|
+
--vf-bg: #ffffff;
|
|
738
|
+
--vf-bg-muted: #f5f5f5;
|
|
739
|
+
--vf-bg-hover: #f0f0f0;
|
|
740
|
+
--vf-border: #e5e5e5;
|
|
741
|
+
--vf-text: #0a0a0a;
|
|
742
|
+
--vf-text-muted: #737373;
|
|
743
|
+
--vf-primary: #171717;
|
|
744
|
+
--vf-primary-fg: #fafafa;
|
|
745
|
+
--vf-accent: #6366f1;
|
|
746
|
+
--vf-accent-fg: #ffffff;
|
|
747
|
+
--vf-destructive: #ef4444;
|
|
748
|
+
--vf-radius: 6px;
|
|
749
|
+
--vf-radius-lg: 8px;
|
|
750
|
+
--vf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
751
|
+
'Helvetica Neue', Arial, sans-serif;
|
|
752
|
+
--vf-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
|
|
753
|
+
0 1px 2px -1px rgba(0, 0, 0, 0.1);
|
|
754
|
+
--vf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
755
|
+
0 4px 6px -4px rgba(0, 0, 0, 0.1);
|
|
756
|
+
--vf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
|
|
757
|
+
0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
758
|
+
}
|
|
759
|
+
`;
|
|
760
|
+
var qt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, V = (i, t, e, s) => {
|
|
761
|
+
for (var r = s > 1 ? void 0 : s ? Jt(t, e) : t, o = i.length - 1, n; o >= 0; o--)
|
|
762
|
+
(n = i[o]) && (r = (s ? n(t, e, r) : n(r)) || r);
|
|
763
|
+
return s && r && qt(t, e, r), r;
|
|
764
|
+
};
|
|
765
|
+
let C = class extends x {
|
|
766
|
+
constructor() {
|
|
767
|
+
super(...arguments), this.open = !1, this.flags = {}, this.configs = [], this.onFlagChange = () => {
|
|
768
|
+
this.syncFromStore();
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
connectedCallback() {
|
|
772
|
+
super.connectedCallback(), window.addEventListener("vibe-flags-changed", this.onFlagChange), this.syncFromStore();
|
|
773
|
+
}
|
|
774
|
+
disconnectedCallback() {
|
|
775
|
+
super.disconnectedCallback(), window.removeEventListener("vibe-flags-changed", this.onFlagChange);
|
|
776
|
+
}
|
|
777
|
+
syncFromStore() {
|
|
778
|
+
this.configs = m.getConfig(), this.flags = m.getAll();
|
|
779
|
+
}
|
|
780
|
+
toggleSidebar() {
|
|
781
|
+
this.open = !this.open;
|
|
782
|
+
}
|
|
783
|
+
closeSidebar() {
|
|
784
|
+
this.open = !1;
|
|
785
|
+
}
|
|
786
|
+
onToggle(i) {
|
|
787
|
+
const t = this.flags[i];
|
|
788
|
+
m.set(i, !t);
|
|
789
|
+
}
|
|
790
|
+
onSelect(i, t) {
|
|
791
|
+
const e = t.target;
|
|
792
|
+
m.set(i, e.value);
|
|
793
|
+
}
|
|
794
|
+
onReset() {
|
|
795
|
+
m.reset();
|
|
796
|
+
}
|
|
797
|
+
renderFlagIcon() {
|
|
798
|
+
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" y1="22" x2="4" y2="15"/></svg>`;
|
|
799
|
+
}
|
|
800
|
+
renderCloseIcon() {
|
|
801
|
+
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>`;
|
|
802
|
+
}
|
|
803
|
+
renderChevronDown() {
|
|
804
|
+
return f`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>`;
|
|
805
|
+
}
|
|
806
|
+
renderBooleanFlag(i) {
|
|
807
|
+
const t = this.flags[i.key] === !0;
|
|
808
|
+
return f`
|
|
809
|
+
<div class="flag-item">
|
|
810
|
+
<div class="flag-row">
|
|
811
|
+
<div class="flag-info">
|
|
812
|
+
<div class="flag-label">${i.label || i.key}</div>
|
|
813
|
+
<div class="flag-key">${i.key}</div>
|
|
814
|
+
</div>
|
|
815
|
+
<label class="toggle">
|
|
816
|
+
<input
|
|
817
|
+
type="checkbox"
|
|
818
|
+
.checked=${t}
|
|
819
|
+
@change=${() => this.onToggle(i.key)}
|
|
820
|
+
/>
|
|
821
|
+
<span class="toggle-track"></span>
|
|
822
|
+
<span class="toggle-thumb"></span>
|
|
823
|
+
</label>
|
|
824
|
+
</div>
|
|
825
|
+
</div>
|
|
826
|
+
`;
|
|
827
|
+
}
|
|
828
|
+
renderSelectFlag(i) {
|
|
829
|
+
if (i.type !== "select") return c;
|
|
830
|
+
const t = this.flags[i.key];
|
|
831
|
+
return f`
|
|
832
|
+
<div class="flag-item">
|
|
833
|
+
<div class="flag-row">
|
|
834
|
+
<div class="flag-info">
|
|
835
|
+
<div class="flag-label">${i.label || i.key}</div>
|
|
836
|
+
<div class="flag-key">${i.key}</div>
|
|
837
|
+
</div>
|
|
838
|
+
<div class="select-wrapper">
|
|
839
|
+
<select
|
|
840
|
+
class="select"
|
|
841
|
+
.value=${t}
|
|
842
|
+
@change=${(e) => this.onSelect(i.key, e)}
|
|
843
|
+
>
|
|
844
|
+
${i.options.map(
|
|
845
|
+
(e) => f`<option value=${e} ?selected=${e === t}>
|
|
846
|
+
${e}
|
|
847
|
+
</option>`
|
|
848
|
+
)}
|
|
849
|
+
</select>
|
|
850
|
+
<span class="select-chevron">${this.renderChevronDown()}</span>
|
|
851
|
+
</div>
|
|
852
|
+
</div>
|
|
853
|
+
</div>
|
|
854
|
+
`;
|
|
855
|
+
}
|
|
856
|
+
render() {
|
|
857
|
+
return f`
|
|
858
|
+
${this.open ? c : f`
|
|
859
|
+
<button class="fab" @click=${this.toggleSidebar} aria-label="Toggle feature flags">
|
|
860
|
+
${this.renderFlagIcon()}
|
|
861
|
+
</button>
|
|
862
|
+
`}
|
|
863
|
+
|
|
864
|
+
<div class="backdrop ${this.open ? "open" : ""}" @click=${this.closeSidebar}></div>
|
|
865
|
+
|
|
866
|
+
<div class="sidebar ${this.open ? "open" : ""}">
|
|
867
|
+
<div class="header">
|
|
868
|
+
<h2>
|
|
869
|
+
${this.renderFlagIcon()}
|
|
870
|
+
VibeFlags
|
|
871
|
+
<span class="badge">${this.configs.length}</span>
|
|
872
|
+
</h2>
|
|
873
|
+
<button class="close-btn" @click=${this.closeSidebar} aria-label="Close">
|
|
874
|
+
${this.renderCloseIcon()}
|
|
875
|
+
</button>
|
|
876
|
+
</div>
|
|
877
|
+
|
|
878
|
+
<div class="flags">
|
|
879
|
+
${this.configs.length === 0 ? f`<div class="empty">No flags configured</div>` : this.configs.map(
|
|
880
|
+
(i) => i.type === "boolean" ? this.renderBooleanFlag(i) : this.renderSelectFlag(i)
|
|
881
|
+
)}
|
|
882
|
+
</div>
|
|
883
|
+
|
|
884
|
+
<div class="footer">
|
|
885
|
+
<button class="reset-btn" @click=${this.onReset}>
|
|
886
|
+
Reset all to defaults
|
|
887
|
+
</button>
|
|
888
|
+
</div>
|
|
889
|
+
</div>
|
|
890
|
+
`;
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
C.styles = [
|
|
894
|
+
Wt,
|
|
895
|
+
dt`
|
|
896
|
+
* {
|
|
897
|
+
box-sizing: border-box;
|
|
898
|
+
margin: 0;
|
|
899
|
+
padding: 0;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.fab {
|
|
903
|
+
position: fixed;
|
|
904
|
+
right: 0;
|
|
905
|
+
top: 50%;
|
|
906
|
+
transform: translateY(-50%);
|
|
907
|
+
z-index: 99999;
|
|
908
|
+
width: 40px;
|
|
909
|
+
height: 44px;
|
|
910
|
+
border: 1px solid var(--vf-border);
|
|
911
|
+
border-right: none;
|
|
912
|
+
border-radius: var(--vf-radius-lg) 0 0 var(--vf-radius-lg);
|
|
913
|
+
background: var(--vf-bg);
|
|
914
|
+
color: var(--vf-text);
|
|
915
|
+
cursor: pointer;
|
|
916
|
+
display: flex;
|
|
917
|
+
align-items: center;
|
|
918
|
+
justify-content: center;
|
|
919
|
+
box-shadow: var(--vf-shadow-lg);
|
|
920
|
+
transition: all 0.2s ease;
|
|
921
|
+
font-family: var(--vf-font);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.fab:hover {
|
|
925
|
+
width: 46px;
|
|
926
|
+
background: var(--vf-bg-muted);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.fab svg {
|
|
930
|
+
width: 20px;
|
|
931
|
+
height: 20px;
|
|
932
|
+
flex-shrink: 0;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.backdrop {
|
|
936
|
+
position: fixed;
|
|
937
|
+
inset: 0;
|
|
938
|
+
z-index: 100000;
|
|
939
|
+
background: rgba(0, 0, 0, 0.4);
|
|
940
|
+
opacity: 0;
|
|
941
|
+
transition: opacity 0.3s ease;
|
|
942
|
+
pointer-events: none;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.backdrop.open {
|
|
946
|
+
opacity: 1;
|
|
947
|
+
pointer-events: auto;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.sidebar {
|
|
951
|
+
position: fixed;
|
|
952
|
+
top: 0;
|
|
953
|
+
right: 0;
|
|
954
|
+
bottom: 0;
|
|
955
|
+
z-index: 100001;
|
|
956
|
+
width: 340px;
|
|
957
|
+
max-width: 90vw;
|
|
958
|
+
background: var(--vf-bg);
|
|
959
|
+
border-left: 1px solid var(--vf-border);
|
|
960
|
+
box-shadow: var(--vf-shadow-xl);
|
|
961
|
+
transform: translateX(100%);
|
|
962
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
963
|
+
display: flex;
|
|
964
|
+
flex-direction: column;
|
|
965
|
+
font-family: var(--vf-font);
|
|
966
|
+
color: var(--vf-text);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.sidebar.open {
|
|
970
|
+
transform: translateX(0);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.header {
|
|
974
|
+
display: flex;
|
|
975
|
+
align-items: center;
|
|
976
|
+
justify-content: space-between;
|
|
977
|
+
padding: 16px 20px;
|
|
978
|
+
border-bottom: 1px solid var(--vf-border);
|
|
979
|
+
flex-shrink: 0;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.header h2 {
|
|
983
|
+
font-size: 16px;
|
|
984
|
+
font-weight: 600;
|
|
985
|
+
letter-spacing: -0.025em;
|
|
986
|
+
display: flex;
|
|
987
|
+
align-items: center;
|
|
988
|
+
gap: 8px;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.header h2 svg {
|
|
992
|
+
width: 18px;
|
|
993
|
+
height: 18px;
|
|
994
|
+
color: var(--vf-accent);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.badge {
|
|
998
|
+
font-size: 11px;
|
|
999
|
+
font-weight: 500;
|
|
1000
|
+
padding: 2px 7px;
|
|
1001
|
+
border-radius: 9999px;
|
|
1002
|
+
background: var(--vf-bg-muted);
|
|
1003
|
+
color: var(--vf-text-muted);
|
|
1004
|
+
border: 1px solid var(--vf-border);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.close-btn {
|
|
1008
|
+
width: 32px;
|
|
1009
|
+
height: 32px;
|
|
1010
|
+
border: none;
|
|
1011
|
+
border-radius: var(--vf-radius);
|
|
1012
|
+
background: transparent;
|
|
1013
|
+
color: var(--vf-text-muted);
|
|
1014
|
+
cursor: pointer;
|
|
1015
|
+
display: flex;
|
|
1016
|
+
align-items: center;
|
|
1017
|
+
justify-content: center;
|
|
1018
|
+
transition: all 0.15s ease;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.close-btn:hover {
|
|
1022
|
+
background: var(--vf-bg-muted);
|
|
1023
|
+
color: var(--vf-text);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.close-btn svg {
|
|
1027
|
+
width: 16px;
|
|
1028
|
+
height: 16px;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.flags {
|
|
1032
|
+
flex: 1;
|
|
1033
|
+
overflow-y: auto;
|
|
1034
|
+
padding: 8px 0;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.flag-item {
|
|
1038
|
+
padding: 12px 20px;
|
|
1039
|
+
transition: background 0.1s ease;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
.flag-item:hover {
|
|
1043
|
+
background: var(--vf-bg-muted);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
.flag-item + .flag-item {
|
|
1047
|
+
border-top: 1px solid var(--vf-border);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
.flag-label {
|
|
1051
|
+
font-size: 13px;
|
|
1052
|
+
font-weight: 500;
|
|
1053
|
+
margin-bottom: 2px;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.flag-key {
|
|
1057
|
+
font-size: 11px;
|
|
1058
|
+
color: var(--vf-text-muted);
|
|
1059
|
+
font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas,
|
|
1060
|
+
monospace;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.flag-row {
|
|
1064
|
+
display: flex;
|
|
1065
|
+
align-items: center;
|
|
1066
|
+
justify-content: space-between;
|
|
1067
|
+
gap: 12px;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
.flag-info {
|
|
1071
|
+
min-width: 0;
|
|
1072
|
+
flex: 1;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/* Toggle switch */
|
|
1076
|
+
.toggle {
|
|
1077
|
+
position: relative;
|
|
1078
|
+
width: 40px;
|
|
1079
|
+
height: 22px;
|
|
1080
|
+
flex-shrink: 0;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.toggle input {
|
|
1084
|
+
opacity: 0;
|
|
1085
|
+
width: 0;
|
|
1086
|
+
height: 0;
|
|
1087
|
+
position: absolute;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.toggle-track {
|
|
1091
|
+
position: absolute;
|
|
1092
|
+
inset: 0;
|
|
1093
|
+
border-radius: 11px;
|
|
1094
|
+
background: var(--vf-border);
|
|
1095
|
+
cursor: pointer;
|
|
1096
|
+
transition: background 0.2s ease;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.toggle input:checked + .toggle-track {
|
|
1100
|
+
background: var(--vf-primary);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.toggle-thumb {
|
|
1104
|
+
position: absolute;
|
|
1105
|
+
top: 2px;
|
|
1106
|
+
left: 2px;
|
|
1107
|
+
width: 18px;
|
|
1108
|
+
height: 18px;
|
|
1109
|
+
border-radius: 50%;
|
|
1110
|
+
background: white;
|
|
1111
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
1112
|
+
transition: transform 0.2s ease;
|
|
1113
|
+
pointer-events: none;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
.toggle input:checked ~ .toggle-thumb {
|
|
1117
|
+
transform: translateX(18px);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/* Select dropdown */
|
|
1121
|
+
.select-wrapper {
|
|
1122
|
+
position: relative;
|
|
1123
|
+
flex-shrink: 0;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
.select {
|
|
1127
|
+
appearance: none;
|
|
1128
|
+
-webkit-appearance: none;
|
|
1129
|
+
font-size: 13px;
|
|
1130
|
+
font-family: var(--vf-font);
|
|
1131
|
+
padding: 6px 30px 6px 10px;
|
|
1132
|
+
border: 1px solid var(--vf-border);
|
|
1133
|
+
border-radius: var(--vf-radius);
|
|
1134
|
+
background: var(--vf-bg);
|
|
1135
|
+
color: var(--vf-text);
|
|
1136
|
+
cursor: pointer;
|
|
1137
|
+
outline: none;
|
|
1138
|
+
min-width: 100px;
|
|
1139
|
+
transition: border-color 0.15s ease;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
.select:hover {
|
|
1143
|
+
border-color: var(--vf-text-muted);
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
.select:focus {
|
|
1147
|
+
border-color: var(--vf-accent);
|
|
1148
|
+
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
.select-chevron {
|
|
1152
|
+
position: absolute;
|
|
1153
|
+
right: 8px;
|
|
1154
|
+
top: 50%;
|
|
1155
|
+
transform: translateY(-50%);
|
|
1156
|
+
pointer-events: none;
|
|
1157
|
+
color: var(--vf-text-muted);
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
.select-chevron svg {
|
|
1161
|
+
width: 14px;
|
|
1162
|
+
height: 14px;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/* Footer */
|
|
1166
|
+
.footer {
|
|
1167
|
+
padding: 12px 20px;
|
|
1168
|
+
border-top: 1px solid var(--vf-border);
|
|
1169
|
+
flex-shrink: 0;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
.reset-btn {
|
|
1173
|
+
width: 100%;
|
|
1174
|
+
padding: 8px 16px;
|
|
1175
|
+
font-size: 13px;
|
|
1176
|
+
font-weight: 500;
|
|
1177
|
+
font-family: var(--vf-font);
|
|
1178
|
+
border: 1px solid var(--vf-border);
|
|
1179
|
+
border-radius: var(--vf-radius);
|
|
1180
|
+
background: var(--vf-bg);
|
|
1181
|
+
color: var(--vf-text);
|
|
1182
|
+
cursor: pointer;
|
|
1183
|
+
transition: all 0.15s ease;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
.reset-btn:hover {
|
|
1187
|
+
background: var(--vf-bg-muted);
|
|
1188
|
+
border-color: var(--vf-text-muted);
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
.empty {
|
|
1192
|
+
padding: 40px 20px;
|
|
1193
|
+
text-align: center;
|
|
1194
|
+
color: var(--vf-text-muted);
|
|
1195
|
+
font-size: 13px;
|
|
1196
|
+
}
|
|
1197
|
+
`
|
|
1198
|
+
];
|
|
1199
|
+
V([
|
|
1200
|
+
L()
|
|
1201
|
+
], C.prototype, "open", 2);
|
|
1202
|
+
V([
|
|
1203
|
+
L()
|
|
1204
|
+
], C.prototype, "flags", 2);
|
|
1205
|
+
V([
|
|
1206
|
+
L()
|
|
1207
|
+
], C.prototype, "configs", 2);
|
|
1208
|
+
C = V([
|
|
1209
|
+
Y("vibe-toolbar")
|
|
1210
|
+
], C);
|
|
1211
|
+
export {
|
|
1212
|
+
g as VibeFlag,
|
|
1213
|
+
ht as VibeFlags,
|
|
1214
|
+
C as VibeToolbar,
|
|
1215
|
+
m as flagStore
|
|
1216
|
+
};
|