@cas-smartdesign/tree 4.0.3
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/docs/3_lazy_loading.js +1 -0
- package/dist/docs/doc.css +1 -0
- package/dist/docs/doc.mjs +755 -0
- package/dist/docs/index.html +25 -0
- package/dist/src/checkbox-node.d.ts +9 -0
- package/dist/src/constants.d.ts +2 -0
- package/dist/src/loading-indicator.d.ts +14 -0
- package/dist/src/node.d.ts +43 -0
- package/dist/src/radio-button-node.d.ts +13 -0
- package/dist/src/tree-node.d.ts +44 -0
- package/dist/src/tree.d.ts +98 -0
- package/dist/src/types.d.ts +21 -0
- package/dist/src/utils.d.ts +9 -0
- package/dist/src/utils.spec.d.ts +1 -0
- package/dist/tree-with-externals.js +203 -0
- package/dist/tree-with-externals.js.map +7 -0
- package/dist/tree.d.ts +1 -0
- package/dist/tree.mjs +737 -0
- package/dist/tree.mjs.map +1 -0
- package/dist/vitest.config.d.mts +2 -0
- package/npm-third-party-licenses.json +192 -0
- package/package.json +44 -0
- package/readme.md +111 -0
|
@@ -0,0 +1,755 @@
|
|
|
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 rr=`<!-- Load element with all dependencies directly -->
|
|
2
|
+
<script src="./tree-with-externals.js"><\/script>
|
|
3
|
+
|
|
4
|
+
<div id="example-root">
|
|
5
|
+
<div class="tree-example">
|
|
6
|
+
<div><b>Parent selection not allowed</b></div>
|
|
7
|
+
<sd-tree tabindex="0">
|
|
8
|
+
<sd-tree-node text="node-0" node-id="0"></sd-tree-node>
|
|
9
|
+
<sd-tree-node text="node-1" node-id="1">
|
|
10
|
+
<sd-tree-node text="node-2" node-id="2"></sd-tree-node>
|
|
11
|
+
<sd-tree-node text="node-3" node-id="3"></sd-tree-node>
|
|
12
|
+
</sd-tree-node>
|
|
13
|
+
<sd-tree-node text="node-4" node-id="4">
|
|
14
|
+
<sd-tree-node text="node-5" node-id="5"></sd-tree-node>
|
|
15
|
+
<sd-tree-node text="node-6" node-id="6"></sd-tree-node>
|
|
16
|
+
<sd-tree-node text="node-7" node-id="7"></sd-tree-node>
|
|
17
|
+
<sd-tree-node text="node-8" node-id="8">
|
|
18
|
+
<sd-tree-node text="node-9" node-id="9"></sd-tree-node>
|
|
19
|
+
<sd-tree-node text="node-10" node-id="10"></sd-tree-node>
|
|
20
|
+
<sd-tree-node text="node-11" node-id="11"></sd-tree-node>
|
|
21
|
+
<sd-tree-node text="node-12" node-id="12"></sd-tree-node>
|
|
22
|
+
<sd-tree-node text="node-13" node-id="13"></sd-tree-node>
|
|
23
|
+
<sd-tree-node text="node-14" node-id="14"></sd-tree-node>
|
|
24
|
+
</sd-tree-node>
|
|
25
|
+
<sd-tree-node text="node-15" node-id="15"></sd-tree-node>
|
|
26
|
+
<sd-tree-node text="node-16" node-id="16"></sd-tree-node>
|
|
27
|
+
</sd-tree-node>
|
|
28
|
+
</sd-tree>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="tree-example">
|
|
31
|
+
<div><b>Parent selection allowed</b></div>
|
|
32
|
+
<sd-tree tabindex="0" parent-selection-allowed>
|
|
33
|
+
<sd-tree-node text="node-0" node-id="0"></sd-tree-node>
|
|
34
|
+
<sd-tree-node text="node-1" node-id="1">
|
|
35
|
+
<sd-tree-node text="node-2" node-id="2"></sd-tree-node>
|
|
36
|
+
<sd-tree-node text="node-3" node-id="3"></sd-tree-node>
|
|
37
|
+
</sd-tree-node>
|
|
38
|
+
<sd-tree-node text="node-4" node-id="4">
|
|
39
|
+
<sd-tree-node text="node-5" node-id="5"></sd-tree-node>
|
|
40
|
+
<sd-tree-node text="node-6" node-id="6"></sd-tree-node>
|
|
41
|
+
<sd-tree-node text="node-7" node-id="7"></sd-tree-node>
|
|
42
|
+
<sd-tree-node text="node-8" node-id="8">
|
|
43
|
+
<sd-tree-node text="node-9" node-id="9"></sd-tree-node>
|
|
44
|
+
<sd-tree-node text="node-10" node-id="10"></sd-tree-node>
|
|
45
|
+
<sd-tree-node text="node-11" node-id="11"></sd-tree-node>
|
|
46
|
+
<sd-tree-node text="node-12" node-id="12"></sd-tree-node>
|
|
47
|
+
<sd-tree-node text="node-13" node-id="13"></sd-tree-node>
|
|
48
|
+
<sd-tree-node text="node-14" node-id="14"></sd-tree-node>
|
|
49
|
+
</sd-tree-node>
|
|
50
|
+
<sd-tree-node text="node-15" node-id="15"></sd-tree-node>
|
|
51
|
+
<sd-tree-node text="node-16" node-id="16"></sd-tree-node>
|
|
52
|
+
</sd-tree-node>
|
|
53
|
+
</sd-tree>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
`,or=`<h3 id="declarative-example-with-checkboxes-only">Declarative example with checkboxes only</h3>
|
|
57
|
+
`,lr=`#example-root {
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: repeat(2, 1fr);
|
|
60
|
+
column-gap: 16px;
|
|
61
|
+
}
|
|
62
|
+
sd-tree {
|
|
63
|
+
max-height: 500px;
|
|
64
|
+
}
|
|
65
|
+
`,ar={mainContent:rr,description:or,css:lr},dr=Object.freeze(Object.defineProperty({__proto__:null,default:ar},Symbol.toStringTag,{value:"Module"})),cr=`<!-- Load element with all dependencies directly -->
|
|
66
|
+
<script src="./tree-with-externals.js"><\/script>
|
|
67
|
+
|
|
68
|
+
<div id="example-root">
|
|
69
|
+
<div class="tree-example">
|
|
70
|
+
<div><b>Mixed nodes, parent selection not allowed</b></div>
|
|
71
|
+
<sd-tree tabindex="0">
|
|
72
|
+
<sd-tree-node text="node-0" node-id="0"></sd-tree-node>
|
|
73
|
+
<sd-tree-node text="node-1" node-id="1" type="checkbox">
|
|
74
|
+
<sd-tree-node text="node-2" node-id="2" type="radio"></sd-tree-node>
|
|
75
|
+
<sd-tree-node text="node-3" node-id="3" type="radio"></sd-tree-node>
|
|
76
|
+
</sd-tree-node>
|
|
77
|
+
<sd-tree-node text="node-4" node-id="4" type="checkbox">
|
|
78
|
+
<sd-tree-node text="node-5" node-id="5" type="checkbox"></sd-tree-node>
|
|
79
|
+
<sd-tree-node text="node-6" node-id="6" type="checkbox"></sd-tree-node>
|
|
80
|
+
<sd-tree-node text="node-7" node-id="7" type="checkbox"></sd-tree-node>
|
|
81
|
+
<sd-tree-node text="node-8" node-id="8" type="checkbox">
|
|
82
|
+
<sd-tree-node text="node-9" node-id="9" type="radio"></sd-tree-node>
|
|
83
|
+
<sd-tree-node text="node-10" node-id="10" type="radio"></sd-tree-node>
|
|
84
|
+
<sd-tree-node text="node-11" node-id="11" type="radio"></sd-tree-node>
|
|
85
|
+
<sd-tree-node text="node-12" node-id="12" type="radio"></sd-tree-node>
|
|
86
|
+
<sd-tree-node text="node-13" node-id="13" type="radio"></sd-tree-node>
|
|
87
|
+
<sd-tree-node text="node-14" node-id="14" type="radio"></sd-tree-node>
|
|
88
|
+
</sd-tree-node>
|
|
89
|
+
<sd-tree-node text="node-15" node-id="15" type="checkbox"></sd-tree-node>
|
|
90
|
+
<sd-tree-node text="node-16" node-id="16" type="checkbox">
|
|
91
|
+
<sd-tree-node text="node-17" node-id="17" type="checkbox"></sd-tree-node>
|
|
92
|
+
<sd-tree-node text="node-18" node-id="18" type="checkbox"></sd-tree-node>
|
|
93
|
+
<sd-tree-node text="node-19" node-id="19" type="checkbox"></sd-tree-node>
|
|
94
|
+
</sd-tree-node>
|
|
95
|
+
</sd-tree-node>
|
|
96
|
+
</sd-tree>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="tree-example">
|
|
99
|
+
<div><b>Mixed nodes, parent selection allowed</b></div>
|
|
100
|
+
<sd-tree tabindex="0" parent-selection-allowed>
|
|
101
|
+
<sd-tree-node text="node-0" node-id="0"></sd-tree-node>
|
|
102
|
+
<sd-tree-node text="node-1" node-id="1" type="checkbox">
|
|
103
|
+
<sd-tree-node text="node-2" node-id="2" type="radio"></sd-tree-node>
|
|
104
|
+
<sd-tree-node text="node-3" node-id="3" type="radio"></sd-tree-node>
|
|
105
|
+
</sd-tree-node>
|
|
106
|
+
<sd-tree-node text="node-4" node-id="4" type="checkbox">
|
|
107
|
+
<sd-tree-node text="node-5" node-id="5" type="checkbox"></sd-tree-node>
|
|
108
|
+
<sd-tree-node text="node-6" node-id="6" type="checkbox"></sd-tree-node>
|
|
109
|
+
<sd-tree-node text="node-7" node-id="7" type="checkbox"></sd-tree-node>
|
|
110
|
+
<sd-tree-node text="node-8" node-id="8" type="checkbox">
|
|
111
|
+
<sd-tree-node text="node-9" node-id="9" type="radio"></sd-tree-node>
|
|
112
|
+
<sd-tree-node text="node-10" node-id="10" type="radio"></sd-tree-node>
|
|
113
|
+
<sd-tree-node text="node-11" node-id="11" type="radio"></sd-tree-node>
|
|
114
|
+
<sd-tree-node text="node-12" node-id="12" type="radio"></sd-tree-node>
|
|
115
|
+
<sd-tree-node text="node-13" node-id="13" type="radio"></sd-tree-node>
|
|
116
|
+
<sd-tree-node text="node-14" node-id="14" type="radio"></sd-tree-node>
|
|
117
|
+
</sd-tree-node>
|
|
118
|
+
<sd-tree-node text="node-15" node-id="15" type="checkbox"></sd-tree-node>
|
|
119
|
+
<sd-tree-node text="node-16" node-id="16" type="checkbox"></sd-tree-node>
|
|
120
|
+
</sd-tree-node>
|
|
121
|
+
</sd-tree>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="tree-example">
|
|
124
|
+
<div><b>Radio button only, parent selection not allowed</b></div>
|
|
125
|
+
<sd-tree tabindex="0">
|
|
126
|
+
<sd-tree-node text="node-0" node-id="0" type="radio"></sd-tree-node>
|
|
127
|
+
<sd-tree-node text="node-1" node-id="1" type="radio">
|
|
128
|
+
<sd-tree-node text="node-2" node-id="2" type="radio"></sd-tree-node>
|
|
129
|
+
<sd-tree-node text="node-3" node-id="3" type="radio"></sd-tree-node>
|
|
130
|
+
</sd-tree-node>
|
|
131
|
+
<sd-tree-node text="node-4" node-id="4" type="radio">
|
|
132
|
+
<sd-tree-node text="node-5" node-id="5" type="radio"></sd-tree-node>
|
|
133
|
+
<sd-tree-node text="node-6" node-id="6" type="radio"></sd-tree-node>
|
|
134
|
+
<sd-tree-node text="node-7" node-id="7" type="radio"></sd-tree-node>
|
|
135
|
+
<sd-tree-node text="node-8" node-id="8" type="radio">
|
|
136
|
+
<sd-tree-node text="node-9" node-id="9" type="radio"></sd-tree-node>
|
|
137
|
+
<sd-tree-node text="node-10" node-id="10" type="radio"></sd-tree-node>
|
|
138
|
+
<sd-tree-node text="node-11" node-id="11" type="radio"></sd-tree-node>
|
|
139
|
+
<sd-tree-node text="node-12" node-id="12" type="radio"></sd-tree-node>
|
|
140
|
+
<sd-tree-node text="node-13" node-id="13" type="radio"></sd-tree-node>
|
|
141
|
+
<sd-tree-node text="node-14" node-id="14" type="radio"></sd-tree-node>
|
|
142
|
+
</sd-tree-node>
|
|
143
|
+
<sd-tree-node text="node-15" node-id="15" type="radio"></sd-tree-node>
|
|
144
|
+
<sd-tree-node text="node-16" node-id="16" type="radio"></sd-tree-node>
|
|
145
|
+
</sd-tree-node>
|
|
146
|
+
</sd-tree>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="tree-example">
|
|
149
|
+
<div><b>Radio button only, parent selection allowed</b></div>
|
|
150
|
+
<sd-tree tabindex="0" parent-selection-allowed>
|
|
151
|
+
<sd-tree-node text="node-0" node-id="0" type="radio"></sd-tree-node>
|
|
152
|
+
<sd-tree-node text="node-1" node-id="1" type="radio">
|
|
153
|
+
<sd-tree-node text="node-2" node-id="2" type="radio"></sd-tree-node>
|
|
154
|
+
<sd-tree-node text="node-3" node-id="3" type="radio"></sd-tree-node>
|
|
155
|
+
</sd-tree-node>
|
|
156
|
+
<sd-tree-node text="node-4" node-id="4" type="radio">
|
|
157
|
+
<sd-tree-node text="node-5" node-id="5" type="radio"></sd-tree-node>
|
|
158
|
+
<sd-tree-node text="node-6" node-id="6" type="radio"></sd-tree-node>
|
|
159
|
+
<sd-tree-node text="node-7" node-id="7" type="radio"></sd-tree-node>
|
|
160
|
+
<sd-tree-node text="node-8" node-id="8" type="radio">
|
|
161
|
+
<sd-tree-node text="node-9" node-id="9" type="radio"></sd-tree-node>
|
|
162
|
+
<sd-tree-node text="node-10" node-id="10" type="radio"></sd-tree-node>
|
|
163
|
+
<sd-tree-node text="node-11" node-id="11" type="radio"></sd-tree-node>
|
|
164
|
+
<sd-tree-node text="node-12" node-id="12" type="radio"></sd-tree-node>
|
|
165
|
+
<sd-tree-node text="node-13" node-id="13" type="radio"></sd-tree-node>
|
|
166
|
+
<sd-tree-node text="node-14" node-id="14" type="radio"></sd-tree-node>
|
|
167
|
+
</sd-tree-node>
|
|
168
|
+
<sd-tree-node text="node-15" node-id="15" type="radio"></sd-tree-node>
|
|
169
|
+
<sd-tree-node text="node-16" node-id="16" type="radio"></sd-tree-node>
|
|
170
|
+
</sd-tree-node>
|
|
171
|
+
</sd-tree>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
`,hr=`<h3 id="declarative-example-with-radio-buttons">Declarative example with radio buttons</h3>
|
|
175
|
+
`,ur=`#example-root {
|
|
176
|
+
display: grid;
|
|
177
|
+
grid-template-columns: repeat(2, 1fr);
|
|
178
|
+
column-gap: 16px;
|
|
179
|
+
row-gap: 16px;
|
|
180
|
+
}
|
|
181
|
+
sd-tree {
|
|
182
|
+
max-height: 500px;
|
|
183
|
+
}
|
|
184
|
+
`,pr={mainContent:cr,description:hr,css:ur},fr=Object.freeze(Object.defineProperty({__proto__:null,default:pr},Symbol.toStringTag,{value:"Module"})),gr="modulepreload",mr=function(i,e){return new URL(i,e).href},Qn={},br=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=mr(r,n),r in Qn)return;Qn[r]=!0;const l=r.endsWith(".css"),a=l?'[rel="stylesheet"]':"";if(!!n)for(let p=o.length-1;p>=0;p--){const f=o[p];if(f.href===r&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${a}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":gr,l||(c.as="script",c.crossOrigin=""),c.href=r,document.head.appendChild(c),l)return new Promise((p,f)=>{c.addEventListener("load",p),c.addEventListener("error",()=>f(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})},yr=`<!-- Load element with all dependencies directly -->
|
|
185
|
+
<script src="./tree-with-externals.js"><\/script>
|
|
186
|
+
|
|
187
|
+
<div id="lazy-loading-example-root">
|
|
188
|
+
<div class="tree-example">
|
|
189
|
+
<div><b>Editable tree</b></div>
|
|
190
|
+
<button id="expand-btn">Expand All</button>
|
|
191
|
+
<button id="collapse-btn">Collapse All</button>
|
|
192
|
+
</div>
|
|
193
|
+
<div class="tree-example">
|
|
194
|
+
<div><b>Read only tree</b></div>
|
|
195
|
+
<button id="expand-btn">Expand All</button>
|
|
196
|
+
<button id="collapse-btn">Collapse All</button>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
`,xr=`<h3 id="creating-tree-with-server-data">Creating tree with server data</h3>
|
|
200
|
+
`,vr=`#lazy-loading-example-root {
|
|
201
|
+
display: grid;
|
|
202
|
+
grid-template-columns: repeat(2, 1fr);
|
|
203
|
+
column-gap: 16px;
|
|
204
|
+
}
|
|
205
|
+
sd-tree {
|
|
206
|
+
max-height: 500px;
|
|
207
|
+
}
|
|
208
|
+
`,wr=`import { CheckboxNode, NodeType, RadioButtonNode, Tree, Node } from "@cas-smartdesign/tree";
|
|
209
|
+
import { Server } from "./server";
|
|
210
|
+
|
|
211
|
+
class DataProvider {
|
|
212
|
+
private nodeId = 0;
|
|
213
|
+
|
|
214
|
+
getData(type: NodeType, parentPath?: string[]): Node[] {
|
|
215
|
+
const nodes: Node[] = [];
|
|
216
|
+
const numberOfNodes = 50;
|
|
217
|
+
const depth = parentPath?.length + 1 || 0;
|
|
218
|
+
for (let i = 0; i < numberOfNodes; i++) {
|
|
219
|
+
const id = Math.random().toString(36).substring(7);
|
|
220
|
+
const text = "node" + this.nodeId++;
|
|
221
|
+
const path = Array.isArray(parentPath) ? [...parentPath, id] : [id];
|
|
222
|
+
let node: Node;
|
|
223
|
+
if (type === "checkbox") {
|
|
224
|
+
node = new CheckboxNode(id, text, path, []);
|
|
225
|
+
node.childCount = depth === 3 ? 0 : 50 * Math.floor(Math.random() * 5);
|
|
226
|
+
node.childrenType = "checkbox";
|
|
227
|
+
} else {
|
|
228
|
+
node = new RadioButtonNode(id, text, path, []);
|
|
229
|
+
}
|
|
230
|
+
nodes.push(node);
|
|
231
|
+
}
|
|
232
|
+
return nodes;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const container = document.querySelector("#lazy-loading-example-root");
|
|
237
|
+
|
|
238
|
+
container.querySelectorAll(".tree-example").forEach((example) => {
|
|
239
|
+
const tree = new Tree();
|
|
240
|
+
const dataProvider = new DataProvider();
|
|
241
|
+
const server = new Server(tree, 100, { nextPage: dataProvider.getData.bind(dataProvider) }, "checkbox");
|
|
242
|
+
|
|
243
|
+
example.querySelector("#expand-btn").addEventListener("click", () => server.expandAll());
|
|
244
|
+
example.querySelector("#collapse-btn").addEventListener("click", () => server.collapseAll());
|
|
245
|
+
example.appendChild(tree);
|
|
246
|
+
});
|
|
247
|
+
`,_r=`import {
|
|
248
|
+
Tree,
|
|
249
|
+
CheckboxNode,
|
|
250
|
+
Node,
|
|
251
|
+
NodeGetter,
|
|
252
|
+
isCheckboxNode,
|
|
253
|
+
NodeType,
|
|
254
|
+
IDataRequest,
|
|
255
|
+
IExpansion,
|
|
256
|
+
ISelection,
|
|
257
|
+
findNodeByPath,
|
|
258
|
+
RadioButtonNode,
|
|
259
|
+
} from "@cas-smartdesign/tree";
|
|
260
|
+
|
|
261
|
+
export interface IDataSource {
|
|
262
|
+
nextPage(type: NodeType, parentPath?: string[]): Node[];
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
type AllNodeState = "none" | "expanded" | "collapsed";
|
|
266
|
+
|
|
267
|
+
export class Server {
|
|
268
|
+
private _nodes: Node[] = [];
|
|
269
|
+
private _tree: Tree;
|
|
270
|
+
private _dataSource: IDataSource;
|
|
271
|
+
private _allNodeState: AllNodeState = "none";
|
|
272
|
+
private _type: NodeType;
|
|
273
|
+
|
|
274
|
+
constructor(tree: Tree, rootItemCount = 100, dataSource: IDataSource, type: NodeType) {
|
|
275
|
+
if (tree) {
|
|
276
|
+
tree.addEventListener("data-request", this.handleTreeDataRequest);
|
|
277
|
+
tree.addEventListener("expansion", this.handleTreeExpansion);
|
|
278
|
+
tree.addEventListener("selection", this.handleTreeSelection);
|
|
279
|
+
tree.rootNodeCount = rootItemCount;
|
|
280
|
+
this._tree = tree;
|
|
281
|
+
} else {
|
|
282
|
+
throw new Error("A tree instance is needed!");
|
|
283
|
+
}
|
|
284
|
+
this._dataSource = dataSource;
|
|
285
|
+
this._type = type;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
public expandAll(): void {
|
|
289
|
+
this._allNodeState = "expanded";
|
|
290
|
+
this.setExpandedState(this._nodes);
|
|
291
|
+
this._tree.setNodes(this.cloneNodes(this._nodes));
|
|
292
|
+
this._tree.focusIndex = 0;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
public collapseAll(): void {
|
|
296
|
+
this._allNodeState = "collapsed";
|
|
297
|
+
this.setExpandedState(this._nodes);
|
|
298
|
+
this._tree.focusIndex = 0;
|
|
299
|
+
this._tree.setNodes(this.cloneNodes(this._nodes));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private handleTreeDataRequest = (event: CustomEvent<IDataRequest>): void => {
|
|
303
|
+
const { path } = event.detail;
|
|
304
|
+
const nodes = this._dataSource.nextPage(this._type, path);
|
|
305
|
+
nodes.forEach((node) => (node.nodeGetter = this.nodeGetter));
|
|
306
|
+
if (path) {
|
|
307
|
+
const parent = findNodeByPath(this._nodes, path);
|
|
308
|
+
if (isCheckboxNode(parent)) {
|
|
309
|
+
this.setSelectionState(nodes, parent);
|
|
310
|
+
parent.nodes = [...parent.nodes, ...nodes];
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
this._nodes = [...this._nodes, ...nodes];
|
|
314
|
+
}
|
|
315
|
+
this.setExpandedState(nodes);
|
|
316
|
+
window.setTimeout(() => {
|
|
317
|
+
this._tree.addNodes(this.cloneNodes(nodes), path);
|
|
318
|
+
}, 1000);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// cloning is only needed because this is just a simulated server
|
|
322
|
+
private cloneNodes(nodes: Node[]): Node[] {
|
|
323
|
+
return nodes.map((p) => {
|
|
324
|
+
let node;
|
|
325
|
+
if (isCheckboxNode(p)) {
|
|
326
|
+
node = new CheckboxNode(p.id, p.text, p.path, this.cloneNodes(p.nodes));
|
|
327
|
+
} else {
|
|
328
|
+
node = new RadioButtonNode(p.id, p.text, p.path, this.cloneNodes(p.nodes));
|
|
329
|
+
}
|
|
330
|
+
node.type = p.type;
|
|
331
|
+
node.depth = p.depth;
|
|
332
|
+
node.selectionState = p.selectionState;
|
|
333
|
+
node.childCount = p.childCount;
|
|
334
|
+
node.expanded = p.expanded;
|
|
335
|
+
node.childrenType = p.childrenType;
|
|
336
|
+
node.parentSelectionAllowed = p.parentSelectionAllowed;
|
|
337
|
+
node.lastLoadingChild = p.lastLoadingChild;
|
|
338
|
+
node.loading = p.loading;
|
|
339
|
+
node.disabled = p.disabled;
|
|
340
|
+
return node;
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
private setExpandedState(nodes: Node[]): void {
|
|
345
|
+
if (this._allNodeState !== "none") {
|
|
346
|
+
const newState = this._allNodeState === "expanded";
|
|
347
|
+
nodes.forEach((node) => {
|
|
348
|
+
if (isCheckboxNode(node)) {
|
|
349
|
+
node.expanded = newState;
|
|
350
|
+
}
|
|
351
|
+
this.forAllChildren(node, (child) => {
|
|
352
|
+
if (isCheckboxNode(child)) {
|
|
353
|
+
child.expanded = newState;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
private setSelectionState(nodes: Node[], parent: CheckboxNode): void {
|
|
361
|
+
if (parent.selectionState === "checked") {
|
|
362
|
+
nodes.forEach((newNode) => {
|
|
363
|
+
newNode.selectionState = "checked";
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
private handleTreeExpansion = (event: CustomEvent<IExpansion>): void => {
|
|
369
|
+
const { path } = event.detail;
|
|
370
|
+
const node = findNodeByPath(this._nodes, path);
|
|
371
|
+
if (isCheckboxNode(node)) {
|
|
372
|
+
node.expanded = !node.expanded;
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
private handleTreeSelection = (event: CustomEvent<ISelection>): void => {
|
|
377
|
+
const { path } = event.detail;
|
|
378
|
+
const node = findNodeByPath(this._nodes, path);
|
|
379
|
+
node.toggle();
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
private forAllChildren(node: Node, f: (child: Node) => void): void {
|
|
383
|
+
if (isCheckboxNode(node)) {
|
|
384
|
+
node.nodes.forEach((child: Node) => {
|
|
385
|
+
f(child);
|
|
386
|
+
this.forAllChildren(child, f);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
private nodeGetter: NodeGetter = (path: string[]): Node => {
|
|
392
|
+
return findNodeByPath(this._nodes, path);
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
`,Sr={mainContent:yr,description:xr,css:vr,initializer:{content:wr,type:"typescript",initialize:()=>br(()=>import("./3_lazy_loading.js"),__vite__mapDeps([]),import.meta.url)},additionalSources:[{type:"source",language:"typescript",label:"server.ts",content:_r}]},Er=Object.freeze(Object.defineProperty({__proto__:null,default:Sr},Symbol.toStringTag,{value:"Module"}));const _t=window,An=_t.ShadowRoot&&(_t.ShadyCSS===void 0||_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Nn=Symbol(),Yn=new WeakMap;let Li=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Nn)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(An&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Yn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Yn.set(t,e))}return e}toString(){return this.cssText}};const ce=i=>new Li(typeof i=="string"?i:i+"",void 0,Nn),we=(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 Li(t,i,Nn)},kr=(i,e)=>{An?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),s=_t.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)})},ei=An?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return ce(t)})(i):i;var Jt;const $t=window,ti=$t.trustedTypes,$r=ti?ti.emptyScript:"",ni=$t.reactiveElementPolyfillSupport,cn={toAttribute(i,e){switch(e){case Boolean:i=i?$r: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}},Di=(i,e)=>e!==i&&(e==e||i==i),Xt={attribute:!0,type:String,converter:cn,reflect:!1,hasChanged:Di},hn="finalized";let Ne=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=Xt){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)||Xt}static finalize(){if(this.hasOwnProperty(hn))return!1;this[hn]=!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(ei(s))}else e!==void 0&&t.push(ei(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 kr(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=Xt){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:cn).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),l=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?r.converter:cn;this._$El=o,this[o]=l.fromAttribute(t,r.type),this._$El=null}}requestUpdate(e,t,n){let s=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Di)(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){}};Ne[hn]=!0,Ne.elementProperties=new Map,Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},ni==null||ni({ReactiveElement:Ne}),((Jt=$t.reactiveElementVersions)!==null&&Jt!==void 0?Jt:$t.reactiveElementVersions=[]).push("1.6.3");var Qt;const Ct=window,Oe=Ct.trustedTypes,ii=Oe?Oe.createPolicy("lit-html",{createHTML:i=>i}):void 0,un="$lit$",ae=`lit$${(Math.random()+"").slice(9)}$`,Bi="?"+ae,Cr=`<${Bi}>`,ve=document,Ve=()=>ve.createComment(""),qe=i=>i===null||typeof i!="object"&&typeof i!="function",ji=Array.isArray,Ar=i=>ji(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Yt=`[
|
|
396
|
+
\f\r]`,je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,si=/-->/g,ri=/>/g,me=RegExp(`>|${Yt}(?:([^\\s"'>=/]+)(${Yt}*=${Yt}*(?:[^
|
|
397
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),oi=/'/g,li=/"/g,zi=/^(?:script|style|textarea|title)$/i,Nr=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),I=Nr(1),Ie=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),ai=new WeakMap,ye=ve.createTreeWalker(ve,129,null,!1);function Ui(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ii!==void 0?ii.createHTML(e):e}const Or=(i,e)=>{const t=i.length-1,n=[];let s,o=e===2?"<svg>":"",r=je;for(let l=0;l<t;l++){const a=i[l];let d,c,p=-1,f=0;for(;f<a.length&&(r.lastIndex=f,c=r.exec(a),c!==null);)f=r.lastIndex,r===je?c[1]==="!--"?r=si:c[1]!==void 0?r=ri:c[2]!==void 0?(zi.test(c[2])&&(s=RegExp("</"+c[2],"g")),r=me):c[3]!==void 0&&(r=me):r===me?c[0]===">"?(r=s??je,p=-1):c[1]===void 0?p=-2:(p=r.lastIndex-c[2].length,d=c[1],r=c[3]===void 0?me:c[3]==='"'?li:oi):r===li||r===oi?r=me:r===si||r===ri?r=je:(r=me,s=void 0);const _=r===me&&i[l+1].startsWith("/>")?" ":"";o+=r===je?a+Cr:p>=0?(n.push(d),a.slice(0,p)+un+a.slice(p)+ae+_):a+ae+(p===-2?(n.push(void 0),l):_)}return[Ui(i,o+(i[t]||"<?>")+(e===2?"</svg>":"")),n]};class Ge{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let o=0,r=0;const l=e.length-1,a=this.parts,[d,c]=Or(e,t);if(this.el=Ge.createElement(d,n),ye.currentNode=this.el.content,t===2){const p=this.el.content,f=p.firstChild;f.remove(),p.append(...f.childNodes)}for(;(s=ye.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes()){const p=[];for(const f of s.getAttributeNames())if(f.endsWith(un)||f.startsWith(ae)){const _=c[r++];if(p.push(f),_!==void 0){const N=s.getAttribute(_.toLowerCase()+un).split(ae),P=/([.?@])?(.*)/.exec(_);a.push({type:1,index:o,name:P[2],strings:N,ctor:P[1]==="."?Rr:P[1]==="?"?Mr:P[1]==="@"?Tr:Mt})}else a.push({type:6,index:o})}for(const f of p)s.removeAttribute(f)}if(zi.test(s.tagName)){const p=s.textContent.split(ae),f=p.length-1;if(f>0){s.textContent=Oe?Oe.emptyScript:"";for(let _=0;_<f;_++)s.append(p[_],Ve()),ye.nextNode(),a.push({type:2,index:++o});s.append(p[f],Ve())}}}else if(s.nodeType===8)if(s.data===Bi)a.push({type:2,index:o});else{let p=-1;for(;(p=s.data.indexOf(ae,p+1))!==-1;)a.push({type:7,index:o}),p+=ae.length-1}o++}}static createElement(e,t){const n=ve.createElement("template");return n.innerHTML=e,n}}function Re(i,e,t=i,n){var s,o,r,l;if(e===Ie)return e;let a=n!==void 0?(s=t._$Co)===null||s===void 0?void 0:s[n]:t._$Cl;const d=qe(e)?void 0:e._$litDirective$;return(a==null?void 0:a.constructor)!==d&&((o=a==null?void 0:a._$AO)===null||o===void 0||o.call(a,!1),d===void 0?a=void 0:(a=new d(i),a._$AT(i,t,n)),n!==void 0?((r=(l=t)._$Co)!==null&&r!==void 0?r:l._$Co=[])[n]=a:t._$Cl=a),a!==void 0&&(e=Re(i,a._$AS(i,e.values),a,n)),e}class Ir{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:ve).importNode(n,!0);ye.currentNode=o;let r=ye.nextNode(),l=0,a=0,d=s[0];for(;d!==void 0;){if(l===d.index){let c;d.type===2?c=new nt(r,r.nextSibling,this,e):d.type===1?c=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(c=new Lr(r,this,e)),this._$AV.push(c),d=s[++a]}l!==(d==null?void 0:d.index)&&(r=ye.nextNode(),l++)}return ye.currentNode=ve,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 nt{constructor(e,t,n,s){var o;this.type=2,this._$AH=R,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=Re(this,e,t),qe(e)?e===R||e==null||e===""?(this._$AH!==R&&this._$AR(),this._$AH=R):e!==this._$AH&&e!==Ie&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Ar(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!==R&&qe(this._$AH)?this._$AA.nextSibling.data=e:this.$(ve.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=Ge.createElement(Ui(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 Ir(o,this),l=r.u(this.options);r.v(n),this.$(l),this._$AH=r}}_$AC(e){let t=ai.get(e.strings);return t===void 0&&ai.set(e.strings,t=new Ge(e)),t}T(e){ji(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 nt(this.k(Ve()),this.k(Ve()),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 Mt=class{constructor(e,t,n,s,o){this.type=1,this._$AH=R,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=R}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=Re(this,e,t,0),r=!qe(e)||e!==this._$AH&&e!==Ie,r&&(this._$AH=e);else{const l=e;let a,d;for(e=o[0],a=0;a<o.length-1;a++)d=Re(this,l[n+a],t,a),d===Ie&&(d=this._$AH[a]),r||(r=!qe(d)||d!==this._$AH[a]),d===R?e=R:e!==R&&(e+=(d??"")+o[a+1]),this._$AH[a]=d}r&&!s&&this.j(e)}j(e){e===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class Rr extends Mt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===R?void 0:e}}const Pr=Oe?Oe.emptyScript:"";class Mr extends Mt{constructor(){super(...arguments),this.type=4}j(e){e&&e!==R?this.element.setAttribute(this.name,Pr):this.element.removeAttribute(this.name)}}let Tr=class extends Mt{constructor(e,t,n,s,o){super(e,t,n,s,o),this.type=5}_$AI(e,t=this){var n;if((e=(n=Re(this,e,t,0))!==null&&n!==void 0?n:R)===Ie)return;const s=this._$AH,o=e===R&&s!==R||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==R&&(s===R||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 Lr{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){Re(this,e)}}const di=Ct.litHtmlPolyfillSupport;di==null||di(Ge,nt),((Qt=Ct.litHtmlVersions)!==null&&Qt!==void 0?Qt:Ct.litHtmlVersions=[]).push("2.8.0");const Fi=(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 l=(s=t==null?void 0:t.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=r=new nt(e.insertBefore(Ve(),l),l,void 0,t??{})}return r._$AI(i),r};var en,tn;class U extends Ne{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=Fi(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 Ie}}U.finalized=!0,U._$litElement$=!0,(en=globalThis.litElementHydrateSupport)===null||en===void 0||en.call(globalThis,{LitElement:U});const ci=globalThis.litElementPolyfillSupport;ci==null||ci({LitElement:U});((tn=globalThis.litElementVersions)!==null&&tn!==void 0?tn:globalThis.litElementVersions=[]).push("3.3.3");const Dr=(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)}},Br=(i,e,t)=>{e.constructor.createProperty(t,i)};function x(i){return(e,t)=>t!==void 0?Br(i,e,t):Dr(i,e)}const Hi=i=>i??R,jr=":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}",zr="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",Ur="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",Fr="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 Hr=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,On=(i,e,t,n)=>{for(var s=n>1?void 0:n?Wr(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&&Hr(e,t,s),s},$e;const Ke=($e=class extends U{static parseLevel(i){if(i){const e=Object.keys(Ze).find(t=>t.toLowerCase()===i.toLowerCase());return e&&Ze[e]}}static get styles(){return[we`
|
|
398
|
+
${ce(jr)}
|
|
399
|
+
`]}render(){return I`${this.iconToUse&&I`<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($e.parseLevel(this.level)){case"warn":return Fr;case"suggest":return Ur;case"error":return zr;default:return null}}},$e.ID="sd-field-validation-message",$e.levelConverter={fromAttribute(i){return $e.parseLevel(i)},toAttribute(i){return i&&i.toLowerCase()}},$e);On([x({type:String,attribute:!0})],Ke.prototype,"message",2);On([x({type:String,attribute:!0})],Ke.prototype,"icon",2);On([x({converter:Ke.levelConverter,reflect:!0})],Ke.prototype,"level",2);let nn=Ke;var Ze=(i=>(i.Warn="warn",i.Suggest="suggest",i.Error="error",i))(Ze||{});customElements.get(nn.ID)||customElements.define(nn.ID,nn);const Vr=`:host{display:block}:host,.label,.checkbox{outline:none}.checkbox-container{display:flex;flex-direction:row;align-items:flex-start}.checkbox{appearance:none;-moz-appearance:none;-webkit-appearance:none;display:block;margin:0;width:20px;height:20px;border:2px solid #767676;cursor:pointer;background-color:#fff}:host(:not([disabled]):focus) .highlight,:host(:not([disabled])[focused]) .highlight{background-color:#1467ba4d;border-radius:4px}:host(:not([disabled]):focus) .highlight .checkbox,:host(:not([disabled])[focused]) .highlight .checkbox{border-color:#1467ba}:host([checked]) .checkbox{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2020%2020'%3e%3cpath%20d='M15.9%204.6L17.4%206l-9.5%209.5-5.2-5.2%201.4-1.4%203.8%203.8%208-8.1z'%20fill='%23fff'/%3e%3c/svg%3e") no-repeat center center;border-color:#1467ba}.checkbox.indeterminate{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20fill='%23fff'%20d='M8%2014h16v4H8z'/%3e%3c/svg%3e") no-repeat center center;background-size:20px;border-color:#1467ba}.highlight{border:4px solid transparent;margin-right:6px}:host([disabled]) .checkbox-container{opacity:.6;cursor:default;filter:grayscale(100%);pointer-events:none}.validation-message{margin-left:4px}.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-top:4px;line-height:20px}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;var qr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,se=(i,e,t,n)=>{for(var s=n>1?void 0:n?Gr(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&&qr(e,t,s),s};const Kr="indeterminate",sn="delegatesFocus"in window.ShadowRoot.prototype;var oe;const K=(oe=class extends U{constructor(){super(...arguments),this._checked=!1,this._indeterminate=!1}get checked(){return this._checked}set checked(i){const e=this._checked;this._checked=i,this._checked&&(this.indeterminate=!1),this.requestUpdate("checked",e)}get indeterminate(){return this._indeterminate}set indeterminate(i){const e=this._indeterminate;this._indeterminate=i,this._indeterminate&&(this.checked=!1),this.requestUpdate("indeterminate",e)}firstUpdated(i){super.firstUpdated(i),sn||(this.checkboxElement.onfocus=()=>this.setAttribute("focused",""),this.checkboxElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",e=>{e.target===this&&this.checkboxElement.focus()}))}focus(){this.checkboxElement?this.checkboxElement.focus():super.focus()}attributeChangedCallback(i,e,t){super.attributeChangedCallback(i,e,t),!sn&&i==="tabindex"&&e!==t&&t==="0"&&this.removeAttribute("tabindex")}render(){return I`
|
|
400
|
+
<div class="checkbox-container">
|
|
401
|
+
<div class="highlight">
|
|
402
|
+
<input
|
|
403
|
+
type="checkbox"
|
|
404
|
+
id="input"
|
|
405
|
+
?disabled=${this.disabled}
|
|
406
|
+
tabindex=${Hi(this.tabIndex==null?void 0:this.tabIndex)}
|
|
407
|
+
.checked=${this.checked}
|
|
408
|
+
.indeterminate=${this.indeterminate}
|
|
409
|
+
class="checkbox${this.indeterminate?" "+Kr:""}"
|
|
410
|
+
@change="${this.onInputValueChange}"
|
|
411
|
+
/>
|
|
412
|
+
</div>
|
|
413
|
+
<label class="label" for="input">${this.label}</label>
|
|
414
|
+
</div>
|
|
415
|
+
${this.validationMessage&&I`
|
|
416
|
+
<sd-field-validation-message
|
|
417
|
+
class="validation-message"
|
|
418
|
+
.message=${this.validationMessage}
|
|
419
|
+
.icon=${this.validationIconSrc}
|
|
420
|
+
.level=${this.validationLevel}
|
|
421
|
+
>
|
|
422
|
+
</sd-field-validation-message>
|
|
423
|
+
`}
|
|
424
|
+
`}onInputValueChange(i){i.preventDefault(),i.stopPropagation(),this.checked=i.target.checked,this.fireValueChange()}fireValueChange(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.checked}}))}get checkboxElement(){return this.shadowRoot.querySelector(".checkbox")}static get styles(){return[we`
|
|
425
|
+
${ce(Vr)}
|
|
426
|
+
`]}},oe.ID="sd-checkbox",oe.ensureDefined=()=>{customElements.get(oe.ID)||customElements.define(oe.ID,oe)},oe.shadowRootOptions={...U.shadowRootOptions,delegatesFocus:sn},oe);se([x({type:Boolean,reflect:!0})],K.prototype,"disabled",2);se([x({type:String,reflect:!0})],K.prototype,"label",2);se([x({type:String})],K.prototype,"validationMessage",2);se([x({type:String})],K.prototype,"validationIconSrc",2);se([x({type:Ze,reflect:!0})],K.prototype,"validationLevel",2);se([x({type:Number})],K.prototype,"tabIndex",2);se([x({type:Boolean,reflect:!0})],K.prototype,"oneLine",2);se([x({type:Boolean,reflect:!0})],K.prototype,"checked",1);se([x({type:Boolean,reflect:!1,attribute:!1})],K.prototype,"indeterminate",1);let Wi=K;Wi.ensureDefined();const Zr=":host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding-top:6px;padding-bottom:6px}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:Segoe UI,Lucida Sans,Arial,sans-serif;text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}";var Jr=Object.defineProperty,Xr=Object.getOwnPropertyDescriptor,Tt=(i,e,t,n)=>{for(var s=n>1?void 0:n?Xr(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&&Jr(e,t,s),s};let Qr=0;var le;const it=(le=class extends U{constructor(){super(),this.checked=!1,this.value="",this.disabled=!1,this.label="",this.handleClick=i=>{i.preventDefault()},this.a11yID=le.ID+"_"+Qr++}static get styles(){return[we`
|
|
427
|
+
${ce(Zr)}
|
|
428
|
+
`]}render(){return I`
|
|
429
|
+
<div class="root">
|
|
430
|
+
<div class="radio-button-container">
|
|
431
|
+
<input
|
|
432
|
+
type="radio"
|
|
433
|
+
id="${this.a11yID}"
|
|
434
|
+
.checked="${this.checked}"
|
|
435
|
+
?disabled="${this.disabled}"
|
|
436
|
+
@click="${this.handleClick}"
|
|
437
|
+
class="radio-button"
|
|
438
|
+
/>
|
|
439
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-14 -14 28 28">
|
|
440
|
+
<circle
|
|
441
|
+
class="highlight"
|
|
442
|
+
style="display:none"
|
|
443
|
+
r="11px"
|
|
444
|
+
fill="transparent"
|
|
445
|
+
stroke-width="6px"
|
|
446
|
+
></circle>
|
|
447
|
+
<circle class="inner" r="6px" style="display:none" stroke="none"></circle>
|
|
448
|
+
<circle class="outer" r="9px" fill="transparent" stroke-width="2px"></circle>
|
|
449
|
+
</svg>
|
|
450
|
+
</div>
|
|
451
|
+
<label class="label" for="${this.a11yID}" @click="${this.handleClick}">${this.label}</label>
|
|
452
|
+
</div>
|
|
453
|
+
`}},le.ID="sd-radio-button",le.ensureDefined=()=>{customElements.get(le.ID)||customElements.define(le.ID,le)},le);Tt([x({type:Boolean,reflect:!0,attribute:!0})],it.prototype,"checked",2);Tt([x({type:String,reflect:!0,attribute:!0})],it.prototype,"value",2);Tt([x({type:Boolean,reflect:!0,attribute:!0})],it.prototype,"disabled",2);Tt([x({type:String,reflect:!0,attribute:!0})],it.prototype,"label",2);let Vi=it;const Yr=":host(:focus){outline:none}.buttons-container{display:flex}.buttons-container.vertical{flex-direction:column}.validation-message{margin-left:5px}";var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,_e=(i,e,t,n)=>{for(var s=n>1?void 0:n?to(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&&eo(e,t,s),s},be;const he=(be=class extends U{constructor(){super(...arguments),this.layout="horizontal",this.value="",this.uncheckAllowed=!1,this.disabled=!1,this._focusIndex=-1,this._checkedButton=null,this.handleSlotChange=()=>{this._buttons=this.buttonsSlot.assignedElements(),this._buttons.forEach(i=>{!i.hasAttribute("disabled")&&this.disabled&&i.setAttribute("disabled",""),i.setAttribute("tabIndex","-1"),this.updateCheckedButton(i)})},this.handleFocusIn=i=>{const e=i.target,t=this._buttons.findIndex(n=>n==e);this.focusIndex=this.focusIndex>=0?this.focusIndex:this.getNextFocusIndex(t!==-1?t:0),this.updateFocused(null,this._buttons[this.focusIndex])},this.handleFocusOut=()=>{this.updateFocused(this._buttons[this.focusIndex])},this.handleButtonClick=i=>{this.focus();const e=this._buttons.find(n=>n.contains(i.target)),t=this._buttons.findIndex(n=>n==e);t>=0&&(this.focusIndex=t,this.updateChecked())},this.handleKeyDown=i=>{let e=!0;switch(i.key){case"Down":case"ArrowDown":{const t=this.getNextFocusIndex(this.focusIndex+1);this.focusIndex=t!==-1?t:this.getNextFocusIndex(0),this.uncheckAllowed||this.updateChecked();break}case"Up":case"ArrowUp":{const t=this.getPreviousFocusIndex(this.focusIndex-1);this.focusIndex=t!==-1?t:this.getPreviousFocusIndex(this.childElementCount-1),this.uncheckAllowed||this.updateChecked();break}case"Enter":{this.updateChecked();break}default:e=!1}e&&(i.preventDefault(),i.stopPropagation())}}get focusIndex(){return this._focusIndex}set focusIndex(i){if(i>=-1&&i<this.childElementCount){const e=this._focusIndex;if(this._focusIndex=i,e!==i){const t=this._buttons[e],n=this._buttons[this.focusIndex];this.updateFocused(t,n)}}}firstUpdated(i){super.firstUpdated(i),this.buttonsSlot.addEventListener("slotchange",this.handleSlotChange),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("keydown",this.handleKeyDown)}updated(i){super.updated(i),i.has("disabled")&&(this.disabled?this.disableButtons():this.enableButtons())}static get styles(){return[we`
|
|
454
|
+
${ce(Yr)}
|
|
455
|
+
`]}render(){return I`
|
|
456
|
+
<div
|
|
457
|
+
class="buttons-container ${this.layout==="vertical"?"vertical":"horizontal"}"
|
|
458
|
+
@click="${Hi(this.disabled?void 0:this.handleButtonClick)}"
|
|
459
|
+
>
|
|
460
|
+
<slot></slot>
|
|
461
|
+
</div>
|
|
462
|
+
${this.validationMessage&&I`
|
|
463
|
+
<sd-field-validation-message
|
|
464
|
+
class="validation-message"
|
|
465
|
+
.message=${this.validationMessage}
|
|
466
|
+
.icon=${this.validationIconSrc}
|
|
467
|
+
.level=${this.validationLevel}
|
|
468
|
+
>
|
|
469
|
+
</sd-field-validation-message>
|
|
470
|
+
`}
|
|
471
|
+
`}updateCheckedButton(i){if(this._checkedButton&&this._checkedButton!==i)this.uncheckButton(i);else if(i.hasAttribute("checked")){this._checkedButton=i;const e=i.getAttribute("value");this.updateValue(e)}}disableButtons(){var i;(i=this._buttons)==null||i.forEach(e=>{e.setAttribute("disabled","")})}enableButtons(){var i;(i=this._buttons)==null||i.forEach(e=>{e.removeAttribute("disabled")})}fireValueChangeEvent(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.value,selectedIndex:this.selectedIndex}}))}getNextFocusIndex(i){for(let e=i;e<this.childElementCount;e++){const t=this._buttons[e];if(this.isFocusable(t))return e}return-1}getPreviousFocusIndex(i){for(let e=i;e>=0;e--){const t=this._buttons[e];if(this.isFocusable(t))return e}return-1}isFocusable(i){return!i.hasAttribute("disabled")}updateChecked(){const i=this._checkedButton,e=this._buttons[this.focusIndex];this._checkedButton=e,i&&i!==e&&this.uncheckButton(i),e&&this.toggleButton(e)}toggleButton(i){i.hasAttribute("checked")?this.uncheckAllowed&&(this.uncheckButton(i),this._checkedButton=null,this.updateValue("")):(this.checkButton(i),this.updateValue(i.getAttribute("value")))}updateValue(i){this.value=i,this.fireValueChangeEvent()}updateFocused(i,e){var t,n;(t=i==null?void 0:i.removeAttribute)==null||t.call(i,"focused"),(n=e==null?void 0:e.setAttribute)==null||n.call(e,"focused","")}checkButton(i){i.setAttribute("checked","")}uncheckButton(i){i.removeAttribute("checked")}get buttonsSlot(){return this.shadowRoot&&!this._buttonsSlot&&(this._buttonsSlot=this.shadowRoot.querySelector("slot")),this._buttonsSlot}get selectedIndex(){return this._buttons.indexOf(this._checkedButton)}},be.ID="sd-radio-button-group",be.ensureDefined=()=>{Vi.ensureDefined(),customElements.get(be.ID)||customElements.define(be.ID,be)},be);_e([x({type:String,reflect:!0,attribute:!0})],he.prototype,"layout",2);_e([x({type:String})],he.prototype,"value",2);_e([x({type:Boolean,reflect:!0,attribute:"uncheck-allowed"})],he.prototype,"uncheckAllowed",2);_e([x({type:Boolean,reflect:!0,attribute:!0})],he.prototype,"disabled",2);_e([x({type:String})],he.prototype,"validationMessage",2);_e([x({type:String})],he.prototype,"validationIconSrc",2);_e([x({type:{fromAttribute(i){return i&&Ze[i.toLowerCase()]},toAttribute(i){return i&&i.toLowerCase()}},reflect:!0})],he.prototype,"validationLevel",2);let no=he;no.ensureDefined();const qi=16,Ce=35;let Gi=class{constructor(e,t,n,s){this.id=e,this.text=t,this.path=n,this.nodes=s,this.depth=0,this.selectionState="unchecked",this.expanded=!1,this.parentSelectionAllowed=!1,this.lastLoadingChild=!1,this.loading=!1,this.disabled=!1,this.parent=[],n?(this.depth=n.length-1,this.parent=n.slice(0,-1)):this.path=[e],this.childCount=s?s.length:0}updateSelectionStateOfChildren(){this.nodes.forEach(e=>{if(this.selectionState==="checked"){if(e.childrenType==="radio"||so(e))return;e.selectionState="checked"}else this.selectionState==="unchecked"&&(e.selectionState="unchecked");e.updateSelectionStateOfChildren()})}updateParent(){const e=this.parentNode;return e&&(!this.parentSelectionAllowed||this.selectionState!=="unchecked"||e.disabled)&&(e.updateSelectionStateByChildren(),e.updateParent()),e}get parentNode(){return this.parent.length?this.nodeGetter(this.parent):null}check(){this.selectionState!=="checked"&&(this.selectionState="checked",this.updateBranch())}uncheck(){this.selectionState!=="unchecked"&&(this.selectionState="unchecked",this.updateBranch())}hasRadioButtonDescendant(){if(this.childrenType==="radio")return!0;for(const e of this.nodes)if(e.hasRadioButtonDescendant())return!0}};const io=i=>(i==null?void 0:i.type)==="checkbox",so=i=>(i==null?void 0:i.type)==="radio";class ro extends Gi{constructor(e,t,n,s){super(e,t,n,s),this.type="checkbox"}toggle(){this.selectionState==="checked"?this.selectionState="unchecked":this.selectionState="checked",this.updateBranch()}updateBranch(){(!this.parentSelectionAllowed||this.selectionState==="unchecked")&&(this.updateSelectionStateOfChildren(),this.updateSelectionStateByChildren()),this.updateParent()}updateSelectionStateByChildren(){if(this.nodes.length===0)return;const e=this.nodes.map(n=>n.selectionState==="checked"||n.selectionState==="indeterminate"),t=e.some(Boolean);if(this.parentSelectionAllowed)this.selectionState=t?"checked":"unchecked";else{const n=e.every(Boolean),s=this.nodes.map(o=>o.selectionState).some(o=>o==="indeterminate");this.childrenType==="radio"?this.selectionState=t?"checked":"unchecked":s?this.selectionState="indeterminate":n?this.selectionState="checked":t?this.selectionState="indeterminate":this.selectionState="unchecked"}}getFlattenedSubtree(e){return e.reduce((t,n)=>t.concat(io(n)&&n.childCount>0&&n.expanded?[n,...this.getFlattenedSubtree(n.nodes)]:n),[])}}class In extends Gi{constructor(e,t,n,s){super(e,t,n,s),this.type="radio"}toggle(){this.selectionState==="checked"?this.selectionState="unchecked":(this.selectionState="checked",this.clearSiblings()),this.updateBranch()}check(){this.selectionState!=="checked"&&(this.selectionState="checked",this.clearSiblings(),this.updateBranch())}updateBranch(){this.selectionState==="unchecked"&&this.updateSelectionStateOfChildren(),this.updateParent()}updateParent(){const e=super.updateParent();return e instanceof In&&e.clearSiblings(),e}updateSelectionStateByChildren(){if(this.nodes.length===0)return;this.nodes.map(t=>t.selectionState==="checked").some(Boolean)?this.selectionState="checked":this.selectionState="unchecked"}clearSiblings(){this.getSiblings().forEach(t=>{t.uncheck()})}}const oo=`:host{width:100%;display:block;contain:layout;position:absolute}:host([readonly][focused]){background-color:#1467ba4d}.node{height:35px;display:flex;align-items:center}.node .expander,.node .placeholder{height:28px;width:30px;flex-shrink:0}.node .expander{cursor:pointer;background-position:center;background-size:24px;flex:0 0 auto}.node .expander.more{background-image:url("data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m15%2021%209.5-9.5%209.5%209.5'%20fill='none'%20stroke='%23999'%20stroke-linecap='square'%20stroke-width='2'%20transform='matrix(0%201%20-1%200%2032.25%20-8.25)'/%3e%3c/svg%3e")}.node .expander.less{background-image:url("data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m19.75%206.75%209.5%209.5-9.5%209.5'%20fill='none'%20stroke='%23999'%20stroke-linecap='square'%20stroke-width='2'%20transform='matrix(0%201%20-1%200%2032.25%20-8.25)'/%3e%3c/svg%3e")}.node .label{outline:none}.node .input{overflow:hidden}.node ul{list-style-type:none;margin:0;padding:0}`;var lo=Object.defineProperty,ao=Object.getOwnPropertyDescriptor,F=(i,e,t,n)=>{for(var s=n>1?void 0:n?ao(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&&lo(e,t,s),s},ee;const j=(ee=class extends U{constructor(){super(...arguments),this.text="",this.expanded=!1,this.childCount=0,this.focused=!1,this.readonly=!1,this.depth=0,this.path=[],this.type="checkbox",this.selectionState="unchecked",this.disabled=!1,this.loading=!1,this.onSelectionChange=()=>{if(!this.readonly){if(this.type=="checkbox"){const e=this.shadowRoot.querySelector(".input");this.selectionState=e.checked?"checked":e.indeterminate?"indeterminate":"unchecked"}else{const e=this.shadowRoot.querySelector(".input");this.selectionState=e.checked?"checked":"unchecked"}this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:this.path,checked:this.selectionState==="checked",indeterminate:this.selectionState==="indeterminate"},bubbles:!0,composed:!0}))})}}}static get styles(){return[we`
|
|
472
|
+
${ce(oo)}
|
|
473
|
+
`]}render(){const e=this.childCount>0||this.children.length>0;return I`
|
|
474
|
+
<li class="node" style="margin-left: ${this.depth*qi}px">
|
|
475
|
+
${e?I` <div class="expander ${this.expanded?"less":"more"}" @click="${this.toggle}"></div> `:I` <div class="placeholder"></div> `}
|
|
476
|
+
${this.readonly?I` <div class="label">${this.text}</div> `:I`
|
|
477
|
+
${this.type==="checkbox"?I`
|
|
478
|
+
<sd-checkbox
|
|
479
|
+
class="input"
|
|
480
|
+
tabIndex="-1"
|
|
481
|
+
label="${this.text}"
|
|
482
|
+
?checked="${this.selectionState==="checked"}"
|
|
483
|
+
?focused="${this.focused}"
|
|
484
|
+
?disabled="${this.disabled}"
|
|
485
|
+
.indeterminate="${this.selectionState==="indeterminate"}"
|
|
486
|
+
@value-change="${this.onSelectionChange}"
|
|
487
|
+
oneline
|
|
488
|
+
></sd-checkbox>
|
|
489
|
+
`:I`
|
|
490
|
+
<sd-radio-button
|
|
491
|
+
class="input"
|
|
492
|
+
tabIndex="-1"
|
|
493
|
+
label="${this.text}"
|
|
494
|
+
?checked="${this.selectionState==="checked"}"
|
|
495
|
+
?focused="${this.focused}"
|
|
496
|
+
?disabled="${this.disabled}"
|
|
497
|
+
@click="${this.onSelectionChange}"
|
|
498
|
+
></sd-radio-button>
|
|
499
|
+
`}
|
|
500
|
+
`}
|
|
501
|
+
${e&&this.expanded?I`
|
|
502
|
+
<ul>
|
|
503
|
+
<slot></slot>
|
|
504
|
+
</ul>
|
|
505
|
+
`:""}
|
|
506
|
+
</li>
|
|
507
|
+
`}toggle(){this.loading||(this.expanded=!this.expanded,this.dispatchExpansionEvent())}expand(){if(!this.loading){const e=!this.expanded;this.expanded=!0,e&&this.dispatchExpansionEvent()}}collapse(){if(!this.loading){const e=this.expanded;this.expanded=!1,e&&this.dispatchExpansionEvent()}}getState(e){var o;const t=Array.isArray(e)?[...e,this.nodeId]:[this.nodeId],n=[...this.children].map(r=>r.getState(t));let s;return this.type==="checkbox"?s=new ro(this.nodeId,this.text,t,n):s=new In(this.nodeId,this.text,t,n),s.selectionState=this.selectionState,s.childrenType=(o=n[0])==null?void 0:o.type,s.expanded=this.expanded,s.disabled=this.disabled,s}dispatchExpansionEvent(){this.dispatchEvent(new CustomEvent("expansion",{detail:{path:this.path,expanded:this.expanded},bubbles:!0,composed:!0}))}},ee.ID="sd-tree-node",ee.ensureDefined=()=>{Vi.ensureDefined(),Wi.ensureDefined(),customElements.get(ee.ID)||customElements.define(ee.ID,ee)},ee);F([x({type:String,reflect:!0,attribute:!0})],j.prototype,"text",2);F([x({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"expanded",2);F([x({type:String,reflect:!0,attribute:"node-id"})],j.prototype,"nodeId",2);F([x({type:Number,reflect:!0,attribute:"child-count"})],j.prototype,"childCount",2);F([x({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"focused",2);F([x({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"readonly",2);F([x({type:Number})],j.prototype,"depth",2);F([x({type:Array,attribute:!1})],j.prototype,"path",2);F([x({type:String,reflect:!0,attribute:!0})],j.prototype,"type",2);F([x({type:String,reflect:!0,attribute:"selection-state"})],j.prototype,"selectionState",2);F([x({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"disabled",2);F([x({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"loading",2);let co=j;const ho=":host{position:absolute;width:100%}:host([readonly]) li{padding-left:30px}li{height:35px;padding-left:34px}.text{vertical-align:middle;line-height:35px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;font-size:16px}";var uo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,Ki=(i,e,t,n)=>{for(var s=n>1?void 0:n?po(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&&uo(e,t,s),s},te;const Rn=(te=class extends U{constructor(){super(...arguments),this.readonly=!1,this.depth=0}static get styles(){return[we`
|
|
508
|
+
${ce(ho)}
|
|
509
|
+
`]}render(){return I`
|
|
510
|
+
<li class="root" style="margin-left: ${this.depth*qi}px;">
|
|
511
|
+
<div class="text">
|
|
512
|
+
<slot>Loading...</slot>
|
|
513
|
+
</div>
|
|
514
|
+
</li>
|
|
515
|
+
`}},te.ID="sd-tree-loading-indicator",te.ensureDefined=()=>{customElements.get(te.ID)||customElements.define(te.ID,te)},te);Ki([x({type:Boolean,reflect:!0,attribute:!0})],Rn.prototype,"readonly",2);Ki([x({type:Number})],Rn.prototype,"depth",2);let fo=Rn;const St=(i,e=1,t=0)=>e>0?i.reduce((n,s)=>n.concat(s.childCount>0&&s.expanded?[s,...St(s.nodes,e-1,t+1)]:s),[]):i.slice(),go=(i,e,t=0)=>{if(!e)return null;const n=e[t],s=i.find(o=>o.id===n);return e.length-1===t?s:(s==null?void 0:s.nodes.length)>0?go(s.nodes,e,t+1):null},mo=(i,e,t,n,s,o)=>{const r=Math.max(0,o*n),l=Math.min(r,i*n),a=Math.max(0,i*n-s+n);switch(e){case"start":return l;case"end":return a;case"center":{const d=Math.round(a+(l-a)/2);return d<Math.ceil(s/2)?0:d>r+Math.floor(s/2)?r:d}case"auto":default:return t>=a&&t<=l?t:t<a?a:l}},ze=(i,e)=>i.findIndex(t=>typeof t=="string"&&t===JSON.stringify(e)),Y=i=>typeof i=="string",bo=":host{display:block;position:relative;contain:layout;overflow:auto}:host(:focus){outline:none}ul{list-style-type:none;margin:0;padding:0}.root{width:100%}";var yo=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,st=(i,e,t,n)=>{for(var s=n>1?void 0:n?xo(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&&yo(e,t,s),s},ne;const De=(ne=class extends U{constructor(){super(),this.pageSize=50,this.loadingText="Loading...",this.parentSelectionAllowed=!1,this.readonly=!1,this._lastKnownHeight=0,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._visibleItemsNum=0,this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0,this._focusIndex=-1,this._flattenedNodes=[],this._rootItemsLoading=!1,this._rootNodeCount=0,this._loadedRootNodeCount=0,this._allNodeCount=0,this._nodeStates=new Map,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;const e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=Ce&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleNodeExpansion=e=>{const{path:t,expanded:n}=e.detail;this.updateAfterExpansion(t,n)},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"ArrowDown":{this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowUp":{this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"ArrowRight":{const n=this.focusedNode;if(n)if(n.childCount>0&&!n.expanded){const s=this.querySelector(`[node-id='${n.id}']`);s&&s.expand()}else this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowLeft":{const n=this.focusedNode;if(n)if(n.childCount>0&&n.expanded){const s=this.querySelector(`[node-id='${n.id}']`);s&&s.collapse()}else this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"Enter":{const n=this.focusedNode;n&&(this.toggleSelection(n.path),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:n.path,checked:n.selectionState==="checked",indeterminate:n.selectionState==="indeterminate"},bubbles:!0,composed:!0}))}));break}default:{t=!1;break}}t&&(e.preventDefault(),e.stopPropagation())},this.handleNodeSelection=e=>{if(e.target==this)return;this._reusePreviousRenderData=!0;const{path:t}=e.detail;this.focusIndex=ze(this._flattenedNodes,t),this.focus(),this.toggleSelection(t),this.updateComplete.then(()=>{this._reusePreviousRenderData=!1})},this.getFlattenedNodeId=e=>JSON.stringify(e.path),this.nodeGetter=e=>e?this._nodeStates.get(JSON.stringify(e)):null,this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get rootNodeCount(){return this._rootNodeCount}set rootNodeCount(e){e===0?this._allNodeCount=0:e>0&&(this._allNodeCount+=e-this.rootNodeCount),this._rootNodeCount=e,this.requestUpdate()}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this._allNodeCount){const t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToNode(e),t!=e&&this.requestUpdate("focusIndex",t)}}setNodes(e){this.stopLoadingIndicator(),this.setLastLoadingChildren(e,this.rootNodeCount,e.length),e.forEach((t,n)=>{const s=[...e];s.splice(n,1),this.updateNodeMap(t,s)}),this.updateCount(e),this._loadedRootNodeCount=e.length,this._flattenedNodes=St(e,1/0).map(this.getFlattenedNodeId),this.requestUpdate()}addNodes(e,t){this.stopLoadingIndicator(t),e.forEach((s,o)=>{const r=[...e];r.splice(o,1),this.updateNodeMap(s,r)});const n=this.nodeGetter(t);n?n.expanded&&(this._allNodeCount+=e.length+this.getNodeCount(e)):this._loadedRootNodeCount+=e.length,this.updateFlattenedNodes(e,t),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}static get styles(){return[we`
|
|
516
|
+
${ce(bo)}
|
|
517
|
+
`]}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(e){super.updated(e),this.updateNodes(),e.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),I`
|
|
518
|
+
<div class="root" style="height: ${this._allNodeCount*Ce}px">
|
|
519
|
+
<ul>
|
|
520
|
+
<slot></slot>
|
|
521
|
+
</ul>
|
|
522
|
+
</div>
|
|
523
|
+
`}scrollToNode(e,t="auto"){this.scrollTop=mo(this.normalizeIndex(e),t,this.scrollTop,Ce,this.height,this._allNodeCount)}updateNodeMap(e,t){e&&(e.nodeGetter=this.nodeGetter,e.getSiblings=()=>t,this._nodeStates.set(JSON.stringify(e.path),e),e.nodes.forEach((n,s)=>{const o=[...e.nodes];o.splice(s,1),this.updateNodeMap(n,o)}))}updateParentSelectionAllowed(){this._nodeStates.forEach(e=>{e.parentSelectionAllowed=this.parentSelectionAllowed})}updateNodes(){const e=this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1);Fi(I`
|
|
524
|
+
${e.map((t,n)=>{const s=n+this._firstRenderedIndex,o=this.getTopPosition(s);if(!Y(t))return I`
|
|
525
|
+
<sd-tree-loading-indicator .depth="${t.depth}" style="transform: translateY(${o}px)"
|
|
526
|
+
>${this.loadingText}</sd-tree-loading-indicator
|
|
527
|
+
>
|
|
528
|
+
`;const r=this._nodeStates.get(t),l=s===this.focusIndex;let a=r.disabled;return this.parentSelectionAllowed||(a=a||r.hasRadioButtonDescendant()),I`
|
|
529
|
+
<sd-tree-node
|
|
530
|
+
text="${r.text}"
|
|
531
|
+
selection-state="${r.selectionState}"
|
|
532
|
+
.nodeId="${r.id}"
|
|
533
|
+
.depth="${r.depth}"
|
|
534
|
+
style="transform: translateY(${o}px);"
|
|
535
|
+
.path="${r.path}"
|
|
536
|
+
?focused="${l}"
|
|
537
|
+
?readonly="${this.readonly}"
|
|
538
|
+
type="${r.type}"
|
|
539
|
+
?expanded="${r.expanded}"
|
|
540
|
+
child-count="${r.childCount}"
|
|
541
|
+
?disabled="${a}"
|
|
542
|
+
.loading="${r.loading}"
|
|
543
|
+
></sd-tree-node>
|
|
544
|
+
`})}
|
|
545
|
+
`,this)}getTopPosition(e){return e*Ce}updateRenderData(){if(!this._reusePreviousRenderData)if(this._lastRenderedScrollTop=this.scrollTop,this._visibleItemsNum=Math.min(Math.ceil(this.height/Ce),this._allNodeCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastRenderedScrollTop/Ce)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum),this._firstRenderedIndex=this.normalizeIndex(this._firstVisibleIndex-2),this._lastRenderedIndex=this.normalizeIndex(this._lastVisibleIndex+2);for(const e of this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1)){const t=Y(e)&&this._nodeStates.get(e);if(t){if(t.lastLoadingChild){const n=t.parentNode;if(n){if(this.needsFurtherData(n)){this.requestData(n);break}}else if(this._loadedRootNodeCount<this.rootNodeCount&&!this._rootItemsLoading){this.requestData();break}}else if(this.needsFurtherData(t)){this.requestData(t);break}}}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0}needsFurtherData(e){return e.expanded&&e.childCount>e.nodes.length&&this.nodeIndex(e.id)+e.nodes.length<this._lastRenderedIndex}nodeIndex(e){return this._flattenedNodes.findIndex(t=>t===e)}normalizeIndex(e){return Math.max(0,Math.min(e,this._allNodeCount-1))}get height(){return this.offsetHeight}requestData(e){if(!(e!=null&&e.loading)){const t=e==null?void 0:e.path;this.startLoadingIndicator(t),this.dispatchEvent(new CustomEvent("data-request",{detail:{path:t}}))}}updateAfterExpansion(e,t){const n=this._nodeStates.get(JSON.stringify(e));if(n){n.expanded=t;const s=ze(this._flattenedNodes,e),o=this._flattenedNodes[this.focusIndex];if(t){const r=this.addSubtree(n,s+1),l=n.childCount>n.nodes.length,a=s+n.nodes.length<this._lastRenderedIndex;l&&a&&this.requestData(n),this._allNodeCount+=r}else{const r=this.removeSubtree(s);this._allNodeCount-=r}if(o){const r=this._flattenedNodes.findIndex(l=>l==o);r!==this.focusIndex&&(this._focusIndex=r)}}this.requestUpdate()}addSubtree(e,t){const n=this.getFlattenedSubtree(e.nodes);return this._flattenedNodes.splice(t,0,...n),n.length}getFlattenedSubtree(e){return e.reduce((t,n)=>t.concat(n&&n.childCount>0&&n.expanded?[JSON.stringify(n.path),...this.getFlattenedSubtree(n.nodes)]:JSON.stringify(n.path)),[])}removeSubtree(e){const t=this.getNextNonDescendantIndex(e);let n=0;return t!==-1?(n=t-e-1,this._flattenedNodes.splice(e+1,n)):(n=this._flattenedNodes.length-e-1,this._flattenedNodes.splice(e+1)),n}getNextNonDescendantIndex(e){const t=this._flattenedNodes[e],n=Y(t)&&this._nodeStates.get(t);if(n)for(let s=e+1;s<this._flattenedNodes.length;s++){const o=this._flattenedNodes[s],r=Y(o)&&this._nodeStates.get(o);if(r&&r.path.length<=n.path.length)return s}return-1}get focusedNode(){const e=this._flattenedNodes[this.focusIndex];return Y(e)&&this._nodeStates.get(e)}toggleSelection(e){this.nodeGetter(e).toggle(),this.requestUpdate()}updateFlattenedNodes(e,t){if(t){const n=ze(this._flattenedNodes,t),s=this._flattenedNodes[n];if(Y(s)){const o=this._nodeStates.get(s);if(o){const r=n+o.nodes.length+1,l=o.depth,a=St(e,1/0,l+1).map(this.getFlattenedNodeId);o.expanded&&this._flattenedNodes.splice(r,0,...a),o.nodes=[...o.nodes,...e],o.loading=!1,this.updateLastLoadingChild(o.nodes,a)}}}else{const n=St(e,1/0).map(this.getFlattenedNodeId);this.updateLastLoadingChild(this._flattenedNodes,n),this._flattenedNodes=[...this._flattenedNodes,...n]}}updateLastLoadingChild(e,t){const n=e[e.length-1],s=Y(n)&&this._nodeStates.get(n),o=t[t.length-1],r=Y(o)&&this._nodeStates.get(o);if(s&&(s.lastLoadingChild=!1),r){const l=r.parentNode;(l&&l.childCount>l.nodes.length||!l&&this.rootNodeCount>this._loadedRootNodeCount)&&(r.lastLoadingChild=!0)}}setLastLoadingChildren(e,t,n){if(n<t){const s=e[e.length-1];s&&(s.lastLoadingChild=!0)}e.forEach(s=>{this.setLastLoadingChildren(s.nodes,s.childCount,s.nodes.length)})}startLoadingIndicator(e){if(e){const t=this._nodeStates.get(JSON.stringify(e));if(t){const n=ze(this._flattenedNodes,e);t.loading=!0,this.addPlaceholders(n,t)}}else this._rootItemsLoading=!0,this._flattenedNodes=[...this._flattenedNodes,...new Array(this.rootNodeCount-this._loadedRootNodeCount).fill({depth:0})];this.updateNodes()}addPlaceholders(e,t){const n=e+t.nodes.length+1,s=t.childCount-t.nodes.length;this._flattenedNodes.splice(n,0,...new Array(s).fill({depth:t.depth+1}))}stopLoadingIndicator(e){if(e){const t=this._nodeStates.get(JSON.stringify(e));if(t&&(t.loading=!1,t.expanded)){const n=ze(this._flattenedNodes,e);this.removePlaceHolders(n,t)}}else{this._rootItemsLoading=!1;const t=this._flattenedNodes.findIndex(n=>!Y(n));this._flattenedNodes.splice(t)}}removePlaceHolders(e,t){const n=e+t.nodes.length+1,s=t.childCount-t.nodes.length;this._flattenedNodes.splice(n,s)}syncState(){const t=[...this.children].map(n=>n.getState());this.addNodes(t),this.rootNodeCount=t.length,this.innerHTML=""}updateCount(e){this._allNodeCount=e.length+this.getNodeCount(e)}getNodeCount(e){let t=0;return e.forEach(n=>{n.expanded&&(t+=n.childCount+this.getNodeCount(n.nodes))}),t}},ne.ID="sd-tree",ne.ensureDefined=()=>{co.ensureDefined(),fo.ensureDefined(),customElements.get(ne.ID)||customElements.define(ne.ID,ne)},ne);st([x({type:String})],De.prototype,"loadingText",2);st([x({type:Boolean,reflect:!0,attribute:"parent-selection-allowed"})],De.prototype,"parentSelectionAllowed",2);st([x({type:Boolean,reflect:!0,attribute:!0})],De.prototype,"readonly",2);st([x({type:Number})],De.prototype,"rootNodeCount",1);st([x({type:Number,attribute:"focus-index",reflect:!0})],De.prototype,"focusIndex",1);let vo=De;vo.ensureDefined();function Zi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function wo(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 Pn={exports:{}},C=String,Ji=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C}};Pn.exports=Ji();Pn.exports.createColors=Ji;var _o=Pn.exports;const So={},Eo=Object.freeze(Object.defineProperty({__proto__:null,default:So},Symbol.toStringTag,{value:"Module"})),H=wo(Eo);let hi=_o,ui=H,pn=class Xi 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,Xi)}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=hi.isColorSupported),ui&&e&&(t=ui(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,l,a;if(e){let{bold:d,gray:c,red:p}=hi.createColors(!0);l=f=>d(p(f)),a=f=>c(f)}else l=a=d=>d;return n.slice(s,o).map((d,c)=>{let p=s+1+c,f=" "+(" "+p).slice(-r)+" | ";if(p===this.line){let _=a(f.replace(/\d/g," "))+d.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(f)+d+`
|
|
546
|
+
`+_+l("^")}return" "+a(f)+d}).join(`
|
|
547
|
+
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
548
|
+
|
|
549
|
+
`+e+`
|
|
550
|
+
`),this.name+": "+this.message+e}};var Mn=pn;pn.default=pn;var rt={};rt.isClean=Symbol("isClean");rt.my=Symbol("my");const pi={after:`
|
|
551
|
+
`,beforeClose:`
|
|
552
|
+
`,beforeComment:`
|
|
553
|
+
`,beforeDecl:`
|
|
554
|
+
`,beforeOpen:" ",beforeRule:`
|
|
555
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function ko(i){return i[0].toUpperCase()+i.slice(1)}let fn=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(`
|
|
556
|
+
`)){let r=this.raw(e,null,"indent");if(r.length)for(let l=0;l<o;l++)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 pi[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 l="raw"+ko(n);this[l]?s=this[l](r,e):r.walk(a=>{if(s=a.raws[t],typeof s<"u")return!1})}return typeof s>"u"&&(s=pi[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(`
|
|
557
|
+
`)&&(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(`
|
|
558
|
+
`)&&(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(`
|
|
559
|
+
`)&&(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(`
|
|
560
|
+
`)&&(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(`
|
|
561
|
+
`);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 Qi=fn;fn.default=fn;let $o=Qi;function gn(i,e){new $o(e).stringify(i)}var Lt=gn;gn.default=gn;let{isClean:ht,my:Co}=rt,Ao=Mn,No=Qi,Oo=Lt;function mn(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=>mn(r,t)):(o==="object"&&s!==null&&(s=mn(s)),t[n]=s)}return t}let bn=class{constructor(e={}){this.raws={},this[ht]=!1,this[Co]=!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=mn(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 Ao(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[ht]){this[ht]=!1;let e=this;for(;e=e.parent;)e[ht]=!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]===`
|
|
562
|
+
`?(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 No().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 l=this[r];if(Array.isArray(l))n[r]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)n[r]=l.toJSON(null,t);else if(r==="source"){let a=t.get(l.input);a==null&&(a=o,t.set(l.input,o),o++),n[r]={end:l.end,inputId:a,start:l.start}}else n[r]=l}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=Oo){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 Dt=bn;bn.default=bn;let Io=Dt,yn=class extends Io{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 Bt=yn;yn.default=yn;let Ro="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Po=(i,e=21)=>(t=e)=>{let n="",s=t;for(;s--;)n+=i[Math.random()*i.length|0];return n},Mo=(i=21)=>{let e="",t=i;for(;t--;)e+=Ro[Math.random()*64|0];return e};var To={nanoid:Mo,customAlphabet:Po};let{SourceMapConsumer:fi,SourceMapGenerator:gi}=H,{existsSync:Lo,readFileSync:Do}=H,{dirname:rn,join:Bo}=H;function jo(i){return Buffer?Buffer.from(i,"base64").toString():window.atob(i)}let xn=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=rn(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new fi(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 jo(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=rn(e),Lo(e))return this.mapFile=e,Do(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 fi)return gi.fromSourceMap(t).toString();if(t instanceof gi)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=Bo(rn(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 Yi=xn;xn.default=xn;let{SourceMapConsumer:zo,SourceMapGenerator:Uo}=H,{fileURLToPath:mi,pathToFileURL:ut}=H,{isAbsolute:vn,resolve:wn}=H,{nanoid:Fo}=To,on=H,bi=Mn,Ho=Yi,ln=Symbol("fromOffsetCache"),Wo=!!(zo&&Uo),yi=!!(wn&&vn),At=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&&(!yi||/^\w+:\/\//.test(t.from)||vn(t.from)?this.file=t.from:this.file=wn(t.from)),yi&&Wo){let n=new Ho(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 "+Fo(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,s={}){let o,r,l;if(t&&typeof t=="object"){let d=t,c=n;if(typeof d.offset=="number"){let p=this.fromOffset(d.offset);t=p.line,n=p.col}else t=d.line,n=d.column;if(typeof c.offset=="number"){let p=this.fromOffset(c.offset);r=p.line,l=p.col}else r=c.line,l=c.column}else if(!n){let d=this.fromOffset(t);t=d.line,n=d.col}let a=this.origin(t,n,r,l);return a?o=new bi(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,s.plugin):o=new bi(e,r===void 0?t:{column:n,line:t},r===void 0?n:{column:l,line:r},this.css,this.file,s.plugin),o.input={column:n,endColumn:l,endLine:r,line:t,source:this.css},this.file&&(ut&&(o.input.url=ut(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[ln])n=this[ln];else{let o=this.css.split(`
|
|
563
|
+
`);n=new Array(o.length);let r=0;for(let l=0,a=o.length;l<a;l++)n[l]=r,r+=o[l].length+1;this[ln]=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:wn(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 l;typeof n=="number"&&(l=o.originalPositionFor({column:s,line:n}));let a;vn(r.source)?a=ut(r.source):a=new URL(r.source,this.map.consumer().sourceRoot||ut(this.map.mapFile));let d={column:r.column,endColumn:l&&l.column,endLine:l&&l.line,line:r.line,url:a.toString()};if(a.protocol==="file:")if(mi)d.file=mi(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(r.source);return c&&(d.source=c),d}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 jt=At;At.default=At;on&&on.registerInput&&on.registerInput(At);let{SourceMapConsumer:es,SourceMapGenerator:Et}=H,{dirname:kt,relative:ts,resolve:ns,sep:is}=H,{pathToFileURL:xi}=H,Vo=jt,qo=!!(es&&Et),Go=!!(kt&&ns&&ts&&is),Ko=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=`
|
|
564
|
+
`;this.css.includes(`\r
|
|
565
|
+
`)&&(t=`\r
|
|
566
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),n=e.root||kt(e.file),s;this.mapOpts.sourcesContent===!1?(s=new es(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(),Go&&qo&&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=Et.fromSourceMap(e)}else this.map=new Et({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 Et({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,(l,a,d)=>{if(this.css+=l,a&&d!=="end"&&(s.generated.line=e,s.generated.column=t-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=n,s.original.line=1,s.original.column=0,this.map.addMapping(s))),o=l.match(/\n/g),o?(e+=o.length,r=l.lastIndexOf(`
|
|
567
|
+
`),t=l.length-r):t+=l.length,a&&d!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.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?kt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(n=kt(ns(n,this.mapOpts.annotation)));let s=ts(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 Vo(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(xi){let n=xi(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;is==="\\"&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};var ss=Ko;let Zo=Dt,_n=class extends Zo{constructor(e){super(e),this.type="comment"}};var zt=_n;_n.default=_n;let{isClean:rs,my:os}=rt,ls=Bt,as=zt,Jo=Dt,ds,Tn,Ln,cs;function hs(i){return i.map(e=>(e.nodes&&(e.nodes=hs(e.nodes)),delete e.source,e))}function us(i){if(i[rs]=!1,i.proxyOf.nodes)for(let e of i.proxyOf.nodes)us(e)}let ie=class ps extends Jo{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 l of o)this.proxyOf.nodes.splice(n,0,l);let r;for(let l in this.indexes)r=this.indexes[l],n<=r&&(this.indexes[l]=r+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=hs(ds(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 ls(e)]}else if(e.selector)e=[new Tn(e)];else if(e.name)e=[new Ln(e)];else if(e.text)e=[new as(e)];else throw new Error("Unknown node type in node creation");return e.map(s=>(s[os]||ps.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[rs]&&us(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=>{ds=i};ie.registerRule=i=>{Tn=i};ie.registerAtRule=i=>{Ln=i};ie.registerRoot=i=>{cs=i};var Se=ie;ie.default=ie;ie.rebuild=i=>{i.type==="atrule"?Object.setPrototypeOf(i,Ln.prototype):i.type==="rule"?Object.setPrototypeOf(i,Tn.prototype):i.type==="decl"?Object.setPrototypeOf(i,ls.prototype):i.type==="comment"?Object.setPrototypeOf(i,as.prototype):i.type==="root"&&Object.setPrototypeOf(i,cs.prototype),i[os]=!0,i.nodes&&i.nodes.forEach(e=>{ie.rebuild(e)})};let Xo=Se,fs,gs,Je=class extends Xo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new fs(new gs,this,e).stringify()}};Je.registerLazyResult=i=>{fs=i};Je.registerProcessor=i=>{gs=i};var Dn=Je;Je.default=Je;let Sn=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 ms=Sn;Sn.default=Sn;let Qo=ms,En=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 Qo(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Bn=En;En.default=En;const an=39,vi=34,pt=92,wi=47,ft=10,Ue=32,gt=12,mt=9,bt=13,Yo=91,el=93,tl=40,nl=41,il=123,sl=125,rl=59,ol=42,ll=58,al=64,yt=/[\t\n\f\r "#'()/;[\\\]{}]/g,xt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,dl=/.[\r\n"'(/\\]/,_i=/[\da-f]/i;var cl=function(e,t={}){let n=e.css.valueOf(),s=t.ignoreErrors,o,r,l,a,d,c,p,f,_,N,P=n.length,b=0,Z=[],J=[];function ue(){return b}function z(W){throw e.error("Unclosed "+W,b)}function X(){return J.length===0&&b>=P}function Be(W){if(J.length)return J.pop();if(b>=P)return;let L=W?W.ignoreUnclosed:!1;switch(o=n.charCodeAt(b),o){case ft:case Ue:case mt:case bt:case gt:{r=b;do r+=1,o=n.charCodeAt(r);while(o===Ue||o===ft||o===mt||o===bt||o===gt);N=["space",n.slice(b,r)],b=r-1;break}case Yo:case el:case il:case sl:case ll:case rl:case nl:{let pe=String.fromCharCode(o);N=[pe,pe,b];break}case tl:{if(f=Z.length?Z.pop()[1]:"",_=n.charCodeAt(b+1),f==="url"&&_!==an&&_!==vi&&_!==Ue&&_!==ft&&_!==mt&&_!==gt&&_!==bt){r=b;do{if(c=!1,r=n.indexOf(")",r+1),r===-1)if(s||L){r=b;break}else z("bracket");for(p=r;n.charCodeAt(p-1)===pt;)p-=1,c=!c}while(c);N=["brackets",n.slice(b,r+1),b,r],b=r}else r=n.indexOf(")",b+1),a=n.slice(b,r+1),r===-1||dl.test(a)?N=["(","(",b]:(N=["brackets",a,b,r],b=r);break}case an:case vi:{l=o===an?"'":'"',r=b;do{if(c=!1,r=n.indexOf(l,r+1),r===-1)if(s||L){r=b+1;break}else z("string");for(p=r;n.charCodeAt(p-1)===pt;)p-=1,c=!c}while(c);N=["string",n.slice(b,r+1),b,r],b=r;break}case al:{yt.lastIndex=b+1,yt.test(n),yt.lastIndex===0?r=n.length-1:r=yt.lastIndex-2,N=["at-word",n.slice(b,r+1),b,r],b=r;break}case pt:{for(r=b,d=!0;n.charCodeAt(r+1)===pt;)r+=1,d=!d;if(o=n.charCodeAt(r+1),d&&o!==wi&&o!==Ue&&o!==ft&&o!==mt&&o!==bt&&o!==gt&&(r+=1,_i.test(n.charAt(r)))){for(;_i.test(n.charAt(r+1));)r+=1;n.charCodeAt(r+1)===Ue&&(r+=1)}N=["word",n.slice(b,r+1),b,r],b=r;break}default:{o===wi&&n.charCodeAt(b+1)===ol?(r=n.indexOf("*/",b+2)+1,r===0&&(s||L?r=n.length:z("comment")),N=["comment",n.slice(b,r+1),b,r],b=r):(xt.lastIndex=b+1,xt.test(n),xt.lastIndex===0?r=n.length-1:r=xt.lastIndex-2,N=["word",n.slice(b,r+1),b,r],Z.push(N),b=r);break}}return b++,N}function ke(W){J.push(W)}return{back:ke,endOfFile:X,nextToken:Be,position:ue}};let bs=Se,Nt=class extends bs{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 jn=Nt;Nt.default=Nt;bs.registerAtRule(Nt);let ys=Se,xs,vs,Pe=class extends ys{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 xs(new vs,this,e).stringify()}};Pe.registerLazyResult=i=>{xs=i};Pe.registerProcessor=i=>{vs=i};var ot=Pe;Pe.default=Pe;ys.registerRoot(Pe);let Xe={comma(i){return Xe.split(i,[","],!0)},space(i){let e=[" ",`
|
|
568
|
+
`," "];return Xe.split(i,e)},split(i,e,t){let n=[],s="",o=!1,r=0,l=!1,a="",d=!1;for(let c of i)d?d=!1:c==="\\"?d=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?r+=1:c===")"?r>0&&(r-=1):r===0&&e.includes(c)&&(o=!0),o?(s!==""&&n.push(s.trim()),s="",o=!1):s+=c;return(t||s!=="")&&n.push(s.trim()),n}};var ws=Xe;Xe.default=Xe;let _s=Se,hl=ws,Ot=class extends _s{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return hl.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 zn=Ot;Ot.default=Ot;_s.registerRule(Ot);let ul=Bt,pl=cl,fl=zt,gl=jn,ml=ot,Si=zn;const Ei={empty:!0,space:!0};function bl(i){for(let e=i.length-1;e>=0;e--){let t=i[e],n=t[3]||t[2];if(n)return n}}let yl=class{constructor(e){this.input=e,this.root=new ml,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 gl;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,s,o,r=!1,l=!1,a=[],d=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n==="("||n==="["?d.push(n==="("?")":"]"):n==="{"&&d.length>0?d.push("}"):n===d[d.length-1]&&d.pop(),d.length===0)if(n===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){l=!0;break}else if(n==="}"){if(a.length>0){for(o=a.length-1,s=a[o];s&&s[0]==="space";)s=a[--o];s&&(t.source.end=this.getPosition(s[3]||s[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){r=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),r&&(e=a[a.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=""),l&&(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,l]of e.entries()){if(n=l,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 fl;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=pl(this.input)}decl(e,t){let n=new ul;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]||bl(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 d=e[0][0];if(d===":"||d==="space"||d==="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=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)r.push(e.shift());this.precheckMissedSemicolon(e);for(let d=e.length-1;d>=0;d--){if(o=e[d],o[1].toLowerCase()==="!important"){n.important=!0;let c=this.stringFrom(e,d);c=this.spacesFromEnd(e)+c,c!==" !important"&&(n.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),p="";for(let f=d;f>0;f--){let _=c[f][0];if(p.trim().indexOf("!")===0&&_!=="space")break;p=c.pop()[1]+p}p.trim().indexOf("!")===0&&(n.important=!0,n.raws.important=p,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(d=>d[0]!=="space"&&d[0]!=="comment")&&(n.raws.between+=r.map(d=>d[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 Si;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=[],l=e[1].startsWith("--"),a=[],d=e;for(;d;){if(n=d[0],a.push(d),n==="("||n==="[")o||(o=d),r.push(n==="("?")":"]");else if(l&&s&&n==="{")o||(o=d),r.push("}");else if(r.length===0)if(n===";")if(s){this.decl(a,l);return}else break;else if(n==="{"){this.rule(a);return}else if(n==="}"){this.tokenizer.back(a.pop()),t=!0;break}else n===":"&&(s=!0);else n===r[r.length-1]&&(r.pop(),r.length===0&&(o=null));d=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(o),t&&s){if(!l)for(;a.length&&(d=a[a.length-1][0],!(d!=="space"&&d!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}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,l=n.length,a="",d=!0,c,p;for(let f=0;f<l;f+=1)o=n[f],r=o[0],r==="space"&&f===l-1&&!s?d=!1:r==="comment"?(p=n[f-1]?n[f-1][0]:"empty",c=n[f+1]?n[f+1][0]:"empty",!Ei[p]&&!Ei[c]?a.slice(-1)===","?d=!1:a+=o[1]:d=!1):a+=o[1];if(!d){let f=n.reduce((_,N)=>_+N[1],"");e.raws[t]={raw:f,value:a}}e[t]=a}rule(e){e.pop();let t=new Si;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 xl=yl;let vl=Se,wl=xl,_l=jt;function It(i,e){let t=new _l(i,e),n=new wl(t);try{n.parse()}catch(s){throw s}return n.root}var Un=It;It.default=It;vl.registerParse(It);let{isClean:G,my:Sl}=rt,El=ss,kl=Lt,$l=Se,Cl=Dn,ki=Bn,Al=Un,Nl=ot;const Ol={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Il={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},Rl={Once:!0,postcssPlugin:!0,prepare:!0},Me=0;function Fe(i){return typeof i=="object"&&typeof i.then=="function"}function Ss(i){let e=!1,t=Ol[i.type];return i.type==="decl"?e=i.prop.toLowerCase():i.type==="atrule"&&(e=i.name.toLowerCase()),e&&i.append?[t,t+"-"+e,Me,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:i.append?[t,Me,t+"Exit"]:[t,t+"Exit"]}function $i(i){let e;return i.type==="document"?e=["Document",Me,"DocumentExit"]:i.type==="root"?e=["Root",Me,"RootExit"]:e=Ss(i),{eventIndex:0,events:e,iterator:0,node:i,visitorIndex:0,visitors:[]}}function kn(i){return i[G]=!1,i.nodes&&i.nodes.forEach(e=>kn(e)),i}let $n={},Te=class Es{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=kn(t);else if(t instanceof Es||t instanceof ki)s=kn(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=Al;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[Sl]&&$l.rebuild(s)}this.result=new ki(e,s,n),this.helpers={...$n,postcss:$n,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(!Il[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Rl[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(Fe(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[G];){e[G]=!0;let t=[$i(e)];for(;t.length>0;){let n=this.visitTick(t);if(Fe(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 Fe(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=kl;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new El(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(Fe(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[G];)e[G]=!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(Fe(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,l]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=r;try{return l(n.toProxy(),this.helpers)}catch(a){throw this.handleError(a,n)}}if(t.iterator!==0){let r=t.iterator,l;for(;l=n.nodes[n.indexes[r]];)if(n.indexes[r]+=1,!l[G]){l[G]=!0,e.push($i(l));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===Me){n.nodes&&n.nodes.length&&(n[G]=!0,t.iterator=n.getIterator());return}else if(this.listeners[r]){t.visitors=this.listeners[r];return}}e.pop()}walkSync(e){e[G]=!0;let t=Ss(e);for(let n of t)if(n===Me)e.nodes&&e.each(s=>{s[G]||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"}};Te.registerPostcss=i=>{$n=i};var ks=Te;Te.default=Te;Nl.registerLazyResult(Te);Cl.registerLazyResult(Te);let Pl=ss,Ml=Lt,Tl=Un;const Ll=Bn;let Cn=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=Ml;this.result=new Ll(this._processor,s,this._opts),this.result.css=t;let r=this;Object.defineProperty(this.result,"root",{get(){return r.root}});let l=new Pl(o,s,this._opts,t);if(l.isMap()){let[a,d]=l.generate();a&&(this.result.css=a),d&&(this.result.map=d)}}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=Tl;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 Dl=Cn;Cn.default=Cn;let Bl=Dl,jl=ks,zl=Dn,Ul=ot,Qe=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 Bl(this,e,t):new jl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Fl=Qe;Qe.default=Qe;Ul.registerProcessor(Qe);zl.registerProcessor(Qe);let Hl=Bt,Wl=Yi,Vl=zt,ql=jn,Gl=jt,Kl=ot,Zl=zn;function Ye(i,e){if(Array.isArray(i))return i.map(s=>Ye(s));let{inputs:t,...n}=i;if(t){e=[];for(let s of t){let o={...s,__proto__:Gl.prototype};o.map&&(o.map={...o.map,__proto__:Wl.prototype}),e.push(o)}}if(n.nodes&&(n.nodes=i.nodes.map(s=>Ye(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 Kl(n);if(n.type==="decl")return new Hl(n);if(n.type==="rule")return new Zl(n);if(n.type==="comment")return new Vl(n);if(n.type==="atrule")return new ql(n);throw new Error("Unknown node type: "+i.type)}var Jl=Ye;Ye.default=Ye;var Ci={};let Xl=Mn,$s=Bt,Ql=ks,Yl=Se,Fn=Fl,ea=Lt,ta=Jl,Cs=Dn,na=ms,As=zt,Ns=jn,ia=Bn,sa=jt,ra=Un,oa=ws,Os=zn,Is=ot,la=Dt;function E(...i){return i.length===1&&Array.isArray(i[0])&&(i=i[0]),new Fn(i)}E.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:
|
|
569
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Ci.LANG&&Ci.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
570
|
+
https://www.w3ctech.com/topic/2226`));let l=t(...r);return l.postcssPlugin=e,l.postcssVersion=new Fn().version,l}let o;return Object.defineProperty(s,"postcss",{get(){return o||(o=s()),o}}),s.process=function(r,l,a){return E([s(a)]).process(r,l)},s};E.stringify=ea;E.parse=ra;E.fromJSON=ta;E.list=oa;E.comment=i=>new As(i);E.atRule=i=>new Ns(i);E.decl=i=>new $s(i);E.rule=i=>new Os(i);E.root=i=>new Is(i);E.document=i=>new Cs(i);E.CssSyntaxError=Xl;E.Declaration=$s;E.Container=Yl;E.Processor=Fn;E.Document=Cs;E.Comment=As;E.Warning=na;E.AtRule=Ns;E.Result=ia;E.Input=sa;E.Rule=Os;E.Root=Is;E.Node=la;Ql.registerPostcss(E);var aa=E;E.default=E;const A=Zi(aa);A.stringify;A.fromJSON;A.plugin;A.parse;A.list;A.document;A.comment;A.atRule;A.rule;A.decl;A.root;A.CssSyntaxError;A.Declaration;A.Container;A.Processor;A.Document;A.Comment;A.Warning;A.AtRule;A.Result;A.Input;A.Rule;A.Root;A.Node;var da=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&&Ai(r.source.input.file,s)||o.length&&r.source.input.file&&!Ai(r.source.input.file,o)||r.walkRules(l=>{const a=["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"];l.parent&&a.includes(l.parent.name)||(l.selectors=l.selectors.map(d=>e.exclude&&ca(d,e.exclude)?d:e.transform?e.transform(t,d,n+d,r.source.input.file,l):n+d))})}};function Ai(i,e){return e.some(t=>t instanceof RegExp?t.test(i):i.includes(t))}function ca(i,e){return e.some(t=>t instanceof RegExp?t.test(i):i===t)}const ha=Zi(da),ua="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}",pa="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 fa(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Rs(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)&&Rs(t)}),i}class Ni{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ps(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function de(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 ga="</span>",Oi=i=>!!i.scope,ma=(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 ba{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Ps(e)}openNode(e){if(!Oi(e))return;const t=ma(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){Oi(e)&&(this.buffer+=ga)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const Ii=(i={})=>{const e={children:[]};return Object.assign(e,i),e};class Hn{constructor(){this.rootNode=Ii(),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=Ii({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=>{Hn._collapse(t)}))}}class ya extends Hn{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 ba(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function et(i){return i?typeof i=="string"?i:i.source:null}function Ms(i){return Ee("(?=",i,")")}function xa(i){return Ee("(?:",i,")*")}function va(i){return Ee("(?:",i,")?")}function Ee(...i){return i.map(e=>et(e)).join("")}function wa(i){const e=i[i.length-1];return typeof e=="object"&&e.constructor===Object?(i.splice(i.length-1,1),e):{}}function Wn(...i){return"("+(wa(i).capture?"":"?:")+i.map(e=>et(e)).join("|")+")"}function Ts(i){return new RegExp(i.toString()+"|").exec("").length-1}function _a(i,e){const t=i&&i.exec(e);return t&&t.index===0}const Sa=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Vn(i,{joinWith:e}){let t=0;return i.map(n=>{t+=1;const s=t;let o=et(n),r="";for(;o.length>0;){const l=Sa.exec(o);if(!l){r+=o;break}r+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?r+="\\"+String(Number(l[1])+s):(r+=l[0],l[0]==="("&&t++)}return r}).map(n=>`(${n})`).join(e)}const Ea=/\b\B/,Ls="[a-zA-Z]\\w*",qn="[a-zA-Z_]\\w*",Ds="\\b\\d+(\\.\\d+)?",Bs="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",js="\\b(0b[01]+)",ka="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",$a=(i={})=>{const e=/^#![ ]*\//;return i.binary&&(i.begin=Ee(e,/.*\b/,i.binary,/\b.*/)),de({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,n)=>{t.index!==0&&n.ignoreMatch()}},i)},tt={begin:"\\\\[\\s\\S]",relevance:0},Ca={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[tt]},Aa={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[tt]},Na={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/},Ut=function(i,e,t={}){const n=de({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=Wn("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:Ee(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},Oa=Ut("//","$"),Ia=Ut("/\\*","\\*/"),Ra=Ut("#","$"),Pa={scope:"number",begin:Ds,relevance:0},Ma={scope:"number",begin:Bs,relevance:0},Ta={scope:"number",begin:js,relevance:0},La={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[tt,{begin:/\[/,end:/\]/,relevance:0,contains:[tt]}]},Da={scope:"title",begin:Ls,relevance:0},Ba={scope:"title",begin:qn,relevance:0},ja={begin:"\\.\\s*"+qn,relevance:0},za=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 vt=Object.freeze({__proto__:null,APOS_STRING_MODE:Ca,BACKSLASH_ESCAPE:tt,BINARY_NUMBER_MODE:Ta,BINARY_NUMBER_RE:js,COMMENT:Ut,C_BLOCK_COMMENT_MODE:Ia,C_LINE_COMMENT_MODE:Oa,C_NUMBER_MODE:Ma,C_NUMBER_RE:Bs,END_SAME_AS_BEGIN:za,HASH_COMMENT_MODE:Ra,IDENT_RE:Ls,MATCH_NOTHING_RE:Ea,METHOD_GUARD:ja,NUMBER_MODE:Pa,NUMBER_RE:Ds,PHRASAL_WORDS_MODE:Na,QUOTE_STRING_MODE:Aa,REGEXP_MODE:La,RE_STARTERS_RE:ka,SHEBANG:$a,TITLE_MODE:Da,UNDERSCORE_IDENT_RE:qn,UNDERSCORE_TITLE_MODE:Ba});function Ua(i,e){i.input[i.index-1]==="."&&e.ignoreMatch()}function Fa(i,e){i.className!==void 0&&(i.scope=i.className,delete i.className)}function Ha(i,e){e&&i.beginKeywords&&(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",i.__beforeBegin=Ua,i.keywords=i.keywords||i.beginKeywords,delete i.beginKeywords,i.relevance===void 0&&(i.relevance=0))}function Wa(i,e){Array.isArray(i.illegal)&&(i.illegal=Wn(...i.illegal))}function Va(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 qa(i,e){i.relevance===void 0&&(i.relevance=1)}const Ga=(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=Ee(t.beforeMatch,Ms(t.begin)),i.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},i.relevance=0,delete t.beforeMatch},Ka=["of","and","for","in","not","or","if","then","parent","list","value"],Za="keyword";function zs(i,e,t=Za){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,zs(i[o],e,o))}),n;function s(o,r){e&&(r=r.map(l=>l.toLowerCase())),r.forEach(function(l){const a=l.split("|");n[a[0]]=[o,Ja(a[0],a[1])]})}}function Ja(i,e){return e?Number(e):Xa(i)?0:1}function Xa(i){return Ka.includes(i.toLowerCase())}const Ri={},xe=i=>{console.error(i)},Pi=(i,...e)=>{console.log(`WARN: ${i}`,...e)},Ae=(i,e)=>{Ri[`${i}/${e}`]||(console.log(`Deprecated as of ${i}. ${e}`),Ri[`${i}/${e}`]=!0)},Rt=new Error;function Us(i,e,{key:t}){let n=0;const s=i[t],o={},r={};for(let l=1;l<=e.length;l++)r[l+n]=s[l],o[l+n]=!0,n+=Ts(e[l-1]);i[t]=r,i[t]._emit=o,i[t]._multi=!0}function Qa(i){if(Array.isArray(i.begin)){if(i.skip||i.excludeBegin||i.returnBegin)throw xe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rt;if(typeof i.beginScope!="object"||i.beginScope===null)throw xe("beginScope must be object"),Rt;Us(i,i.begin,{key:"beginScope"}),i.begin=Vn(i.begin,{joinWith:""})}}function Ya(i){if(Array.isArray(i.end)){if(i.skip||i.excludeEnd||i.returnEnd)throw xe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rt;if(typeof i.endScope!="object"||i.endScope===null)throw xe("endScope must be object"),Rt;Us(i,i.end,{key:"endScope"}),i.end=Vn(i.end,{joinWith:""})}}function ed(i){i.scope&&typeof i.scope=="object"&&i.scope!==null&&(i.beginScope=i.scope,delete i.scope)}function td(i){ed(i),typeof i.beginScope=="string"&&(i.beginScope={_wrap:i.beginScope}),typeof i.endScope=="string"&&(i.endScope={_wrap:i.endScope}),Qa(i),Ya(i)}function nd(i){function e(r,l){return new RegExp(et(r),"m"+(i.case_insensitive?"i":"")+(i.unicodeRegex?"u":"")+(l?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=Ts(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=e(Vn(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const d=a.findIndex((p,f)=>f>0&&p!==void 0),c=this.matchIndexes[d];return a.splice(0,d),Object.assign(a,c)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new t;return this.rules.slice(l).forEach(([d,c])=>a.addRule(d,c)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let d=a.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,d=c.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function s(r){const l=new n;return r.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),r.terminatorEnd&&l.addRule(r.terminatorEnd,{type:"end"}),r.illegal&&l.addRule(r.illegal,{type:"illegal"}),l}function o(r,l){const a=r;if(r.isCompiled)return a;[Fa,Va,td,Ga].forEach(c=>c(r,l)),i.compilerExtensions.forEach(c=>c(r,l)),r.__beforeBegin=null,[Ha,Wa,qa].forEach(c=>c(r,l)),r.isCompiled=!0;let d=null;return typeof r.keywords=="object"&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),d=r.keywords.$pattern,delete r.keywords.$pattern),d=d||/\w+/,r.keywords&&(r.keywords=zs(r.keywords,i.case_insensitive)),a.keywordPatternRe=e(d,!0),l&&(r.begin||(r.begin=/\B|\b/),a.beginRe=e(a.begin),!r.end&&!r.endsWithParent&&(r.end=/\B|\b/),r.end&&(a.endRe=e(a.end)),a.terminatorEnd=et(a.end)||"",r.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+l.terminatorEnd)),r.illegal&&(a.illegalRe=e(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map(function(c){return id(c==="self"?r:c)})),r.contains.forEach(function(c){o(c,a)}),r.starts&&o(r.starts,l),a.matcher=s(a),a}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=de(i.classNameAliases||{}),o(i)}function Fs(i){return i?i.endsWithParent||Fs(i.starts):!1}function id(i){return i.variants&&!i.cachedVariants&&(i.cachedVariants=i.variants.map(function(e){return de(i,{variants:null},e)})),i.cachedVariants?i.cachedVariants:Fs(i)?de(i,{starts:i.starts?de(i.starts):null}):Object.isFrozen(i)?de(i):i}var sd="11.9.0";class rd extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const dn=Ps,Mi=de,Ti=Symbol("nomatch"),od=7,Hs=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ya};function a(h){return l.noHighlightRe.test(h)}function d(h){let g=h.className+" ";g+=h.parentNode?h.parentNode.className:"";const v=l.languageDetectRe.exec(g);if(v){const S=L(v[1]);return S||(Pi(o.replace("{}",v[1])),Pi("Falling back to no-highlight mode for this block.",h)),S?v[1]:"no-highlight"}return g.split(/\s+/).find(S=>a(S)||L(S))}function c(h,g,v){let S="",O="";typeof g=="object"?(S=h,v=g.ignoreIllegals,O=g.language):(Ae("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ae("10.7.0",`Please use highlight(code, options) instead.
|
|
571
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),O=h,S=g),v===void 0&&(v=!0);const D={code:S,language:O};fe("before:highlight",D);const re=D.result?D.result:p(D.language,D.code,v);return re.code=D.code,fe("after:highlight",re),re}function p(h,g,v,S){const O=Object.create(null);function D(u,m){return u.keywords[m]}function re(){if(!y.keywords){M.addText($);return}let u=0;y.keywordPatternRe.lastIndex=0;let m=y.keywordPatternRe.exec($),w="";for(;m;){w+=$.substring(u,m.index);const k=q.case_insensitive?m[0].toLowerCase():m[0],T=D(y,k);if(T){const[Q,ir]=T;if(M.addText(w),w="",O[k]=(O[k]||0)+1,O[k]<=od&&(ct+=ir),Q.startsWith("_"))w+=m[0];else{const sr=q.classNameAliases[Q]||Q;V(m[0],sr)}}else w+=m[0];u=y.keywordPatternRe.lastIndex,m=y.keywordPatternRe.exec($)}w+=$.substring(u),M.addText(w)}function at(){if($==="")return;let u=null;if(typeof y.subLanguage=="string"){if(!e[y.subLanguage]){M.addText($);return}u=p(y.subLanguage,$,!0,Xn[y.subLanguage]),Xn[y.subLanguage]=u._top}else u=_($,y.subLanguage.length?y.subLanguage:null);y.relevance>0&&(ct+=u.relevance),M.__addSublanguage(u._emitter,u.language)}function B(){y.subLanguage!=null?at():re(),$=""}function V(u,m){u!==""&&(M.startScope(m),M.addText(u),M.endScope())}function Gn(u,m){let w=1;const k=m.length-1;for(;w<=k;){if(!u._emit[w]){w++;continue}const T=q.classNameAliases[u[w]]||u[w],Q=m[w];T?V(Q,T):($=Q,re(),$=""),w++}}function Kn(u,m){return u.scope&&typeof u.scope=="string"&&M.openNode(q.classNameAliases[u.scope]||u.scope),u.beginScope&&(u.beginScope._wrap?(V($,q.classNameAliases[u.beginScope._wrap]||u.beginScope._wrap),$=""):u.beginScope._multi&&(Gn(u.beginScope,m),$="")),y=Object.create(u,{parent:{value:y}}),y}function Zn(u,m,w){let k=_a(u.endRe,w);if(k){if(u["on:end"]){const T=new Ni(u);u["on:end"](m,T),T.isMatchIgnored&&(k=!1)}if(k){for(;u.endsParent&&u.parent;)u=u.parent;return u}}if(u.endsWithParent)return Zn(u.parent,m,w)}function Qs(u){return y.matcher.regexIndex===0?($+=u[0],1):(Zt=!0,0)}function Ys(u){const m=u[0],w=u.rule,k=new Ni(w),T=[w.__beforeBegin,w["on:begin"]];for(const Q of T)if(Q&&(Q(u,k),k.isMatchIgnored))return Qs(m);return w.skip?$+=m:(w.excludeBegin&&($+=m),B(),!w.returnBegin&&!w.excludeBegin&&($=m)),Kn(w,u),w.returnBegin?0:m.length}function er(u){const m=u[0],w=g.substring(u.index),k=Zn(y,u,w);if(!k)return Ti;const T=y;y.endScope&&y.endScope._wrap?(B(),V(m,y.endScope._wrap)):y.endScope&&y.endScope._multi?(B(),Gn(y.endScope,u)):T.skip?$+=m:(T.returnEnd||T.excludeEnd||($+=m),B(),T.excludeEnd&&($=m));do y.scope&&M.closeNode(),!y.skip&&!y.subLanguage&&(ct+=y.relevance),y=y.parent;while(y!==k.parent);return k.starts&&Kn(k.starts,u),T.returnEnd?0:m.length}function tr(){const u=[];for(let m=y;m!==q;m=m.parent)m.scope&&u.unshift(m.scope);u.forEach(m=>M.openNode(m))}let dt={};function Jn(u,m){const w=m&&m[0];if($+=u,w==null)return B(),0;if(dt.type==="begin"&&m.type==="end"&&dt.index===m.index&&w===""){if($+=g.slice(m.index,m.index+1),!s){const k=new Error(`0 width match regex (${h})`);throw k.languageName=h,k.badRule=dt.rule,k}return 1}if(dt=m,m.type==="begin")return Ys(m);if(m.type==="illegal"&&!v){const k=new Error('Illegal lexeme "'+w+'" for mode "'+(y.scope||"<unnamed>")+'"');throw k.mode=y,k}else if(m.type==="end"){const k=er(m);if(k!==Ti)return k}if(m.type==="illegal"&&w==="")return 1;if(Kt>1e5&&Kt>m.index*3)throw new Error("potential infinite loop, way more iterations than matches");return $+=w,w.length}const q=L(h);if(!q)throw xe(o.replace("{}",h)),new Error('Unknown language: "'+h+'"');const nr=nd(q);let Gt="",y=S||nr;const Xn={},M=new l.__emitter(l);tr();let $="",ct=0,ge=0,Kt=0,Zt=!1;try{if(q.__emitTokens)q.__emitTokens(g,M);else{for(y.matcher.considerAll();;){Kt++,Zt?Zt=!1:y.matcher.considerAll(),y.matcher.lastIndex=ge;const u=y.matcher.exec(g);if(!u)break;const m=g.substring(ge,u.index),w=Jn(m,u);ge=u.index+w}Jn(g.substring(ge))}return M.finalize(),Gt=M.toHTML(),{language:h,value:Gt,relevance:ct,illegal:!1,_emitter:M,_top:y}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:h,value:dn(g),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:ge,context:g.slice(ge-100,ge+100),mode:u.mode,resultSoFar:Gt},_emitter:M};if(s)return{language:h,value:dn(g),illegal:!1,relevance:0,errorRaised:u,_emitter:M,_top:y};throw u}}function f(h){const g={value:dn(h),illegal:!1,relevance:0,_top:r,_emitter:new l.__emitter(l)};return g._emitter.addText(h),g}function _(h,g){g=g||l.languages||Object.keys(e);const v=f(h),S=g.filter(L).filter(lt).map(B=>p(B,h,!1));S.unshift(v);const O=S.sort((B,V)=>{if(B.relevance!==V.relevance)return V.relevance-B.relevance;if(B.language&&V.language){if(L(B.language).supersetOf===V.language)return 1;if(L(V.language).supersetOf===B.language)return-1}return 0}),[D,re]=O,at=D;return at.secondBest=re,at}function N(h,g,v){const S=g&&t[g]||v;h.classList.add("hljs"),h.classList.add(`language-${S}`)}function P(h){let g=null;const v=d(h);if(a(v))return;if(fe("before:highlightElement",{el:h,language:v}),h.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",h);return}if(h.children.length>0&&(l.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(h)),l.throwUnescapedHTML))throw new rd("One of your code blocks includes unescaped HTML.",h.innerHTML);g=h;const S=g.textContent,O=v?c(S,{language:v,ignoreIllegals:!0}):_(S);h.innerHTML=O.value,h.dataset.highlighted="yes",N(h,v,O.language),h.result={language:O.language,re:O.relevance,relevance:O.relevance},O.secondBest&&(h.secondBest={language:O.secondBest.language,relevance:O.secondBest.relevance}),fe("after:highlightElement",{el:h,result:O,text:S})}function b(h){l=Mi(l,h)}const Z=()=>{z(),Ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function J(){z(),Ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ue=!1;function z(){if(document.readyState==="loading"){ue=!0;return}document.querySelectorAll(l.cssSelector).forEach(P)}function X(){ue&&z()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",X,!1);function Be(h,g){let v=null;try{v=g(i)}catch(S){if(xe("Language definition for '{}' could not be registered.".replace("{}",h)),s)xe(S);else throw S;v=r}v.name||(v.name=h),e[h]=v,v.rawDefinition=g.bind(null,i),v.aliases&&pe(v.aliases,{languageName:h})}function ke(h){delete e[h];for(const g of Object.keys(t))t[g]===h&&delete t[g]}function W(){return Object.keys(e)}function L(h){return h=(h||"").toLowerCase(),e[h]||e[t[h]]}function pe(h,{languageName:g}){typeof h=="string"&&(h=[h]),h.forEach(v=>{t[v.toLowerCase()]=g})}function lt(h){const g=L(h);return g&&!g.disableAutodetect}function Ht(h){h["before:highlightBlock"]&&!h["before:highlightElement"]&&(h["before:highlightElement"]=g=>{h["before:highlightBlock"](Object.assign({block:g.el},g))}),h["after:highlightBlock"]&&!h["after:highlightElement"]&&(h["after:highlightElement"]=g=>{h["after:highlightBlock"](Object.assign({block:g.el},g))})}function Wt(h){Ht(h),n.push(h)}function Vt(h){const g=n.indexOf(h);g!==-1&&n.splice(g,1)}function fe(h,g){const v=h;n.forEach(function(S){S[v]&&S[v](g)})}function qt(h){return Ae("10.7.0","highlightBlock will be removed entirely in v12.0"),Ae("10.7.0","Please use highlightElement now."),P(h)}Object.assign(i,{highlight:c,highlightAuto:_,highlightAll:z,highlightElement:P,highlightBlock:qt,configure:b,initHighlighting:Z,initHighlightingOnLoad:J,registerLanguage:Be,unregisterLanguage:ke,listLanguages:W,getLanguage:L,registerAliases:pe,autoDetection:lt,inherit:Mi,addPlugin:Wt,removePlugin:Vt}),i.debugMode=function(){s=!1},i.safeMode=function(){s=!0},i.versionString=sd,i.regex={concat:Ee,lookahead:Ms,either:Wn,optional:va,anyNumberOfTimes:xa};for(const h in vt)typeof vt[h]=="object"&&Rs(vt[h]);return Object.assign(i,vt),i},Le=Hs({});Le.newInstance=()=>Hs({});var ld=Le;Le.HighlightJS=Le;Le.default=Le;const Ft=fa(ld),Pt="[A-Za-z$_][0-9A-Za-z$_]*",Ws=["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"],Vs=["true","false","null","undefined","NaN","Infinity"],qs=["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"],Gs=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ks=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Zs=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Js=[].concat(Ks,qs,Gs);function ad(i){const e=i.regex,t=(h,{after:g})=>{const v="</"+h[0].slice(1);return h.input.indexOf(v,g)!==-1},n=Pt,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,r={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(h,g)=>{const v=h[0].length+h.index,S=h.input[v];if(S==="<"||S===","){g.ignoreMatch();return}S===">"&&(t(h,{after:v})||g.ignoreMatch());let O;const D=h.input.substring(v);if(O=D.match(/^\s*=/)){g.ignoreMatch();return}if((O=D.match(/^\s+extends\s+/))&&O.index===0){g.ignoreMatch();return}}},l={$pattern:Pt,keyword:Ws,literal:Vs,built_in:Js,"variable.language":Zs},a="[0-9](_?[0-9])*",d=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${c})((${d})|\\.)?|(${d}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${d})\\b|\\.)?|(${d})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},_={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},N={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,f],subLanguage:"css"}},P={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[i.BACKSLASH_ESCAPE,f]},Z={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]},J=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,_,N,P,b,{match:/\$\d+/},p];f.contains=J.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(J)});const ue=[].concat(Z,f.contains),z=ue.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(ue)}]),X={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z},Be={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"}}]},ke={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:{_:[...qs,...Gs]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[X],illegal:/%/},pe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function lt(h){return e.concat("(?!",h.join("|"),")")}const Ht={match:e.concat(/\b/,lt([...Ks,"super","import"]),n,e.lookahead(/\(/)),className:"title.function",relevance:0},Wt={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Vt={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},X]},fe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+i.UNDERSCORE_IDENT_RE+")\\s*=>",qt={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(fe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[X]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:ke},illegal:/#(?![$_A-z])/,contains:[i.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,_,N,P,b,Z,{match:/\$\d+/},p,ke,{className:"attr",begin:n+e.lookahead(":"),relevance:0},qt,{begin:"("+i.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,i.REGEXP_MODE,{className:"function",begin:fe,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:l,contains:z}]}]},{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"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[X,i.inherit(i.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},Wt,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[X]},Ht,pe,Be,Vt,{match:/\$[(.]/}]}}function dd(i){const e=ad(i),t=Pt,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['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],a={$pattern:Pt,keyword:Ws.concat(l),literal:Vs,built_in:Js.concat(n),"variable.language":Zs},d={className:"meta",begin:"@"+t},c=(f,_,N)=>{const P=f.contains.findIndex(b=>b.label===_);if(P===-1)throw new Error("can not find mode to replace");f.contains.splice(P,1,N)};Object.assign(e.keywords,a),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,s,o]),c(e,"shebang",i.SHEBANG()),c(e,"use_strict",r);const p=e.contains.find(f=>f.label==="func.def");return p.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function cd(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:/\)/}),l=i.inherit(i.APOS_STRING_MODE,{className:"string"}),a=i.inherit(i.QUOTE_STRING_MODE,{className:"string"}),d={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,a,l,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,a,l]}]}]},i.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],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:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const hd=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_-]*/}}),ud=["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"],pd=["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"],fd=["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"],gd=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],md=["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 bd(i){const e=i.regex,t=hd(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_-]*",l=[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:":("+fd.join("|")+")"},{begin:":(:)?("+gd.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+md.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:pd.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ud.join("|")+")\\b"}]}}const Xs=document.createElement("style");Xs.innerText=[ua,pa].join(`
|
|
572
|
+
`);document.head.appendChild(Xs);Ft.registerLanguage("typescript",dd);Ft.registerLanguage("html",cd);Ft.registerLanguage("css",bd);function yd(...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 He(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 We(i,e){const t=document.createElement(i);return typeof e=="string"?t.innerHTML=e:e.forEach(n=>{t.appendChild(n)}),t}async function xd(i,e,t){var n,s,o;const r=e.mainContent,l=We("div",r);l.id=`example-preview-${t}`;const a=typeof e.css=="string"||(n=e.css)==null?void 0:n.label,d=typeof e.css=="string"?e.css:(s=e.css)==null?void 0:s.content,c=yd(He("Preview",l),He("HTML",wt("html",r)),...d?[He(a??"CSS",wt("css",d))]:[],...e.initializer&&e.initializer.content?[He(e.initializer.label??"TS",wt("typescript",e.initializer.content))]:[],...(e.additionalSources||[]).map(f=>He(f.label,wt(f.language,f.content))));e.description&&i.appendChild(We("div",e.description));const p=We("div",[c]);p.classList.add("example"),i.appendChild(p),d&&vd(`#${l.id}`,d),(o=e.initializer)!=null&&o.initialize&&await e.initializer.initialize(l)}function wt(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(`
|
|
573
|
+
`).trim();return i&&i!="raw"&&(t=Ft.highlight(t,{language:i}).value),We("pre",[We("code",t)])}function vd(i,e){const t=document.createElement("style");t.innerHTML=A().use(ha({prefix:i})).process(e).css,document.head.appendChild(t)}async function wd(i,e=document.body){const t=Sd(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;xd(o,r,n++)})}function _d(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 Sd(i){return i.children?_d(i):i}const Ed=`<h1 id="@cas-smartdesign/tree">@cas-smartdesign/tree</h1>
|
|
574
|
+
<p>An element for visualizing tree data structure.</p>
|
|
575
|
+
<h2 id="attributes---tree">Attributes - Tree</h2>
|
|
576
|
+
<ul>
|
|
577
|
+
<li><code>focus-index</code><ul>
|
|
578
|
+
<li>Defines the index of the focused node</li>
|
|
579
|
+
</ul>
|
|
580
|
+
</li>
|
|
581
|
+
<li><code>parent-selection-allowed</code><ul>
|
|
582
|
+
<li>Allows a parent node to have individual value, this means that in this mode if a parent node is selected its children are not selected automatically</li>
|
|
583
|
+
</ul>
|
|
584
|
+
</li>
|
|
585
|
+
<li><code>readonly</code><ul>
|
|
586
|
+
<li>Defines whether if the tree is in readonly mode<ul>
|
|
587
|
+
<li>In this mode the selection handling is disabled and the checkbox is not rendered</li>
|
|
588
|
+
</ul>
|
|
589
|
+
</li>
|
|
590
|
+
</ul>
|
|
591
|
+
</li>
|
|
592
|
+
</ul>
|
|
593
|
+
<h2 id="properties---tree">Properties - Tree</h2>
|
|
594
|
+
<ul>
|
|
595
|
+
<li><code>rootNodeCount</code> <strong><em>number (default=0)</em></strong><ul>
|
|
596
|
+
<li>Defines the number of root nodes</li>
|
|
597
|
+
</ul>
|
|
598
|
+
</li>
|
|
599
|
+
<li><code>nodes</code> <strong><em>INode[] (default=empty)</em></strong><ul>
|
|
600
|
+
<li>The tree data</li>
|
|
601
|
+
</ul>
|
|
602
|
+
</li>
|
|
603
|
+
<li><code>focusIndex</code> <strong><em>number (default=-1)</em></strong><ul>
|
|
604
|
+
<li>Reflects the corresponding attribute</li>
|
|
605
|
+
</ul>
|
|
606
|
+
</li>
|
|
607
|
+
<li><code>readonly</code> <strong><em>boolean (default=false)</em></strong><ul>
|
|
608
|
+
<li>Reflects the corresponding attribute</li>
|
|
609
|
+
</ul>
|
|
610
|
+
</li>
|
|
611
|
+
</ul>
|
|
612
|
+
<h2 id="custom-events---tree">Custom events - Tree</h2>
|
|
613
|
+
<ul>
|
|
614
|
+
<li><code>data-request</code><ul>
|
|
615
|
+
<li>This event is dispatched for loading child nodes for the actively expanded node.</li>
|
|
616
|
+
</ul>
|
|
617
|
+
</li>
|
|
618
|
+
</ul>
|
|
619
|
+
<h2 id="public-methods---tree">Public methods - Tree</h2>
|
|
620
|
+
<ul>
|
|
621
|
+
<li><code>addNodes</code><ul>
|
|
622
|
+
<li>Used for adding either root or non-root nodes to patch the missing visible parts of the tree</li>
|
|
623
|
+
</ul>
|
|
624
|
+
</li>
|
|
625
|
+
<li><code>setNodes</code><ul>
|
|
626
|
+
<li>Used for overwriting all nodes in the tree</li>
|
|
627
|
+
<li>If called frequently, this can have an impact on the performance</li>
|
|
628
|
+
</ul>
|
|
629
|
+
</li>
|
|
630
|
+
</ul>
|
|
631
|
+
<h2 id="attributes---treenode">Attributes - TreeNode</h2>
|
|
632
|
+
<ul>
|
|
633
|
+
<li><code>text</code><ul>
|
|
634
|
+
<li>Defines the text content of the node</li>
|
|
635
|
+
</ul>
|
|
636
|
+
</li>
|
|
637
|
+
<li><code>expanded</code><ul>
|
|
638
|
+
<li>Defines whether if the children of the node are visible</li>
|
|
639
|
+
</ul>
|
|
640
|
+
</li>
|
|
641
|
+
<li><code>selection-state</code><ul>
|
|
642
|
+
<li>Defines whether if the node is in <code>checked</code>, <code>unchecked</code> or <code>indeterminate</code> state<ul>
|
|
643
|
+
<li>The <code>indeterminate</code> state mean that only some, not all of it children are selected</li>
|
|
644
|
+
<li>This state can only occur when parent selection is not allowed</li>
|
|
645
|
+
</ul>
|
|
646
|
+
</li>
|
|
647
|
+
</ul>
|
|
648
|
+
</li>
|
|
649
|
+
<li><code>node-id</code><ul>
|
|
650
|
+
<li>Defines the id of the node</li>
|
|
651
|
+
</ul>
|
|
652
|
+
</li>
|
|
653
|
+
<li><code>child-count</code><ul>
|
|
654
|
+
<li>Defines the number of children of the node</li>
|
|
655
|
+
</ul>
|
|
656
|
+
</li>
|
|
657
|
+
<li><code>focused</code><ul>
|
|
658
|
+
<li>Defines whether if the node is focused</li>
|
|
659
|
+
</ul>
|
|
660
|
+
</li>
|
|
661
|
+
<li><code>readonly</code><ul>
|
|
662
|
+
<li>Defines whether if the node is in readonly mode</li>
|
|
663
|
+
</ul>
|
|
664
|
+
</li>
|
|
665
|
+
<li><code>type</code><ul>
|
|
666
|
+
<li>Defines the type of the node<ul>
|
|
667
|
+
<li>Possible value are: <code>checkbox</code>, <code>radio</code></li>
|
|
668
|
+
</ul>
|
|
669
|
+
</li>
|
|
670
|
+
</ul>
|
|
671
|
+
</li>
|
|
672
|
+
<li><code>disabled</code><ul>
|
|
673
|
+
<li>Defines whether if the input of the node is disabled</li>
|
|
674
|
+
</ul>
|
|
675
|
+
</li>
|
|
676
|
+
</ul>
|
|
677
|
+
<h2 id="properties---treenode">Properties - TreeNode</h2>
|
|
678
|
+
<ul>
|
|
679
|
+
<li><code>text</code>, <code>expanded</code>, <code>selectionState</code>, <code>nodeId</code>, <code>childCount</code>, <code>focused</code>, <code>readonly</code>, <code>type</code>, <code>disabled</code><ul>
|
|
680
|
+
<li>Reflects the corresponding attribute</li>
|
|
681
|
+
</ul>
|
|
682
|
+
</li>
|
|
683
|
+
<li><code>depth</code> <strong><em>number (default=0)</em></strong><ul>
|
|
684
|
+
<li>Defines the number of level the node is on in the tree</li>
|
|
685
|
+
</ul>
|
|
686
|
+
</li>
|
|
687
|
+
<li><code>path</code> <strong><em>string[] (default=empty)</em></strong><ul>
|
|
688
|
+
<li>Defines the path by which the node is reachable</li>
|
|
689
|
+
<li>This is used to identify the nodes as one node can be present multiple times under different parents</li>
|
|
690
|
+
</ul>
|
|
691
|
+
</li>
|
|
692
|
+
</ul>
|
|
693
|
+
<h2 id="custom-events---treenode">Custom events - TreeNode</h2>
|
|
694
|
+
<ul>
|
|
695
|
+
<li><code>expansion</code><ul>
|
|
696
|
+
<li>This event is dispatched whenever a tree node is expanded / collapsed</li>
|
|
697
|
+
</ul>
|
|
698
|
+
</li>
|
|
699
|
+
<li><code>selection</code><ul>
|
|
700
|
+
<li>This event is dispatched whenever a tree node is selected</li>
|
|
701
|
+
</ul>
|
|
702
|
+
</li>
|
|
703
|
+
</ul>
|
|
704
|
+
<h2 id="custom-css-properties---treenode">Custom CSS Properties - TreeNode</h2>
|
|
705
|
+
<ul>
|
|
706
|
+
<li><code>--sd-tree-readonly-focus-color</code><ul>
|
|
707
|
+
<li>Defines the background color of a node if it's focused in readonly mode</li>
|
|
708
|
+
</ul>
|
|
709
|
+
</li>
|
|
710
|
+
</ul>
|
|
711
|
+
<h2 id="selection">Selection</h2>
|
|
712
|
+
<h3 id="parent-selection-is-allowed">Parent selection is allowed</h3>
|
|
713
|
+
<ul>
|
|
714
|
+
<li>It is enabled by setting the <code>parent-selection-allowed</code> attribute on the tree to true</li>
|
|
715
|
+
<li>When a node is selected, then:<ul>
|
|
716
|
+
<li>For each ancestor of the node, the following happens:<ul>
|
|
717
|
+
<li>the ancestor is selected</li>
|
|
718
|
+
<li>if it is a radio button node then all its siblings are unselected</li>
|
|
719
|
+
</ul>
|
|
720
|
+
</li>
|
|
721
|
+
</ul>
|
|
722
|
+
</li>
|
|
723
|
+
<li>When a node is unselected, then:<ul>
|
|
724
|
+
<li>For each ancestor of the node, until an enabled one is found, the ancestor is unselected</li>
|
|
725
|
+
</ul>
|
|
726
|
+
</li>
|
|
727
|
+
</ul>
|
|
728
|
+
<h3 id="parent-selection-is-not-allowed">Parent selection is not allowed</h3>
|
|
729
|
+
<ul>
|
|
730
|
+
<li>It is enabled by setting the <code>parent-selection-allowed</code> attribute on the tree to false or removing it</li>
|
|
731
|
+
<li>When a node is selected, then:<ul>
|
|
732
|
+
<li>The selection state of all its ancestors are updated</li>
|
|
733
|
+
<li>All its descendants are selected</li>
|
|
734
|
+
</ul>
|
|
735
|
+
</li>
|
|
736
|
+
<li>When a node is unselected, then:<ul>
|
|
737
|
+
<li>The selection state of all its ancestors are updated</li>
|
|
738
|
+
<li>All its descendants are unselected</li>
|
|
739
|
+
</ul>
|
|
740
|
+
</li>
|
|
741
|
+
<li>When updating the selection state of a parent node<ul>
|
|
742
|
+
<li>If a node has all of its descendants selected, then it is selected</li>
|
|
743
|
+
<li>If a node has only some of its descendants selected, then it is in indeterminate state</li>
|
|
744
|
+
<li>If a node has none of its descendants selected, then it is unselected</li>
|
|
745
|
+
</ul>
|
|
746
|
+
</li>
|
|
747
|
+
</ul>
|
|
748
|
+
<h2 id="examples">Examples</h2>
|
|
749
|
+
`;document.querySelector("#markdown-container").innerHTML=Ed;wd(Object.assign({"./examples/1_declarative_checkbox/index.ts":dr,"./examples/2_declarative_radiobutton/index.ts":fr,"./examples/3_lazy_loading/index.ts":Er}));export{ro as C,In as R,vo as T,go as f,io as i};
|
|
750
|
+
function __vite__mapDeps(indexes) {
|
|
751
|
+
if (!__vite__mapDeps.viteFileDeps) {
|
|
752
|
+
__vite__mapDeps.viteFileDeps = []
|
|
753
|
+
}
|
|
754
|
+
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
755
|
+
}
|