@halo-dev/shiki-code-element 1.1.0 → 1.2.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.js +259 -259
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
var tailwind_default = "*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before,:after{--un-content:\"\"}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}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-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;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}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}", t$2 = globalThis, e$4 = t$2.ShadowRoot && (t$2.ShadyCSS === void 0 || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$5 = /* @__PURE__ */ new WeakMap(), n$4 = class {
|
|
2
|
-
constructor(y,
|
|
3
|
-
if (this._$cssResult$ = !0,
|
|
4
|
-
this.cssText = y, this.t =
|
|
2
|
+
constructor(y, b, w) {
|
|
3
|
+
if (this._$cssResult$ = !0, w !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
4
|
+
this.cssText = y, this.t = b;
|
|
5
5
|
}
|
|
6
6
|
get styleSheet() {
|
|
7
|
-
let y = this.o,
|
|
7
|
+
let y = this.o, b = this.t;
|
|
8
8
|
if (e$4 && y === void 0) {
|
|
9
|
-
let
|
|
10
|
-
|
|
9
|
+
let w = b !== void 0 && b.length === 1;
|
|
10
|
+
w && (y = o$5.get(b)), y === void 0 && ((this.o = y = new CSSStyleSheet()).replaceSync(this.cssText), w && o$5.set(b, y));
|
|
11
11
|
}
|
|
12
12
|
return y;
|
|
13
13
|
}
|
|
14
14
|
toString() {
|
|
15
15
|
return this.cssText;
|
|
16
16
|
}
|
|
17
|
-
}, r$4 = (y) => new n$4(typeof y == "string" ? y : y + "", void 0, s$2), i$4 = (y, ...
|
|
17
|
+
}, r$4 = (y) => new n$4(typeof y == "string" ? y : y + "", void 0, s$2), i$4 = (y, ...b) => new n$4(y.length === 1 ? y[0] : b.reduce(((b, w, D) => b + ((y) => {
|
|
18
18
|
if (!0 === y._$cssResult$) return y.cssText;
|
|
19
19
|
if (typeof y == "number") return y;
|
|
20
20
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + y + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
21
|
-
})(
|
|
22
|
-
if (e$4) y.adoptedStyleSheets =
|
|
23
|
-
else for (let
|
|
24
|
-
let
|
|
25
|
-
|
|
21
|
+
})(w) + y[D + 1]), y[0]), y, s$2), S$1 = (y, D) => {
|
|
22
|
+
if (e$4) y.adoptedStyleSheets = D.map(((y) => y instanceof CSSStyleSheet ? y : y.styleSheet));
|
|
23
|
+
else for (let w of D) {
|
|
24
|
+
let D = document.createElement("style"), O = t$2.litNonce;
|
|
25
|
+
O !== void 0 && D.setAttribute("nonce", O), D.textContent = w.cssText, y.appendChild(D);
|
|
26
26
|
}
|
|
27
27
|
}, c$2 = e$4 ? (y) => y : (y) => y instanceof CSSStyleSheet ? ((y) => {
|
|
28
|
-
let
|
|
29
|
-
for (let
|
|
30
|
-
return r$4(
|
|
31
|
-
})(y) : y, { is: i$3, defineProperty: e$3, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$3, getOwnPropertySymbols: o$4, getPrototypeOf: n$3 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (y,
|
|
32
|
-
toAttribute(y,
|
|
33
|
-
switch (
|
|
28
|
+
let b = "";
|
|
29
|
+
for (let w of y.cssRules) b += w.cssText;
|
|
30
|
+
return r$4(b);
|
|
31
|
+
})(y) : y, { is: i$3, defineProperty: e$3, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$3, getOwnPropertySymbols: o$4, getPrototypeOf: n$3 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (y, b) => y, u$1 = {
|
|
32
|
+
toAttribute(y, b) {
|
|
33
|
+
switch (b) {
|
|
34
34
|
case Boolean:
|
|
35
35
|
y = y ? l$1 : null;
|
|
36
36
|
break;
|
|
@@ -39,25 +39,25 @@ var tailwind_default = "*,:before,:after{box-sizing:border-box;border-style:soli
|
|
|
39
39
|
}
|
|
40
40
|
return y;
|
|
41
41
|
},
|
|
42
|
-
fromAttribute(y,
|
|
43
|
-
let
|
|
44
|
-
switch (
|
|
42
|
+
fromAttribute(y, b) {
|
|
43
|
+
let w = y;
|
|
44
|
+
switch (b) {
|
|
45
45
|
case Boolean:
|
|
46
|
-
|
|
46
|
+
w = y !== null;
|
|
47
47
|
break;
|
|
48
48
|
case Number:
|
|
49
|
-
|
|
49
|
+
w = y === null ? null : Number(y);
|
|
50
50
|
break;
|
|
51
51
|
case Object:
|
|
52
52
|
case Array: try {
|
|
53
|
-
|
|
53
|
+
w = JSON.parse(y);
|
|
54
54
|
} catch {
|
|
55
|
-
|
|
55
|
+
w = null;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return w;
|
|
59
59
|
}
|
|
60
|
-
}, f$1 = (y,
|
|
60
|
+
}, f$1 = (y, b) => !i$3(y, b), b$1 = {
|
|
61
61
|
attribute: !0,
|
|
62
62
|
type: String,
|
|
63
63
|
converter: u$1,
|
|
@@ -73,26 +73,26 @@ var y$1 = class extends HTMLElement {
|
|
|
73
73
|
static get observedAttributes() {
|
|
74
74
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
75
75
|
}
|
|
76
|
-
static createProperty(y,
|
|
77
|
-
if (
|
|
78
|
-
let
|
|
79
|
-
|
|
76
|
+
static createProperty(y, b = b$1) {
|
|
77
|
+
if (b.state && (b.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(y) && ((b = Object.create(b)).wrapped = !0), this.elementProperties.set(y, b), !b.noAccessor) {
|
|
78
|
+
let w = Symbol(), D = this.getPropertyDescriptor(y, w, b);
|
|
79
|
+
D !== void 0 && e$3(this.prototype, y, D);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
static getPropertyDescriptor(y,
|
|
83
|
-
let { get:
|
|
82
|
+
static getPropertyDescriptor(y, b, w) {
|
|
83
|
+
let { get: D, set: O } = h$1(this.prototype, y) ?? {
|
|
84
84
|
get() {
|
|
85
|
-
return this[
|
|
85
|
+
return this[b];
|
|
86
86
|
},
|
|
87
87
|
set(y) {
|
|
88
|
-
this[
|
|
88
|
+
this[b] = y;
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
return {
|
|
92
|
-
get:
|
|
93
|
-
set(
|
|
94
|
-
let
|
|
95
|
-
|
|
92
|
+
get: D,
|
|
93
|
+
set(b) {
|
|
94
|
+
let F = D?.call(this);
|
|
95
|
+
O?.call(this, b), this.requestUpdate(y, F, w);
|
|
96
96
|
},
|
|
97
97
|
configurable: !0,
|
|
98
98
|
enumerable: !0
|
|
@@ -109,32 +109,32 @@ var y$1 = class extends HTMLElement {
|
|
|
109
109
|
static finalize() {
|
|
110
110
|
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
111
111
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
112
|
-
let y = this.properties,
|
|
113
|
-
for (let
|
|
112
|
+
let y = this.properties, b = [...r$3(y), ...o$4(y)];
|
|
113
|
+
for (let w of b) this.createProperty(w, y[w]);
|
|
114
114
|
}
|
|
115
115
|
let y = this[Symbol.metadata];
|
|
116
116
|
if (y !== null) {
|
|
117
|
-
let
|
|
118
|
-
if (
|
|
117
|
+
let b = litPropertyMetadata.get(y);
|
|
118
|
+
if (b !== void 0) for (let [y, w] of b) this.elementProperties.set(y, w);
|
|
119
119
|
}
|
|
120
120
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
121
|
-
for (let [y,
|
|
122
|
-
let
|
|
123
|
-
|
|
121
|
+
for (let [y, b] of this.elementProperties) {
|
|
122
|
+
let w = this._$Eu(y, b);
|
|
123
|
+
w !== void 0 && this._$Eh.set(w, y);
|
|
124
124
|
}
|
|
125
125
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
126
126
|
}
|
|
127
127
|
static finalizeStyles(y) {
|
|
128
|
-
let
|
|
128
|
+
let b = [];
|
|
129
129
|
if (Array.isArray(y)) {
|
|
130
|
-
let
|
|
131
|
-
for (let y of
|
|
132
|
-
} else y !== void 0 &&
|
|
133
|
-
return
|
|
130
|
+
let w = new Set(y.flat(Infinity).reverse());
|
|
131
|
+
for (let y of w) b.unshift(c$2(y));
|
|
132
|
+
} else y !== void 0 && b.push(c$2(y));
|
|
133
|
+
return b;
|
|
134
134
|
}
|
|
135
|
-
static _$Eu(y,
|
|
136
|
-
let
|
|
137
|
-
return !1 ===
|
|
135
|
+
static _$Eu(y, b) {
|
|
136
|
+
let w = b.attribute;
|
|
137
|
+
return !1 === w ? void 0 : typeof w == "string" ? w : typeof y == "string" ? y.toLowerCase() : void 0;
|
|
138
138
|
}
|
|
139
139
|
constructor() {
|
|
140
140
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -149,8 +149,8 @@ var y$1 = class extends HTMLElement {
|
|
|
149
149
|
this._$EO?.delete(y);
|
|
150
150
|
}
|
|
151
151
|
_$E_() {
|
|
152
|
-
let y = /* @__PURE__ */ new Map(),
|
|
153
|
-
for (let
|
|
152
|
+
let y = /* @__PURE__ */ new Map(), b = this.constructor.elementProperties;
|
|
153
|
+
for (let w of b.keys()) this.hasOwnProperty(w) && (y.set(w, this[w]), delete this[w]);
|
|
154
154
|
y.size > 0 && (this._$Ep = y);
|
|
155
155
|
}
|
|
156
156
|
createRenderRoot() {
|
|
@@ -164,35 +164,35 @@ var y$1 = class extends HTMLElement {
|
|
|
164
164
|
disconnectedCallback() {
|
|
165
165
|
this._$EO?.forEach(((y) => y.hostDisconnected?.()));
|
|
166
166
|
}
|
|
167
|
-
attributeChangedCallback(y,
|
|
168
|
-
this._$AK(y,
|
|
167
|
+
attributeChangedCallback(y, b, w) {
|
|
168
|
+
this._$AK(y, w);
|
|
169
169
|
}
|
|
170
|
-
_$ET(y,
|
|
171
|
-
let
|
|
172
|
-
if (
|
|
173
|
-
let
|
|
174
|
-
this._$Em = y,
|
|
170
|
+
_$ET(y, b) {
|
|
171
|
+
let w = this.constructor.elementProperties.get(y), D = this.constructor._$Eu(y, w);
|
|
172
|
+
if (D !== void 0 && !0 === w.reflect) {
|
|
173
|
+
let O = (w.converter?.toAttribute === void 0 ? u$1 : w.converter).toAttribute(b, w.type);
|
|
174
|
+
this._$Em = y, O == null ? this.removeAttribute(D) : this.setAttribute(D, O), this._$Em = null;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
_$AK(y,
|
|
178
|
-
let
|
|
179
|
-
if (
|
|
180
|
-
let y =
|
|
181
|
-
this._$Em =
|
|
182
|
-
let
|
|
183
|
-
this[
|
|
177
|
+
_$AK(y, b) {
|
|
178
|
+
let w = this.constructor, D = w._$Eh.get(y);
|
|
179
|
+
if (D !== void 0 && this._$Em !== D) {
|
|
180
|
+
let y = w.getPropertyOptions(D), O = typeof y.converter == "function" ? { fromAttribute: y.converter } : y.converter?.fromAttribute === void 0 ? u$1 : y.converter;
|
|
181
|
+
this._$Em = D;
|
|
182
|
+
let F = O.fromAttribute(b, y.type);
|
|
183
|
+
this[D] = F ?? this._$Ej?.get(D) ?? F, this._$Em = null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
requestUpdate(y,
|
|
186
|
+
requestUpdate(y, b, w) {
|
|
187
187
|
if (y !== void 0) {
|
|
188
|
-
let
|
|
189
|
-
if (
|
|
190
|
-
this.C(y,
|
|
188
|
+
let D = this.constructor, O = this[y];
|
|
189
|
+
if (w ??= D.getPropertyOptions(y), !((w.hasChanged ?? f$1)(O, b) || w.useDefault && w.reflect && O === this._$Ej?.get(y) && !this.hasAttribute(D._$Eu(y, w)))) return;
|
|
190
|
+
this.C(y, b, w);
|
|
191
191
|
}
|
|
192
192
|
!1 === this.isUpdatePending && (this._$ES = this._$EP());
|
|
193
193
|
}
|
|
194
|
-
C(y,
|
|
195
|
-
|
|
194
|
+
C(y, b, { useDefault: w, reflect: D, wrapped: O }, F) {
|
|
195
|
+
w && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(y) && (this._$Ej.set(y, F ?? b ?? this[y]), !0 !== O || F !== void 0) || (this._$AL.has(y) || (this.hasUpdated || w || (b = void 0), this._$AL.set(y, b)), !0 === D && this._$Em !== y && (this._$Eq ??= /* @__PURE__ */ new Set()).add(y));
|
|
196
196
|
}
|
|
197
197
|
async _$EP() {
|
|
198
198
|
this.isUpdatePending = !0;
|
|
@@ -211,22 +211,22 @@ var y$1 = class extends HTMLElement {
|
|
|
211
211
|
if (!this.isUpdatePending) return;
|
|
212
212
|
if (!this.hasUpdated) {
|
|
213
213
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
214
|
-
for (let [y,
|
|
214
|
+
for (let [y, b] of this._$Ep) this[y] = b;
|
|
215
215
|
this._$Ep = void 0;
|
|
216
216
|
}
|
|
217
217
|
let y = this.constructor.elementProperties;
|
|
218
|
-
if (y.size > 0) for (let [
|
|
219
|
-
let { wrapped: y } =
|
|
220
|
-
!0 !== y || this._$AL.has(
|
|
218
|
+
if (y.size > 0) for (let [b, w] of y) {
|
|
219
|
+
let { wrapped: y } = w, D = this[b];
|
|
220
|
+
!0 !== y || this._$AL.has(b) || D === void 0 || this.C(b, void 0, w, D);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
let y = !1,
|
|
223
|
+
let y = !1, b = this._$AL;
|
|
224
224
|
try {
|
|
225
|
-
y = this.shouldUpdate(
|
|
226
|
-
} catch (
|
|
227
|
-
throw y = !1, this._$EM(),
|
|
225
|
+
y = this.shouldUpdate(b), y ? (this.willUpdate(b), this._$EO?.forEach(((y) => y.hostUpdate?.())), this.update(b)) : this._$EM();
|
|
226
|
+
} catch (b) {
|
|
227
|
+
throw y = !1, this._$EM(), b;
|
|
228
228
|
}
|
|
229
|
-
y && this._$AE(
|
|
229
|
+
y && this._$AE(b);
|
|
230
230
|
}
|
|
231
231
|
willUpdate(y) {}
|
|
232
232
|
_$AE(y) {
|
|
@@ -256,86 +256,86 @@ y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("eleme
|
|
|
256
256
|
* Copyright 2017 Google LLC
|
|
257
257
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
258
258
|
*/
|
|
259
|
-
var t$1 = globalThis, i$2 = t$1.trustedTypes, s$1 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (y) => y }) : void 0, e$2 = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$3 = "?" + h, n$2 = `<${o$3}>`, r$2 = document, l = () => r$2.createComment(""), c = (y) => y === null || typeof y != "object" && typeof y != "function", a = Array.isArray, u = (y) => a(y) || typeof y?.[Symbol.iterator] == "function", d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, x = ((y) => (
|
|
259
|
+
var t$1 = globalThis, i$2 = t$1.trustedTypes, s$1 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (y) => y }) : void 0, e$2 = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$3 = "?" + h, n$2 = `<${o$3}>`, r$2 = document, l = () => r$2.createComment(""), c = (y) => y === null || typeof y != "object" && typeof y != "function", a = Array.isArray, u = (y) => a(y) || typeof y?.[Symbol.iterator] == "function", d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, x = ((y) => (b, ...w) => ({
|
|
260
260
|
_$litType$: y,
|
|
261
|
-
strings:
|
|
262
|
-
values:
|
|
261
|
+
strings: b,
|
|
262
|
+
values: w
|
|
263
263
|
}))(1), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r$2.createTreeWalker(r$2, 129);
|
|
264
|
-
function P(y,
|
|
264
|
+
function P(y, b) {
|
|
265
265
|
if (!a(y) || !y.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
266
|
-
return s$1 === void 0 ?
|
|
266
|
+
return s$1 === void 0 ? b : s$1.createHTML(b);
|
|
267
267
|
}
|
|
268
|
-
var V = (y,
|
|
269
|
-
let
|
|
270
|
-
for (let
|
|
271
|
-
let
|
|
272
|
-
for (;
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
return [P(y,
|
|
268
|
+
var V = (y, b) => {
|
|
269
|
+
let w = y.length - 1, D = [], O, F = b === 2 ? "<svg>" : b === 3 ? "<math>" : "", U = f;
|
|
270
|
+
for (let b = 0; b < w; b++) {
|
|
271
|
+
let w = y[b], W, G, K = -1, q = 0;
|
|
272
|
+
for (; q < w.length && (U.lastIndex = q, G = U.exec(w), G !== null);) q = U.lastIndex, U === f ? G[1] === "!--" ? U = v : G[1] === void 0 ? G[2] === void 0 ? G[3] !== void 0 && (U = m) : ($.test(G[2]) && (O = RegExp("</" + G[2], "g")), U = m) : U = _ : U === m ? G[0] === ">" ? (U = O ?? f, K = -1) : G[1] === void 0 ? K = -2 : (K = U.lastIndex - G[2].length, W = G[1], U = G[3] === void 0 ? m : G[3] === "\"" ? g : p) : U === g || U === p ? U = m : U === v || U === _ ? U = f : (U = m, O = void 0);
|
|
273
|
+
let J = U === m && y[b + 1].startsWith("/>") ? " " : "";
|
|
274
|
+
F += U === f ? w + n$2 : K >= 0 ? (D.push(W), w.slice(0, K) + e$2 + w.slice(K) + h + J) : w + h + (K === -2 ? b : J);
|
|
275
|
+
}
|
|
276
|
+
return [P(y, F + (y[w] || "<?>") + (b === 2 ? "</svg>" : b === 3 ? "</math>" : "")), D];
|
|
277
277
|
}, N = class y {
|
|
278
|
-
constructor({ strings:
|
|
279
|
-
let
|
|
278
|
+
constructor({ strings: b, _$litType$: w }, D) {
|
|
279
|
+
let O;
|
|
280
280
|
this.parts = [];
|
|
281
|
-
let
|
|
282
|
-
if (this.el = y.createElement(
|
|
281
|
+
let F = 0, U = 0, W = b.length - 1, G = this.parts, [K, q] = V(b, w);
|
|
282
|
+
if (this.el = y.createElement(K, D), C.currentNode = this.el.content, w === 2 || w === 3) {
|
|
283
283
|
let y = this.el.content.firstChild;
|
|
284
284
|
y.replaceWith(...y.childNodes);
|
|
285
285
|
}
|
|
286
|
-
for (; (
|
|
287
|
-
if (
|
|
288
|
-
if (
|
|
289
|
-
let
|
|
290
|
-
|
|
286
|
+
for (; (O = C.nextNode()) !== null && G.length < W;) {
|
|
287
|
+
if (O.nodeType === 1) {
|
|
288
|
+
if (O.hasAttributes()) for (let y of O.getAttributeNames()) if (y.endsWith(e$2)) {
|
|
289
|
+
let b = q[U++], w = O.getAttribute(y).split(h), D = /([.?@])?(.*)/.exec(b);
|
|
290
|
+
G.push({
|
|
291
291
|
type: 1,
|
|
292
|
-
index:
|
|
293
|
-
name:
|
|
294
|
-
strings:
|
|
295
|
-
ctor:
|
|
296
|
-
}),
|
|
297
|
-
} else y.startsWith(h) && (
|
|
292
|
+
index: F,
|
|
293
|
+
name: D[2],
|
|
294
|
+
strings: w,
|
|
295
|
+
ctor: D[1] === "." ? H : D[1] === "?" ? I : D[1] === "@" ? L : k
|
|
296
|
+
}), O.removeAttribute(y);
|
|
297
|
+
} else y.startsWith(h) && (G.push({
|
|
298
298
|
type: 6,
|
|
299
|
-
index:
|
|
300
|
-
}),
|
|
301
|
-
if ($.test(
|
|
302
|
-
let y =
|
|
303
|
-
if (
|
|
304
|
-
|
|
305
|
-
for (let
|
|
299
|
+
index: F
|
|
300
|
+
}), O.removeAttribute(y));
|
|
301
|
+
if ($.test(O.tagName)) {
|
|
302
|
+
let y = O.textContent.split(h), b = y.length - 1;
|
|
303
|
+
if (b > 0) {
|
|
304
|
+
O.textContent = i$2 ? i$2.emptyScript : "";
|
|
305
|
+
for (let w = 0; w < b; w++) O.append(y[w], l()), C.nextNode(), G.push({
|
|
306
306
|
type: 2,
|
|
307
|
-
index: ++
|
|
307
|
+
index: ++F
|
|
308
308
|
});
|
|
309
|
-
|
|
309
|
+
O.append(y[b], l());
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
} else if (
|
|
312
|
+
} else if (O.nodeType === 8) if (O.data === o$3) G.push({
|
|
313
313
|
type: 2,
|
|
314
|
-
index:
|
|
314
|
+
index: F
|
|
315
315
|
});
|
|
316
316
|
else {
|
|
317
317
|
let y = -1;
|
|
318
|
-
for (; (y =
|
|
318
|
+
for (; (y = O.data.indexOf(h, y + 1)) !== -1;) G.push({
|
|
319
319
|
type: 7,
|
|
320
|
-
index:
|
|
320
|
+
index: F
|
|
321
321
|
}), y += h.length - 1;
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
F++;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
static createElement(y,
|
|
327
|
-
let
|
|
328
|
-
return
|
|
326
|
+
static createElement(y, b) {
|
|
327
|
+
let w = r$2.createElement("template");
|
|
328
|
+
return w.innerHTML = y, w;
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
|
-
function S(y,
|
|
332
|
-
if (
|
|
333
|
-
let
|
|
334
|
-
return
|
|
331
|
+
function S(y, b, w = y, D) {
|
|
332
|
+
if (b === T) return b;
|
|
333
|
+
let O = D === void 0 ? w._$Cl : w._$Co?.[D], F = c(b) ? void 0 : b._$litDirective$;
|
|
334
|
+
return O?.constructor !== F && (O?._$AO?.(!1), F === void 0 ? O = void 0 : (O = new F(y), O._$AT(y, w, D)), D === void 0 ? w._$Cl = O : (w._$Co ??= [])[D] = O), O !== void 0 && (b = S(y, O._$AS(y, b.values), O, D)), b;
|
|
335
335
|
}
|
|
336
336
|
var M = class {
|
|
337
|
-
constructor(y,
|
|
338
|
-
this._$AV = [], this._$AN = void 0, this._$AD = y, this._$AM =
|
|
337
|
+
constructor(y, b) {
|
|
338
|
+
this._$AV = [], this._$AN = void 0, this._$AD = y, this._$AM = b;
|
|
339
339
|
}
|
|
340
340
|
get parentNode() {
|
|
341
341
|
return this._$AM.parentNode;
|
|
@@ -344,32 +344,32 @@ var M = class {
|
|
|
344
344
|
return this._$AM._$AU;
|
|
345
345
|
}
|
|
346
346
|
u(y) {
|
|
347
|
-
let { el: { content:
|
|
348
|
-
C.currentNode =
|
|
349
|
-
let
|
|
350
|
-
for (;
|
|
351
|
-
if (
|
|
352
|
-
let
|
|
353
|
-
|
|
347
|
+
let { el: { content: b }, parts: w } = this._$AD, D = (y?.creationScope ?? r$2).importNode(b, !0);
|
|
348
|
+
C.currentNode = D;
|
|
349
|
+
let O = C.nextNode(), F = 0, U = 0, W = w[0];
|
|
350
|
+
for (; W !== void 0;) {
|
|
351
|
+
if (F === W.index) {
|
|
352
|
+
let b;
|
|
353
|
+
W.type === 2 ? b = new R(O, O.nextSibling, this, y) : W.type === 1 ? b = new W.ctor(O, W.name, W.strings, this, y) : W.type === 6 && (b = new z(O, this, y)), this._$AV.push(b), W = w[++U];
|
|
354
354
|
}
|
|
355
|
-
|
|
355
|
+
F !== W?.index && (O = C.nextNode(), F++);
|
|
356
356
|
}
|
|
357
|
-
return C.currentNode = r$2,
|
|
357
|
+
return C.currentNode = r$2, D;
|
|
358
358
|
}
|
|
359
359
|
p(y) {
|
|
360
|
-
let
|
|
361
|
-
for (let
|
|
360
|
+
let b = 0;
|
|
361
|
+
for (let w of this._$AV) w !== void 0 && (w.strings === void 0 ? w._$AI(y[b]) : (w._$AI(y, w, b), b += w.strings.length - 2)), b++;
|
|
362
362
|
}
|
|
363
363
|
}, R = class y {
|
|
364
364
|
get _$AU() {
|
|
365
365
|
return this._$AM?._$AU ?? this._$Cv;
|
|
366
366
|
}
|
|
367
|
-
constructor(y,
|
|
368
|
-
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = y, this._$AB =
|
|
367
|
+
constructor(y, b, w, D) {
|
|
368
|
+
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = y, this._$AB = b, this._$AM = w, this.options = D, this._$Cv = D?.isConnected ?? !0;
|
|
369
369
|
}
|
|
370
370
|
get parentNode() {
|
|
371
|
-
let y = this._$AA.parentNode,
|
|
372
|
-
return
|
|
371
|
+
let y = this._$AA.parentNode, b = this._$AM;
|
|
372
|
+
return b !== void 0 && y?.nodeType === 11 && (y = b.parentNode), y;
|
|
373
373
|
}
|
|
374
374
|
get startNode() {
|
|
375
375
|
return this._$AA;
|
|
@@ -377,8 +377,8 @@ var M = class {
|
|
|
377
377
|
get endNode() {
|
|
378
378
|
return this._$AB;
|
|
379
379
|
}
|
|
380
|
-
_$AI(y,
|
|
381
|
-
y = S(this, y,
|
|
380
|
+
_$AI(y, b = this) {
|
|
381
|
+
y = S(this, y, b), c(y) ? y === E || y == null || y === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : y !== this._$AH && y !== T && this._(y) : y._$litType$ === void 0 ? y.nodeType === void 0 ? u(y) ? this.k(y) : this._(y) : this.T(y) : this.$(y);
|
|
382
382
|
}
|
|
383
383
|
O(y) {
|
|
384
384
|
return this._$AA.parentNode.insertBefore(y, this._$AB);
|
|
@@ -390,27 +390,27 @@ var M = class {
|
|
|
390
390
|
this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = y : this.T(r$2.createTextNode(y)), this._$AH = y;
|
|
391
391
|
}
|
|
392
392
|
$(y) {
|
|
393
|
-
let { values:
|
|
394
|
-
if (this._$AH?._$AD ===
|
|
393
|
+
let { values: b, _$litType$: w } = y, D = typeof w == "number" ? this._$AC(y) : (w.el === void 0 && (w.el = N.createElement(P(w.h, w.h[0]), this.options)), w);
|
|
394
|
+
if (this._$AH?._$AD === D) this._$AH.p(b);
|
|
395
395
|
else {
|
|
396
|
-
let y = new M(
|
|
397
|
-
y.p(
|
|
396
|
+
let y = new M(D, this), w = y.u(this.options);
|
|
397
|
+
y.p(b), this.T(w), this._$AH = y;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
_$AC(y) {
|
|
401
|
-
let
|
|
402
|
-
return
|
|
401
|
+
let b = A.get(y.strings);
|
|
402
|
+
return b === void 0 && A.set(y.strings, b = new N(y)), b;
|
|
403
403
|
}
|
|
404
|
-
k(
|
|
404
|
+
k(b) {
|
|
405
405
|
a(this._$AH) || (this._$AH = [], this._$AR());
|
|
406
|
-
let
|
|
407
|
-
for (let
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
_$AR(y = this._$AA.nextSibling,
|
|
411
|
-
for (this._$AP?.(!1, !0,
|
|
412
|
-
let
|
|
413
|
-
y.remove(), y =
|
|
406
|
+
let w = this._$AH, D, O = 0;
|
|
407
|
+
for (let F of b) O === w.length ? w.push(D = new y(this.O(l()), this.O(l()), this, this.options)) : D = w[O], D._$AI(F), O++;
|
|
408
|
+
O < w.length && (this._$AR(D && D._$AB.nextSibling, O), w.length = O);
|
|
409
|
+
}
|
|
410
|
+
_$AR(y = this._$AA.nextSibling, b) {
|
|
411
|
+
for (this._$AP?.(!1, !0, b); y !== this._$AB;) {
|
|
412
|
+
let b = y.nextSibling;
|
|
413
|
+
y.remove(), y = b;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
setConnected(y) {
|
|
@@ -423,17 +423,17 @@ var M = class {
|
|
|
423
423
|
get _$AU() {
|
|
424
424
|
return this._$AM._$AU;
|
|
425
425
|
}
|
|
426
|
-
constructor(y,
|
|
427
|
-
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = y, this.name =
|
|
426
|
+
constructor(y, b, w, D, O) {
|
|
427
|
+
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = y, this.name = b, this._$AM = D, this.options = O, w.length > 2 || w[0] !== "" || w[1] !== "" ? (this._$AH = Array(w.length - 1).fill(/* @__PURE__ */ new String()), this.strings = w) : this._$AH = E;
|
|
428
428
|
}
|
|
429
|
-
_$AI(y,
|
|
430
|
-
let
|
|
431
|
-
if (
|
|
429
|
+
_$AI(y, b = this, w, D) {
|
|
430
|
+
let O = this.strings, F = !1;
|
|
431
|
+
if (O === void 0) y = S(this, y, b, 0), F = !c(y) || y !== this._$AH && y !== T, F && (this._$AH = y);
|
|
432
432
|
else {
|
|
433
|
-
let
|
|
434
|
-
for (y =
|
|
433
|
+
let D = y, U, W;
|
|
434
|
+
for (y = O[0], U = 0; U < O.length - 1; U++) W = S(this, D[w + U], b, U), W === T && (W = this._$AH[U]), F ||= !c(W) || W !== this._$AH[U], W === E ? y = E : y !== E && (y += (W ?? "") + O[U + 1]), this._$AH[U] = W;
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
F && !D && this.j(y);
|
|
437
437
|
}
|
|
438
438
|
j(y) {
|
|
439
439
|
y === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, y ?? "");
|
|
@@ -453,20 +453,20 @@ var M = class {
|
|
|
453
453
|
this.element.toggleAttribute(this.name, !!y && y !== E);
|
|
454
454
|
}
|
|
455
455
|
}, L = class extends k {
|
|
456
|
-
constructor(y,
|
|
457
|
-
super(y,
|
|
456
|
+
constructor(y, b, w, D, O) {
|
|
457
|
+
super(y, b, w, D, O), this.type = 5;
|
|
458
458
|
}
|
|
459
|
-
_$AI(y,
|
|
460
|
-
if ((y = S(this, y,
|
|
461
|
-
let
|
|
462
|
-
|
|
459
|
+
_$AI(y, b = this) {
|
|
460
|
+
if ((y = S(this, y, b, 0) ?? E) === T) return;
|
|
461
|
+
let w = this._$AH, D = y === E && w !== E || y.capture !== w.capture || y.once !== w.once || y.passive !== w.passive, O = y !== E && (w === E || D);
|
|
462
|
+
D && this.element.removeEventListener(this.name, this, w), O && this.element.addEventListener(this.name, this, y), this._$AH = y;
|
|
463
463
|
}
|
|
464
464
|
handleEvent(y) {
|
|
465
465
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, y) : this._$AH.handleEvent(y);
|
|
466
466
|
}
|
|
467
467
|
}, z = class {
|
|
468
|
-
constructor(y,
|
|
469
|
-
this.element = y, this.type = 6, this._$AN = void 0, this._$AM =
|
|
468
|
+
constructor(y, b, w) {
|
|
469
|
+
this.element = y, this.type = 6, this._$AN = void 0, this._$AM = b, this.options = w;
|
|
470
470
|
}
|
|
471
471
|
get _$AU() {
|
|
472
472
|
return this._$AM._$AU;
|
|
@@ -476,13 +476,13 @@ var M = class {
|
|
|
476
476
|
}
|
|
477
477
|
}, j = t$1.litHtmlPolyfillSupport;
|
|
478
478
|
j?.(N, R), (t$1.litHtmlVersions ??= []).push("3.3.1");
|
|
479
|
-
var B = (y,
|
|
480
|
-
let
|
|
481
|
-
if (
|
|
482
|
-
let y =
|
|
483
|
-
|
|
479
|
+
var B = (y, b, w) => {
|
|
480
|
+
let D = w?.renderBefore ?? b, O = D._$litPart$;
|
|
481
|
+
if (O === void 0) {
|
|
482
|
+
let y = w?.renderBefore ?? null;
|
|
483
|
+
D._$litPart$ = O = new R(b.insertBefore(l(), y), y, void 0, w ?? {});
|
|
484
484
|
}
|
|
485
|
-
return
|
|
485
|
+
return O._$AI(y), O;
|
|
486
486
|
}, s = globalThis, i$1 = class extends y$1 {
|
|
487
487
|
constructor() {
|
|
488
488
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -492,8 +492,8 @@ var B = (y, F, U) => {
|
|
|
492
492
|
return this.renderOptions.renderBefore ??= y.firstChild, y;
|
|
493
493
|
}
|
|
494
494
|
update(y) {
|
|
495
|
-
let
|
|
496
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(y), this._$Do = B(
|
|
495
|
+
let b = this.render();
|
|
496
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(y), this._$Do = B(b, this.renderRoot, this.renderOptions);
|
|
497
497
|
}
|
|
498
498
|
connectedCallback() {
|
|
499
499
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -518,34 +518,34 @@ o$2?.({ LitElement: i$1 }), (s.litElementVersions ??= []).push("4.2.1");
|
|
|
518
518
|
converter: u$1,
|
|
519
519
|
reflect: !1,
|
|
520
520
|
hasChanged: f$1
|
|
521
|
-
}, r$1 = (y = o$1,
|
|
522
|
-
let { kind:
|
|
523
|
-
if (
|
|
524
|
-
let { name:
|
|
521
|
+
}, r$1 = (y = o$1, b, w) => {
|
|
522
|
+
let { kind: D, metadata: O } = w, F = globalThis.litPropertyMetadata.get(O);
|
|
523
|
+
if (F === void 0 && globalThis.litPropertyMetadata.set(O, F = /* @__PURE__ */ new Map()), D === "setter" && ((y = Object.create(y)).wrapped = !0), F.set(w.name, y), D === "accessor") {
|
|
524
|
+
let { name: D } = w;
|
|
525
525
|
return {
|
|
526
|
-
set(
|
|
527
|
-
let
|
|
528
|
-
|
|
526
|
+
set(w) {
|
|
527
|
+
let O = b.get.call(this);
|
|
528
|
+
b.set.call(this, w), this.requestUpdate(D, O, y);
|
|
529
529
|
},
|
|
530
|
-
init(
|
|
531
|
-
return
|
|
530
|
+
init(b) {
|
|
531
|
+
return b !== void 0 && this.C(D, void 0, y, b), b;
|
|
532
532
|
}
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
if (
|
|
536
|
-
let { name:
|
|
537
|
-
return function(
|
|
538
|
-
let
|
|
539
|
-
|
|
535
|
+
if (D === "setter") {
|
|
536
|
+
let { name: D } = w;
|
|
537
|
+
return function(w) {
|
|
538
|
+
let O = this[D];
|
|
539
|
+
b.call(this, w), this.requestUpdate(D, O, y);
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
throw Error("Unsupported decorator location: " +
|
|
542
|
+
throw Error("Unsupported decorator location: " + D);
|
|
543
543
|
};
|
|
544
544
|
function n$1(y) {
|
|
545
|
-
return (
|
|
546
|
-
let
|
|
547
|
-
return
|
|
548
|
-
})(y,
|
|
545
|
+
return (b, w) => typeof w == "object" ? r$1(y, b, w) : ((y, b, w) => {
|
|
546
|
+
let D = b.hasOwnProperty(w);
|
|
547
|
+
return b.constructor.createProperty(w, y), D ? Object.getOwnPropertyDescriptor(b, w) : void 0;
|
|
548
|
+
})(y, b, w);
|
|
549
549
|
}
|
|
550
550
|
/**
|
|
551
551
|
* @license
|
|
@@ -570,22 +570,22 @@ var t = {
|
|
|
570
570
|
BOOLEAN_ATTRIBUTE: 4,
|
|
571
571
|
EVENT: 5,
|
|
572
572
|
ELEMENT: 6
|
|
573
|
-
}, e$1 = (y) => (...
|
|
573
|
+
}, e$1 = (y) => (...b) => ({
|
|
574
574
|
_$litDirective$: y,
|
|
575
|
-
values:
|
|
575
|
+
values: b
|
|
576
576
|
}), i = class {
|
|
577
577
|
constructor(y) {}
|
|
578
578
|
get _$AU() {
|
|
579
579
|
return this._$AM._$AU;
|
|
580
580
|
}
|
|
581
|
-
_$AT(y,
|
|
582
|
-
this._$Ct = y, this._$AM =
|
|
581
|
+
_$AT(y, b, w) {
|
|
582
|
+
this._$Ct = y, this._$AM = b, this._$Ci = w;
|
|
583
583
|
}
|
|
584
|
-
_$AS(y,
|
|
585
|
-
return this.update(y,
|
|
584
|
+
_$AS(y, b) {
|
|
585
|
+
return this.update(y, b);
|
|
586
586
|
}
|
|
587
|
-
update(y,
|
|
588
|
-
return this.render(...
|
|
587
|
+
update(y, b) {
|
|
588
|
+
return this.render(...b);
|
|
589
589
|
}
|
|
590
590
|
}, e = class extends i {
|
|
591
591
|
constructor(y) {
|
|
@@ -597,10 +597,10 @@ var t = {
|
|
|
597
597
|
if (typeof y != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
598
598
|
if (y === this.it) return this._t;
|
|
599
599
|
this.it = y;
|
|
600
|
-
let
|
|
601
|
-
return
|
|
600
|
+
let b = [y];
|
|
601
|
+
return b.raw = b, this._t = {
|
|
602
602
|
_$litType$: this.constructor.resultType,
|
|
603
|
-
strings:
|
|
603
|
+
strings: b,
|
|
604
604
|
values: []
|
|
605
605
|
};
|
|
606
606
|
}
|
|
@@ -612,30 +612,30 @@ var o = e$1(e);
|
|
|
612
612
|
* Copyright 2021 Google LLC
|
|
613
613
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
614
614
|
*/
|
|
615
|
-
function n(y,
|
|
616
|
-
return y ?
|
|
615
|
+
function n(y, b, w) {
|
|
616
|
+
return y ? b(y) : w?.(y);
|
|
617
617
|
}
|
|
618
618
|
var shiki_default = ".shiki{color-scheme:var(--shiki-theme-type,light);padding:.875em;overflow-x:auto}code{z-index:0;width:max-content;min-width:100%;font-size:var(--font-size,.875em);counter-reset:step;counter-increment:step 0;display:block;position:relative}code .line:before{content:counter(step);counter-increment:step;text-align:right;color:#738a9480;width:1rem;margin-right:1.5rem;display:inline-block}code .line:last-child:empty:before{content:none;counter-increment:none}.has-diff .diff,.has-highlighted .highlighted{width:100%;display:inline-block;position:relative}.has-diff .diff.remove:before{content:\"-\"}.has-diff .diff.add:before{content:\"+\"}.has-diff .diff.remove:after{content:\"\";z-index:-1;background:#ef444426;border-left:1px solid #ef4444cc;position:absolute;inset:0 -.875em}.has-diff .diff.add:after{content:\"\";z-index:-1;background:#22c55e26;border-left:1px solid #22c55ecc;position:absolute;inset:0 -.875em}.has-focused .line:not(.focused){opacity:.7;filter:blur(.095rem);transition:filter .35s,opacity .35s}.has-focused:hover .line:not(.focused){opacity:1;filter:blur()}.has-highlighted .highlighted:after{content:\"\";z-index:-1;background:#65758529;border-left:1px solid #22c55ecc;position:absolute;inset:0 -.875em}.has-highlighted .highlighted.error:after{background:#f43f5e29!important}.has-highlighted .highlighted.warning:after{background:#eab30829!important}:host([color-scheme=dark]) .shiki,:host([color-scheme=dark]) .shiki span{color:var(--shiki-dark)!important}:host([color-scheme=dark]) .shiki{background-color:var(--shiki-dark-bg)!important}";
|
|
619
|
-
function copyText(y,
|
|
619
|
+
function copyText(y, b) {
|
|
620
620
|
if (navigator.clipboard) navigator.clipboard.writeText(y).then(() => {
|
|
621
|
-
|
|
621
|
+
b();
|
|
622
622
|
});
|
|
623
623
|
else {
|
|
624
|
-
let
|
|
625
|
-
|
|
624
|
+
let w = document.createElement("textarea");
|
|
625
|
+
w.value = y, w.style.position = "fixed", w.style.opacity = "0", document.body.appendChild(w), w.focus(), w.select();
|
|
626
626
|
try {
|
|
627
|
-
document.execCommand("copy") &&
|
|
627
|
+
document.execCommand("copy") && b();
|
|
628
628
|
} catch (y) {
|
|
629
629
|
console.error("Fallback: Oops, unable to copy", y);
|
|
630
630
|
}
|
|
631
|
-
document.body.removeChild(
|
|
631
|
+
document.body.removeChild(w);
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
function __decorate(y,
|
|
635
|
-
var
|
|
636
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
637
|
-
else for (var
|
|
638
|
-
return
|
|
634
|
+
function __decorate(y, b, w, D) {
|
|
635
|
+
var O = arguments.length, F = O < 3 ? b : D === null ? D = Object.getOwnPropertyDescriptor(b, w) : D, U;
|
|
636
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") F = Reflect.decorate(y, b, w, D);
|
|
637
|
+
else for (var W = y.length - 1; W >= 0; W--) (U = y[W]) && (F = (O < 3 ? U(F) : O > 3 ? U(b, w, F) : U(b, w)) || F);
|
|
638
|
+
return O > 3 && F && Object.defineProperty(b, w, F), F;
|
|
639
639
|
}
|
|
640
640
|
var ShikiCodeBaseVariant = class extends i$1 {
|
|
641
641
|
constructor(...y) {
|
|
@@ -825,8 +825,8 @@ var ShikiCode = class extends i$1 {
|
|
|
825
825
|
this._observer?.disconnect(), this._media?.removeEventListener("change", () => this.updateTheme()), super.disconnectedCallback();
|
|
826
826
|
}
|
|
827
827
|
isDarkMode() {
|
|
828
|
-
let y = document.documentElement,
|
|
829
|
-
return
|
|
828
|
+
let y = document.documentElement, b = document.body, w = (y, b) => y?.classList.contains(b), D = (y, b, w) => y?.getAttribute(b) === w;
|
|
829
|
+
return w(y, "color-scheme-auto") || w(b, "color-scheme-auto") || D(y, "data-color-scheme", "auto") || D(b, "data-color-scheme", "auto") ? this._media?.matches : !!(w(y, "color-scheme-dark") || w(y, "dark") || D(y, "data-color-scheme", "dark") || w(b, "color-scheme-dark") || w(b, "dark") || D(b, "data-color-scheme", "dark"));
|
|
830
830
|
}
|
|
831
831
|
updateTheme() {
|
|
832
832
|
this._colorScheme = this.isDarkMode() ? "dark" : "light";
|
|
@@ -848,19 +848,19 @@ var ShikiCode = class extends i$1 {
|
|
|
848
848
|
if (this.variant === "simple") return x`<shiki-code-simple-variant .options=${y}></shiki-code-simple-variant>`;
|
|
849
849
|
}
|
|
850
850
|
handleSlotchange(y) {
|
|
851
|
-
let
|
|
852
|
-
if (!
|
|
853
|
-
let
|
|
854
|
-
if (
|
|
855
|
-
let y =
|
|
851
|
+
let b = y.target.assignedElements({ flatten: !0 });
|
|
852
|
+
if (!b.length) return;
|
|
853
|
+
let w = b[0];
|
|
854
|
+
if (w.tagName === "PRE") {
|
|
855
|
+
let y = w.querySelector("code");
|
|
856
856
|
y && this.process(y);
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
async process(y) {
|
|
860
860
|
try {
|
|
861
861
|
this.languageCode = this.extractLanguageCode(y.classList) || "plaintext", this.languageCode === "auto" && (this.languageCode = "plaintext"), this.languageCode === "text" && (this.languageCode = "plaintext"), this.code = y.textContent || "", this.html = await this.renderCodeAsHtml(this.code || "", this.languageCode);
|
|
862
|
-
let { getSingletonHighlighter:
|
|
863
|
-
this.languageCode === "plaintext" ? this.languageName = "plaintext" : this.languageName =
|
|
862
|
+
let { getSingletonHighlighter: b } = await import("shiki"), w = await b();
|
|
863
|
+
this.languageCode === "plaintext" ? this.languageName = "plaintext" : this.languageName = w.getLanguage(this.languageCode).name, this.lightThemeRegistration = w.getTheme(this.lightTheme), this.darkThemeRegistration = w.getTheme(this.darkTheme || this.lightTheme);
|
|
864
864
|
} catch (y) {
|
|
865
865
|
y instanceof Error && (this.error = y.message);
|
|
866
866
|
} finally {
|
|
@@ -870,29 +870,29 @@ var ShikiCode = class extends i$1 {
|
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
872
|
extractLanguageCode(y) {
|
|
873
|
-
let
|
|
874
|
-
for (let
|
|
875
|
-
let
|
|
876
|
-
for (let y = 0; y <
|
|
877
|
-
let
|
|
878
|
-
if (
|
|
873
|
+
let b = ["language-", "lang-"];
|
|
874
|
+
for (let w = 0; w < y.length; w++) {
|
|
875
|
+
let D = y[w];
|
|
876
|
+
for (let y = 0; y < b.length; y++) {
|
|
877
|
+
let w = b[y];
|
|
878
|
+
if (D.startsWith(w)) return D.substring(w.length).toLowerCase();
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
return null;
|
|
882
882
|
}
|
|
883
|
-
async renderCodeAsHtml(y,
|
|
884
|
-
let { codeToHtml:
|
|
885
|
-
return await
|
|
886
|
-
lang:
|
|
883
|
+
async renderCodeAsHtml(y, b) {
|
|
884
|
+
let { codeToHtml: w } = await import("shiki"), { transformerNotationDiff: D, transformerNotationHighlight: O, transformerNotationFocus: F, transformerNotationErrorLevel: U } = await import("@shikijs/transformers");
|
|
885
|
+
return await w(y, {
|
|
886
|
+
lang: b,
|
|
887
887
|
themes: {
|
|
888
888
|
light: this.lightTheme,
|
|
889
889
|
dark: this.darkTheme || this.lightTheme
|
|
890
890
|
},
|
|
891
891
|
transformers: [
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
892
|
+
D(),
|
|
893
|
+
O(),
|
|
894
|
+
F(),
|
|
895
|
+
U()
|
|
896
896
|
]
|
|
897
897
|
});
|
|
898
898
|
}
|