@cas-smartdesign/token-selector 0.15.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/LICENSE +8 -0
- package/dist/clipboard-extension.d.ts +6 -0
- package/dist/docs/1_remove_only.js +1 -0
- package/dist/docs/2_multi_select.js +1 -0
- package/dist/docs/3_editable_input_attributes.js +1 -0
- package/dist/docs/4_dnd.js +1 -0
- package/dist/docs/5_other.js +1 -0
- package/dist/docs/button.mjs +103 -0
- package/dist/docs/demo.svg +4 -0
- package/dist/docs/doc.css +1 -0
- package/dist/docs/doc.mjs +835 -0
- package/dist/docs/edit.svg +3 -0
- package/dist/docs/index.html +32 -0
- package/dist/docs/monkey.svg +55 -0
- package/dist/docs/state-accept.svg +3 -0
- package/dist/docs/state-decline.svg +3 -0
- package/dist/docs/state-no-response-received.svg +4 -0
- package/dist/docs/state-tentative.svg +8 -0
- package/dist/docs/token-provider.mjs +1 -0
- package/dist/drag-and-drop-extension.d.ts +6 -0
- package/dist/token-selector-with-externals.js +250 -0
- package/dist/token-selector-with-externals.js.map +7 -0
- package/dist/token-selector.d.ts +109 -0
- package/dist/token-selector.mjs +637 -0
- package/dist/token-selector.mjs.map +1 -0
- package/dist/token-suggest-popover.d.ts +26 -0
- package/dist/token.d.ts +43 -0
- package/npm-third-party-licenses.json +197 -0
- package/package.json +42 -0
- package/readme.md +137 -0
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();const po="modulepreload",fo=function(i,e){return new URL(i,e).href},Wi={},Nt=function(e,t,n){let s=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link");s=Promise.all(t.map(r=>{if(r=fo(r,n),r in Wi)return;Wi[r]=!0;const a=r.endsWith(".css"),l=a?'[rel="stylesheet"]':"";if(!!n)for(let h=o.length-1;h>=0;h--){const p=o[h];if(p.href===r&&(!a||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${l}`))return;const d=document.createElement("link");if(d.rel=a?"stylesheet":po,a||(d.as="script",d.crossOrigin=""),d.href=r,document.head.appendChild(d),a)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${r}`)))})}))}return s.then(()=>e()).catch(o=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o})},go=`<div id="remove-only-example" class="example-root">
|
|
2
|
+
<sd-token-selector selection-mode="remove-only"></sd-token-selector>
|
|
3
|
+
<h4>Disabled</h4>
|
|
4
|
+
<sd-token-selector selection-mode="remove-only" aria-disabled="true"></sd-token-selector>
|
|
5
|
+
</div>
|
|
6
|
+
`,mo=`<h3 id="remove-only-token-viewer">Remove only token viewer</h3>
|
|
7
|
+
`,jt=`.example-root {
|
|
8
|
+
width: 100%;
|
|
9
|
+
max-width: 600px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
sd-token-selector {
|
|
13
|
+
padding-top: 8px;
|
|
14
|
+
padding-bottom: 8px;
|
|
15
|
+
margin: 1px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
sd-token {
|
|
19
|
+
height: 28px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
sd-token[draggable="true"] {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
sd-token[type="aia-tag"] {
|
|
27
|
+
--token-background-color: rgba(138, 189, 12, 0.2);
|
|
28
|
+
--token-border: 1px solid rgb(138, 189, 12);
|
|
29
|
+
}
|
|
30
|
+
sd-token[type="user-tag"] {
|
|
31
|
+
--token-background-color: rgba(237, 156, 38, 0.2);
|
|
32
|
+
--token-border: 1px solid rgb(237, 156, 38);
|
|
33
|
+
}
|
|
34
|
+
sd-token[type="system-tag"] {
|
|
35
|
+
--token-background-color: rgba(0, 138, 178, 0.2);
|
|
36
|
+
--token-border: 1px solid rgb(0, 138, 178);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
sd-token-selector:focus-within sd-token[aria-checked="true"] {
|
|
40
|
+
--token-background-color: #bada55 !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
sd-token-selector:focus-within sd-token[aria-current="true"] {
|
|
44
|
+
outline: 1px solid black;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
sd-token-selector:focus-within sd-token[aria-current="true"][type$="-tag"] {
|
|
48
|
+
--token-border: 1px solid white !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
sd-token-selector[drop] {
|
|
52
|
+
--input-wrapper-background-color: #dfeff9;
|
|
53
|
+
}
|
|
54
|
+
`,vo=`import TokenSelector from "@cas-smartdesign/token-selector";
|
|
55
|
+
import { getItems } from "token-provider";
|
|
56
|
+
|
|
57
|
+
TokenSelector.ensureDefined();
|
|
58
|
+
|
|
59
|
+
document.querySelectorAll("#remove-only-example sd-token-selector").forEach((selector: TokenSelector) => {
|
|
60
|
+
selector.items = getItems(true);
|
|
61
|
+
if (!selector.disabled) {
|
|
62
|
+
selector.addEventListener("tokens-removed", (event) => {
|
|
63
|
+
selector.items = selector.items.filter((_item, i) => !event.detail.removedIndices.includes(i));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
`,vi=`import { TokenData } from "@cas-smartdesign/token-selector";
|
|
68
|
+
|
|
69
|
+
const demoSvg = "./demo.svg";
|
|
70
|
+
|
|
71
|
+
export function getItems(editable: boolean): TokenData[] {
|
|
72
|
+
const items = [];
|
|
73
|
+
|
|
74
|
+
items.push({ caption: "Address assistant", description: "First aia tag", type: "aia-tag", disabled: true });
|
|
75
|
+
items.push({ caption: "Picasso assistant", description: "Second aia tag", type: "aia-tag" });
|
|
76
|
+
items.push({ caption: "Import assistant", description: "Third aia tag", type: "aia-tag" });
|
|
77
|
+
|
|
78
|
+
items.push({ caption: "My personal tag", type: "user-tag", disabled: !editable });
|
|
79
|
+
items.push({
|
|
80
|
+
caption: "My second personal tag",
|
|
81
|
+
type: "user-tag",
|
|
82
|
+
disabled: !editable,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
items.push({
|
|
86
|
+
caption: "Administration",
|
|
87
|
+
type: "system-tag",
|
|
88
|
+
icon: demoSvg,
|
|
89
|
+
iconBackgroundColor: "rgb(0, 138, 178)",
|
|
90
|
+
});
|
|
91
|
+
items.push({
|
|
92
|
+
caption: "Database assistant",
|
|
93
|
+
type: "system-tag",
|
|
94
|
+
icon: demoSvg,
|
|
95
|
+
iconBackgroundColor: "rgb(0, 138, 178)",
|
|
96
|
+
});
|
|
97
|
+
items.push({ caption: "Tag without type", disabled: !editable });
|
|
98
|
+
items.push({
|
|
99
|
+
caption: "Tag with some description",
|
|
100
|
+
description: "This is the description of the tag",
|
|
101
|
+
disabled: !editable,
|
|
102
|
+
});
|
|
103
|
+
return items;
|
|
104
|
+
}
|
|
105
|
+
`,bo={mainContent:go,description:mo,css:jt,initializer:{content:vo,type:"typescript",initialize:()=>Nt(()=>import("./1_remove_only.js"),__vite__mapDeps([0,1]),import.meta.url)},additionalSources:[{type:"source",language:"typescript",label:"token-provider.ts",content:vi}]},yo=Object.freeze(Object.defineProperty({__proto__:null,default:bo},Symbol.toStringTag,{value:"Module"})),wo=`<div id="multi-select-example" class="example-root">
|
|
106
|
+
<sd-token-selector>
|
|
107
|
+
<sd-button icon="edit.svg" slot="additional-content"></sd-button>
|
|
108
|
+
</sd-token-selector>
|
|
109
|
+
<sd-token-selector commit-values-with-space input-label="Commit values also with space">
|
|
110
|
+
<sd-button icon="edit.svg" slot="additional-content"></sd-button>
|
|
111
|
+
</sd-token-selector>
|
|
112
|
+
<h4>Disabled</h4>
|
|
113
|
+
<sd-token-selector aria-disabled="true">
|
|
114
|
+
<sd-button aria-disabled="true" icon="edit.svg" slot="additional-content"></sd-button>
|
|
115
|
+
</sd-token-selector>
|
|
116
|
+
</div>
|
|
117
|
+
`,xo=`<h3 id="editable-token-selector">Editable token selector</h3>
|
|
118
|
+
`,ko=`import "@cas-smartdesign/button";
|
|
119
|
+
import { Button } from "@cas-smartdesign/button";
|
|
120
|
+
import TokenSelector from "@cas-smartdesign/token-selector";
|
|
121
|
+
import { getItems } from "token-provider";
|
|
122
|
+
|
|
123
|
+
TokenSelector.ensureDefined();
|
|
124
|
+
|
|
125
|
+
document.querySelectorAll("#multi-select-example sd-token-selector").forEach((el) => {
|
|
126
|
+
const editButton = el.querySelector("sd-button") as Button;
|
|
127
|
+
const tokenSelector = el as TokenSelector;
|
|
128
|
+
|
|
129
|
+
tokenSelector.items = getItems(true);
|
|
130
|
+
tokenSelector.selectedIndexes = [0, 1, 3];
|
|
131
|
+
tokenSelector.addEventListener("token-created", ((event: CustomEvent) => {
|
|
132
|
+
tokenSelector.items.push({ caption: event.detail.value, type: "user-tag", disabled: false });
|
|
133
|
+
tokenSelector.selectedIndexes.push(tokenSelector.items.length - 1);
|
|
134
|
+
}) as EventListener);
|
|
135
|
+
|
|
136
|
+
if (tokenSelector.hasAttribute("commit-values-with-space")) {
|
|
137
|
+
tokenSelector.setAdditionalTokenCommittingKeys([" "]);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
editButton.addEventListener("click", () => tokenSelector.openSuggestions());
|
|
141
|
+
});
|
|
142
|
+
`,Eo={mainContent:wo,description:xo,css:jt,initializer:{content:ko,type:"typescript",initialize:()=>Nt(()=>import("./2_multi_select.js"),__vite__mapDeps([2,3,1]),import.meta.url)},additionalSources:[{type:"source",language:"typescript",label:"token-provider.ts",content:vi}]},So=Object.freeze(Object.defineProperty({__proto__:null,default:Eo},Symbol.toStringTag,{value:"Module"})),_o=`<div id="editable-input-attributes-example" class="example-root">
|
|
143
|
+
<sd-token-selector placeholder="Default"
|
|
144
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
145
|
+
></sd-token-selector>
|
|
146
|
+
<sd-token-selector input-label="Floating label"
|
|
147
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
148
|
+
></sd-token-selector>
|
|
149
|
+
<sd-token-selector input-label="Floating label" placeholder="Search"
|
|
150
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
151
|
+
></sd-token-selector>
|
|
152
|
+
<sd-token-selector mandatory input-label="Mandatory"
|
|
153
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
154
|
+
></sd-token-selector>
|
|
155
|
+
</div>
|
|
156
|
+
`,Ao=`<h3 id="editable-token-selector-with-various-input-attributes">Editable token selector with various input attributes</h3>
|
|
157
|
+
`,$o=`import "@cas-smartdesign/button";
|
|
158
|
+
import { Button } from "@cas-smartdesign/button";
|
|
159
|
+
import { ValidationLevel } from "@cas-smartdesign/field-validation-message";
|
|
160
|
+
import TokenSelector from "@cas-smartdesign/token-selector";
|
|
161
|
+
import { getItems } from "token-provider";
|
|
162
|
+
|
|
163
|
+
TokenSelector.ensureDefined();
|
|
164
|
+
|
|
165
|
+
document.querySelectorAll("#editable-input-attributes-example sd-token-selector").forEach((el) => {
|
|
166
|
+
const editButton = el.querySelector("sd-button") as Button;
|
|
167
|
+
const tokenSelector = el as TokenSelector;
|
|
168
|
+
|
|
169
|
+
if (tokenSelector.hasAttribute("mandatory")) {
|
|
170
|
+
const updateMandatoryMessage = () =>
|
|
171
|
+
tokenSelector.updateComplete.then(() => {
|
|
172
|
+
if (tokenSelector.selectedIndexes.length == 0) {
|
|
173
|
+
tokenSelector.validationLevel = ValidationLevel.Error;
|
|
174
|
+
tokenSelector.validationMessage = "Should not be empty";
|
|
175
|
+
} else {
|
|
176
|
+
tokenSelector.validationLevel = null;
|
|
177
|
+
tokenSelector.validationMessage = null;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
tokenSelector.addEventListener("tokens-selected", () => updateMandatoryMessage());
|
|
181
|
+
tokenSelector.addEventListener("tokens-removed", () => updateMandatoryMessage());
|
|
182
|
+
tokenSelector.addEventListener("token-created", () => updateMandatoryMessage());
|
|
183
|
+
updateMandatoryMessage();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
tokenSelector.items = getItems(true);
|
|
187
|
+
tokenSelector.items.forEach((t) => (t.disabled = false));
|
|
188
|
+
tokenSelector.addEventListener("token-created", ((event: CustomEvent) => {
|
|
189
|
+
tokenSelector.items.push({ caption: event.detail.value, type: "user-tag", disabled: false });
|
|
190
|
+
tokenSelector.selectedIndexes.push(tokenSelector.items.length - 1);
|
|
191
|
+
}) as EventListener);
|
|
192
|
+
|
|
193
|
+
editButton.addEventListener("click", () => tokenSelector.openSuggestions());
|
|
194
|
+
});
|
|
195
|
+
`,Co={mainContent:_o,description:Ao,css:jt,initializer:{content:$o,type:"typescript",initialize:()=>Nt(()=>import("./3_editable_input_attributes.js"),__vite__mapDeps([4,3,1]),import.meta.url)},additionalSources:[{type:"source",language:"typescript",label:"token-provider.ts",content:vi}]},Oo=Object.freeze(Object.defineProperty({__proto__:null,default:Co},Symbol.toStringTag,{value:"Module"})),Io=`<div id="dnd-example" class="example-root">
|
|
196
|
+
<sd-token-selector input-label="First selector"
|
|
197
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
198
|
+
></sd-token-selector>
|
|
199
|
+
<sd-token-selector input-label="Second selector"
|
|
200
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
201
|
+
></sd-token-selector>
|
|
202
|
+
<sd-token-selector input-label="Third selector (explicit token type)" token-type="tokens from 3rd selector"
|
|
203
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
204
|
+
></sd-token-selector>
|
|
205
|
+
</div>
|
|
206
|
+
`,To=`<h3 id="drag-and-drop-example">Drag and drop example</h3>
|
|
207
|
+
`,Lo=`import "@cas-smartdesign/button";
|
|
208
|
+
import TokenSelector, { TokenData, generator } from "@cas-smartdesign/token-selector";
|
|
209
|
+
import { getItems as getDefaultItems } from "../token-provider";
|
|
210
|
+
|
|
211
|
+
TokenSelector.ensureDefined();
|
|
212
|
+
|
|
213
|
+
interface TokenWithValue extends TokenData {
|
|
214
|
+
value: number;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const items = getDefaultItems(true) as TokenWithValue[];
|
|
218
|
+
items.forEach((item, index) => (item.value = index % 3));
|
|
219
|
+
|
|
220
|
+
const updateSelection = (selector: TokenSelector, selectorIndex: number) => {
|
|
221
|
+
const selection = [];
|
|
222
|
+
items.forEach((item, index) => {
|
|
223
|
+
if (item.value == selectorIndex) {
|
|
224
|
+
selection.push(index);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
selector.selectedIndexes = selection;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const allTokenSelectors: TokenSelector[] = [];
|
|
231
|
+
let selectorCounter = 0;
|
|
232
|
+
document.querySelectorAll("#dnd-example sd-token-selector").forEach((tokenSelector: TokenSelector) => {
|
|
233
|
+
allTokenSelectors.push(tokenSelector);
|
|
234
|
+
const selectorIndex = selectorCounter++;
|
|
235
|
+
|
|
236
|
+
tokenSelector.items = items;
|
|
237
|
+
updateSelection(tokenSelector, selectorIndex);
|
|
238
|
+
|
|
239
|
+
tokenSelector.tokenGenerator = (data: TokenData, index) => {
|
|
240
|
+
const token = generator(data, index);
|
|
241
|
+
token.draggable = true;
|
|
242
|
+
return token;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
tokenSelector.addEventListener("token-created", (event) => {
|
|
246
|
+
const tokenData = {
|
|
247
|
+
value: selectorIndex,
|
|
248
|
+
caption: event.detail.value,
|
|
249
|
+
disabled: false,
|
|
250
|
+
} as TokenWithValue;
|
|
251
|
+
items.push(tokenData);
|
|
252
|
+
tokenSelector.items = items;
|
|
253
|
+
tokenSelector.selectedIndexes.push(items.length - 1);
|
|
254
|
+
});
|
|
255
|
+
tokenSelector.addEventListener("tokens-selected", (event) => {
|
|
256
|
+
event.detail.selectedIndices.forEach((i) => (items[i].value = selectorIndex));
|
|
257
|
+
allTokenSelectors.forEach((value, index) => {
|
|
258
|
+
if (value != tokenSelector) {
|
|
259
|
+
updateSelection(value, index);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
tokenSelector.addEventListener("tokens-removed", (event) =>
|
|
264
|
+
event.detail.removedIndices.map((i) => items[i]).forEach((item) => (item.value = -1)),
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
tokenSelector.querySelector("sd-button").addEventListener("click", () => tokenSelector.openSuggestions());
|
|
268
|
+
});
|
|
269
|
+
`,Po={mainContent:Io,description:To,css:jt,initializer:{content:Lo,type:"typescript",initialize:()=>Nt(()=>import("./4_dnd.js"),__vite__mapDeps([5,3,1]),import.meta.url)}},Ro=Object.freeze(Object.defineProperty({__proto__:null,default:Po},Symbol.toStringTag,{value:"Module"})),Mo=`<div id="other-example" class="example-root">
|
|
270
|
+
<sd-token-selector input-label="Additional content" additional-icons
|
|
271
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
272
|
+
></sd-token-selector>
|
|
273
|
+
<sd-token-selector input-label="Search also in description" search-also-in-description
|
|
274
|
+
><sd-button icon="edit.svg" slot="additional-content"></sd-button
|
|
275
|
+
></sd-token-selector>
|
|
276
|
+
</div>
|
|
277
|
+
`,Do=`<h3 id="additional-examples">Additional examples</h3>
|
|
278
|
+
`,No=`.overlap-indicator {
|
|
279
|
+
width: 4px;
|
|
280
|
+
background-color: #999999;
|
|
281
|
+
}
|
|
282
|
+
.overlap-indicator.free {
|
|
283
|
+
background-color: #59a531;
|
|
284
|
+
}
|
|
285
|
+
.overlap-indicator.blocked {
|
|
286
|
+
background-color: #cc0000;
|
|
287
|
+
}
|
|
288
|
+
`,jo=`import "@cas-smartdesign/button";
|
|
289
|
+
import { Button } from "@cas-smartdesign/button";
|
|
290
|
+
import TokenSelector, { generator } from "@cas-smartdesign/token-selector";
|
|
291
|
+
import { getItems, OverlapStatus, InvitationStatus, ExtendedTokenData } from "./token-provider";
|
|
292
|
+
import { getItems as getDefaultItems } from "../token-provider";
|
|
293
|
+
|
|
294
|
+
TokenSelector.ensureDefined();
|
|
295
|
+
|
|
296
|
+
document.querySelectorAll("#other-example sd-token-selector").forEach((el) => {
|
|
297
|
+
const editButton = el.querySelector("sd-button") as Button;
|
|
298
|
+
const tokenSelector = el as TokenSelector;
|
|
299
|
+
|
|
300
|
+
if (tokenSelector.hasAttribute("additional-icons")) {
|
|
301
|
+
tokenSelector.tokenGenerator = (data: ExtendedTokenData, index) => {
|
|
302
|
+
const token = generator(data, index);
|
|
303
|
+
const overlapIndicator = document.createElement("span");
|
|
304
|
+
overlapIndicator.classList.add("overlap-indicator");
|
|
305
|
+
overlapIndicator.classList.add(data.overlapStatus);
|
|
306
|
+
overlapIndicator.setAttribute("slot", "before-icon");
|
|
307
|
+
|
|
308
|
+
const invitationStatusIcon = document.createElement("img");
|
|
309
|
+
invitationStatusIcon.style.backgroundColor = "transparent";
|
|
310
|
+
invitationStatusIcon.src = "state-" + data.invitationStatus + ".svg";
|
|
311
|
+
invitationStatusIcon.setAttribute("slot", "after-icon");
|
|
312
|
+
|
|
313
|
+
token.appendChild(overlapIndicator);
|
|
314
|
+
token.appendChild(invitationStatusIcon);
|
|
315
|
+
|
|
316
|
+
return token;
|
|
317
|
+
};
|
|
318
|
+
const originalAutoSuggestItemGenerator = tokenSelector.autoSuggestItemGenerator;
|
|
319
|
+
tokenSelector.autoSuggestItemGenerator = (data: ExtendedTokenData, index) => {
|
|
320
|
+
const overlapIndicator = document.createElement("span");
|
|
321
|
+
const style = overlapIndicator.style;
|
|
322
|
+
style.width = "4px";
|
|
323
|
+
style.height = "100%";
|
|
324
|
+
if (data.overlapStatus == OverlapStatus.Free) {
|
|
325
|
+
style.backgroundColor = "#59a531";
|
|
326
|
+
} else if (data.overlapStatus == OverlapStatus.Blocked) {
|
|
327
|
+
style.backgroundColor = "#cc0000";
|
|
328
|
+
} else {
|
|
329
|
+
style.backgroundColor = "#999999";
|
|
330
|
+
}
|
|
331
|
+
overlapIndicator.setAttribute("slot", "left-content");
|
|
332
|
+
|
|
333
|
+
const el = originalAutoSuggestItemGenerator(data, index);
|
|
334
|
+
el.appendChild(overlapIndicator);
|
|
335
|
+
return el;
|
|
336
|
+
};
|
|
337
|
+
tokenSelector.items = getItems();
|
|
338
|
+
tokenSelector.selectedIndexes = [0, 1, 2, 3];
|
|
339
|
+
} else {
|
|
340
|
+
tokenSelector.items = getDefaultItems(true);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
tokenSelector.addEventListener("token-created", ((event: CustomEvent) => {
|
|
344
|
+
tokenSelector.items.push({
|
|
345
|
+
caption: event.detail.value,
|
|
346
|
+
type: "participant",
|
|
347
|
+
disabled: false,
|
|
348
|
+
overlapStatus: OverlapStatus.Free,
|
|
349
|
+
invitationStatus: InvitationStatus.NoResponse,
|
|
350
|
+
} as ExtendedTokenData);
|
|
351
|
+
tokenSelector.selectedIndexes.push(tokenSelector.items.length - 1);
|
|
352
|
+
}) as EventListener);
|
|
353
|
+
|
|
354
|
+
editButton.addEventListener("click", () => tokenSelector.openSuggestions());
|
|
355
|
+
});
|
|
356
|
+
`,Bo=`import { TokenData } from "@cas-smartdesign/token-selector";
|
|
357
|
+
|
|
358
|
+
export enum InvitationStatus {
|
|
359
|
+
Accept = "accept",
|
|
360
|
+
Decline = "decline",
|
|
361
|
+
NoResponse = "no-response-received",
|
|
362
|
+
Tentative = "tentative",
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export enum OverlapStatus {
|
|
366
|
+
Free = "free",
|
|
367
|
+
Blocked = "blocked",
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export interface ExtendedTokenData extends TokenData {
|
|
371
|
+
overlapStatus?: OverlapStatus;
|
|
372
|
+
invitationStatus: InvitationStatus;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export function getItems(): ExtendedTokenData[] {
|
|
376
|
+
const items: ExtendedTokenData[] = [];
|
|
377
|
+
items.push({
|
|
378
|
+
caption: "Robert Glaser",
|
|
379
|
+
overlapStatus: OverlapStatus.Free,
|
|
380
|
+
invitationStatus: InvitationStatus.Accept,
|
|
381
|
+
type: "participant",
|
|
382
|
+
disabled: false,
|
|
383
|
+
});
|
|
384
|
+
items.push({
|
|
385
|
+
caption: "Britta Glatt",
|
|
386
|
+
overlapStatus: OverlapStatus.Blocked,
|
|
387
|
+
invitationStatus: InvitationStatus.Decline,
|
|
388
|
+
type: "participant",
|
|
389
|
+
disabled: false,
|
|
390
|
+
});
|
|
391
|
+
items.push({
|
|
392
|
+
caption: "Frank Shreeve",
|
|
393
|
+
overlapStatus: OverlapStatus.Blocked,
|
|
394
|
+
invitationStatus: InvitationStatus.NoResponse,
|
|
395
|
+
type: "participant",
|
|
396
|
+
disabled: false,
|
|
397
|
+
});
|
|
398
|
+
items.push({
|
|
399
|
+
caption: "Mario Rossi",
|
|
400
|
+
invitationStatus: InvitationStatus.Tentative,
|
|
401
|
+
icon: "./monkey.svg",
|
|
402
|
+
type: "participant",
|
|
403
|
+
disabled: false,
|
|
404
|
+
});
|
|
405
|
+
return items;
|
|
406
|
+
}
|
|
407
|
+
`,zo={mainContent:Mo,description:Do,css:No+jt,initializer:{content:jo,type:"typescript",initialize:()=>Nt(()=>import("./5_other.js"),__vite__mapDeps([6,3,1]),import.meta.url)},additionalSources:[{type:"source",language:"typescript",label:"token-provider.ts",content:Bo}]},Uo=Object.freeze(Object.defineProperty({__proto__:null,default:zo},Symbol.toStringTag,{value:"Module"}));const an=window,bi=an.ShadowRoot&&(an.ShadyCSS===void 0||an.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yi=Symbol(),qi=new WeakMap;let zs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==yi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(bi&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=qi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&qi.set(t,e))}return e}toString(){return this.cssText}};const ht=i=>new zs(typeof i=="string"?i:i+"",void 0,yi),wi=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((n,s,o)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new zs(t,i,yi)},Fo=(i,e)=>{bi?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),s=an.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)})},Vi=bi?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return ht(t)})(i):i;var Dn;const fn=window,Gi=fn.trustedTypes,Ho=Gi?Gi.emptyScript:"",Ki=fn.reactiveElementPolyfillSupport,Kn={toAttribute(i,e){switch(e){case Boolean:i=i?Ho:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Us=(i,e)=>e!==i&&(e==e||i==i),Nn={attribute:!0,type:String,converter:Kn,reflect:!1,hasChanged:Us},Zn="finalized";let et=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const s=this._$Ep(n,t);s!==void 0&&(this._$Ev.set(s,n),e.push(s))}),e}static createProperty(e,t=Nn){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,s=this.getPropertyDescriptor(e,n,t);s!==void 0&&Object.defineProperty(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(s){const o=this[e];this[t]=s,this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Nn}static finalize(){if(this.hasOwnProperty(Zn))return!1;this[Zn]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of n)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const s of n)t.unshift(Vi(s))}else e!==void 0&&t.push(Vi(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Fo(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=Nn){var s;const o=this.constructor._$Ep(e,n);if(o!==void 0&&n.reflect===!0){const r=(((s=n.converter)===null||s===void 0?void 0:s.toAttribute)!==void 0?n.converter:Kn).toAttribute(t,n.type);this._$El=e,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(e,t){var n;const s=this.constructor,o=s._$Ev.get(e);if(o!==void 0&&this._$El!==o){const r=s.getPropertyOptions(o),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?r.converter:Kn;this._$El=o,this[o]=a.fromAttribute(t,r.type),this._$El=null}}requestUpdate(e,t,n){let s=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Us)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((s,o)=>this[o]=s),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(s=>{var o;return(o=s.hostUpdate)===null||o===void 0?void 0:o.call(s)}),this.update(n)):this._$Ek()}catch(s){throw t=!1,this._$Ek(),s}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(n=>{var s;return(s=n.hostUpdated)===null||s===void 0?void 0:s.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};et[Zn]=!0,et.elementProperties=new Map,et.elementStyles=[],et.shadowRootOptions={mode:"open"},Ki==null||Ki({ReactiveElement:et}),((Dn=fn.reactiveElementVersions)!==null&&Dn!==void 0?Dn:fn.reactiveElementVersions=[]).push("1.6.3");var jn;const gn=window,nt=gn.trustedTypes,Zi=nt?nt.createPolicy("lit-html",{createHTML:i=>i}):void 0,Xn="$lit$",Le=`lit$${(Math.random()+"").slice(9)}$`,Fs="?"+Le,Wo=`<${Fs}>`,He=document,Et=()=>He.createComment(""),St=i=>i===null||typeof i!="object"&&typeof i!="function",Hs=Array.isArray,qo=i=>Hs(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Bn=`[
|
|
408
|
+
\f\r]`,gt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xi=/-->/g,Ji=/>/g,je=RegExp(`>|${Bn}(?:([^\\s"'>=/]+)(${Bn}*=${Bn}*(?:[^
|
|
409
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Yi=/'/g,Qi=/"/g,Ws=/^(?:script|style|textarea|title)$/i,Vo=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),X=Vo(1),We=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),es=new WeakMap,ze=He.createTreeWalker(He,129,null,!1);function qs(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Zi!==void 0?Zi.createHTML(e):e}const Go=(i,e)=>{const t=i.length-1,n=[];let s,o=e===2?"<svg>":"",r=gt;for(let a=0;a<t;a++){const l=i[a];let c,d,h=-1,p=0;for(;p<l.length&&(r.lastIndex=p,d=r.exec(l),d!==null);)p=r.lastIndex,r===gt?d[1]==="!--"?r=Xi:d[1]!==void 0?r=Ji:d[2]!==void 0?(Ws.test(d[2])&&(s=RegExp("</"+d[2],"g")),r=je):d[3]!==void 0&&(r=je):r===je?d[0]===">"?(r=s??gt,h=-1):d[1]===void 0?h=-2:(h=r.lastIndex-d[2].length,c=d[1],r=d[3]===void 0?je:d[3]==='"'?Qi:Yi):r===Qi||r===Yi?r=je:r===Xi||r===Ji?r=gt:(r=je,s=void 0);const m=r===je&&i[a+1].startsWith("/>")?" ":"";o+=r===gt?l+Wo:h>=0?(n.push(c),l.slice(0,h)+Xn+l.slice(h)+Le+m):l+Le+(h===-2?(n.push(void 0),a):m)}return[qs(i,o+(i[t]||"<?>")+(e===2?"</svg>":"")),n]};class _t{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let o=0,r=0;const a=e.length-1,l=this.parts,[c,d]=Go(e,t);if(this.el=_t.createElement(c,n),ze.currentNode=this.el.content,t===2){const h=this.el.content,p=h.firstChild;p.remove(),h.append(...p.childNodes)}for(;(s=ze.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes()){const h=[];for(const p of s.getAttributeNames())if(p.endsWith(Xn)||p.startsWith(Le)){const m=d[r++];if(h.push(p),m!==void 0){const E=s.getAttribute(m.toLowerCase()+Xn).split(Le),w=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:w[2],strings:E,ctor:w[1]==="."?Zo:w[1]==="?"?Jo:w[1]==="@"?Yo:Sn})}else l.push({type:6,index:o})}for(const p of h)s.removeAttribute(p)}if(Ws.test(s.tagName)){const h=s.textContent.split(Le),p=h.length-1;if(p>0){s.textContent=nt?nt.emptyScript:"";for(let m=0;m<p;m++)s.append(h[m],Et()),ze.nextNode(),l.push({type:2,index:++o});s.append(h[p],Et())}}}else if(s.nodeType===8)if(s.data===Fs)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(Le,h+1))!==-1;)l.push({type:7,index:o}),h+=Le.length-1}o++}}static createElement(e,t){const n=He.createElement("template");return n.innerHTML=e,n}}function it(i,e,t=i,n){var s,o,r,a;if(e===We)return e;let l=n!==void 0?(s=t._$Co)===null||s===void 0?void 0:s[n]:t._$Cl;const c=St(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==c&&((o=l==null?void 0:l._$AO)===null||o===void 0||o.call(l,!1),c===void 0?l=void 0:(l=new c(i),l._$AT(i,t,n)),n!==void 0?((r=(a=t)._$Co)!==null&&r!==void 0?r:a._$Co=[])[n]=l:t._$Cl=l),l!==void 0&&(e=it(i,l._$AS(i,e.values),l,n)),e}class Ko{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:s}=this._$AD,o=((t=e==null?void 0:e.creationScope)!==null&&t!==void 0?t:He).importNode(n,!0);ze.currentNode=o;let r=ze.nextNode(),a=0,l=0,c=s[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new Bt(r,r.nextSibling,this,e):c.type===1?d=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(d=new Qo(r,this,e)),this._$AV.push(d),c=s[++l]}a!==(c==null?void 0:c.index)&&(r=ze.nextNode(),a++)}return ze.currentNode=He,o}v(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class Bt{constructor(e,t,n,s){var o;this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cp=(o=s==null?void 0:s.isConnected)===null||o===void 0||o}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=it(this,e,t),St(e)?e===z||e==null||e===""?(this._$AH!==z&&this._$AR(),this._$AH=z):e!==this._$AH&&e!==We&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):qo(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==z&&St(this._$AH)?this._$AA.nextSibling.data=e:this.$(He.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:s}=e,o=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=_t.createElement(qs(s.h,s.h[0]),this.options)),s);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===o)this._$AH.v(n);else{const r=new Ko(o,this),a=r.u(this.options);r.v(n),this.$(a),this._$AH=r}}_$AC(e){let t=es.get(e.strings);return t===void 0&&es.set(e.strings,t=new _t(e)),t}T(e){Hs(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,s=0;for(const o of e)s===t.length?t.push(n=new Bt(this.k(Et()),this.k(Et()),this,this.options)):n=t[s],n._$AI(o),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}let Sn=class{constructor(e,t,n,s,o){this.type=1,this._$AH=z,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,s){const o=this.strings;let r=!1;if(o===void 0)e=it(this,e,t,0),r=!St(e)||e!==this._$AH&&e!==We,r&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;l<o.length-1;l++)c=it(this,a[n+l],t,l),c===We&&(c=this._$AH[l]),r||(r=!St(c)||c!==this._$AH[l]),c===z?e=z:e!==z&&(e+=(c??"")+o[l+1]),this._$AH[l]=c}r&&!s&&this.j(e)}j(e){e===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class Zo extends Sn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===z?void 0:e}}const Xo=nt?nt.emptyScript:"";class Jo extends Sn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==z?this.element.setAttribute(this.name,Xo):this.element.removeAttribute(this.name)}}let Yo=class extends Sn{constructor(e,t,n,s,o){super(e,t,n,s,o),this.type=5}_$AI(e,t=this){var n;if((e=(n=it(this,e,t,0))!==null&&n!==void 0?n:z)===We)return;const s=this._$AH,o=e===z&&s!==z||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==z&&(s===z||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}};class Qo{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){it(this,e)}}const ts=gn.litHtmlPolyfillSupport;ts==null||ts(_t,Bt),((jn=gn.litHtmlVersions)!==null&&jn!==void 0?jn:gn.litHtmlVersions=[]).push("2.8.0");const ea=(i,e,t)=>{var n,s;const o=(n=t==null?void 0:t.renderBefore)!==null&&n!==void 0?n:e;let r=o._$litPart$;if(r===void 0){const a=(s=t==null?void 0:t.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=r=new Bt(e.insertBefore(Et(),a),a,void 0,t??{})}return r._$AI(i),r};var zn,Un;let be=class extends et{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ea(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return We}};be.finalized=!0,be._$litElement$=!0,(zn=globalThis.litElementHydrateSupport)===null||zn===void 0||zn.call(globalThis,{LitElement:be});const ns=globalThis.litElementPolyfillSupport;ns==null||ns({LitElement:be});((Un=globalThis.litElementVersions)!==null&&Un!==void 0?Un:globalThis.litElementVersions=[]).push("3.3.3");const ta=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},na=(i,e,t)=>{e.constructor.createProperty(t,i)};function y(i){return(e,t)=>t!==void 0?na(i,e,t):ta(i,e)}const le=i=>i??z,ia=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",sa="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",ra="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",oa="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e";var aa=Object.defineProperty,la=Object.getOwnPropertyDescriptor,xi=(i,e,t,n)=>{for(var s=n>1?void 0:n?la(e,t):e,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(n?r(e,t,s):r(s))||s);return n&&s&&aa(e,t,s),s},Ye;const At=(Ye=class extends be{static parseLevel(i){if(i){const e=Object.keys($t).find(t=>t.toLowerCase()===i.toLowerCase());return e&&$t[e]}}static get styles(){return[wi`
|
|
410
|
+
${ht(ia)}
|
|
411
|
+
`]}render(){return X`${this.iconToUse&&X`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(i){return i.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(i)}get iconForLevel(){switch(Ye.parseLevel(this.level)){case"warn":return oa;case"suggest":return ra;case"error":return sa;default:return null}}},Ye.ID="sd-field-validation-message",Ye.levelConverter={fromAttribute(i){return Ye.parseLevel(i)},toAttribute(i){return i&&i.toLowerCase()}},Ye);xi([y({type:String,attribute:!0})],At.prototype,"message",2);xi([y({type:String,attribute:!0})],At.prototype,"icon",2);xi([y({converter:At.levelConverter,reflect:!0})],At.prototype,"level",2);let ln=At;var $t=(i=>(i.Warn="warn",i.Suggest="suggest",i.Error="error",i))($t||{});customElements.get(ln.ID)||customElements.define(ln.ID,ln);const ca=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}:host([validationlevel=warn]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn]) .label,:host([validationlevel=warn]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest]) .label,:host([validationlevel=suggest]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error]) .label,:host([validationlevel=error]) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{position:relative}.validation-message{position:absolute;left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input,.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}.input::-ms-clear{display:none}.input::placeholder{color:var(--sd-input-color, #767676)}.input:-ms-input-placeholder{color:var(--sd-input-color, #767676)}.input::-ms-input-placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;top:0;right:0;bottom:0;left:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}";var da=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,Z=(i,e,t,n)=>{for(var s=n>1?void 0:n?ua(e,t):e,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(n?r(e,t,s):r(s))||s);return n&&s&&da(e,t,s),s};const ha="sd-lit-input",is="delegatesFocus"in window.ShadowRoot.prototype;let pa=0;var ke;const V=(ke=class extends be{constructor(){super(),this.rows=1,this.effectiveDisabled=!1,this.type="text",this.autocomplete="off";const i=pa++;this._validationMessageId=ke.ID+"_message_"+i,this._inputId=ke.ID+"_input_"+i,this.attachInternals&&!this.activeShadyDOM&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabIndex")||(this.tabIndex=0)}firstUpdated(i){super.firstUpdated(i),this.initAutocompleted(this.inputElement),this.updateInitialValue(),this.hasAttribute("disabled")&&(this.disabled=!0),this.inputElement.oninput=e=>{this.autocompleted=e.inputType==="insertReplacementText"||!("data"in e),this.currentText=this.inputElement.value,this.fireValueChange(!0)},this.inputElement.onchange=()=>this.fireValueChange(),is||(this.inputElement.onfocus=()=>this.setAttribute("focused",""),this.inputElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",e=>{e.target===this&&this.inputElement.focus()})),this.addEventListener("keydown",e=>{var t,n;e.key=="Enter"&&((n=(t=this._internals)==null?void 0:t.form)==null||n.requestSubmit())}),this._initialized=!0}initAutocompleted(i){const e=t=>{/^onautofillstart(-sd-lit-input-\d+|\s?)$/.test(t.animationName)?this.autocompleted=!0:/^onautofillcancel(-sd-lit-input-\d+|\s?)$/.test(t.animationName)&&(this.autocompleted=!1)};this.activeShadyDOM?(this._needsAutocompletedCheck=!0,this.activeShadyDOM.nativeMethods.addEventListener.call(i,"animationstart",e)):i.addEventListener("animationstart",e)}get activeShadyDOM(){const i=window.ShadyDOM;return i&&i.inUse?i:null}updateInitialValue(){typeof this.currentText<"u"?this.value=this.currentText:this.value=this.getAttribute("value"),this.value&&(this.currentText=this.inputElement.value),this._initialValue=this.value}get disabled(){return this.hasAttribute("disabled")}set disabled(i){i?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._internals||(this.effectiveDisabled=i)}get inputElement(){return this.shadowRoot&&!this._inputElement&&(this._inputElement=this.shadowRoot.querySelector(".input")),this._inputElement}get value(){return this.inputElement&&this.inputElement.value}set value(i){this.currentText=i||"",this.inputElement&&(this.inputElement.value=this.currentText),this.setFormValue(this.currentText)}get selectionStart(){return this.inputElement?this.inputElement.selectionStart:0}focus(){this.inputElement?this.inputElement.focus():super.focus()}select(){this.inputElement&&this.inputElement.select()}setSelectionRange(i,e){this.updateComplete.then(()=>{this.inputElement&&this.inputElement.setSelectionRange(i,e)})}static get styles(){return[wi`
|
|
412
|
+
${ht(ca)}
|
|
413
|
+
`]}render(){let i;return this.rows===1?i=X`
|
|
414
|
+
<input
|
|
415
|
+
id=${this._inputId}
|
|
416
|
+
class="input"
|
|
417
|
+
.type=${this.type}
|
|
418
|
+
placeholder=${le(this.placeholder||void 0)}
|
|
419
|
+
name=${le(this.name||void 0)}
|
|
420
|
+
aria-disabled=${this.effectiveDisabled}
|
|
421
|
+
autocomplete=${this.autocomplete}
|
|
422
|
+
?disabled=${this.inactive}
|
|
423
|
+
?readonly=${this.readonly||this.effectiveDisabled}
|
|
424
|
+
?required=${this.required}
|
|
425
|
+
maxlength=${this.maxlength>0?this.maxlength:ke.DEFAULT_MAX_LENGTH}
|
|
426
|
+
aria-describedby=${this._validationMessageId}
|
|
427
|
+
aria-invalid=${le(!!this.validationMessage||void 0)}
|
|
428
|
+
aria-label=${le(this.sdAriaLabel||void 0)}
|
|
429
|
+
/>
|
|
430
|
+
`:i=X`
|
|
431
|
+
<textarea
|
|
432
|
+
id=${this._inputId}
|
|
433
|
+
class="input"
|
|
434
|
+
placeholder=${le(this.placeholder||void 0)}
|
|
435
|
+
name=${le(this.name||void 0)}
|
|
436
|
+
aria-disabled=${this.effectiveDisabled}
|
|
437
|
+
autocomplete=${this.autocomplete}
|
|
438
|
+
?disabled=${this.inactive}
|
|
439
|
+
?readonly=${this.readonly||this.effectiveDisabled}
|
|
440
|
+
?required=${this.required}
|
|
441
|
+
maxlength=${this.maxlength>0?this.maxlength:ke.DEFAULT_MAX_LENGTH}
|
|
442
|
+
rows=${this.rows}
|
|
443
|
+
aria-describedby=${this._validationMessageId}
|
|
444
|
+
aria-invalid=${le(!!this.validationMessage||void 0)}
|
|
445
|
+
aria-label=${le(this.sdAriaLabel||void 0)}
|
|
446
|
+
></textarea>
|
|
447
|
+
`,X`
|
|
448
|
+
${this.label?X` <div class="floated-label-placeholder" aria-hidden="true"> </div> `:z}
|
|
449
|
+
<div class="input-wrapper">
|
|
450
|
+
<span class="prefix"><slot name="prefix"></slot></span>
|
|
451
|
+
<div class="input-container" style="position:${this.shouldFloat()?"static":"relative"};">
|
|
452
|
+
${this.label&&X`
|
|
453
|
+
<label for="${this._inputId}" class="label ${this.shouldFloat()?"float":""}"
|
|
454
|
+
>${this.label}</label
|
|
455
|
+
>
|
|
456
|
+
`}
|
|
457
|
+
${i}
|
|
458
|
+
</div>
|
|
459
|
+
<span class="suffix"><slot name="suffix"></slot></span>
|
|
460
|
+
</div>
|
|
461
|
+
<div class="underline" aria-hidden="true">
|
|
462
|
+
<div class="unfocused-line"></div>
|
|
463
|
+
<div class="focused-line"></div>
|
|
464
|
+
</div>
|
|
465
|
+
<div class="validation-message-wrapper" aria-hidden="true">
|
|
466
|
+
${this.validationMessage&&X`
|
|
467
|
+
<sd-field-validation-message
|
|
468
|
+
id=${this._validationMessageId}
|
|
469
|
+
class="validation-message"
|
|
470
|
+
.message=${this.validationMessage}
|
|
471
|
+
.icon=${this.validationIconSrc}
|
|
472
|
+
.level=${this.validationLevel}
|
|
473
|
+
>
|
|
474
|
+
</sd-field-validation-message>
|
|
475
|
+
`}
|
|
476
|
+
</div>
|
|
477
|
+
`}updated(i){super.updated(i),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0)}update(i){var e,t;if(super.update(i),i.has("validationMessage")&&(this.validationMessage?(this.validationLevel||(this.validationLevel=$t.Error),(e=this._internals)==null||e.setValidity({customError:!0},this.validationMessage)):(this.validationLevel=null,(t=this._internals)==null||t.setValidity({}))),this._initialized&&i.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(i){this.dispatchEvent(new CustomEvent(`${i?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted}setFormValue(i){var e;(e=this._internals)==null||e.setFormValue(i)}formResetCallback(){this.value=this._initialValue}formDisabledCallback(i){this.effectiveDisabled=i||this.hasAttribute("disabled")}formAssociatedCallback(i){this._needsAutocompletedCheck=!0}formStateRestoreCallback(i,e){typeof i=="string"&&(this.value=i)}},ke.ID=ha,ke.DEFAULT_MAX_LENGTH=524288,ke.formAssociated=!0,ke.shadowRootOptions={...be.shadowRootOptions,delegatesFocus:is},ke);Z([y({type:String,reflect:!0})],V.prototype,"label",2);Z([y({type:String,attribute:!0})],V.prototype,"validationMessage",2);Z([y({type:String,attribute:!0})],V.prototype,"validationIconSrc",2);Z([y({type:$t,attribute:!0,reflect:!0})],V.prototype,"validationLevel",2);Z([y({type:String,hasChanged(i,e){return e!=null&&e!=i}})],V.prototype,"currentText",2);Z([y({type:Boolean,attribute:!0})],V.prototype,"alwaysFloatLabel",2);Z([y({type:Boolean,attribute:!0})],V.prototype,"autocompleted",2);Z([y({type:Number,attribute:!0})],V.prototype,"rows",2);Z([y({type:Boolean,reflect:!0,attribute:"effective-disabled"})],V.prototype,"effectiveDisabled",2);Z([y({type:Boolean,reflect:!0,attribute:"extended-prefix"})],V.prototype,"extendedPrefix",2);Z([y({type:String,reflect:!0})],V.prototype,"type",2);Z([y({type:String,reflect:!0})],V.prototype,"placeholder",2);Z([y({type:String,reflect:!0})],V.prototype,"sdAriaLabel",2);Z([y({type:Number,reflect:!0})],V.prototype,"maxlength",2);Z([y({type:Boolean,reflect:!0})],V.prototype,"readonly",2);Z([y({type:Boolean,reflect:!0})],V.prototype,"required",2);Z([y({type:String,reflect:!0})],V.prototype,"name",2);Z([y({type:Boolean,reflect:!0})],V.prototype,"inactive",2);Z([y({type:String,attribute:!0})],V.prototype,"autocomplete",2);let Fn=V;customElements.get(Fn.ID)||customElements.define(Fn.ID,Fn);const fa={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Vs=i=>(...e)=>({_$litDirective$:i,values:e});let ga=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};let mn=class extends ga{constructor(e){if(super(e),this.et=z,e.type!==fa.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===z||e==null)return this.ft=void 0,this.et=e;if(e===We)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}};mn.directiveName="unsafeHTML",mn.resultType=1;const ma=Vs(mn);let Gs=class{static showImage(e,t,n,s){let o;if(s||!(e instanceof HTMLImageElement)?o=r=>e.style.backgroundImage=this.prepareSrc(r):o=r=>e.src=r,o(n),t){const r=()=>{o(t)},a=new Image;a.addEventListener("load",r),a.src=t,a.complete&&(a.removeEventListener("load",r),r())}}static prepareSrc(e){return e?e.startsWith("url")?e:`url("${e}")`:null}};const va=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}';var ba=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,ie=(i,e,t,n)=>{for(var s=n>1?void 0:n?ya(e,t):e,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(n?r(e,t,s):r(s))||s);return n&&s&&ba(e,t,s),s},Be;const ee=(Be=class extends be{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[wi`
|
|
478
|
+
${ht(va)}
|
|
479
|
+
`]}render(){return X`
|
|
480
|
+
<div class="container">
|
|
481
|
+
${this.getLevelIndicators().map((i,e)=>X` <div class="level-indicator level-${e}"></div> `)}
|
|
482
|
+
<div class="side-content">
|
|
483
|
+
<slot name="left-content"></slot>
|
|
484
|
+
${this.renderIcon()}
|
|
485
|
+
</div>
|
|
486
|
+
<div class="labels">
|
|
487
|
+
${this.renderLabel("caption",this.caption,this.captionAttrTitle)}
|
|
488
|
+
${this.renderLabel("description",this.description,this.descriptionAttrTitle)}
|
|
489
|
+
</div>
|
|
490
|
+
<div class="side-content">
|
|
491
|
+
<slot name="right-content"></slot>
|
|
492
|
+
</div>
|
|
493
|
+
</div>
|
|
494
|
+
`}renderIcon(){if(this.icon||this.iconPlaceholder){const i=this.iconBackgroundColor!=null?`background-color:${this.iconBackgroundColor}`:void 0;return X`
|
|
495
|
+
<div
|
|
496
|
+
class="icon-wrapper"
|
|
497
|
+
@pointerdown="${this.handleIconClick}"
|
|
498
|
+
style="${le(i)}"
|
|
499
|
+
role="img"
|
|
500
|
+
aria-label="${le(this.iconAttrAriaLabel)}"
|
|
501
|
+
title="${le(this.iconAttrTitle)}"
|
|
502
|
+
>
|
|
503
|
+
<div class="icon"></div>
|
|
504
|
+
</div>
|
|
505
|
+
`}return z}renderLabel(i,e,t){return e?X`
|
|
506
|
+
<div class="${i}" title="${le(t)}">
|
|
507
|
+
${this.contentMode==="html"?ma(e):e}
|
|
508
|
+
</div>
|
|
509
|
+
`:z}updated(i){super.updated(i),(i.has("icon")||i.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Gs.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const n=this.shadowRoot.querySelector(".description");return n&&(e=Math.max(e,n.scrollWidth-n.clientWidth)),e>0&&e++,i&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Be.ID="sd-list-item",Be.ensureDefined=()=>{customElements.get(Be.ID)||customElements.define(Be.ID,Be)},Be);ie([y({type:String})],ee.prototype,"caption",2);ie([y({type:String})],ee.prototype,"description",2);ie([y({type:Boolean})],ee.prototype,"selected",2);ie([y({type:String})],ee.prototype,"icon",2);ie([y({type:String})],ee.prototype,"iconBackgroundColor",2);ie([y({type:String})],ee.prototype,"iconPlaceholder",2);ie([y({type:Number})],ee.prototype,"level",2);ie([y()],ee.prototype,"contentMode",2);ie([y({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],ee.prototype,"enableLineClamp",2);ie([y({type:Boolean,reflect:!0,attribute:"aria-disabled"})],ee.prototype,"disabled",2);ie([y({type:String,attribute:"icon-attr-aria-label"})],ee.prototype,"iconAttrAriaLabel",2);ie([y({type:String,reflect:!0})],ee.prototype,"role",2);ie([y({type:String,attribute:"caption-attr-title"})],ee.prototype,"captionAttrTitle",2);ie([y({type:String,attribute:"description-attr-title"})],ee.prototype,"descriptionAttrTitle",2);ie([y({type:String,attribute:"icon-attr-title"})],ee.prototype,"iconAttrTitle",2);let Ct=ee;const Ks=(i,e)=>{const t=document.createElement(Ct.ID);if(i){if(t.caption=i.caption,t.description=i.description,t.icon=i.icon,t.iconBackgroundColor=i.iconBackgroundColor,t.iconPlaceholder=i.iconPlaceholder,t.level=i.level,t.disabled=i.disabled,i.contentMode&&(t.contentMode=i.contentMode),i.leftContentGenerator){const n=i.leftContentGenerator(i,t);n&&(n.slot="left-content",t.appendChild(n))}if(i.rightContentGenerator){const n=i.rightContentGenerator(i,t);n&&(n.slot="right-content",t.appendChild(n))}}return t};Ct.ensureDefined();var se="top",he="bottom",pe="right",re="left",ki="auto",zt=[se,he,pe,re],st="start",Ot="end",wa="clippingParents",Zs="viewport",mt="popper",xa="reference",ss=zt.reduce(function(i,e){return i.concat([e+"-"+st,e+"-"+Ot])},[]),Xs=[].concat(zt,[ki]).reduce(function(i,e){return i.concat([e,e+"-"+st,e+"-"+Ot])},[]),ka="beforeRead",Ea="read",Sa="afterRead",_a="beforeMain",Aa="main",$a="afterMain",Ca="beforeWrite",Oa="write",Ia="afterWrite",Ta=[ka,Ea,Sa,_a,Aa,$a,Ca,Oa,Ia];function Ae(i){return i?(i.nodeName||"").toLowerCase():null}function ce(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function qe(i){var e=ce(i).Element;return i instanceof e||i instanceof Element}function ue(i){var e=ce(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Ei(i){if(typeof ShadowRoot>"u")return!1;var e=ce(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function La(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},s=e.attributes[t]||{},o=e.elements[t];!ue(o)||!Ae(o)||(Object.assign(o.style,n),Object.keys(s).forEach(function(r){var a=s[r];a===!1?o.removeAttribute(r):o.setAttribute(r,a===!0?"":a)}))})}function Pa(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var s=e.elements[n],o=e.attributes[n]||{},r=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),a=r.reduce(function(l,c){return l[c]="",l},{});!ue(s)||!Ae(s)||(Object.assign(s.style,a),Object.keys(o).forEach(function(l){s.removeAttribute(l)}))})}}const Ra={name:"applyStyles",enabled:!0,phase:"write",fn:La,effect:Pa,requires:["computeStyles"]};function _e(i){return i.split("-")[0]}var Ue=Math.max,vn=Math.min,rt=Math.round;function Jn(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Js(){return!/^((?!chrome|android).)*safari/i.test(Jn())}function ot(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=i.getBoundingClientRect(),s=1,o=1;e&&ue(i)&&(s=i.offsetWidth>0&&rt(n.width)/i.offsetWidth||1,o=i.offsetHeight>0&&rt(n.height)/i.offsetHeight||1);var r=qe(i)?ce(i):window,a=r.visualViewport,l=!Js()&&t,c=(n.left+(l&&a?a.offsetLeft:0))/s,d=(n.top+(l&&a?a.offsetTop:0))/o,h=n.width/s,p=n.height/o;return{width:h,height:p,top:d,right:c+h,bottom:d+p,left:c,x:c,y:d}}function Si(i){var e=ot(i),t=i.offsetWidth,n=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:n}}function Ys(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Ei(t)){var n=e;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Oe(i){return ce(i).getComputedStyle(i)}function Ma(i){return["table","td","th"].indexOf(Ae(i))>=0}function Re(i){return((qe(i)?i.ownerDocument:i.document)||window.document).documentElement}function _n(i){return Ae(i)==="html"?i:i.assignedSlot||i.parentNode||(Ei(i)?i.host:null)||Re(i)}function rs(i){return!ue(i)||Oe(i).position==="fixed"?null:i.offsetParent}function Da(i){var e=/firefox/i.test(Jn()),t=/Trident/i.test(Jn());if(t&&ue(i)){var n=Oe(i);if(n.position==="fixed")return null}var s=_n(i);for(Ei(s)&&(s=s.host);ue(s)&&["html","body"].indexOf(Ae(s))<0;){var o=Oe(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function Ut(i){for(var e=ce(i),t=rs(i);t&&Ma(t)&&Oe(t).position==="static";)t=rs(t);return t&&(Ae(t)==="html"||Ae(t)==="body"&&Oe(t).position==="static")?e:t||Da(i)||e}function _i(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function wt(i,e,t){return Ue(i,vn(e,t))}function Na(i,e,t){var n=wt(i,e,t);return n>t?t:n}function Qs(){return{top:0,right:0,bottom:0,left:0}}function er(i){return Object.assign({},Qs(),i)}function tr(i,e){return e.reduce(function(t,n){return t[n]=i,t},{})}var ja=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,er(typeof e!="number"?e:tr(e,zt))};function Ba(i){var e,t=i.state,n=i.name,s=i.options,o=t.elements.arrow,r=t.modifiersData.popperOffsets,a=_e(t.placement),l=_i(a),c=[re,pe].indexOf(a)>=0,d=c?"height":"width";if(!(!o||!r)){var h=ja(s.padding,t),p=Si(o),m=l==="y"?se:re,E=l==="y"?he:pe,w=t.rects.reference[d]+t.rects.reference[l]-r[l]-t.rects.popper[d],f=r[l]-t.rects.reference[l],$=Ut(o),T=$?l==="y"?$.clientHeight||0:$.clientWidth||0:0,L=w/2-f/2,x=h[m],A=T-p[d]-h[E],O=T/2-p[d]/2+L,P=wt(x,O,A),M=l;t.modifiersData[n]=(e={},e[M]=P,e.centerOffset=P-O,e)}}function za(i){var e=i.state,t=i.options,n=t.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||Ys(e.elements.popper,s)&&(e.elements.arrow=s))}const Ua={name:"arrow",enabled:!0,phase:"main",fn:Ba,effect:za,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function at(i){return i.split("-")[1]}var Fa={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ha(i,e){var t=i.x,n=i.y,s=e.devicePixelRatio||1;return{x:rt(t*s)/s||0,y:rt(n*s)/s||0}}function os(i){var e,t=i.popper,n=i.popperRect,s=i.placement,o=i.variation,r=i.offsets,a=i.position,l=i.gpuAcceleration,c=i.adaptive,d=i.roundOffsets,h=i.isFixed,p=r.x,m=p===void 0?0:p,E=r.y,w=E===void 0?0:E,f=typeof d=="function"?d({x:m,y:w}):{x:m,y:w};m=f.x,w=f.y;var $=r.hasOwnProperty("x"),T=r.hasOwnProperty("y"),L=re,x=se,A=window;if(c){var O=Ut(t),P="clientHeight",M="clientWidth";if(O===ce(t)&&(O=Re(t),Oe(O).position!=="static"&&a==="absolute"&&(P="scrollHeight",M="scrollWidth")),O=O,s===se||(s===re||s===pe)&&o===Ot){x=he;var I=h&&O===A&&A.visualViewport?A.visualViewport.height:O[P];w-=I-n.height,w*=l?1:-1}if(s===re||(s===se||s===he)&&o===Ot){L=pe;var j=h&&O===A&&A.visualViewport?A.visualViewport.width:O[M];m-=j-n.width,m*=l?1:-1}}var q=Object.assign({position:a},c&&Fa),te=d===!0?Ha({x:m,y:w},ce(t)):{x:m,y:w};if(m=te.x,w=te.y,l){var G;return Object.assign({},q,(G={},G[x]=T?"0":"",G[L]=$?"0":"",G.transform=(A.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",G))}return Object.assign({},q,(e={},e[x]=T?w+"px":"",e[L]=$?m+"px":"",e.transform="",e))}function Wa(i){var e=i.state,t=i.options,n=t.gpuAcceleration,s=n===void 0?!0:n,o=t.adaptive,r=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:_e(e.placement),variation:at(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,os(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,os(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const qa={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Wa,data:{}};var Gt={passive:!0};function Va(i){var e=i.state,t=i.instance,n=i.options,s=n.scroll,o=s===void 0?!0:s,r=n.resize,a=r===void 0?!0:r,l=ce(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(d){d.addEventListener("scroll",t.update,Gt)}),a&&l.addEventListener("resize",t.update,Gt),function(){o&&c.forEach(function(d){d.removeEventListener("scroll",t.update,Gt)}),a&&l.removeEventListener("resize",t.update,Gt)}}const Ga={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Va,data:{}};var Ka={left:"right",right:"left",bottom:"top",top:"bottom"};function cn(i){return i.replace(/left|right|bottom|top/g,function(e){return Ka[e]})}var Za={start:"end",end:"start"};function as(i){return i.replace(/start|end/g,function(e){return Za[e]})}function Ai(i){var e=ce(i),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function $i(i){return ot(Re(i)).left+Ai(i).scrollLeft}function Xa(i,e){var t=ce(i),n=Re(i),s=t.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Js();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+$i(i),y:l}}function Ja(i){var e,t=Re(i),n=Ai(i),s=(e=i.ownerDocument)==null?void 0:e.body,o=Ue(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=Ue(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+$i(i),l=-n.scrollTop;return Oe(s||t).direction==="rtl"&&(a+=Ue(t.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}function Ci(i){var e=Oe(i),t=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+n)}function nr(i){return["html","body","#document"].indexOf(Ae(i))>=0?i.ownerDocument.body:ue(i)&&Ci(i)?i:nr(_n(i))}function xt(i,e){var t;e===void 0&&(e=[]);var n=nr(i),s=n===((t=i.ownerDocument)==null?void 0:t.body),o=ce(n),r=s?[o].concat(o.visualViewport||[],Ci(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(xt(_n(r)))}function Yn(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function Ya(i,e){var t=ot(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function ls(i,e,t){return e===Zs?Yn(Xa(i,t)):qe(e)?Ya(e,t):Yn(Ja(Re(i)))}function Qa(i){var e=xt(_n(i)),t=["absolute","fixed"].indexOf(Oe(i).position)>=0,n=t&&ue(i)?Ut(i):i;return qe(n)?e.filter(function(s){return qe(s)&&Ys(s,n)&&Ae(s)!=="body"}):[]}function el(i,e,t,n){var s=e==="clippingParents"?Qa(i):[].concat(e),o=[].concat(s,[t]),r=o[0],a=o.reduce(function(l,c){var d=ls(i,c,n);return l.top=Ue(d.top,l.top),l.right=vn(d.right,l.right),l.bottom=vn(d.bottom,l.bottom),l.left=Ue(d.left,l.left),l},ls(i,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ir(i){var e=i.reference,t=i.element,n=i.placement,s=n?_e(n):null,o=n?at(n):null,r=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case se:l={x:r,y:e.y-t.height};break;case he:l={x:r,y:e.y+e.height};break;case pe:l={x:e.x+e.width,y:a};break;case re:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?_i(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case st:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Ot:l[c]=l[c]+(e[d]/2-t[d]/2);break}}return l}function It(i,e){e===void 0&&(e={});var t=e,n=t.placement,s=n===void 0?i.placement:n,o=t.strategy,r=o===void 0?i.strategy:o,a=t.boundary,l=a===void 0?wa:a,c=t.rootBoundary,d=c===void 0?Zs:c,h=t.elementContext,p=h===void 0?mt:h,m=t.altBoundary,E=m===void 0?!1:m,w=t.padding,f=w===void 0?0:w,$=er(typeof f!="number"?f:tr(f,zt)),T=p===mt?xa:mt,L=i.rects.popper,x=i.elements[E?T:p],A=el(qe(x)?x:x.contextElement||Re(i.elements.popper),l,d,r),O=ot(i.elements.reference),P=ir({reference:O,element:L,strategy:"absolute",placement:s}),M=Yn(Object.assign({},L,P)),I=p===mt?M:O,j={top:A.top-I.top+$.top,bottom:I.bottom-A.bottom+$.bottom,left:A.left-I.left+$.left,right:I.right-A.right+$.right},q=i.modifiersData.offset;if(p===mt&&q){var te=q[s];Object.keys(j).forEach(function(G){var ge=[pe,he].indexOf(G)>=0?1:-1,ne=[se,he].indexOf(G)>=0?"y":"x";j[G]+=te[ne]*ge})}return j}function tl(i,e){e===void 0&&(e={});var t=e,n=t.placement,s=t.boundary,o=t.rootBoundary,r=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?Xs:l,d=at(n),h=d?a?ss:ss.filter(function(E){return at(E)===d}):zt,p=h.filter(function(E){return c.indexOf(E)>=0});p.length===0&&(p=h);var m=p.reduce(function(E,w){return E[w]=It(i,{placement:w,boundary:s,rootBoundary:o,padding:r})[_e(w)],E},{});return Object.keys(m).sort(function(E,w){return m[E]-m[w]})}function nl(i){if(_e(i)===ki)return[];var e=cn(i);return[as(i),e,as(e)]}function il(i){var e=i.state,t=i.options,n=i.name;if(!e.modifiersData[n]._skip){for(var s=t.mainAxis,o=s===void 0?!0:s,r=t.altAxis,a=r===void 0?!0:r,l=t.fallbackPlacements,c=t.padding,d=t.boundary,h=t.rootBoundary,p=t.altBoundary,m=t.flipVariations,E=m===void 0?!0:m,w=t.allowedAutoPlacements,f=e.options.placement,$=_e(f),T=$===f,L=l||(T||!E?[cn(f)]:nl(f)),x=[f].concat(L).reduce(function(me,H){return me.concat(_e(H)===ki?tl(e,{placement:H,boundary:d,rootBoundary:h,padding:c,flipVariations:E,allowedAutoPlacements:w}):H)},[]),A=e.rects.reference,O=e.rects.popper,P=new Map,M=!0,I=x[0],j=0;j<x.length;j++){var q=x[j],te=_e(q),G=at(q)===st,ge=[se,he].indexOf(te)>=0,ne=ge?"width":"height",J=It(e,{placement:q,boundary:d,rootBoundary:h,altBoundary:p,padding:c}),u=ge?G?pe:re:G?he:se;A[ne]>O[ne]&&(u=cn(u));var v=cn(u),k=[];if(o&&k.push(J[te]<=0),a&&k.push(J[u]<=0,J[v]<=0),k.every(function(me){return me})){I=q,M=!1;break}P.set(q,k)}if(M)for(var C=E?3:1,B=function(H){var Y=x.find(function(De){var we=P.get(De);if(we)return we.slice(0,H).every(function(Ke){return Ke})});if(Y)return I=Y,"break"},K=C;K>0;K--){var oe=B(K);if(oe==="break")break}e.placement!==I&&(e.modifiersData[n]._skip=!0,e.placement=I,e.reset=!0)}}const sl={name:"flip",enabled:!0,phase:"main",fn:il,requiresIfExists:["offset"],data:{_skip:!1}};function cs(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function ds(i){return[se,pe,he,re].some(function(e){return i[e]>=0})}function rl(i){var e=i.state,t=i.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=It(e,{elementContext:"reference"}),a=It(e,{altBoundary:!0}),l=cs(r,n),c=cs(a,s,o),d=ds(l),h=ds(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const ol={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rl};function al(i,e,t){var n=_e(i),s=[re,se].indexOf(n)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[re,pe].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}function ll(i){var e=i.state,t=i.options,n=i.name,s=t.offset,o=s===void 0?[0,0]:s,r=Xs.reduce(function(d,h){return d[h]=al(h,e.rects,o),d},{}),a=r[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}const cl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ll};function dl(i){var e=i.state,t=i.name;e.modifiersData[t]=ir({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const ul={name:"popperOffsets",enabled:!0,phase:"read",fn:dl,data:{}};function hl(i){return i==="x"?"y":"x"}function pl(i){var e=i.state,t=i.options,n=i.name,s=t.mainAxis,o=s===void 0?!0:s,r=t.altAxis,a=r===void 0?!1:r,l=t.boundary,c=t.rootBoundary,d=t.altBoundary,h=t.padding,p=t.tether,m=p===void 0?!0:p,E=t.tetherOffset,w=E===void 0?0:E,f=It(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),$=_e(e.placement),T=at(e.placement),L=!T,x=_i($),A=hl(x),O=e.modifiersData.popperOffsets,P=e.rects.reference,M=e.rects.popper,I=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,j=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,te={x:0,y:0};if(O){if(o){var G,ge=x==="y"?se:re,ne=x==="y"?he:pe,J=x==="y"?"height":"width",u=O[x],v=u+f[ge],k=u-f[ne],C=m?-M[J]/2:0,B=T===st?P[J]:M[J],K=T===st?-M[J]:-P[J],oe=e.elements.arrow,me=m&&oe?Si(oe):{width:0,height:0},H=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Qs(),Y=H[ge],De=H[ne],we=wt(0,P[J],me[J]),Ke=L?P[J]/2-C-we-Y-j.mainAxis:B-we-Y-j.mainAxis,Rn=L?-P[J]/2+C+we+De+j.mainAxis:K+we+De+j.mainAxis,pt=e.elements.arrow&&Ut(e.elements.arrow),Mn=pt?x==="y"?pt.clientTop||0:pt.clientLeft||0:0,Wt=(G=q==null?void 0:q[x])!=null?G:0,Ze=u+Ke-Wt-Mn,qt=u+Rn-Wt,ae=wt(m?vn(v,Ze):v,u,m?Ue(k,qt):k);O[x]=ae,te[x]=ae-u}if(a){var Vt,ft=x==="x"?se:re,S=x==="x"?he:pe,xe=O[A],W=A==="y"?"height":"width",D=xe+f[ft],Ne=xe-f[S],ve=[se,re].indexOf($)!==-1,Xe=(Vt=q==null?void 0:q[A])!=null?Vt:0,Je=ve?D:xe-P[W]-M[W]-Xe+j.altAxis,g=ve?xe+P[W]+M[W]-Xe-j.altAxis:Ne,b=m&&ve?Na(Je,xe,g):wt(m?Je:D,xe,m?g:Ne);O[A]=b,te[A]=b-xe}e.modifiersData[n]=te}}const fl={name:"preventOverflow",enabled:!0,phase:"main",fn:pl,requiresIfExists:["offset"]};function gl(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function ml(i){return i===ce(i)||!ue(i)?Ai(i):gl(i)}function vl(i){var e=i.getBoundingClientRect(),t=rt(e.width)/i.offsetWidth||1,n=rt(e.height)/i.offsetHeight||1;return t!==1||n!==1}function bl(i,e,t){t===void 0&&(t=!1);var n=ue(e),s=ue(e)&&vl(e),o=Re(e),r=ot(i,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!t)&&((Ae(e)!=="body"||Ci(o))&&(a=ml(e)),ue(e)?(l=ot(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=$i(o))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function yl(i){var e=new Map,t=new Set,n=[];i.forEach(function(o){e.set(o.name,o)});function s(o){t.add(o.name);var r=[].concat(o.requires||[],o.requiresIfExists||[]);r.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),n.push(o)}return i.forEach(function(o){t.has(o.name)||s(o)}),n}function wl(i){var e=yl(i);return Ta.reduce(function(t,n){return t.concat(e.filter(function(s){return s.phase===n}))},[])}function xl(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function kl(i){var e=i.reduce(function(t,n){var s=t[n.name];return t[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var us={placement:"bottom",modifiers:[],strategy:"absolute"};function hs(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function El(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,n=t===void 0?[]:t,s=e.defaultOptions,o=s===void 0?us:s;return function(a,l,c){c===void 0&&(c=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},us,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],p=!1,m={state:d,setOptions:function($){var T=typeof $=="function"?$(d.options):$;w(),d.options=Object.assign({},o,d.options,T),d.scrollParents={reference:qe(a)?xt(a):a.contextElement?xt(a.contextElement):[],popper:xt(l)};var L=wl(kl([].concat(n,d.options.modifiers)));return d.orderedModifiers=L.filter(function(x){return x.enabled}),E(),m.update()},forceUpdate:function(){if(!p){var $=d.elements,T=$.reference,L=$.popper;if(hs(T,L)){d.rects={reference:bl(T,Ut(L),d.options.strategy==="fixed"),popper:Si(L)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(j){return d.modifiersData[j.name]=Object.assign({},j.data)});for(var x=0;x<d.orderedModifiers.length;x++){if(d.reset===!0){d.reset=!1,x=-1;continue}var A=d.orderedModifiers[x],O=A.fn,P=A.options,M=P===void 0?{}:P,I=A.name;typeof O=="function"&&(d=O({state:d,options:M,name:I,instance:m})||d)}}}},update:xl(function(){return new Promise(function(f){m.forceUpdate(),f(d)})}),destroy:function(){w(),p=!0}};if(!hs(a,l))return m;m.setOptions(c).then(function(f){!p&&c.onFirstUpdate&&c.onFirstUpdate(f)});function E(){d.orderedModifiers.forEach(function(f){var $=f.name,T=f.options,L=T===void 0?{}:T,x=f.effect;if(typeof x=="function"){var A=x({state:d,name:$,instance:m,options:L}),O=function(){};h.push(A||O)}})}function w(){h.forEach(function(f){return f()}),h=[]}return m}}var Sl=[Ga,ul,qa,Ra,cl,sl,fl,Ua,ol],_l=El({defaultModifiers:Sl});const Al=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="12" viewBox="0 0 24 12">\r
|
|
510
|
+
<path d="M0 0l11.96 12L24 0z" fill="#999" class="arrow-border"/>\r
|
|
511
|
+
<path d="M12 11L1 0h22z" fill="#f2f2f2" class="arrow-background"/>\r
|
|
512
|
+
</svg>\r
|
|
513
|
+
`,$l=navigator.userAgent.indexOf("Trident")!==-1,ps=1,fs="sd-popover-open",sr=class extends HTMLElement{constructor(){super(...arguments),this._open=!1,this._firstUpdated=!1,this.toggle=()=>{this.open=!this.open},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1},this.hideIfExternalTarget=e=>{const t=e.target;(!(t instanceof HTMLElement)||!this._container.contains(t)&&!this.targetElement.contains(t))&&this.hide()}}get triggerType(){return this.getAttribute("trigger-type")}set triggerType(e){e?this.setAttribute("trigger-type",e):this.removeAttribute("trigger-type")}get placement(){return this.getAttribute("placement")}set placement(e){e?this.setAttribute("placement",e):this.removeAttribute("placement")}get targetElement(){return this._targetElement}set targetElement(e){this.removeTargetEventListener(this.targetElement),this._targetElement&&this._targetElement.getAttribute("aria-expanded")=="true"&&this._targetElement.setAttribute("aria-expanded","false"),this._targetElement=e,e.setAttribute("aria-expanded","false"),this.addTargetEventListener(this.targetElement),this.updatePopper()}get targetSelector(){return this.getAttribute("target-selector")}set targetSelector(e){e?this.setAttribute("target-selector",e):this.removeAttribute("target-selector")}get modal(){return this.hasAttribute("modal")}set modal(e){e?this.setAttribute("modal",""):this.removeAttribute("modal")}get popoverFor(){return this.getAttribute("popover-for")}set popoverFor(e){e?this.setAttribute("popover-for",e):this.removeAttribute("popover-for")}get flipPriority(){return this._flipPriority}set flipPriority(e){e&&e.length>0?this._flipPriority=e:this._flipPriority=null,this.reConfigurePopper()}get offset(){return this.getAttribute("offset")?parseInt(this.getAttribute("offset")):0}set offset(e){e?this.setAttribute("offset",e.toString()):this.removeAttribute("offset"),this.reConfigurePopper()}reConfigurePopper(){this._popper&&this.configurePopper()}get noArrow(){return this.hasAttribute("no-arrow")}set noArrow(e){e?this.setAttribute("no-arrow",""):this.removeAttribute("no-arrow")}static get observedAttributes(){return["placement","target-selector","trigger-type"]}attributeChangedCallback(e,t){switch(e){case"placement":{this.updatePopper();break}case"trigger-type":{this.removeTargetEventListener(this.targetElement),this.addTargetEventListener(this.targetElement);break}case"target-selector":{this.handleTargetSelectorChange(t);break}}}connectedCallback(){this._firstUpdated||(this.firstUpdated(),this._firstUpdated=!0),this.targetElement?this.addTargetEventListener(this.targetElement):this.targetSelector&&requestAnimationFrame(()=>{this.isConnected&&this.handleTargetSelectorChange(null)}),this._arrow=document.createElement("div"),this._arrow.classList.add("popover-arrow"),this._arrow.setAttribute("data-popper-arrow",""),this._arrow.style.display="flex",this._arrow.innerHTML=Al}disconnectedCallback(){this.targetElement&&(this.removeTargetEventListener(this.targetElement),this.removeTargetClassForOpen(this.targetElement)),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}firstUpdated(){this.style.display="none",this.triggerType=this.triggerType||"click",this.placement=this.placement||"auto"}get open(){return this._open}set open(e){e!==this._open&&(this._open=e,this.handleOpenChange())}handleOpenChange(){this.open?(this._popper||this.configurePopper(),this._container.innerHTML="",this.popoverFor&&this._container.setAttribute("popover-for",this.popoverFor),this.content&&(this._container.prepend(this.content),Object.assign(this.content.style,{position:"relative",display:"block",zIndex:1}),window.requestAnimationFrame(()=>{let e=getComputedStyle(this.content).backgroundColor;e=="rgba(0, 0, 0, 0)"&&(this.content.style.background=e="#f2f2f2"),this._arrow.querySelector(".arrow-background").style.fill=e})),this.ensureArrowIsAdded(),this.ownerDocument.body.appendChild(this._container),this.updatePopper(),this.setAttribute("open",""),this.modal&&(window.addEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.addEventListener("focus",this.hideIfExternalTarget,{capture:!0})),this.targetElement&&(this.addTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","true")),this.dispatchEvent(new CustomEvent("open"))):(this.ownerDocument.body.removeChild(this._container),this.removeAttribute("open"),window.removeEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.removeEventListener("focus",this.hideIfExternalTarget,{capture:!0}),this.targetElement&&(this.removeTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","false")),this.dispatchEvent(new CustomEvent("close")))}handleTargetSelectorChange(e){const t=document.querySelector(e);t&&(this.removeTargetEventListener(t),this.removeTargetClassForOpen(t)),this.targetSelector&&(this.targetElement=document.querySelector(this.targetSelector),this.addTargetEventListener(this.targetElement))}addTargetEventListener(e){if(e)switch(this.triggerType){case"hover":{e.addEventListener("mouseenter",this.show),e.addEventListener("mouseleave",this.hide);break}case"click":{e.addEventListener("click",this.toggle);break}}}removeTargetEventListener(e){if(e)switch(this.triggerType){case"hover":{e.removeEventListener("mouseenter",this.show),e.removeEventListener("mouseleave",this.hide);break}case"click":{e.removeEventListener("click",this.toggle);break}}}configurePopper(){this.createContentContainer(),this.ensureArrowIsAdded();const e=this,t={placement:e.placement,strategy:"absolute",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!$l}},{name:"flip",options:{fallbackPlacements:e._flipPriority}},{name:"offset",options:{offset:()=>[0,e.noArrow?0+e.offset:this._arrow.clientHeight+e.offset]}},{name:"arrow",options:{padding:6}},{name:"resetArrowStyles",enabled:!0,phase:"beforeWrite",fn({state:n}){Object.assign(e._arrow.style,{top:n.styles.arrow.top||"",left:n.styles.arrow.left||"",bottom:n.styles.arrow.bottom||"",right:n.styles.arrow.right||""})}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn({state:n}){e.updateArrow(n.placement)}}]};this._popper=_l(this.targetElement,this._container,t)}createContentContainer(){this._container=document.createElement("div"),this._container.classList.add("popover-container"),this._container.tabIndex=0,this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(()=>{this._popper&&this._popper.update()}),this._resizeObserver.observe(this._container),Object.assign(this._container.style,{boxShadow:`0 4px 5px 0 rgba(0, 0, 0, 0.14),
|
|
514
|
+
0 1px 10px 0 rgba(0, 0, 0, 0.12),
|
|
515
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.4)`,border:"1px solid #999",boxSizing:"border-box",zIndex:2e4})}ensureArrowIsAdded(){!this.noArrow&&!this._container.contains(this._arrow)&&this._container.appendChild(this._arrow)}updatePopper(){this._popper&&(this._popper.state.elements.reference=this.targetElement,this._popper.state.options.placement=this.placement,this.open&&this._popper.update())}updateArrow(e){if(this._arrow){const t=this.getArrowVariant(e);if(this._arrow.setAttribute("variant",t),this._content){const n=this._arrow.querySelector("svg"),s=this._arrow.clientWidth,o=this._arrow.clientHeight,r=`-${o-ps}px`,a=(s-o)/2,l=`-${o+a-ps}px`;switch(t){case"bottom":{this._arrow.style.top=r,n.style.transform="rotate(180deg)";break}case"top":{this._arrow.style.bottom=r,n.style.transform="rotate(0deg)";break}case"left":{this._arrow.style.right=l,n.style.transform="rotate(270deg)";break}case"right":{this._arrow.style.left=l,n.style.transform="rotate(90deg)";break}}}}}getArrowVariant(e){if(e.indexOf("bottom")!==-1)return"bottom";if(e.indexOf("top")!==-1)return"top";if(e.indexOf("left")!==-1)return"left";if(e.indexOf("right")!==-1)return"right"}get content(){return this._content||(this._content=this.firstElementChild,this._content.setAttribute("data-popper-content","")),this._content}addTargetClassForOpen(e){e&&e.classList.add(fs)}removeTargetClassForOpen(e){e&&e.classList.remove(fs)}};sr.ID="sd-popover";let dn=sr;customElements.get(dn.ID)||customElements.define(dn.ID,dn);const rr=class un extends HTMLElement{memoizedTemplate(){const e=this.is();if(un.TEMPLATE_CACHE[e])return un.TEMPLATE_CACHE[e];const t=this.template();return window.ShadyCSS&&window.ShadyCSS.prepareTemplate(t,this.is()),un.TEMPLATE_CACHE[e]=t,t}connectedCallback(){const e=this.memoizedTemplate();window.ShadyCSS&&window.ShadyCSS.styleElement(this),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.importNode(e.content,!0)),requestAnimationFrame(()=>this.dispatchEvent(new CustomEvent("ready"))))}whenReady(e){this.shadowRoot?e():this.addEventListener("ready",()=>e())}};rr.TEMPLATE_CACHE={};let Cl=rr;const Ol=`<style>
|
|
516
|
+
:host {
|
|
517
|
+
background-color: var(--sd-list-base-background-color, white);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.container {
|
|
521
|
+
width: 100%;
|
|
522
|
+
height: 100%;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
:host(:focus) {
|
|
526
|
+
outline: none;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
:host(:focus-visible) ::slotted([focused]) {
|
|
530
|
+
box-shadow: 0 0 0 1px #1467ba inset;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.container ::slotted(*) {
|
|
534
|
+
display: block;
|
|
535
|
+
box-sizing: border-box;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.container ::slotted(:not(:last-of-type)) {
|
|
539
|
+
border-bottom: 1px solid #d9d9d9;
|
|
540
|
+
}
|
|
541
|
+
</style>
|
|
542
|
+
|
|
543
|
+
<div class="container">
|
|
544
|
+
<slot name="items"></slot>
|
|
545
|
+
<slot id="default-slot"></slot>
|
|
546
|
+
</div>
|
|
547
|
+
`;let Il=0;const tt=class Qn extends Cl{constructor(){super(),this._items=[],this._selectedIndexes=[],this._itemGenerator=Ks,this.onDefaultSlotChange=()=>{let e=0;this.defaultSlot.assignedElements().forEach(t=>{this.isSeparator(t)||this.initListItem(t,e++)}),this.updateFocusedElement()},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"ArrowDown":case"Down":this.focusIndex=Math.min(this.getListItems.length-1,this.focusIndex+1);break;case"ArrowUp":case"Up":this.focusIndex=Math.max(0,this.focusIndex-1);break;case"Enter":case"Space":case" ":this.handleSelection(this.focusIndex,e.metaKey||e.ctrlKey);break;case"End":case"PageDown":this.focusIndex=this.items.length-1;break;case"Home":case"PageUp":this.focusIndex=0;break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._fallbackId=Qn.ID+"_"+Il++,this.addEventListener("pointerup",e=>{this.focusIndex=this.getListItems.indexOf(e.target),this.updateFocusedElement()}),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndexes&&(this.focusIndex=this.selectedIndexes[0]),this.focusIndex==-1&&this.childElementCount>0&&(this.focusIndex=0)):this.updateFocusedElement())}),this.addEventListener("blur",()=>this.removeFocusedItemAttributes())}get items(){return this._items}set items(e){this._items=e,this.render()}get itemGenerator(){return this._itemGenerator}set itemGenerator(e){this._itemGenerator=e,this.render()}get selectionType(){return this.getAttribute("selection-type")}set selectionType(e){e?this.setAttribute("selection-type",e):this.removeAttribute("selection-type")}get focusIndex(){return this.hasAttribute("focus-index")?Number(this.getAttribute("focus-index")):-1}set focusIndex(e){0<=e&&e<this.getListItems.length?this.setAttribute("focus-index",e.toString()):this.removeAttribute("focus-index")}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}getListItem(e){return this.shadowRoot?this.getListItems[e]:null}get getListItems(){return Array.prototype.slice.call(this.children).filter(e=>!this.isSeparator(e))}get selectedIndexes(){return this._selectedIndexes}set selectedIndexes(e){const t=this._selectedIndexes||[];this._selectedIndexes=e||[],t.filter(n=>!this._selectedIndexes.includes(n)).forEach(n=>{this.setSelectedAttr(this.getListItem(n),!1)}),this._selectedIndexes.filter(n=>!t.includes(n)).forEach(n=>{this.setSelectedAttr(this.getListItem(n),!0)})}static get observedAttributes(){return["focus-index","focus-target"]}is(){return Qn.ID}template(){const e=document.createElement("template");return e.innerHTML=Ol,e}removeFocusedItemAttributes(){if(this.focusIndex!=-1){const e=this.getListItem(this.focusIndex);e&&(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant"))}}connectedCallback(){super.connectedCallback(),this.defaultSlot.addEventListener("slotchange",this.onDefaultSlotChange),this.hasAttribute("role")||this.setAttribute("role","listbox"),this.id||(this.id=this._fallbackId),this.render(),this.addEventListener("keydown",this.handleKeyDown),this.selectionType||(this.selectionType="trigger-only")}get defaultSlot(){return this.shadowRoot.querySelector("#default-slot")}isSeparator(e){return e.tagName=="HR"||e.getAttribute("role")=="separator"}attributeChangedCallback(e,t,n){if(e==="focus-index"){const s=this.getListItem(t);s&&s.removeAttribute("focused"),this.updateFocusedElement()}else e==="focus-target"&&(this.focusTarget?this.updateFocusedElement():document.activeElement!=this&&this.removeFocusedItemAttributes())}increaseWidthIfNeeded(){window.requestAnimationFrame(()=>{let e=Number.MAX_SAFE_INTEGER;const t=getComputedStyle(this).maxWidth,n=this.offsetWidth;t.endsWith("px")&&(e=Number.parseInt(t)-n);const s=this.style.width;if(e==0||s.endsWith("px")&&n<Number.parseInt(s))this.enableLineClampOnItemsIfNeeded();else{const o=[...this.querySelectorAll("[slot='items']")].map(a=>{if(a instanceof Ct){a.enableLineClamp=!1;const l=a.missingWidthForTexts;return l>e&&(a.enableLineClamp=!0),l}}),r=Math.max(...o);if(r>0){const a=n+r;this.style.width=`${a}px`,this.offsetWidth<a&&this.enableLineClampOnItemsIfNeeded()}}})}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[slot='items']").forEach(e=>{e instanceof Ct&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}render(){if(!this.isConnected||!this.items)return;this.querySelectorAll("[slot='items']").forEach(n=>{this.removeChild(n)});const e=document.createDocumentFragment();let t=0;this.items.forEach((n,s)=>{const o=this.itemGenerator(n,s);this.isSeparator(o)||this.initListItem(o,t++),o.slot="items",e.appendChild(o)}),this.appendChild(e),this.updateFocusedElement()}initListItem(e,t){this.setSelectedAttr(e,this.selectedIndexes.includes(t)),e.addEventListener("click",n=>{this.handleItemClick(n,t)}),e.addEventListener("mousedown",n=>{n.button==1&&n.preventDefault()}),e.addEventListener("auxclick",n=>{this.handleItemClick(n,t)}),(!e.id||e.id.startsWith(this.id+"_item_"))&&(e.id=this.id+"_item_"+t)}ensureItemVisible(e){const t=e.getBoundingClientRect(),n=this.getBoundingClientRect();t.bottom>n.bottom?this.scrollTop+=t.bottom-n.bottom:t.top<n.top&&(this.scrollTop-=n.top-t.top)}updateFocusedElement(){const e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this)?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id),this.ensureItemVisible(e)):this.removeAttribute("aria-activedescendant")}handleItemClick(e,t){if(e.button!==null){const n=e.type=="auxclick"&&e.button==1||e.metaKey||e.ctrlKey;(e.button==0||e.button==1)&&this.handleSelection(t,n)}}handleSelection(e,t){const n=this.items[e];if(!n||n.disabled)return;const s=this.getListItem(e),o=this.isSelected(s);this.selectionType!=="trigger-only"&&(this.selectionType==="single"?this.selectedIndexes=o?[]:[e]:this.toggleSelection(s)?this._selectedIndexes.push(e):this.removeFromSelectedIndexes(e)),this.focusIndex=e,this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:this.selectionType=="trigger-only"||!o,hasModifier:t},bubbles:!0,composed:!0}))}removeFromSelectedIndexes(e){const t=this._selectedIndexes.indexOf(e);t!==-1&&this._selectedIndexes.splice(t,1)}toggleSelection(e){const t=!e.hasAttribute("selected");return this.setSelectedAttr(e,t),t}setSelectedAttr(e,t){e&&(t?e.setAttribute("selected",""):e.removeAttribute("selected"),e.setAttribute("aria-selected",String(t)))}isSelected(e){return e.hasAttribute("selected")}};tt.ID="sd-list",tt.ensureDefined=()=>{Ct.ensureDefined(),customElements.get(tt.ID)||customElements.define(tt.ID,tt)};let ei=tt;ei.ensureDefined();let Tl=class or{constructor(e,t){this.eventTarget=e,this.keydownHandler=t,this.catchedKeys=["Down","ArrowDown","Up","ArrowUp","Enter"],this.markAsFocusTargetHandler=()=>this.eventTarget.setAttribute("focus-target",""),this.unmarkAsFocusTargetHandler=()=>this.eventTarget.removeAttribute("focus-target"),this.delegateKeyDownEvent=n=>{if(this.catchedKeys.indexOf(n.key)!==-1){const s=n.key.toLocaleLowerCase();let o=0;const r=s.includes("enter");r||(o=s.includes("down")?1:-1),this.keydownHandler(n,o,r),n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()}}}static delegateTo(e){return new or(e,t=>e.dispatchEvent(new KeyboardEvent(t.type,t)))}connect(e){var t,n;if(e!=null){e.addEventListener("keydown",this.delegateKeyDownEvent),e.addEventListener("focus",this.markAsFocusTargetHandler),e.addEventListener("blur",this.unmarkAsFocusTargetHandler);const s=document.activeElement;(e.contains(s)||(n=(t=e.shadowRoot)==null?void 0:t.activeElement)!=null&&n.contains(s))&&this.markAsFocusTargetHandler()}}disconnect(e){e!=null&&(e.removeEventListener("keydown",this.delegateKeyDownEvent),e.removeEventListener("focus",this.markAsFocusTargetHandler),e.removeEventListener("blur",this.unmarkAsFocusTargetHandler),this.unmarkAsFocusTargetHandler())}};class Ll{constructor(e,t,n,s){this.inputElement=e,this.notSelectedTokensProvider=t,this.initializeCallback=s,this.filter=(o,r)=>{if(!o)return!0;if(r.disabled||r.deactivated)return!1;if(r.caption&&r.caption.toLowerCase().includes(o))return!0},ei.ensureDefined(),this._tokenList=new ei,this._tokenList.style.minWidth="250px",this._tokenList.addEventListener("selection",o=>{const r=o.detail.index,a=this._suggestItems[r];n(a),this.hide()}),new Tl(this._tokenList,(o,r,a)=>{this._tokenList.dispatchEvent(new KeyboardEvent(o.type,o)),!a&&!this.isOpened&&this.show()}).connect(e)}show(){this.inputElement.effectiveDisabled||(this.popover,this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.items=this._suggestItems.map(e=>({...e,contentMode:"text"})),this._tokenList.focusIndex=-1,Object.assign(this._tokenList.style,{minWidth:`${Math.max(this.popover.targetElement.offsetWidth,250)}px`}),this.popover.show()))}refreshItems(){this.isOpened&&(this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():this._tokenList.items=this._suggestItems.map(e=>({...e,contentMode:"text"})))}filterItems(e){const t=this.notSelectedTokensProvider();return e?t.filter(n=>this.filter(e,n)):t}hide(){var e;this._suggestItems=[],this._tokenList.items=[],(e=this._popover)==null||e.hide()}get list(){return this._tokenList}get popover(){return this._popover||(this._popover=this.createPopover(),this.initializeCallback(this)),this._popover}createPopover(){const e=new dn;return e.setAttribute("trigger-type","manual"),e.setAttribute("placement","bottom-start"),e.setAttribute("modal",""),e.setAttribute("popover-for","token-autosuggest-popover"),e.setAttribute("offset","-2"),e.targetElement=this.inputElement,e.appendChild(this._tokenList),e}get isOpened(){return this._popover&&this._popover.hasAttribute("open")}get focusedSuggestToken(){return this._suggestItems[this._tokenList.focusIndex]}}class ti extends mn{}ti.directiveName="unsafeSVG",ti.resultType=2;const Pl=Vs(ti),Rl=":host{flex-shrink:0;max-width:100%}.container{display:flex;height:28px;background-color:var(--token-background-color, #f3f3f3);border:var(--token-border);box-sizing:border-box}.container .icon-wrapper{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:100%;overflow:hidden;background-color:var(--token-icon-background-color, transparent)}.container .icon-wrapper .icon{height:100%;width:100%;object-fit:contain;background-size:cover;background-repeat:no-repeat;background-position:center}.container .value{display:inline-block;align-self:center;padding:0 8px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .delete-button-wrapper{display:flex;align-self:center;height:16px;width:16px;padding-right:8px;opacity:.5}.container .delete-button-wrapper:hover{cursor:pointer;filter:brightness(10%);opacity:1}",Ml=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\r
|
|
548
|
+
<path d="m3.5 12.5 9-9m-9 0 9 9" style="fill:none;stroke:#333;stroke-linecap:square;stroke-width:1.1px"/>\r
|
|
549
|
+
</svg>`;var Dl=Object.defineProperty,Nl=Object.getOwnPropertyDescriptor,Me=(i,e,t,n)=>{for(var s=n>1?void 0:n?Nl(e,t):e,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(n?r(e,t,s):r(s))||s);return n&&s&&Dl(e,t,s),s};const Oi={fromAttribute:i=>i=="true",toAttribute:i=>i};var Ce;const Te=(Ce=class extends be{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return ht(Rl)}set checked(e){const t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",n=>{n.stopPropagation(),n.getModifierState("Control")?this.checked=!this.checked:(this.checked=!0,this._tokenClickHandler&&this._tokenClickHandler(this.index))});const t=this.shadowRoot.querySelector(".delete-button-wrapper");t&&t.addEventListener("click",n=>{n.stopPropagation(),this._tokenDeleteHandler&&this._tokenDeleteHandler(this.index)})}render(){return X`
|
|
550
|
+
<div class="container">
|
|
551
|
+
<slot name="before-icon"></slot>
|
|
552
|
+
${this.renderIcon()}
|
|
553
|
+
<slot name="after-icon"></slot>
|
|
554
|
+
<div class="value">${this.value}</div>
|
|
555
|
+
${this.disabled?z:X` <div class="delete-button-wrapper">${Pl(Ml)}</div> `}
|
|
556
|
+
</div>
|
|
557
|
+
`}renderIcon(){if(this.icon||this.iconPlaceholder){const e=this.iconBackgroundColor!=null?`--token-icon-background-color: ${this.iconBackgroundColor}`:void 0;return X`
|
|
558
|
+
<div class="icon-wrapper" style="${le(e)}" role="img">
|
|
559
|
+
<div class="icon"></div>
|
|
560
|
+
</div>
|
|
561
|
+
`}return z}updated(e){super.updated(e),(e.has("icon")||e.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Gs.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},Ce.ID="sd-token",Ce.ensureDefined=()=>{customElements.get(Ce.ID)||customElements.define(Ce.ID,Ce)},Ce);Me([y({type:String,attribute:!0,reflect:!0})],Te.prototype,"value",2);Me([y({type:String,attribute:!0,reflect:!0})],Te.prototype,"type",2);Me([y({type:String})],Te.prototype,"icon",2);Me([y({type:String})],Te.prototype,"iconPlaceholder",2);Me([y({type:String})],Te.prototype,"iconBackgroundColor",2);Me([y({converter:Oi,reflect:!0,attribute:"aria-disabled"})],Te.prototype,"disabled",2);Me([y({converter:Oi,reflect:!0,attribute:"aria-current"})],Te.prototype,"current",2);Me([y({converter:Oi,reflect:!0,attribute:"aria-checked"})],Te.prototype,"checked",1);let An=Te;const jl=(i,e)=>{const t=document.createElement(An.ID);return i&&(t.value=i.caption,t.type=i.type,t.icon=i.icon,t.iconPlaceholder=i.iconPlaceholder,t.iconBackgroundColor=i.iconBackgroundColor,t.disabled=i.disabled,t.index=e),t};An.ensureDefined();const Kt="web application/json";class Bl{constructor(e,t,n){navigator.clipboard&&(e.addEventListener("copy",()=>{t()||this.writeToClipboard(e)}),e.addEventListener("cut",()=>{t()||(e.removeSelectionOrActiveToken(),this.writeToClipboard(e))}),e.addEventListener("paste",()=>{e.disabled||this.readFromClipboard(n)}))}writeToClipboard(e){const t=e.querySelectorAll("[slot='items'][aria-checked='true']"),n=[];if(t.length>0)t.forEach(s=>n.push(s.index));else if(e.activeTokenIndex!=-1){const s=e.activeTokenElement;s&&n.push(s.index)}if(n.length>0){const s=JSON.stringify(n.map(r=>e.items[r])),o=new Blob([s],{type:Kt});navigator.clipboard.write([new ClipboardItem({[Kt]:o})])}}async readFromClipboard(e){const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes(Kt)){const o=await(await n.getType(Kt)).text(),r=JSON.parse(o);Array.isArray(r)&&e(r)}}}const zl=":host{display:flex;align-items:flex-end}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){margin-right:24px;margin-bottom:4px}.container{display:flex;flex-wrap:wrap;gap:8px;flex-grow:1;min-width:0}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:8px}";class Ul{constructor(e,t){this.tokenSelector=e;let n=[];const s=o=>{const r=o.target;e.contains(r)||e.removeTokens(n),n=[]};e.addEventListener("dragstart",o=>{const r=o.target;if(r instanceof An){if(r.disabled){o.preventDefault();return}r.setAttribute("aria-checked","true");const a=e.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){const l=Array.from(a).filter(c=>!c.disabled).map(c=>(n.push(c.index),e.items[c.index]));if(o.dataTransfer.setData("text/plain",JSON.stringify(l)),o.dataTransfer.dropEffect="move",o.dataTransfer.effectAllowed="move",a.length>1){const c=this.createCustomDragImage(r,l.length);o.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",s,{capture:!0,once:!0})}}}),e.addEventListener("dragenter",o=>{e.setAttribute("drop",""),o.preventDefault()}),e.addEventListener("dragover",o=>o.preventDefault()),e.addEventListener("dragleave",o=>{o.target==e&&e.removeAttribute("drop")}),e.addEventListener("drop",o=>{e.removeAttribute("drop");const r=o.dataTransfer.getData("text/plain");if(r)try{const a=JSON.parse(r);Array.isArray(a)&&(t(a),o.preventDefault())}catch{}}),e.addEventListener("dragend",()=>{window.removeEventListener("drop",s),n=[]})}createCustomDragImage(e,t){let n=e.cloneNode(!0);if(n.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)n.value=t+" "+this.tokenSelector.tokenType;else{const s=document.createElement("div");s.innerText="+"+(t-1),Object.assign(s.style,{position:"absolute",left:"90%",top:"75%"});const o=document.createElement("div");o.appendChild(n),o.appendChild(s),n=o}return Object.assign(n.style,{height:e.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),n.slot="items",this.tokenSelector.appendChild(n),requestAnimationFrame(()=>n.remove()),n}}var Fl=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,fe=(i,e,t,n)=>{for(var s=n>1?void 0:n?Hl(e,t):e,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(n?r(e,t,s):r(s))||s);return n&&s&&Fl(e,t,s),s};function Wl(i,e){let t;return function(...n){t!=null&&clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}var Se;const de=(Se=class extends be{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=jl,this._autoSuggestItemGenerator=Ks,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value);return}switch(e.key){case"Escape":{e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide();break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide();break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){const t=this.activeTokenElement;e.getModifierState("Control")?t.checked=!t.checked:(t.checked=!0,this.onTokenClick(t,!1)),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.handleWindowPointerDown=e=>{const t=this.inputElement;if(!t||!t.value)return;e.composedPath().some(s=>{if(s instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||s.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=Wl(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return ht(zl)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){this.inputElement?this.inputElement.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?X`<div class="container" tabindex="0">
|
|
562
|
+
<slot name="items"
|
|
563
|
+
>${this.placeholder?X`<span part="remove-only-placeholder" class="placeholder"
|
|
564
|
+
>${this.placeholder}</span
|
|
565
|
+
>`:z}</slot
|
|
566
|
+
>
|
|
567
|
+
</div>
|
|
568
|
+
<slot class="additonal-content" name="additional-content"></slot>`:X`
|
|
569
|
+
<sd-lit-input
|
|
570
|
+
class="input"
|
|
571
|
+
.extendedPrefix=${!0}
|
|
572
|
+
.label=${this.inputLabel}
|
|
573
|
+
.validationLevel=${this.validationLevel}
|
|
574
|
+
.validationIconSrc=${this.validationIconSrc}
|
|
575
|
+
.validationMessage=${this.validationMessage}
|
|
576
|
+
.alwaysFloatLabel=${this.selectedIndexes.length>0}
|
|
577
|
+
.placeholder=${this.selectedIndexes.length==0?this.placeholder:""}
|
|
578
|
+
.disabled=${this.disabled}
|
|
579
|
+
tabindex="0"
|
|
580
|
+
><div class="token-wrapper" slot="prefix"><slot name="items"></slot></div>
|
|
581
|
+
</sd-lit-input>
|
|
582
|
+
<slot class="additonal-content" name="additional-content"></slot>
|
|
583
|
+
`}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),this.hasAttribute("tabIndex")||(this.tabIndex=0),this.addEventListener("focusout",t=>{const n=t.relatedTarget;!this.contains(n)&&!this.shadowRoot.contains(n)&&this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(s=>s.checked=!1)}),new Bl(this,()=>{var t;return(t=this.inputElement)==null?void 0:t.value},t=>this.addMatchingItems(t)),new Ul(this,t=>this.addMatchingItems(t))}addMatchingItems(e){const t=e.map(n=>{const s=n.caption==null?-1:this.findIndex(n);return s!=-1&&!this.items[s].disabled&&!this.selectedIndexes.includes(s)?s:-1}).filter(n=>n!=-1);t.length>0&&this.handleTokenSelection(t)}removeSelectionOrActiveToken(){if(!this.disabled){const e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){const t=Array.from(e);this.removeTokens(t.filter(n=>!n.disabled).map(n=>n.index))}else if(this.activeTokenIndex!=-1){const t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){const t=this.querySelectorAll("[slot='items']").length-1;this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=t):this.activeTokenIndex==t&&e>0?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(t,this.activeTokenIndex+e))}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){const n=this.tokenSuggestPopover.focusedSuggestToken;if(n){if(!n.disabled){const s=this.findIndex(n);this.handleTokenSelection([s]),this.tokenSuggestPopover.hide()}return}}if(!(e!=null&&e.trim()))return;const t=this.items.findIndex(n=>this.caseSensitive?n.caption==e:n.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");const t=this.inputElement;t.addEventListener("immediate-value-change",n=>this.handleInputValueChange(n)),t.addEventListener("keydown",n=>this.handleInputKeyDown(n,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.popover.remove(),this._tokenSuggestPopover=null);(e.size==0||e.has("selectionMode")||e.has("items")||e.has("selectedIndexes")||e.has("disabled"))&&this.updateItems()}handleInputValueChange(e){e.detail.value?(this.activeTokenIndex=-1,this.cancelSearch=!1,this.debouncedShowTokenSuggestPopover(),window.addEventListener("pointerdown",this.handleWindowPointerDown)):(this.tokenSuggestPopover.hide(),this.cancelSearch=!0)}showFilteredTokenSuggestions(){!this.cancelSearch&&this.inputElement.value&&this.tokenSuggestPopover.show()}isTokenNotSelected(e){return!this.selectedIndexes.includes(e)}get tokenSuggestPopover(){return!this._tokenSuggestPopover&&this.inputElement&&(this._tokenSuggestPopover=new Ll(this.inputElement,()=>this.items.filter((e,t)=>!e.disabled&&this.isTokenNotSelected(t)),e=>{const t=this.findIndex(e);this.handleTokenSelection([t]),window.removeEventListener("pointerdown",this.handleWindowPointerDown)},e=>{this.appendChild(e.popover),this.dispatchEvent(new CustomEvent("auto-suggest-initialized")),e.popover.addEventListener("close",()=>{this.inputElement.value&&!this.contains(document.activeElement)&&(this.inputElement.value="")})}),this._tokenSuggestPopover.list.itemGenerator=this._autoSuggestItemGenerator,this._tokenSuggestPopover.list.className=this.suggestListClass,this.suggestionFilter&&(this._tokenSuggestPopover.filter=this.suggestionFilter)),this._tokenSuggestPopover}updateItems(){if(!this.isConnected||!this.items)return;const e=this.inputElement;e&&(!this._tokenSuggestPopover||!this._tokenSuggestPopover.isOpened)&&(e.value=""),this.querySelectorAll("[slot='items']").forEach(s=>{this.removeChild(s)});const t=document.createDocumentFragment();let n=[];this.selectionMode=="remove-only"?n=this.items.map(s=>this.disableIfNeeded(s)):this.selectedIndexes.forEach(s=>{n.push(this.disableIfNeeded(this.items[s]))}),n.forEach(s=>{const o=this.tokenGenerator(s,this.findIndex(s));o.slot="items",t.appendChild(o),o.id||(o.id=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)),o.setClickHandler(()=>this.onTokenClick(o,!0)),o.addEventListener("click",()=>{document.activeElement!=this&&this.focus()}),o.setDeleteHandler(r=>this.removeTokens([r]))}),this.appendChild(t),this._tokenSuggestPopover&&this._tokenSuggestPopover.refreshItems()}removeTokens(e){this.disabled||(this.activeTokenIndex!=-1&&e.includes(this.activeTokenElement.index)&&(this.activeTokenIndex=-1),this.selectionMode=="remove-only"?this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e}})):(this.selectedIndexes=this.selectedIndexes.filter(t=>!e.includes(t)),this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e,selectedIndices:[...this.selectedIndexes]}}))))}onTokenClick(e,t){let n;this.querySelectorAll("[slot='items']").forEach((s,o)=>{e==s?n=o:s.setAttribute("aria-checked","false")}),this.activeTokenIndex=n,this.setAttribute("aria-activedescendant",this.activeTokenElement.id),this._tokenSuggestPopover&&this._tokenSuggestPopover.isOpened&&this._tokenSuggestPopover.hide(),this.dispatchEvent(new CustomEvent("token-clicked",{detail:{index:e.index,tokenElement:e,byPointerDevice:t}}))}disableIfNeeded(e){return this.disabled?{...e,disabled:!0}:e}handleTokenSelection(e){this.selectedIndexes=this.selectedIndexes.concat(e),this.dispatchEvent(new CustomEvent("tokens-selected",{detail:{newIndices:e,selectedIndices:[...this.selectedIndexes]}}))}handleTokenCreation(e){this.dispatchEvent(new CustomEvent("token-created",{detail:{value:e}}))}get inputElement(){return this.shadowRoot.querySelector(".input")}get activeTokenElement(){return this.getTokenElement(this.activeTokenIndex)}getTokenElement(e){return this.querySelector("[slot='items']:nth-of-type("+(e+1)+")")}findIndex(e){return this.items.findIndex(t=>t.caption===e.caption)}get activeTokenIndex(){return this._activeTokenIndex}set activeTokenIndex(e){if(this._activeTokenIndex!=-1){const t=this.activeTokenElement;t&&(t.current=!1)}if(this._activeTokenIndex=e,e==-1)this.removeAttribute("aria-activedescendant");else{const t=this.activeTokenElement;t.current=!0,this.setAttribute("aria-activedescendant",t.id)}}get hasInputValue(){var e;return!!((e=this.inputElement)!=null&&e.value)}},Se.ID="sd-token-selector",Se.ensureDefined=()=>{An.ensureDefined(),customElements.get(Se.ID)||customElements.define(Se.ID,Se)},Se.shadowRootOptions={...be.shadowRootOptions,delegatesFocus:!0},Se);fe([y({type:String,attribute:"selection-mode",reflect:!0})],de.prototype,"selectionMode",2);fe([y({type:Array,attribute:!1})],de.prototype,"items",2);fe([y({type:Array,attribute:!1})],de.prototype,"selectedIndexes",2);fe([y({type:String,reflect:!0})],de.prototype,"placeholder",2);fe([y({type:String,reflect:!0,attribute:"suggest-list-class"})],de.prototype,"suggestListClass",2);fe([y({type:String,reflect:!0,attribute:"input-label"})],de.prototype,"inputLabel",2);fe([y({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],de.prototype,"disabled",2);fe([y({type:String,attribute:!0})],de.prototype,"validationMessage",2);fe([y({type:String,attribute:!0})],de.prototype,"validationIconSrc",2);fe([y({converter:ln.levelConverter,attribute:!0,reflect:!0})],de.prototype,"validationLevel",2);fe([y({type:String,reflect:!0,attribute:"token-type"})],de.prototype,"tokenType",2);fe([y({type:Boolean,reflect:!0,attribute:"case-sensitive"})],de.prototype,"caseSensitive",2);let sh=de;function ar(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function ql(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Ii={exports:{}},U=String,lr=function(){return{isColorSupported:!1,reset:U,bold:U,dim:U,italic:U,underline:U,inverse:U,hidden:U,strikethrough:U,black:U,red:U,green:U,yellow:U,blue:U,magenta:U,cyan:U,white:U,gray:U,bgBlack:U,bgRed:U,bgGreen:U,bgYellow:U,bgBlue:U,bgMagenta:U,bgCyan:U,bgWhite:U}};Ii.exports=lr();Ii.exports.createColors=lr;var Vl=Ii.exports;const Gl={},Kl=Object.freeze(Object.defineProperty({__proto__:null,default:Gl},Symbol.toStringTag,{value:"Module"})),ye=ql(Kl);let gs=Vl,ms=ye,ni=class cr extends Error{constructor(e,t,n,s,o,r){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),r&&(this.plugin=r),typeof t<"u"&&typeof n<"u"&&(typeof t=="number"?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,cr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=gs.isColorSupported),ms&&e&&(t=ms(t));let n=t.split(/\r?\n/),s=Math.max(this.line-3,0),o=Math.min(this.line+2,n.length),r=String(o).length,a,l;if(e){let{bold:c,gray:d,red:h}=gs.createColors(!0);a=p=>c(h(p)),l=p=>d(p)}else a=l=c=>c;return n.slice(s,o).map((c,d)=>{let h=s+1+d,p=" "+(" "+h).slice(-r)+" | ";if(h===this.line){let m=l(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(p)+c+`
|
|
584
|
+
`+m+a("^")}return" "+l(p)+c}).join(`
|
|
585
|
+
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
586
|
+
|
|
587
|
+
`+e+`
|
|
588
|
+
`),this.name+": "+this.message+e}};var Ti=ni;ni.default=ni;var Ft={};Ft.isClean=Symbol("isClean");Ft.my=Symbol("my");const vs={after:`
|
|
589
|
+
`,beforeClose:`
|
|
590
|
+
`,beforeComment:`
|
|
591
|
+
`,beforeDecl:`
|
|
592
|
+
`,beforeOpen:" ",beforeRule:`
|
|
593
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Zl(i){return i[0].toUpperCase()+i.slice(1)}let ii=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?n+=e.raws.afterName:s&&(n+=" "),e.nodes)this.block(e,n+s);else{let o=(e.raws.between||"")+(t?";":"");this.builder(n+s+o,e)}}beforeAfter(e,t){let n;e.type==="decl"?n=this.raw(e,null,"beforeDecl"):e.type==="comment"?n=this.raw(e,null,"beforeComment"):t==="before"?n=this.raw(e,null,"beforeRule"):n=this.raw(e,null,"beforeClose");let s=e.parent,o=0;for(;s&&s.type!=="root";)o+=1,s=s.parent;if(n.includes(`
|
|
594
|
+
`)){let r=this.raw(e,null,"indent");if(r.length)for(let a=0;a<o;a++)n+=r}return n}block(e,t){let n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start");let s;e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let n=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let o=e.nodes[s],r=this.raw(o,"before");r&&this.builder(r),this.stringify(o,t!==s||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),s=e.prop+n+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,n){let s;if(n||(n=t),t&&(s=e.raws[t],typeof s<"u"))return s;let o=e.parent;if(n==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return vs[n];let r=e.root();if(r.rawCache||(r.rawCache={}),typeof r.rawCache[n]<"u")return r.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(e,n);{let a="raw"+Zl(n);this[a]?s=this[a](r,e):r.walk(l=>{if(s=l.raws[t],typeof s<"u")return!1})}return typeof s>"u"&&(s=vs[n]),r.rawCache[n]=s,s}rawBeforeClose(e){let t;return e.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return t=n.raws.after,t.includes(`
|
|
595
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(s=>{if(typeof s.raws.before<"u")return n=s.raws.before,n.includes(`
|
|
596
|
+
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(s=>{if(typeof s.raws.before<"u")return n=s.raws.before,n.includes(`
|
|
597
|
+
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(n=>{if(n.type!=="decl"&&(t=n.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&typeof n.raws.before<"u")return t=n.raws.before,t.includes(`
|
|
598
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(n=>{if(typeof n.raws.between<"u")return t=n.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(n=>{if(n.nodes&&n.nodes.length===0&&(t=n.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let s=n.parent;if(s&&s!==e&&s.parent&&s.parent===e&&typeof n.raws.before<"u"){let o=n.raws.before.split(`
|
|
599
|
+
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(t=n.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let n=e[t],s=e.raws[t];return s&&s.value===n?s.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var dr=ii;ii.default=ii;let Xl=dr;function si(i,e){new Xl(e).stringify(i)}var $n=si;si.default=si;let{isClean:Zt,my:Jl}=Ft,Yl=Ti,Ql=dr,ec=$n;function ri(i,e){let t=new i.constructor;for(let n in i){if(!Object.prototype.hasOwnProperty.call(i,n)||n==="proxyCache")continue;let s=i[n],o=typeof s;n==="parent"&&o==="object"?e&&(t[n]=e):n==="source"?t[n]=s:Array.isArray(s)?t[n]=s.map(r=>ri(r,t)):(o==="object"&&s!==null&&(s=ri(s)),t[n]=s)}return t}let oi=class{constructor(e={}){this.raws={},this[Zt]=!1,this[Jl]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let n of e[t])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=ri(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:n.column,line:n.line},t)}return new Yl(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Zt]){this[Zt]=!1;let e=this;for(;e=e.parent;)e[Zt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let s=t.indexOf(e.word);s!==-1&&(n=this.positionInside(s,t))}return n}positionInside(e,t){let n=t||this.toString(),s=this.source.start.column,o=this.source.start.line;for(let r=0;r<e;r++)n[r]===`
|
|
600
|
+
`?(s=1,o+=1):s+=1;return{column:s,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),o=s.indexOf(e.word);o!==-1&&(t=this.positionInside(o,s),n=this.positionInside(o+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new Ql().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let s of e)s===this?n=!0:n?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let n={},s=t==null;t=t||new Map;let o=0;for(let r in this){if(!Object.prototype.hasOwnProperty.call(this,r)||r==="parent"||r==="proxyCache")continue;let a=this[r];if(Array.isArray(a))n[r]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)n[r]=a.toJSON(null,t);else if(r==="source"){let l=t.get(a.input);l==null&&(l=o,t.set(a.input,o),o++),n[r]={end:a.end,inputId:l,start:a.start}}else n[r]=a}return s&&(n.inputs=[...t.keys()].map(r=>r.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ec){e.stringify&&(e=e.stringify);let t="";return e(this,n=>{t+=n}),t}warn(e,t,n){let s={node:this};for(let o in n)s[o]=n[o];return e.warn(t,s)}get proxyOf(){return this}};var Cn=oi;oi.default=oi;let tc=Cn,ai=class extends tc{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var On=ai;ai.default=ai;let nc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ic=(i,e=21)=>(t=e)=>{let n="",s=t;for(;s--;)n+=i[Math.random()*i.length|0];return n},sc=(i=21)=>{let e="",t=i;for(;t--;)e+=nc[Math.random()*64|0];return e};var rc={nanoid:sc,customAlphabet:ic};let{SourceMapConsumer:bs,SourceMapGenerator:ys}=ye,{existsSync:oc,readFileSync:ac}=ye,{dirname:Hn,join:lc}=ye;function cc(i){return Buffer?Buffer.from(i,"base64").toString():window.atob(i)}let li=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Hn(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new bs(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(s.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return cc(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),s=e.indexOf("*/",n);n>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,s)))}loadFile(e){if(this.root=Hn(e),oc(e))return this.mapFile=e,ac(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let n=t(e);if(n){let s=this.loadFile(n);if(!s)throw new Error("Unable to load previous source map: "+n.toString());return s}}else{if(t instanceof bs)return ys.fromSourceMap(t).toString();if(t instanceof ys)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let n=this.annotation;return e&&(n=lc(Hn(e),n)),this.loadFile(n)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ur=li;li.default=li;let{SourceMapConsumer:dc,SourceMapGenerator:uc}=ye,{fileURLToPath:ws,pathToFileURL:Xt}=ye,{isAbsolute:ci,resolve:di}=ye,{nanoid:hc}=rc,Wn=ye,xs=Ti,pc=ur,qn=Symbol("fromOffsetCache"),fc=!!(dc&&uc),ks=!!(di&&ci),bn=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ks||/^\w+:\/\//.test(t.from)||ci(t.from)?this.file=t.from:this.file=di(t.from)),ks&&fc){let n=new pc(this.css,t);if(n.text){this.map=n;let s=n.consumer().file;!this.file&&s&&(this.file=this.mapResolve(s))}}this.file||(this.id="<input css "+hc(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,s={}){let o,r,a;if(t&&typeof t=="object"){let c=t,d=n;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);t=h.line,n=h.col}else t=c.line,n=c.column;if(typeof d.offset=="number"){let h=this.fromOffset(d.offset);r=h.line,a=h.col}else r=d.line,a=d.column}else if(!n){let c=this.fromOffset(t);t=c.line,n=c.col}let l=this.origin(t,n,r,a);return l?o=new xs(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,s.plugin):o=new xs(e,r===void 0?t:{column:n,line:t},r===void 0?n:{column:a,line:r},this.css,this.file,s.plugin),o.input={column:n,endColumn:a,endLine:r,line:t,source:this.css},this.file&&(Xt&&(o.input.url=Xt(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[qn])n=this[qn];else{let o=this.css.split(`
|
|
601
|
+
`);n=new Array(o.length);let r=0;for(let a=0,l=o.length;a<l;a++)n[a]=r,r+=o[a].length+1;this[qn]=n}t=n[n.length-1];let s=0;if(e>=t)s=n.length-1;else{let o=n.length-2,r;for(;s<o;)if(r=s+(o-s>>1),e<n[r])o=r-1;else if(e>=n[r+1])s=r+1;else{s=r;break}}return{col:e-n[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:di(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,s){if(!this.map)return!1;let o=this.map.consumer(),r=o.originalPositionFor({column:t,line:e});if(!r.source)return!1;let a;typeof n=="number"&&(a=o.originalPositionFor({column:s,line:n}));let l;ci(r.source)?l=Xt(r.source):l=new URL(r.source,this.map.consumer().sourceRoot||Xt(this.map.mapFile));let c={column:r.column,endColumn:a&&a.column,endLine:a&&a.line,line:r.line,url:l.toString()};if(l.protocol==="file:")if(ws)c.file=ws(l);else throw new Error("file: protocol is not available in this PostCSS build");let d=o.sourceContentFor(r.source);return d&&(c.source=d),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var In=bn;bn.default=bn;Wn&&Wn.registerInput&&Wn.registerInput(bn);let{SourceMapConsumer:hr,SourceMapGenerator:hn}=ye,{dirname:pn,relative:pr,resolve:fr,sep:gr}=ye,{pathToFileURL:Es}=ye,gc=In,mc=!!(hr&&hn),vc=!!(pn&&fr&&pr&&gr),bc=class{constructor(e,t,n,s){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
602
|
+
`;this.css.includes(`\r
|
|
603
|
+
`)&&(t=`\r
|
|
604
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),n=e.root||pn(e.file),s;this.mapOpts.sourcesContent===!1?(s=new hr(e.text),s.sourcesContent&&(s.sourcesContent=s.sourcesContent.map(()=>null))):s=e.consumer(),this.map.applySourceMap(s,t,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),vc&&mc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=hn.fromSourceMap(e)}else this.map=new hn({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new hn({file:this.outputFile()});let e=1,t=1,n="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,r;this.stringify(this.root,(a,l,c)=>{if(this.css+=a,l&&c!=="end"&&(s.generated.line=e,s.generated.column=t-1,l.source&&l.source.start?(s.source=this.sourcePath(l),s.original.line=l.source.start.line,s.original.column=l.source.start.column-1,this.map.addMapping(s)):(s.source=n,s.original.line=1,s.original.column=0,this.map.addMapping(s))),o=a.match(/\n/g),o?(e+=o.length,r=a.lastIndexOf(`
|
|
605
|
+
`),t=a.length-r):t+=a.length,l&&c!=="start"){let d=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==d.last||d.raws.semicolon)&&(l.source&&l.source.end?(s.source=this.sourcePath(l),s.original.line=l.source.end.line,s.original.column=l.source.end.column-1,s.generated.line=e,s.generated.column=t-2,this.map.addMapping(s)):(s.source=n,s.original.line=1,s.original.column=0,s.generated.line=e,s.generated.column=t-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?pn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=pn(fr(n,this.mapOpts.annotation)));let s=pr(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new gc(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let s=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Es){let n=Es(e).toString();return this.memoizedFileURLs.set(e,n),n}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;gr==="\\"&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};var mr=bc;let yc=Cn,ui=class extends yc{constructor(e){super(e),this.type="comment"}};var Tn=ui;ui.default=ui;let{isClean:vr,my:br}=Ft,yr=On,wr=Tn,wc=Cn,xr,Li,Pi,kr;function Er(i){return i.map(e=>(e.nodes&&(e.nodes=Er(e.nodes)),delete e.source,e))}function Sr(i){if(i[vr]=!1,i.proxyOf.nodes)for(let e of i.proxyOf.nodes)Sr(e)}let Ie=class _r extends wc{append(...e){for(let t of e){let n=this.normalize(t,this.last);for(let s of n)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,s;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],s=e(this.proxyOf.nodes[n],n),s!==!1);)this.indexes[t]+=1;return delete this.indexes[t],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...n)=>e[t](...n.map(s=>typeof s=="function"?(o,r)=>s(o.toProxy(),r):s)):t==="every"||t==="some"?n=>e[t]((s,...o)=>n(s.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(n=>n.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let r of s)this.proxyOf.nodes.splice(n+1,0,r);let o;for(let r in this.indexes)o=this.indexes[r],n<o&&(this.indexes[r]=o+s.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),s=n===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let a of o)this.proxyOf.nodes.splice(n,0,a);let r;for(let a in this.indexes)r=this.indexes[a],n<=r&&(this.indexes[a]=r+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Er(xr(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new yr(e)]}else if(e.selector)e=[new Li(e)];else if(e.name)e=[new Pi(e)];else if(e.text)e=[new wr(e)];else throw new Error("Unknown node type in node creation");return e.map(s=>(s[br]||_r.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[vr]&&Sr(s),typeof s.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(s.raws.before=t.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...e){e=e.reverse();for(let t of e){let n=this.normalize(t,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let s;try{s=e(t,n)}catch(o){throw t.addToError(o)}return s!==!1&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&e.test(n.name))return t(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===e)return t(n,s)}):(t=e,this.walk((n,s)=>{if(n.type==="atrule")return t(n,s)}))}walkComments(e){return this.walk((t,n)=>{if(t.type==="comment")return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&e.test(n.prop))return t(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===e)return t(n,s)}):(t=e,this.walk((n,s)=>{if(n.type==="decl")return t(n,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&e.test(n.selector))return t(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===e)return t(n,s)}):(t=e,this.walk((n,s)=>{if(n.type==="rule")return t(n,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ie.registerParse=i=>{xr=i};Ie.registerRule=i=>{Li=i};Ie.registerAtRule=i=>{Pi=i};Ie.registerRoot=i=>{kr=i};var Ve=Ie;Ie.default=Ie;Ie.rebuild=i=>{i.type==="atrule"?Object.setPrototypeOf(i,Pi.prototype):i.type==="rule"?Object.setPrototypeOf(i,Li.prototype):i.type==="decl"?Object.setPrototypeOf(i,yr.prototype):i.type==="comment"?Object.setPrototypeOf(i,wr.prototype):i.type==="root"&&Object.setPrototypeOf(i,kr.prototype),i[br]=!0,i.nodes&&i.nodes.forEach(e=>{Ie.rebuild(e)})};let xc=Ve,Ar,$r,Tt=class extends xc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ar(new $r,this,e).stringify()}};Tt.registerLazyResult=i=>{Ar=i};Tt.registerProcessor=i=>{$r=i};var Ri=Tt;Tt.default=Tt;let hi=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Cr=hi;hi.default=hi;let kc=Cr,pi=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new kc(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Mi=pi;pi.default=pi;const Vn=39,Ss=34,Jt=92,_s=47,Yt=10,vt=32,Qt=12,en=9,tn=13,Ec=91,Sc=93,_c=40,Ac=41,$c=123,Cc=125,Oc=59,Ic=42,Tc=58,Lc=64,nn=/[\t\n\f\r "#'()/;[\\\]{}]/g,sn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Pc=/.[\r\n"'(/\\]/,As=/[\da-f]/i;var Rc=function(e,t={}){let n=e.css.valueOf(),s=t.ignoreErrors,o,r,a,l,c,d,h,p,m,E,w=n.length,f=0,$=[],T=[];function L(){return f}function x(M){throw e.error("Unclosed "+M,f)}function A(){return T.length===0&&f>=w}function O(M){if(T.length)return T.pop();if(f>=w)return;let I=M?M.ignoreUnclosed:!1;switch(o=n.charCodeAt(f),o){case Yt:case vt:case en:case tn:case Qt:{r=f;do r+=1,o=n.charCodeAt(r);while(o===vt||o===Yt||o===en||o===tn||o===Qt);E=["space",n.slice(f,r)],f=r-1;break}case Ec:case Sc:case $c:case Cc:case Tc:case Oc:case Ac:{let j=String.fromCharCode(o);E=[j,j,f];break}case _c:{if(p=$.length?$.pop()[1]:"",m=n.charCodeAt(f+1),p==="url"&&m!==Vn&&m!==Ss&&m!==vt&&m!==Yt&&m!==en&&m!==Qt&&m!==tn){r=f;do{if(d=!1,r=n.indexOf(")",r+1),r===-1)if(s||I){r=f;break}else x("bracket");for(h=r;n.charCodeAt(h-1)===Jt;)h-=1,d=!d}while(d);E=["brackets",n.slice(f,r+1),f,r],f=r}else r=n.indexOf(")",f+1),l=n.slice(f,r+1),r===-1||Pc.test(l)?E=["(","(",f]:(E=["brackets",l,f,r],f=r);break}case Vn:case Ss:{a=o===Vn?"'":'"',r=f;do{if(d=!1,r=n.indexOf(a,r+1),r===-1)if(s||I){r=f+1;break}else x("string");for(h=r;n.charCodeAt(h-1)===Jt;)h-=1,d=!d}while(d);E=["string",n.slice(f,r+1),f,r],f=r;break}case Lc:{nn.lastIndex=f+1,nn.test(n),nn.lastIndex===0?r=n.length-1:r=nn.lastIndex-2,E=["at-word",n.slice(f,r+1),f,r],f=r;break}case Jt:{for(r=f,c=!0;n.charCodeAt(r+1)===Jt;)r+=1,c=!c;if(o=n.charCodeAt(r+1),c&&o!==_s&&o!==vt&&o!==Yt&&o!==en&&o!==tn&&o!==Qt&&(r+=1,As.test(n.charAt(r)))){for(;As.test(n.charAt(r+1));)r+=1;n.charCodeAt(r+1)===vt&&(r+=1)}E=["word",n.slice(f,r+1),f,r],f=r;break}default:{o===_s&&n.charCodeAt(f+1)===Ic?(r=n.indexOf("*/",f+2)+1,r===0&&(s||I?r=n.length:x("comment")),E=["comment",n.slice(f,r+1),f,r],f=r):(sn.lastIndex=f+1,sn.test(n),sn.lastIndex===0?r=n.length-1:r=sn.lastIndex-2,E=["word",n.slice(f,r+1),f,r],$.push(E),f=r);break}}return f++,E}function P(M){T.push(M)}return{back:P,endOfFile:A,nextToken:O,position:L}};let Or=Ve,yn=class extends Or{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Di=yn;yn.default=yn;Or.registerAtRule(yn);let Ir=Ve,Tr,Lr,lt=class extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let s=super.normalize(e);if(t){if(n==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of s)o.raws.before=t.raws.before}return s}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new Tr(new Lr,this,e).stringify()}};lt.registerLazyResult=i=>{Tr=i};lt.registerProcessor=i=>{Lr=i};var Ht=lt;lt.default=lt;Ir.registerRoot(lt);let Lt={comma(i){return Lt.split(i,[","],!0)},space(i){let e=[" ",`
|
|
606
|
+
`," "];return Lt.split(i,e)},split(i,e,t){let n=[],s="",o=!1,r=0,a=!1,l="",c=!1;for(let d of i)c?c=!1:d==="\\"?c=!0:a?d===l&&(a=!1):d==='"'||d==="'"?(a=!0,l=d):d==="("?r+=1:d===")"?r>0&&(r-=1):r===0&&e.includes(d)&&(o=!0),o?(s!==""&&n.push(s.trim()),s="",o=!1):s+=d;return(t||s!=="")&&n.push(s.trim()),n}};var Pr=Lt;Lt.default=Lt;let Rr=Ve,Mc=Pr,wn=class extends Rr{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Mc.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var Ni=wn;wn.default=wn;Rr.registerRule(wn);let Dc=On,Nc=Rc,jc=Tn,Bc=Di,zc=Ht,$s=Ni;const Cs={empty:!0,space:!0};function Uc(i){for(let e=i.length-1;e>=0;e--){let t=i[e],n=t[3]||t[2];if(n)return n}}let Fc=class{constructor(e){this.input=e,this.root=new zc,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Bc;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,s,o,r=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n==="("||n==="["?c.push(n==="("?")":"]"):n==="{"&&c.length>0?c.push("}"):n===c[c.length-1]&&c.pop(),c.length===0)if(n===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){a=!0;break}else if(n==="}"){if(l.length>0){for(o=l.length-1,s=l[o];s&&s[0]==="space";)s=l[--o];s&&(t.source.end=this.getPosition(s[3]||s[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){r=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),r&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,s;for(let o=t-1;o>=0&&(s=e[o],!(s[0]!=="space"&&(n+=1,n===2)));o--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(e){let t=0,n,s,o;for(let[r,a]of e.entries()){if(n=a,s=n[0],s==="("&&(t+=1),s===")"&&(t-=1),t===0&&s===":")if(!o)this.doubleColon(n);else{if(o[0]==="word"&&o[1]==="progid")continue;return r}o=n}return!1}comment(e){let t=new jc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let s=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=s[2],t.raws.left=s[1],t.raws.right=s[3]}}createTokenizer(){this.tokenizer=Nc(this.input)}decl(e,t){let n=new Dc;this.init(n,e[0][2]);let s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||Uc(e)),n.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;n.prop+=e.shift()[1]}n.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){n.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let r=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)r.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(o=e[c],o[1].toLowerCase()==="!important"){n.important=!0;let d=this.stringFrom(e,c);d=this.spacesFromEnd(e)+d,d!==" !important"&&(n.raws.important=d);break}else if(o[1].toLowerCase()==="important"){let d=e.slice(0),h="";for(let p=c;p>0;p--){let m=d[p][0];if(h.trim().indexOf("!")===0&&m!=="space")break;h=d.pop()[1]+h}h.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=h,e=d)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(n.raws.between+=r.map(c=>c[1]).join(""),r=[]),this.raw(n,"value",r.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new $s;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,n=null,s=!1,o=null,r=[],a=e[1].startsWith("--"),l=[],c=e;for(;c;){if(n=c[0],l.push(c),n==="("||n==="[")o||(o=c),r.push(n==="("?")":"]");else if(a&&s&&n==="{")o||(o=c),r.push("}");else if(r.length===0)if(n===";")if(s){this.decl(l,a);return}else break;else if(n==="{"){this.rule(l);return}else if(n==="}"){this.tokenizer.back(l.pop()),t=!0;break}else n===":"&&(s=!0);else n===r[r.length-1]&&(r.pop(),r.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(o),t&&s){if(!a)for(;l.length&&(c=l[l.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,s){let o,r,a=n.length,l="",c=!0,d,h;for(let p=0;p<a;p+=1)o=n[p],r=o[0],r==="space"&&p===a-1&&!s?c=!1:r==="comment"?(h=n[p-1]?n[p-1][0]:"empty",d=n[p+1]?n[p+1][0]:"empty",!Cs[h]&&!Cs[d]?l.slice(-1)===","?c=!1:l+=o[1]:c=!1):l+=o[1];if(!c){let p=n.reduce((m,E)=>m+E[1],"");e.raws[t]={raw:p,value:l}}e[t]=l}rule(e){e.pop();let t=new $s;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],t==="space");)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let s=t;s<e.length;s++)n+=e[s][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var Hc=Fc;let Wc=Ve,qc=Hc,Vc=In;function xn(i,e){let t=new Vc(i,e),n=new qc(t);try{n.parse()}catch(s){throw s}return n.root}var ji=xn;xn.default=xn;Wc.registerParse(xn);let{isClean:Ee,my:Gc}=Ft,Kc=mr,Zc=$n,Xc=Ve,Jc=Ri,Os=Mi,Yc=ji,Qc=Ht;const ed={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},td={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},nd={Once:!0,postcssPlugin:!0,prepare:!0},ct=0;function bt(i){return typeof i=="object"&&typeof i.then=="function"}function Mr(i){let e=!1,t=ed[i.type];return i.type==="decl"?e=i.prop.toLowerCase():i.type==="atrule"&&(e=i.name.toLowerCase()),e&&i.append?[t,t+"-"+e,ct,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:i.append?[t,ct,t+"Exit"]:[t,t+"Exit"]}function Is(i){let e;return i.type==="document"?e=["Document",ct,"DocumentExit"]:i.type==="root"?e=["Root",ct,"RootExit"]:e=Mr(i),{eventIndex:0,events:e,iterator:0,node:i,visitorIndex:0,visitors:[]}}function fi(i){return i[Ee]=!1,i.nodes&&i.nodes.forEach(e=>fi(e)),i}let gi={},dt=class Dr{constructor(e,t,n){this.stringified=!1,this.processed=!1;let s;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))s=fi(t);else if(t instanceof Dr||t instanceof Os)s=fi(t.root),t.map&&(typeof n.map>"u"&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let o=Yc;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{s=o(t,n)}catch(r){this.processed=!0,this.error=r}s&&!s[Gc]&&Xc.rebuild(s)}this.result=new Os(e,s,n),this.helpers={...gi,postcss:gi,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(s){console&&console.error&&console.error(s)}return e}prepareVisitors(){this.listeners={};let e=(t,n,s)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([t,s])};for(let t of this.plugins)if(typeof t=="object")for(let n in t){if(!td[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!nd[n])if(typeof t[n]=="object")for(let s in t[n])s==="*"?e(t,n,t[n][s]):e(t,n+"-"+s.toLowerCase(),t[n][s]);else typeof t[n]=="function"&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(bt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ee];){e[Ee]=!0;let t=[Is(e)];for(;t.length>0;){let n=this.visitTick(t);if(bt(n))try{await n}catch(s){let o=t[t.length-1].node;throw this.handleError(s,o)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let s=e.nodes.map(o=>n(o,this.helpers));await Promise.all(s)}else await n(e,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(n=>e.Once(n,this.helpers));return bt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Zc;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Kc(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(bt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ee];)e[Ee]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,s]of e){this.result.lastPlugin=n;let o;try{o=s(t,this.helpers)}catch(r){throw this.handleError(r,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(bt(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:s}=t;if(n.type!=="root"&&n.type!=="document"&&!n.parent){e.pop();return}if(s.length>0&&t.visitorIndex<s.length){let[r,a]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=r;try{return a(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(t.iterator!==0){let r=t.iterator,a;for(;a=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!a[Ee]){a[Ee]=!0,e.push(Is(a));return}t.iterator=0,delete n.indexes[r]}let o=t.events;for(;t.eventIndex<o.length;){let r=o[t.eventIndex];if(t.eventIndex+=1,r===ct){n.nodes&&n.nodes.length&&(n[Ee]=!0,t.iterator=n.getIterator());return}else if(this.listeners[r]){t.visitors=this.listeners[r];return}}e.pop()}walkSync(e){e[Ee]=!0;let t=Mr(e);for(let n of t)if(n===ct)e.nodes&&e.each(s=>{s[Ee]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};dt.registerPostcss=i=>{gi=i};var Nr=dt;dt.default=dt;Qc.registerLazyResult(dt);Jc.registerLazyResult(dt);let id=mr,sd=$n,rd=ji;const od=Mi;let mi=class{constructor(e,t,n){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s,o=sd;this.result=new od(this._processor,s,this._opts),this.result.css=t;let r=this;Object.defineProperty(this.result,"root",{get(){return r.root}});let a=new id(o,s,this._opts,t);if(a.isMap()){let[l,c]=a.generate();l&&(this.result.css=l),c&&(this.result.map=c)}}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=rd;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var ad=mi;mi.default=mi;let ld=ad,cd=Nr,dd=Ri,ud=Ht,Pt=class{constructor(e=[]){this.version="8.4.32",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n=="object"&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n=="object"&&n.postcssPlugin)t.push(n);else if(typeof n=="function")t.push(n);else if(!(typeof n=="object"&&(n.parse||n.stringify)))throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length===0&&typeof t.parser>"u"&&typeof t.stringifier>"u"&&typeof t.syntax>"u"?new ld(this,e,t):new cd(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var hd=Pt;Pt.default=Pt;ud.registerProcessor(Pt);dd.registerProcessor(Pt);let pd=On,fd=ur,gd=Tn,md=Di,vd=In,bd=Ht,yd=Ni;function Rt(i,e){if(Array.isArray(i))return i.map(s=>Rt(s));let{inputs:t,...n}=i;if(t){e=[];for(let s of t){let o={...s,__proto__:vd.prototype};o.map&&(o.map={...o.map,__proto__:fd.prototype}),e.push(o)}}if(n.nodes&&(n.nodes=i.nodes.map(s=>Rt(s,e))),n.source){let{inputId:s,...o}=n.source;n.source=o,s!=null&&(n.source.input=e[s])}if(n.type==="root")return new bd(n);if(n.type==="decl")return new pd(n);if(n.type==="rule")return new yd(n);if(n.type==="comment")return new gd(n);if(n.type==="atrule")return new md(n);throw new Error("Unknown node type: "+i.type)}var wd=Rt;Rt.default=Rt;var Ts={};let xd=Ti,jr=On,kd=Nr,Ed=Ve,Bi=hd,Sd=$n,_d=wd,Br=Ri,Ad=Cr,zr=Tn,Ur=Di,$d=Mi,Cd=In,Od=ji,Id=Pr,Fr=Ni,Hr=Ht,Td=Cn;function R(...i){return i.length===1&&Array.isArray(i[0])&&(i=i[0]),new Bi(i)}R.plugin=function(e,t){let n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
607
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Ts.LANG&&Ts.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
608
|
+
https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new Bi().version,a}let o;return Object.defineProperty(s,"postcss",{get(){return o||(o=s()),o}}),s.process=function(r,a,l){return R([s(l)]).process(r,a)},s};R.stringify=Sd;R.parse=Od;R.fromJSON=_d;R.list=Id;R.comment=i=>new zr(i);R.atRule=i=>new Ur(i);R.decl=i=>new jr(i);R.rule=i=>new Fr(i);R.root=i=>new Hr(i);R.document=i=>new Br(i);R.CssSyntaxError=xd;R.Declaration=jr;R.Container=Ed;R.Processor=Bi;R.Document=Br;R.Comment=zr;R.Warning=Ad;R.AtRule=Ur;R.Result=$d;R.Input=Cd;R.Rule=Fr;R.Root=Hr;R.Node=Td;kd.registerPostcss(R);var Ld=R;R.default=R;const F=ar(Ld);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var Pd=function(e){const t=e.prefix,n=/\s+$/.test(t)?t:`${t} `,s=e.ignoreFiles?[].concat(e.ignoreFiles):[],o=e.includeFiles?[].concat(e.includeFiles):[];return function(r){s.length&&r.source.input.file&&Ls(r.source.input.file,s)||o.length&&r.source.input.file&&!Ls(r.source.input.file,o)||r.walkRules(a=>{const l=["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"];a.parent&&l.includes(a.parent.name)||(a.selectors=a.selectors.map(c=>e.exclude&&Rd(c,e.exclude)?c:e.transform?e.transform(t,c,n+c,r.source.input.file,a):n+c))})}};function Ls(i,e){return e.some(t=>t instanceof RegExp?t.test(i):i.includes(t))}function Rd(i,e){return e.some(t=>t instanceof RegExp?t.test(i):i===t)}const Md=ar(Pd),Dd="code{white-space:pre}.example{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;gap:16px}.example>*{flex:1 1 500px}.example .tab-control{overflow:hidden}.example div[role=tab]{cursor:pointer;padding:8px 16px;display:inline-block;font-size:16px;border-bottom:2px solid transparent;background-clip:padding-box;-webkit-user-select:none;user-select:none}.example div[role=tab]:hover{background-color:#1467ba14}.example div[role=tab][selected]{background-color:#1467ba21;border-bottom:2px solid #1467ba}.tab-content{margin:16px 0}.tab-content>pre{padding-top:0}.tab-content.code{max-height:500px;overflow:auto}.tab-content.code pre{margin:0}",Nd="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}";function jd(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Wr(i){return i instanceof Map?i.clear=i.delete=i.set=function(){throw new Error("map is read-only")}:i instanceof Set&&(i.add=i.clear=i.delete=function(){throw new Error("set is read-only")}),Object.freeze(i),Object.getOwnPropertyNames(i).forEach(e=>{const t=i[e],n=typeof t;(n==="object"||n==="function")&&!Object.isFrozen(t)&&Wr(t)}),i}class Ps{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function qr(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Pe(i,...e){const t=Object.create(null);for(const n in i)t[n]=i[n];return e.forEach(function(n){for(const s in n)t[s]=n[s]}),t}const Bd="</span>",Rs=i=>!!i.scope,zd=(i,{prefix:e})=>{if(i.startsWith("language:"))return i.replace("language:","language-");if(i.includes(".")){const t=i.split(".");return[`${e}${t.shift()}`,...t.map((n,s)=>`${n}${"_".repeat(s+1)}`)].join(" ")}return`${e}${i}`};class Ud{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=qr(e)}openNode(e){if(!Rs(e))return;const t=zd(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){Rs(e)&&(this.buffer+=Bd)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const Ms=(i={})=>{const e={children:[]};return Object.assign(e,i),e};class zi{constructor(){this.rootNode=Ms(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=Ms({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(n=>this._walk(e,n)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{zi._collapse(t)}))}}class Fd extends zi{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new Ud(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Mt(i){return i?typeof i=="string"?i:i.source:null}function Vr(i){return Ge("(?=",i,")")}function Hd(i){return Ge("(?:",i,")*")}function Wd(i){return Ge("(?:",i,")?")}function Ge(...i){return i.map(e=>Mt(e)).join("")}function qd(i){const e=i[i.length-1];return typeof e=="object"&&e.constructor===Object?(i.splice(i.length-1,1),e):{}}function Ui(...i){return"("+(qd(i).capture?"":"?:")+i.map(e=>Mt(e)).join("|")+")"}function Gr(i){return new RegExp(i.toString()+"|").exec("").length-1}function Vd(i,e){const t=i&&i.exec(e);return t&&t.index===0}const Gd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fi(i,{joinWith:e}){let t=0;return i.map(n=>{t+=1;const s=t;let o=Mt(n),r="";for(;o.length>0;){const a=Gd.exec(o);if(!a){r+=o;break}r+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?r+="\\"+String(Number(a[1])+s):(r+=a[0],a[0]==="("&&t++)}return r}).map(n=>`(${n})`).join(e)}const Kd=/\b\B/,Kr="[a-zA-Z]\\w*",Hi="[a-zA-Z_]\\w*",Zr="\\b\\d+(\\.\\d+)?",Xr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Jr="\\b(0b[01]+)",Zd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Xd=(i={})=>{const e=/^#![ ]*\//;return i.binary&&(i.begin=Ge(e,/.*\b/,i.binary,/\b.*/)),Pe({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,n)=>{t.index!==0&&n.ignoreMatch()}},i)},Dt={begin:"\\\\[\\s\\S]",relevance:0},Jd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Dt]},Yd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Dt]},Qd={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ln=function(i,e,t={}){const n=Pe({scope:"comment",begin:i,end:e,contains:[]},t);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=Ui("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Ge(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},eu=Ln("//","$"),tu=Ln("/\\*","\\*/"),nu=Ln("#","$"),iu={scope:"number",begin:Zr,relevance:0},su={scope:"number",begin:Xr,relevance:0},ru={scope:"number",begin:Jr,relevance:0},ou={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Dt,{begin:/\[/,end:/\]/,relevance:0,contains:[Dt]}]},au={scope:"title",begin:Kr,relevance:0},lu={scope:"title",begin:Hi,relevance:0},cu={begin:"\\.\\s*"+Hi,relevance:0},du=function(i){return Object.assign(i,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var rn=Object.freeze({__proto__:null,APOS_STRING_MODE:Jd,BACKSLASH_ESCAPE:Dt,BINARY_NUMBER_MODE:ru,BINARY_NUMBER_RE:Jr,COMMENT:Ln,C_BLOCK_COMMENT_MODE:tu,C_LINE_COMMENT_MODE:eu,C_NUMBER_MODE:su,C_NUMBER_RE:Xr,END_SAME_AS_BEGIN:du,HASH_COMMENT_MODE:nu,IDENT_RE:Kr,MATCH_NOTHING_RE:Kd,METHOD_GUARD:cu,NUMBER_MODE:iu,NUMBER_RE:Zr,PHRASAL_WORDS_MODE:Qd,QUOTE_STRING_MODE:Yd,REGEXP_MODE:ou,RE_STARTERS_RE:Zd,SHEBANG:Xd,TITLE_MODE:au,UNDERSCORE_IDENT_RE:Hi,UNDERSCORE_TITLE_MODE:lu});function uu(i,e){i.input[i.index-1]==="."&&e.ignoreMatch()}function hu(i,e){i.className!==void 0&&(i.scope=i.className,delete i.className)}function pu(i,e){e&&i.beginKeywords&&(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",i.__beforeBegin=uu,i.keywords=i.keywords||i.beginKeywords,delete i.beginKeywords,i.relevance===void 0&&(i.relevance=0))}function fu(i,e){Array.isArray(i.illegal)&&(i.illegal=Ui(...i.illegal))}function gu(i,e){if(i.match){if(i.begin||i.end)throw new Error("begin & end are not supported with match");i.begin=i.match,delete i.match}}function mu(i,e){i.relevance===void 0&&(i.relevance=1)}const vu=(i,e)=>{if(!i.beforeMatch)return;if(i.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},i);Object.keys(i).forEach(n=>{delete i[n]}),i.keywords=t.keywords,i.begin=Ge(t.beforeMatch,Vr(t.begin)),i.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},i.relevance=0,delete t.beforeMatch},bu=["of","and","for","in","not","or","if","then","parent","list","value"],yu="keyword";function Yr(i,e,t=yu){const n=Object.create(null);return typeof i=="string"?s(t,i.split(" ")):Array.isArray(i)?s(t,i):Object.keys(i).forEach(function(o){Object.assign(n,Yr(i[o],e,o))}),n;function s(o,r){e&&(r=r.map(a=>a.toLowerCase())),r.forEach(function(a){const l=a.split("|");n[l[0]]=[o,wu(l[0],l[1])]})}}function wu(i,e){return e?Number(e):xu(i)?0:1}function xu(i){return bu.includes(i.toLowerCase())}const Ds={},Fe=i=>{console.error(i)},Ns=(i,...e)=>{console.log(`WARN: ${i}`,...e)},Qe=(i,e)=>{Ds[`${i}/${e}`]||(console.log(`Deprecated as of ${i}. ${e}`),Ds[`${i}/${e}`]=!0)},kn=new Error;function Qr(i,e,{key:t}){let n=0;const s=i[t],o={},r={};for(let a=1;a<=e.length;a++)r[a+n]=s[a],o[a+n]=!0,n+=Gr(e[a-1]);i[t]=r,i[t]._emit=o,i[t]._multi=!0}function ku(i){if(Array.isArray(i.begin)){if(i.skip||i.excludeBegin||i.returnBegin)throw Fe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kn;if(typeof i.beginScope!="object"||i.beginScope===null)throw Fe("beginScope must be object"),kn;Qr(i,i.begin,{key:"beginScope"}),i.begin=Fi(i.begin,{joinWith:""})}}function Eu(i){if(Array.isArray(i.end)){if(i.skip||i.excludeEnd||i.returnEnd)throw Fe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kn;if(typeof i.endScope!="object"||i.endScope===null)throw Fe("endScope must be object"),kn;Qr(i,i.end,{key:"endScope"}),i.end=Fi(i.end,{joinWith:""})}}function Su(i){i.scope&&typeof i.scope=="object"&&i.scope!==null&&(i.beginScope=i.scope,delete i.scope)}function _u(i){Su(i),typeof i.beginScope=="string"&&(i.beginScope={_wrap:i.beginScope}),typeof i.endScope=="string"&&(i.endScope={_wrap:i.endScope}),ku(i),Eu(i)}function Au(i){function e(r,a){return new RegExp(Mt(r),"m"+(i.case_insensitive?"i":"")+(i.unicodeRegex?"u":"")+(a?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=Gr(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=e(Fi(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((h,p)=>p>0&&h!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new t;return this.rules.slice(a).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function s(r){const a=new n;return r.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),r.terminatorEnd&&a.addRule(r.terminatorEnd,{type:"end"}),r.illegal&&a.addRule(r.illegal,{type:"illegal"}),a}function o(r,a){const l=r;if(r.isCompiled)return l;[hu,gu,_u,vu].forEach(d=>d(r,a)),i.compilerExtensions.forEach(d=>d(r,a)),r.__beforeBegin=null,[pu,fu,mu].forEach(d=>d(r,a)),r.isCompiled=!0;let c=null;return typeof r.keywords=="object"&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),c=r.keywords.$pattern,delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=Yr(r.keywords,i.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(r.begin||(r.begin=/\B|\b/),l.beginRe=e(l.begin),!r.end&&!r.endsWithParent&&(r.end=/\B|\b/),r.end&&(l.endRe=e(l.end)),l.terminatorEnd=Mt(l.end)||"",r.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(r.end?"|":"")+a.terminatorEnd)),r.illegal&&(l.illegalRe=e(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map(function(d){return $u(d==="self"?r:d)})),r.contains.forEach(function(d){o(d,l)}),r.starts&&o(r.starts,a),l.matcher=s(l),l}if(i.compilerExtensions||(i.compilerExtensions=[]),i.contains&&i.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return i.classNameAliases=Pe(i.classNameAliases||{}),o(i)}function eo(i){return i?i.endsWithParent||eo(i.starts):!1}function $u(i){return i.variants&&!i.cachedVariants&&(i.cachedVariants=i.variants.map(function(e){return Pe(i,{variants:null},e)})),i.cachedVariants?i.cachedVariants:eo(i)?Pe(i,{starts:i.starts?Pe(i.starts):null}):Object.isFrozen(i)?Pe(i):i}var Cu="11.9.0";class Ou extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const Gn=qr,js=Pe,Bs=Symbol("nomatch"),Iu=7,to=function(i){const e=Object.create(null),t=Object.create(null),n=[];let s=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",r={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Fd};function l(u){return a.noHighlightRe.test(u)}function c(u){let v=u.className+" ";v+=u.parentNode?u.parentNode.className:"";const k=a.languageDetectRe.exec(v);if(k){const C=I(k[1]);return C||(Ns(o.replace("{}",k[1])),Ns("Falling back to no-highlight mode for this block.",u)),C?k[1]:"no-highlight"}return v.split(/\s+/).find(C=>l(C)||I(C))}function d(u,v,k){let C="",B="";typeof v=="object"?(C=u,k=v.ignoreIllegals,B=v.language):(Qe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qe("10.7.0",`Please use highlight(code, options) instead.
|
|
609
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),B=u,C=v),k===void 0&&(k=!0);const K={code:C,language:B};ne("before:highlight",K);const oe=K.result?K.result:h(K.language,K.code,k);return oe.code=K.code,ne("after:highlight",oe),oe}function h(u,v,k,C){const B=Object.create(null);function K(g,b){return g.keywords[b]}function oe(){if(!S.keywords){W.addText(D);return}let g=0;S.keywordPatternRe.lastIndex=0;let b=S.keywordPatternRe.exec(D),_="";for(;b;){_+=D.substring(g,b.index);const N=ae.case_insensitive?b[0].toLowerCase():b[0],Q=K(S,N);if(Q){const[$e,uo]=Q;if(W.addText(_),_="",B[N]=(B[N]||0)+1,B[N]<=Iu&&(Ne+=uo),$e.startsWith("_"))_+=b[0];else{const ho=ae.classNameAliases[$e]||$e;Y(b[0],ho)}}else _+=b[0];g=S.keywordPatternRe.lastIndex,b=S.keywordPatternRe.exec(D)}_+=D.substring(g),W.addText(_)}function me(){if(D==="")return;let g=null;if(typeof S.subLanguage=="string"){if(!e[S.subLanguage]){W.addText(D);return}g=h(S.subLanguage,D,!0,xe[S.subLanguage]),xe[S.subLanguage]=g._top}else g=m(D,S.subLanguage.length?S.subLanguage:null);S.relevance>0&&(Ne+=g.relevance),W.__addSublanguage(g._emitter,g.language)}function H(){S.subLanguage!=null?me():oe(),D=""}function Y(g,b){g!==""&&(W.startScope(b),W.addText(g),W.endScope())}function De(g,b){let _=1;const N=b.length-1;for(;_<=N;){if(!g._emit[_]){_++;continue}const Q=ae.classNameAliases[g[_]]||g[_],$e=b[_];Q?Y($e,Q):(D=$e,oe(),D=""),_++}}function we(g,b){return g.scope&&typeof g.scope=="string"&&W.openNode(ae.classNameAliases[g.scope]||g.scope),g.beginScope&&(g.beginScope._wrap?(Y(D,ae.classNameAliases[g.beginScope._wrap]||g.beginScope._wrap),D=""):g.beginScope._multi&&(De(g.beginScope,b),D="")),S=Object.create(g,{parent:{value:S}}),S}function Ke(g,b,_){let N=Vd(g.endRe,_);if(N){if(g["on:end"]){const Q=new Ps(g);g["on:end"](b,Q),Q.isMatchIgnored&&(N=!1)}if(N){for(;g.endsParent&&g.parent;)g=g.parent;return g}}if(g.endsWithParent)return Ke(g.parent,b,_)}function Rn(g){return S.matcher.regexIndex===0?(D+=g[0],1):(Je=!0,0)}function pt(g){const b=g[0],_=g.rule,N=new Ps(_),Q=[_.__beforeBegin,_["on:begin"]];for(const $e of Q)if($e&&($e(g,N),N.isMatchIgnored))return Rn(b);return _.skip?D+=b:(_.excludeBegin&&(D+=b),H(),!_.returnBegin&&!_.excludeBegin&&(D=b)),we(_,g),_.returnBegin?0:b.length}function Mn(g){const b=g[0],_=v.substring(g.index),N=Ke(S,g,_);if(!N)return Bs;const Q=S;S.endScope&&S.endScope._wrap?(H(),Y(b,S.endScope._wrap)):S.endScope&&S.endScope._multi?(H(),De(S.endScope,g)):Q.skip?D+=b:(Q.returnEnd||Q.excludeEnd||(D+=b),H(),Q.excludeEnd&&(D=b));do S.scope&&W.closeNode(),!S.skip&&!S.subLanguage&&(Ne+=S.relevance),S=S.parent;while(S!==N.parent);return N.starts&&we(N.starts,g),Q.returnEnd?0:b.length}function Wt(){const g=[];for(let b=S;b!==ae;b=b.parent)b.scope&&g.unshift(b.scope);g.forEach(b=>W.openNode(b))}let Ze={};function qt(g,b){const _=b&&b[0];if(D+=g,_==null)return H(),0;if(Ze.type==="begin"&&b.type==="end"&&Ze.index===b.index&&_===""){if(D+=v.slice(b.index,b.index+1),!s){const N=new Error(`0 width match regex (${u})`);throw N.languageName=u,N.badRule=Ze.rule,N}return 1}if(Ze=b,b.type==="begin")return pt(b);if(b.type==="illegal"&&!k){const N=new Error('Illegal lexeme "'+_+'" for mode "'+(S.scope||"<unnamed>")+'"');throw N.mode=S,N}else if(b.type==="end"){const N=Mn(b);if(N!==Bs)return N}if(b.type==="illegal"&&_==="")return 1;if(Xe>1e5&&Xe>b.index*3)throw new Error("potential infinite loop, way more iterations than matches");return D+=_,_.length}const ae=I(u);if(!ae)throw Fe(o.replace("{}",u)),new Error('Unknown language: "'+u+'"');const Vt=Au(ae);let ft="",S=C||Vt;const xe={},W=new a.__emitter(a);Wt();let D="",Ne=0,ve=0,Xe=0,Je=!1;try{if(ae.__emitTokens)ae.__emitTokens(v,W);else{for(S.matcher.considerAll();;){Xe++,Je?Je=!1:S.matcher.considerAll(),S.matcher.lastIndex=ve;const g=S.matcher.exec(v);if(!g)break;const b=v.substring(ve,g.index),_=qt(b,g);ve=g.index+_}qt(v.substring(ve))}return W.finalize(),ft=W.toHTML(),{language:u,value:ft,relevance:Ne,illegal:!1,_emitter:W,_top:S}}catch(g){if(g.message&&g.message.includes("Illegal"))return{language:u,value:Gn(v),illegal:!0,relevance:0,_illegalBy:{message:g.message,index:ve,context:v.slice(ve-100,ve+100),mode:g.mode,resultSoFar:ft},_emitter:W};if(s)return{language:u,value:Gn(v),illegal:!1,relevance:0,errorRaised:g,_emitter:W,_top:S};throw g}}function p(u){const v={value:Gn(u),illegal:!1,relevance:0,_top:r,_emitter:new a.__emitter(a)};return v._emitter.addText(u),v}function m(u,v){v=v||a.languages||Object.keys(e);const k=p(u),C=v.filter(I).filter(q).map(H=>h(H,u,!1));C.unshift(k);const B=C.sort((H,Y)=>{if(H.relevance!==Y.relevance)return Y.relevance-H.relevance;if(H.language&&Y.language){if(I(H.language).supersetOf===Y.language)return 1;if(I(Y.language).supersetOf===H.language)return-1}return 0}),[K,oe]=B,me=K;return me.secondBest=oe,me}function E(u,v,k){const C=v&&t[v]||k;u.classList.add("hljs"),u.classList.add(`language-${C}`)}function w(u){let v=null;const k=c(u);if(l(k))return;if(ne("before:highlightElement",{el:u,language:k}),u.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",u);return}if(u.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(u)),a.throwUnescapedHTML))throw new Ou("One of your code blocks includes unescaped HTML.",u.innerHTML);v=u;const C=v.textContent,B=k?d(C,{language:k,ignoreIllegals:!0}):m(C);u.innerHTML=B.value,u.dataset.highlighted="yes",E(u,k,B.language),u.result={language:B.language,re:B.relevance,relevance:B.relevance},B.secondBest&&(u.secondBest={language:B.secondBest.language,relevance:B.secondBest.relevance}),ne("after:highlightElement",{el:u,result:B,text:C})}function f(u){a=js(a,u)}const $=()=>{x(),Qe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){x(),Qe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function x(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(a.cssSelector).forEach(w)}function A(){L&&x()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",A,!1);function O(u,v){let k=null;try{k=v(i)}catch(C){if(Fe("Language definition for '{}' could not be registered.".replace("{}",u)),s)Fe(C);else throw C;k=r}k.name||(k.name=u),e[u]=k,k.rawDefinition=v.bind(null,i),k.aliases&&j(k.aliases,{languageName:u})}function P(u){delete e[u];for(const v of Object.keys(t))t[v]===u&&delete t[v]}function M(){return Object.keys(e)}function I(u){return u=(u||"").toLowerCase(),e[u]||e[t[u]]}function j(u,{languageName:v}){typeof u=="string"&&(u=[u]),u.forEach(k=>{t[k.toLowerCase()]=v})}function q(u){const v=I(u);return v&&!v.disableAutodetect}function te(u){u["before:highlightBlock"]&&!u["before:highlightElement"]&&(u["before:highlightElement"]=v=>{u["before:highlightBlock"](Object.assign({block:v.el},v))}),u["after:highlightBlock"]&&!u["after:highlightElement"]&&(u["after:highlightElement"]=v=>{u["after:highlightBlock"](Object.assign({block:v.el},v))})}function G(u){te(u),n.push(u)}function ge(u){const v=n.indexOf(u);v!==-1&&n.splice(v,1)}function ne(u,v){const k=u;n.forEach(function(C){C[k]&&C[k](v)})}function J(u){return Qe("10.7.0","highlightBlock will be removed entirely in v12.0"),Qe("10.7.0","Please use highlightElement now."),w(u)}Object.assign(i,{highlight:d,highlightAuto:m,highlightAll:x,highlightElement:w,highlightBlock:J,configure:f,initHighlighting:$,initHighlightingOnLoad:T,registerLanguage:O,unregisterLanguage:P,listLanguages:M,getLanguage:I,registerAliases:j,autoDetection:q,inherit:js,addPlugin:G,removePlugin:ge}),i.debugMode=function(){s=!1},i.safeMode=function(){s=!0},i.versionString=Cu,i.regex={concat:Ge,lookahead:Vr,either:Ui,optional:Wd,anyNumberOfTimes:Hd};for(const u in rn)typeof rn[u]=="object"&&Wr(rn[u]);return Object.assign(i,rn),i},ut=to({});ut.newInstance=()=>to({});var Tu=ut;ut.HighlightJS=ut;ut.default=ut;const Pn=jd(Tu),En="[A-Za-z$_][0-9A-Za-z$_]*",no=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],io=["true","false","null","undefined","NaN","Infinity"],so=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ro=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],oo=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ao=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lo=[].concat(oo,so,ro);function Lu(i){const e=i.regex,t=(u,{after:v})=>{const k="</"+u[0].slice(1);return u.input.indexOf(k,v)!==-1},n=En,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(u,v)=>{const k=u[0].length+u.index,C=u.input[k];if(C==="<"||C===","){v.ignoreMatch();return}C===">"&&(t(u,{after:k})||v.ignoreMatch());let B;const K=u.input.substring(k);if(B=K.match(/^\s*=/)){v.ignoreMatch();return}if((B=K.match(/^\s+extends\s+/))&&B.index===0){v.ignoreMatch();return}}},a={$pattern:En,keyword:no,literal:io,built_in:lo,"variable.language":ao},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},E={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,p],subLanguage:"css"}},w={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[i.BACKSLASH_ESCAPE,p]},$={className:"comment",variants:[i.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},T=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,m,E,w,f,{match:/\$\d+/},h];p.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});const L=[].concat($,p.contains),x=L.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(L)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},O={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...so,...ro]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(u){return e.concat("(?!",u.join("|"),")")}const te={match:e.concat(/\b/,q([...oo,"super","import"]),n,e.lookahead(/\(/)),className:"title.function",relevance:0},G={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+i.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[i.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,m,E,w,f,$,{match:/\$\d+/},h,P,{className:"attr",begin:n+e.lookahead(":"),relevance:0},J,{begin:"("+i.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[$,i.REGEXP_MODE,{className:"function",begin:ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:r.begin,"on:begin":r.isTrulyOpeningTag,end:r.end}],subLanguage:"xml",contains:[{begin:r.begin,end:r.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,i.inherit(i.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},te,j,O,ge,{match:/\$[(.]/}]}}function Pu(i){const e=Lu(i),t=En,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[e.exports.CLASS_REFERENCE]},r={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:En,keyword:no.concat(a),literal:io,built_in:lo.concat(n),"variable.language":ao},c={className:"meta",begin:"@"+t},d=(p,m,E)=>{const w=p.contains.findIndex(f=>f.label===m);if(w===-1)throw new Error("can not find mode to replace");p.contains.splice(w,1,E)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,s,o]),d(e,"shebang",i.SHEBANG()),d(e,"use_strict",r);const h=e.contains.find(p=>p.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Ru(i){const e=i.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=i.inherit(o,{begin:/\(/,end:/\)/}),a=i.inherit(i.APOS_STRING_MODE,{className:"string"}),l=i.inherit(i.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,l,a,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,l,a]}]}]},i.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const Mu=i=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:i.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:i.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Du=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Nu=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],ju=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Bu=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],zu=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Uu(i){const e=i.regex,t=Mu(i),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",o=/@-?\w[\w]*(-\w+)*/,r="[a-zA-Z-][a-zA-Z0-9_-]*",a=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,n,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+r,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ju.join("|")+")"},{begin:":(:)?("+Bu.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+zu.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Nu.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Du.join("|")+")\\b"}]}}const co=document.createElement("style");co.innerText=[Dd,Nd].join(`
|
|
610
|
+
`);document.head.appendChild(co);Pn.registerLanguage("typescript",Pu);Pn.registerLanguage("html",Ru);Pn.registerLanguage("css",Uu);function Fu(...i){const e=document.createElement("div"),t=document.createElement("div");t.classList.add("tab-control");const n=document.createElement("div");return i.forEach(s=>{e.appendChild(s),s.addEventListener("click",()=>{i.forEach(o=>o.removeAttribute("selected")),s.setAttribute("selected",""),n.innerHTML="",n.appendChild(s.content),n.className=s.className,n.classList.add("tab-content")})}),t.appendChild(e),t.appendChild(n),n.classList.add("tab-content"),i[0].setAttribute("selected",""),n.appendChild(i[0].content),t}function yt(i,e){const t=document.createElement("div");return t.role="tab",t.tabIndex=0,t.innerText=i,t.content=e,e.tagName=="PRE"&&t.classList.add("code"),t}function kt(i,e){const t=document.createElement(i);return typeof e=="string"?t.innerHTML=e:e.forEach(n=>{t.appendChild(n)}),t}async function Hu(i,e,t){var n,s,o;const r=e.mainContent,a=kt("div",r);a.id=`example-preview-${t}`;const l=typeof e.css=="string"||(n=e.css)==null?void 0:n.label,c=typeof e.css=="string"?e.css:(s=e.css)==null?void 0:s.content,d=Fu(yt("Preview",a),yt("HTML",on("html",r)),...c?[yt(l??"CSS",on("css",c))]:[],...e.initializer&&e.initializer.content?[yt(e.initializer.label??"TS",on("typescript",e.initializer.content))]:[],...(e.additionalSources||[]).map(p=>yt(p.label,on(p.language,p.content))));e.description&&i.appendChild(kt("div",e.description));const h=kt("div",[d]);h.classList.add("example"),i.appendChild(h),c&&Wu(`#${a.id}`,c),(o=e.initializer)!=null&&o.initialize&&await e.initializer.initialize(a)}function on(i,e){let t=e.split(/\r?\n/).map(n=>{const s=n.indexOf("///");if(s>-1){const o=n.substring(s+3).trimStart();return o?n.replace(/^(\s*)([^\s].*)$/,`$1${o}`):void 0}return n}).filter(n=>typeof n<"u").join(`
|
|
611
|
+
`).trim();return i&&i!="raw"&&(t=Pn.highlight(t,{language:i}).value),kt("pre",[kt("code",t)])}function Wu(i,e){const t=document.createElement("style");t.innerHTML=F().use(Md({prefix:i})).process(e).css,document.head.appendChild(t)}async function qu(i,e=document.body){const t=Gu(e);let n=0;Object.keys(i).forEach(async s=>{const o=document.createElement("div");o.className="example-container",t.appendChild(o);const r=i[s].default;Hu(o,r,n++)})}function Vu(i){const e=document.createElement("div");e.id="examples-container";const t=i.querySelector("#examples");return t?t.after(e):i.appendChild(e),e}function Gu(i){return i.children?Vu(i):i}const Ku=`<h1 id="@cas-smartdesign/token-selector">@cas-smartdesign/token-selector</h1>
|
|
612
|
+
<p>A token-selector element based on <a href="https://github.com/Polymer/lit-element">lit-element</a> with SmartDesign look & feel.</p>
|
|
613
|
+
<p><em><code>Note: This is a preview version of the sd-token-selector element. Some features like for example declarative support for the element is not fully supported and guaranteed.</code></em></p>
|
|
614
|
+
<h2 id="attributes---token-selector">Attributes - Token-Selector</h2>
|
|
615
|
+
<ul>
|
|
616
|
+
<li><code>selection-mode</code> : <strong>string (default = "multi")</strong><ul>
|
|
617
|
+
<li><code>multi</code>: it is possible to select, delesect existing tokens or create new ones with the help of a <code>sd-lit-input</code> element.</li>
|
|
618
|
+
<li><code>remove-only</code>: there is no <code>sd-lit-input</code> element shown, tokens may only be removed.</li>
|
|
619
|
+
<li>In addition the property usage of <code>items</code> and <code>selectedIndexes</code> differs. Further information below.</li>
|
|
620
|
+
</ul>
|
|
621
|
+
</li>
|
|
622
|
+
<li><code>placeholder</code> : <strong>string (default = null)</strong><ul>
|
|
623
|
+
<li>Defines the default text content of the selector if there is no selected token present. Just like a placeholder for an HTML input element.</li>
|
|
624
|
+
</ul>
|
|
625
|
+
</li>
|
|
626
|
+
<li><code>suggest-list-class</code> : <strong>string (default = null)</strong><ul>
|
|
627
|
+
<li>The classname of the suggestion list.</li>
|
|
628
|
+
</ul>
|
|
629
|
+
</li>
|
|
630
|
+
<li><code>aria-disabled</code> : <strong>boolean (default = false)</strong><ul>
|
|
631
|
+
<li>Disables the editing possibilities.</li>
|
|
632
|
+
</ul>
|
|
633
|
+
</li>
|
|
634
|
+
<li><code>role</code> : <strong>string (default = 'listbox')</strong></li>
|
|
635
|
+
<li><code>aria-multiselectable</code> : <strong>boolean (default = true)</strong></li>
|
|
636
|
+
<li><code>aria-activedescendant</code> : <strong>string (default = null)</strong><ul>
|
|
637
|
+
<li>The <code>id</code> attribute of the currently active <code>sd-token</code>.</li>
|
|
638
|
+
</ul>
|
|
639
|
+
</li>
|
|
640
|
+
<li><code>aria-haspopup</code> : <strong>string (default = 'listbox')</strong><ul>
|
|
641
|
+
<li>Set only for multi selection mode when the selector has a listbox popup.</li>
|
|
642
|
+
</ul>
|
|
643
|
+
</li>
|
|
644
|
+
<li><code>token-type</code> : <strong>string (default = null)</strong><ul>
|
|
645
|
+
<li>Shown as a drag shadow suffix after the amount when moving multiple tokens. Without it the drag source is used as a drag image with an indicator from the amount of additional selected tokens.</li>
|
|
646
|
+
</ul>
|
|
647
|
+
</li>
|
|
648
|
+
<li><code>drop</code> : <strong>boolean (default = null)</strong><ul>
|
|
649
|
+
<li>Present when the selector is a potential drop candidate.</li>
|
|
650
|
+
</ul>
|
|
651
|
+
</li>
|
|
652
|
+
<li><code>case-sensitive</code> : <strong>boolean (default = null)</strong><ul>
|
|
653
|
+
<li>Based on its value the token-selector differentiates values with or without case sensitive checking.</li>
|
|
654
|
+
</ul>
|
|
655
|
+
</li>
|
|
656
|
+
</ul>
|
|
657
|
+
<h2 id="properties---token-selector">Properties - Token-Selector</h2>
|
|
658
|
+
<ul>
|
|
659
|
+
<li><code>selectionMode</code> : <strong>string (default = "multi")</strong><ul>
|
|
660
|
+
<li>Reflects the corresponding attribute.</li>
|
|
661
|
+
</ul>
|
|
662
|
+
</li>
|
|
663
|
+
<li><code>items</code> : <strong>array (default = empty)</strong><ul>
|
|
664
|
+
<li>The data to be used by the token-selector.</li>
|
|
665
|
+
<li><strong>remove-only</strong><ul>
|
|
666
|
+
<li>The passed items are directly visualized as tokens</li>
|
|
667
|
+
</ul>
|
|
668
|
+
</li>
|
|
669
|
+
<li><strong>multi select</strong><ul>
|
|
670
|
+
<li>The passed items are used as the datasource of the token-selector.</li>
|
|
671
|
+
<li>Based on this datasource, tokens are visualized when <code>selectedIndexes</code> are present.</li>
|
|
672
|
+
<li>In addition the datasource is used for the token suggestions, which will be shown when the user starts typing.</li>
|
|
673
|
+
</ul>
|
|
674
|
+
</li>
|
|
675
|
+
</ul>
|
|
676
|
+
</li>
|
|
677
|
+
<li><code>selectedIndexes</code> : <strong>array (default = empty)</strong><ul>
|
|
678
|
+
<li>The indexes of the currently selected items.</li>
|
|
679
|
+
<li>Only relevant when the selection mode is <strong>multi</strong></li>
|
|
680
|
+
</ul>
|
|
681
|
+
</li>
|
|
682
|
+
<li><code>placeholder</code> : <strong>string (default = null)</strong><ul>
|
|
683
|
+
<li>Reflects the corresponding attribute.</li>
|
|
684
|
+
</ul>
|
|
685
|
+
</li>
|
|
686
|
+
<li><code>suggestListClass</code> : <strong>string (default = null)</strong><ul>
|
|
687
|
+
<li>Reflects the <code>suggest-list-class</code> attribute.</li>
|
|
688
|
+
</ul>
|
|
689
|
+
</li>
|
|
690
|
+
<li><code>disabled</code> : <strong>boolean (default = false)</strong><ul>
|
|
691
|
+
<li>Reflects the <code>aria-disabled</code> attribute.</li>
|
|
692
|
+
</ul>
|
|
693
|
+
</li>
|
|
694
|
+
<li><code>tokenGenerator</code>: Default value is the one from the token element.<ul>
|
|
695
|
+
<li>Tokens can be further customized in addition to the regular properties.</li>
|
|
696
|
+
</ul>
|
|
697
|
+
</li>
|
|
698
|
+
<li><code>autoSuggestItemGenerator</code>: Default value is the one from the list-item element.<ul>
|
|
699
|
+
<li>Auto suggest items can be further customized in addition to the regular properties.</li>
|
|
700
|
+
</ul>
|
|
701
|
+
</li>
|
|
702
|
+
<li><code>tokenType</code> : <strong>string (default = null)</strong><ul>
|
|
703
|
+
<li>Reflects the <code>token-type</code> attribute.</li>
|
|
704
|
+
</ul>
|
|
705
|
+
</li>
|
|
706
|
+
<li><code>caseSensitive</code> : <strong>boolean (default = null)</strong><ul>
|
|
707
|
+
<li>Reflects the <code>case-sensitive</code> attribute.</li>
|
|
708
|
+
</ul>
|
|
709
|
+
</li>
|
|
710
|
+
<li><code>suggestionFilter</code>: <strong>Function (searchTerm: string, item: TokenData) => boolean</strong><ul>
|
|
711
|
+
<li>A custom filter function can be passed to override the default caption based search of suggestions.</li>
|
|
712
|
+
</ul>
|
|
713
|
+
</li>
|
|
714
|
+
</ul>
|
|
715
|
+
<p>In addition it allows to inject elements with slot named <code>additional-content</code> that is shown right after the tokens part.</p>
|
|
716
|
+
<h2 id="attributes/properties---delegated-to-the-internal-<code>sd-lit-input</code>">Attributes/properties - delegated to the internal <code>sd-lit-input</code></h2>
|
|
717
|
+
<ul>
|
|
718
|
+
<li><code>placeholder</code> : <strong>string (default = null)</strong></li>
|
|
719
|
+
<li><code>inputLabel</code> : <strong>string (default = null)</strong></li>
|
|
720
|
+
<li><code>validationMessage</code> : <strong>string (default = null)</strong></li>
|
|
721
|
+
<li><code>validationIconSrc</code> : <strong>string (default = null)</strong></li>
|
|
722
|
+
<li><code>validationLevel</code> : <strong>string (default = null)</strong></li>
|
|
723
|
+
</ul>
|
|
724
|
+
<h2 id="attributes---token">Attributes - Token</h2>
|
|
725
|
+
<ul>
|
|
726
|
+
<li><code>value</code> : <strong>string (default = "")</strong><ul>
|
|
727
|
+
<li>The displayed value of the token.</li>
|
|
728
|
+
</ul>
|
|
729
|
+
</li>
|
|
730
|
+
<li><code>type</code> : <strong>string (default = "")</strong><ul>
|
|
731
|
+
<li>The type of the token. Used to mark tokens by usecases.</li>
|
|
732
|
+
</ul>
|
|
733
|
+
</li>
|
|
734
|
+
<li><code>aria-disabled</code> : <strong>boolean (default = false)</strong><ul>
|
|
735
|
+
<li>Indicates if the token can be edited or removed for example. An edited token may provide a delete button as well.</li>
|
|
736
|
+
</ul>
|
|
737
|
+
</li>
|
|
738
|
+
<li><code>aria-current</code> : <strong>boolean (default = false)</strong><ul>
|
|
739
|
+
<li>Indicates if the token is the active descendant of the relevant <code>sd-token-selector</code>.</li>
|
|
740
|
+
</ul>
|
|
741
|
+
</li>
|
|
742
|
+
<li><code>aria-checked</code> : <strong>boolean (default = false)</strong><ul>
|
|
743
|
+
<li>Indicates if the token is checked for potentially batch actions like removal or drag and drop.</li>
|
|
744
|
+
</ul>
|
|
745
|
+
</li>
|
|
746
|
+
<li><code>aria-selected</code> : <strong>boolean (default = true)</strong></li>
|
|
747
|
+
<li>Set to true initially since every visible token element in a <code>sd-token-selector</code> can be considered as selected. The non-selected ones are not present in the DOM normally.</li>
|
|
748
|
+
</ul>
|
|
749
|
+
<h2 id="properties---token">Properties - Token</h2>
|
|
750
|
+
<ul>
|
|
751
|
+
<li><code>value</code>, <code>type</code><ul>
|
|
752
|
+
<li>Reflect the corresponding attributes.</li>
|
|
753
|
+
</ul>
|
|
754
|
+
</li>
|
|
755
|
+
<li><code>icon</code>: <strong>string (default = "")</strong><ul>
|
|
756
|
+
<li>Defines the icon url. If present the icon is shown at the start of the token.</li>
|
|
757
|
+
</ul>
|
|
758
|
+
</li>
|
|
759
|
+
<li><code>iconPlaceholder</code> : <strong>string (default = "")</strong><ul>
|
|
760
|
+
<li>Defines the placeholder icon of the token</li>
|
|
761
|
+
</ul>
|
|
762
|
+
</li>
|
|
763
|
+
<li><code>iconBackgroundColor</code>: <strong>string (default = "")</strong><ul>
|
|
764
|
+
<li>Defines the background color of the icon container. Only relevant when the icon has a transparent background.</li>
|
|
765
|
+
</ul>
|
|
766
|
+
</li>
|
|
767
|
+
<li><code>disabled</code><ul>
|
|
768
|
+
<li>Reflects the <code>aria-disabled</code> attribute.</li>
|
|
769
|
+
</ul>
|
|
770
|
+
</li>
|
|
771
|
+
<li><code>current</code><ul>
|
|
772
|
+
<li>Reflects the <code>aria-current</code> attribute.</li>
|
|
773
|
+
</ul>
|
|
774
|
+
</li>
|
|
775
|
+
<li><code>checked</code><ul>
|
|
776
|
+
<li>Reflects the <code>aria-checked</code> attribute.</li>
|
|
777
|
+
</ul>
|
|
778
|
+
</li>
|
|
779
|
+
</ul>
|
|
780
|
+
<p>In addition it allows to inject elements with slots named <code>before-icon</code> & <code>after-icon</code>.</p>
|
|
781
|
+
<h2 id="css-custom-properties-&-parts">CSS Custom Properties & parts</h2>
|
|
782
|
+
<ul>
|
|
783
|
+
<li><code>--token-background-color</code><ul>
|
|
784
|
+
<li>Defines the background color of the token.</li>
|
|
785
|
+
</ul>
|
|
786
|
+
</li>
|
|
787
|
+
<li><code>--token-border</code><ul>
|
|
788
|
+
<li>Defines the border of the token.</li>
|
|
789
|
+
</ul>
|
|
790
|
+
</li>
|
|
791
|
+
<li><code>--token-icon-background-color</code><ul>
|
|
792
|
+
<li>Defines the icon background color of the token.</li>
|
|
793
|
+
</ul>
|
|
794
|
+
</li>
|
|
795
|
+
<li><code>remove-only-placeholder</code> part<ul>
|
|
796
|
+
<li>Applies to the placeholder text which is shown when the selector has no selection in <code>remove-only</code> mode.</li>
|
|
797
|
+
</ul>
|
|
798
|
+
</li>
|
|
799
|
+
</ul>
|
|
800
|
+
<h2 id="custom-events">Custom Events</h2>
|
|
801
|
+
<ul>
|
|
802
|
+
<li><code>token-clicked</code><ul>
|
|
803
|
+
<li>Dispatched when a token is clicked.</li>
|
|
804
|
+
<li>Contains the index of the token in the items list and the referenced HTML Element.</li>
|
|
805
|
+
</ul>
|
|
806
|
+
</li>
|
|
807
|
+
<li><code>tokens-removed</code><ul>
|
|
808
|
+
<li>Dispatched when the remove button of a token is clicked or checked tokens are removed via keyboard.</li>
|
|
809
|
+
<li>Contains the indexes of the removed tokens in the items list.</li>
|
|
810
|
+
<li>Contains also an updated list of selectedIndices if the selection-mode is <code>multi</code>.</li>
|
|
811
|
+
</ul>
|
|
812
|
+
</li>
|
|
813
|
+
<li><code>tokens-selected</code><ul>
|
|
814
|
+
<li>Dispatched when an existing and not yet selected token was selected.</li>
|
|
815
|
+
<li>Contains the indexes of the selected tokens in the items list and the updated selectedIndices.</li>
|
|
816
|
+
</ul>
|
|
817
|
+
</li>
|
|
818
|
+
<li><code>token-created</code><ul>
|
|
819
|
+
<li>Dispatched when a not existing token value was submitted.</li>
|
|
820
|
+
<li>Contains the value of the new token.</li>
|
|
821
|
+
</ul>
|
|
822
|
+
</li>
|
|
823
|
+
<li><code>auto-suggest-initialized</code><ul>
|
|
824
|
+
<li>Dispatched when the auto suggest popover is shown for the first time.</li>
|
|
825
|
+
</ul>
|
|
826
|
+
</li>
|
|
827
|
+
</ul>
|
|
828
|
+
<h2 id="examples">Examples</h2>
|
|
829
|
+
`;document.querySelector("#markdown-container").innerHTML=Ku;qu(Object.assign({"./examples/1_remove_only/index.ts":yo,"./examples/2_multi_select/index.ts":So,"./examples/3_editable_input_attributes/index.ts":Oo,"./examples/4_dnd/index.ts":Ro,"./examples/5_other/index.ts":Uo}));export{sh as T,jl as g,$t as h,Cl as s};
|
|
830
|
+
function __vite__mapDeps(indexes) {
|
|
831
|
+
if (!__vite__mapDeps.viteFileDeps) {
|
|
832
|
+
__vite__mapDeps.viteFileDeps = ["./1_remove_only.js","./token-provider.mjs","./2_multi_select.js","./button.mjs","./3_editable_input_attributes.js","./4_dnd.js","./5_other.js"]
|
|
833
|
+
}
|
|
834
|
+
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
835
|
+
}
|