@projectwallace/css-parser 0.18.4 → 0.18.5

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.
@@ -0,0 +1,534 @@
1
+ import { t as Lexer } from "./tokenize-DK24ACbY.js";
2
+ import { l as CSSDataArena } from "./arena-DKhfTFT5.js";
3
+ import { a as is_whitespace, n as is_combinator, o as str_equals } from "./parse-dimension-ouWXNHdx.js";
4
+ import { t as CSSNode } from "./css-node-DKr6cufe.js";
5
+ import { ANplusBParser } from "./parse-anplusb.js";
6
+ //#region src/parse-utils.ts
7
+ /** @internal */
8
+ function skip_whitespace_forward(source, pos, end) {
9
+ while (pos < end && is_whitespace(source.charCodeAt(pos))) pos++;
10
+ return pos;
11
+ }
12
+ /** @internal */
13
+ function skip_whitespace_and_comments_forward(source, pos, end) {
14
+ while (pos < end) {
15
+ let ch = source.charCodeAt(pos);
16
+ if (is_whitespace(ch)) {
17
+ pos++;
18
+ continue;
19
+ }
20
+ if (ch === 47 && pos + 1 < end && source.charCodeAt(pos + 1) === 42) {
21
+ pos += 2;
22
+ while (pos < end) {
23
+ if (source.charCodeAt(pos) === 42 && pos + 1 < end && source.charCodeAt(pos + 1) === 47) {
24
+ pos += 2;
25
+ break;
26
+ }
27
+ pos++;
28
+ }
29
+ continue;
30
+ }
31
+ break;
32
+ }
33
+ return pos;
34
+ }
35
+ /** @internal */
36
+ function skip_whitespace_and_comments_backward(source, pos, start) {
37
+ while (pos > start) {
38
+ let ch = source.charCodeAt(pos - 1);
39
+ if (is_whitespace(ch)) {
40
+ pos--;
41
+ continue;
42
+ }
43
+ if (pos >= 2 && ch === 47 && source.charCodeAt(pos - 2) === 42) {
44
+ pos -= 2;
45
+ while (pos > start) {
46
+ if (pos >= 2 && source.charCodeAt(pos - 2) === 47 && source.charCodeAt(pos - 1) === 42) {
47
+ pos -= 2;
48
+ break;
49
+ }
50
+ pos--;
51
+ }
52
+ continue;
53
+ }
54
+ break;
55
+ }
56
+ return pos;
57
+ }
58
+ /**
59
+ * Trims whitespace and CSS comments from both ends; returns null if the range is only whitespace/comments.
60
+ * @internal
61
+ */
62
+ function trim_boundaries(source, start, end) {
63
+ start = skip_whitespace_and_comments_forward(source, start, end);
64
+ end = skip_whitespace_and_comments_backward(source, end, start);
65
+ if (start >= end) return null;
66
+ return [start, end];
67
+ }
68
+ /** Find the position of the first ':' at parenthesis depth 0 in [start, end). Returns -1 if not found. @internal */
69
+ function find_colon_at_depth_zero(source, start, end) {
70
+ let depth = 0;
71
+ for (let i = start; i < end; i++) {
72
+ let ch = source.charCodeAt(i);
73
+ if (ch === 40) depth++;
74
+ else if (ch === 41) depth--;
75
+ else if (ch === 58 && depth === 0) return i;
76
+ }
77
+ return -1;
78
+ }
79
+ //#endregion
80
+ //#region src/parse-selector.ts
81
+ /** @internal */
82
+ var SelectorParser = class {
83
+ lexer;
84
+ arena;
85
+ source;
86
+ selector_end;
87
+ anplusb_parser;
88
+ constructor(arena, source) {
89
+ this.arena = arena;
90
+ this.source = source;
91
+ this.lexer = new Lexer(source);
92
+ this.selector_end = 0;
93
+ this.anplusb_parser = new ANplusBParser(arena, source);
94
+ }
95
+ parse_selector(start, end, line = 1, column = 1, allow_relative = true) {
96
+ this.selector_end = end;
97
+ this.lexer.seek(start, line, column);
98
+ return this.parse_selector_list(allow_relative);
99
+ }
100
+ parse_selector_list(allow_relative = true) {
101
+ let first_selector = 0;
102
+ let last_selector = 0;
103
+ let list_start = this.lexer.pos;
104
+ let list_line = this.lexer.line;
105
+ let list_column = this.lexer.column;
106
+ while (this.lexer.pos < this.selector_end) {
107
+ let selector_start = this.lexer.pos;
108
+ let selector_line = this.lexer.line;
109
+ let selector_column = this.lexer.column;
110
+ let complex_selector = this.parse_complex_selector(allow_relative);
111
+ if (complex_selector !== null) {
112
+ let selector_wrapper = this.arena.create_node(5, selector_start, this.lexer.pos - selector_start, selector_line, selector_column);
113
+ this.arena.set_content_start_delta(selector_wrapper, 0);
114
+ this.arena.set_content_length(selector_wrapper, this.lexer.pos - selector_start);
115
+ this.arena.set_first_child(selector_wrapper, complex_selector);
116
+ if (first_selector === 0) first_selector = selector_wrapper;
117
+ else this.arena.set_next_sibling(last_selector, selector_wrapper);
118
+ last_selector = selector_wrapper;
119
+ }
120
+ this.skip_whitespace();
121
+ if (this.lexer.pos >= this.selector_end) break;
122
+ this.lexer.next_token_fast(false);
123
+ if (this.lexer.token_type === 18) {
124
+ this.skip_whitespace();
125
+ continue;
126
+ } else break;
127
+ }
128
+ if (first_selector !== 0) {
129
+ let list_node = this.arena.create_node(20, list_start, this.lexer.pos - list_start, list_line, list_column);
130
+ this.arena.set_first_child(list_node, first_selector);
131
+ return list_node;
132
+ }
133
+ return null;
134
+ }
135
+ parse_complex_selector(allow_relative = true) {
136
+ let first_component = 0;
137
+ let chain_tail = 0;
138
+ this.skip_whitespace();
139
+ if (allow_relative && this.lexer.pos < this.selector_end) {
140
+ const saved = this.lexer.save_position();
141
+ this.lexer.next_token_fast(false);
142
+ if (this.lexer.token_type === 9) {
143
+ let ch = this.source.charCodeAt(this.lexer.token_start);
144
+ if (ch === 62 || ch === 43 || ch === 126) {
145
+ let combinator = this.create_node(27, this.lexer.token_start, this.lexer.token_end);
146
+ first_component = combinator;
147
+ chain_tail = combinator;
148
+ this.skip_whitespace();
149
+ } else this.lexer.restore_position(saved);
150
+ } else this.lexer.restore_position(saved);
151
+ }
152
+ while (this.lexer.pos < this.selector_end) {
153
+ let compound = this.parse_compound_selector();
154
+ if (compound === null) break;
155
+ if (chain_tail === 0) first_component = compound;
156
+ else this.arena.set_next_sibling(chain_tail, compound);
157
+ chain_tail = this.arena.get_last_sibling(compound);
158
+ let combinator = this.try_parse_combinator();
159
+ if (combinator !== null) {
160
+ this.arena.set_next_sibling(chain_tail, combinator);
161
+ chain_tail = combinator;
162
+ this.skip_whitespace();
163
+ continue;
164
+ }
165
+ const saved = this.lexer.save_position();
166
+ this.skip_whitespace();
167
+ if (this.lexer.pos >= this.selector_end) {
168
+ this.lexer.restore_position(saved);
169
+ break;
170
+ }
171
+ this.lexer.next_token_fast(false);
172
+ if (this.lexer.token_type === 18 || this.lexer.pos >= this.selector_end) {
173
+ this.lexer.restore_position(saved);
174
+ break;
175
+ }
176
+ this.lexer.restore_position(saved);
177
+ break;
178
+ }
179
+ return first_component === 0 ? null : first_component;
180
+ }
181
+ parse_compound_selector() {
182
+ let first_part = 0;
183
+ let last_part = 0;
184
+ while (this.lexer.pos < this.selector_end) {
185
+ const saved = this.lexer.save_position();
186
+ this.lexer.next_token_fast(false);
187
+ if (this.lexer.token_start >= this.selector_end) break;
188
+ if (this.lexer.token_type === 26) break;
189
+ let part = this.parse_simple_selector();
190
+ if (part === null) {
191
+ this.lexer.restore_position(saved);
192
+ break;
193
+ }
194
+ if (first_part === 0) first_part = part;
195
+ else this.arena.set_next_sibling(last_part, part);
196
+ last_part = part;
197
+ }
198
+ return first_part === 0 ? null : first_part;
199
+ }
200
+ parse_simple_selector() {
201
+ let token_type = this.lexer.token_type;
202
+ let start = this.lexer.token_start;
203
+ let end = this.lexer.token_end;
204
+ switch (token_type) {
205
+ case 1: return this.parse_type_or_namespace_selector(start, end);
206
+ case 4: return this.create_node(23, start, end);
207
+ case 9: {
208
+ let ch = this.source.charCodeAt(start);
209
+ if (ch === 46) return this.parse_class_selector(start);
210
+ else if (ch === 42) return this.parse_universal_or_namespace_selector(start, end);
211
+ else if (ch === 38) return this.create_node(29, start, end);
212
+ else if (ch === 124) return this.parse_empty_namespace_selector(start);
213
+ return null;
214
+ }
215
+ case 19: return this.parse_attribute_selector(start);
216
+ case 16: return this.parse_pseudo(start);
217
+ case 2: return this.parse_pseudo_function(start, end);
218
+ case 11: return this.create_node(12, start, end);
219
+ case 13:
220
+ case 18: return null;
221
+ default: return null;
222
+ }
223
+ }
224
+ parse_namespace_local_part(selector_start, namespace_start, namespace_prefix_length) {
225
+ const saved = this.lexer.save_position();
226
+ this.lexer.next_token_fast(false);
227
+ let node_type;
228
+ if (this.lexer.token_type === 1) node_type = 21;
229
+ else if (this.lexer.token_type === 9 && this.source.charCodeAt(this.lexer.token_start) === 42) node_type = 28;
230
+ else {
231
+ this.lexer.restore_position(saved);
232
+ return null;
233
+ }
234
+ let local_start = this.lexer.token_start;
235
+ let local_end = this.lexer.token_end;
236
+ let node = this.create_node(node_type, selector_start, local_end);
237
+ this.arena.set_flag(node, 16);
238
+ this.arena.set_content_start_delta(node, local_start - selector_start);
239
+ this.arena.set_content_length(node, local_end - local_start);
240
+ this.arena.set_value_start_delta(node, namespace_start - selector_start);
241
+ this.arena.set_value_length(node, namespace_prefix_length);
242
+ return node;
243
+ }
244
+ parse_type_or_namespace_selector(start, end) {
245
+ if (this.source.charCodeAt(start) === 45 && this.source.charCodeAt(start + 1) === 45) return null;
246
+ const saved = this.lexer.save_position();
247
+ this.skip_whitespace();
248
+ if (this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) === 124) {
249
+ this.lexer.pos++;
250
+ let node = this.parse_namespace_local_part(start, start, end - start);
251
+ if (node !== null) return node;
252
+ }
253
+ this.lexer.restore_position(saved);
254
+ return this.create_node(21, start, end);
255
+ }
256
+ parse_universal_or_namespace_selector(start, end) {
257
+ const saved = this.lexer.save_position();
258
+ this.skip_whitespace();
259
+ if (this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) === 124) {
260
+ this.lexer.pos++;
261
+ let node = this.parse_namespace_local_part(start, start, end - start);
262
+ if (node !== null) return node;
263
+ }
264
+ this.lexer.restore_position(saved);
265
+ return this.create_node(28, start, end);
266
+ }
267
+ parse_empty_namespace_selector(start) {
268
+ return this.parse_namespace_local_part(start, start, 0);
269
+ }
270
+ try_parse_combinator() {
271
+ const saved_whitespace_start = this.lexer.save_position();
272
+ let has_whitespace = this.lexer.pos < this.selector_end;
273
+ this.skip_whitespace();
274
+ has_whitespace = has_whitespace && this.lexer.pos > saved_whitespace_start.pos;
275
+ if (this.lexer.pos >= this.selector_end) {
276
+ this.lexer.restore_position(saved_whitespace_start);
277
+ return null;
278
+ }
279
+ this.lexer.next_token_fast(false);
280
+ if (this.lexer.token_type === 9) {
281
+ let ch = this.source.charCodeAt(this.lexer.token_start);
282
+ if (is_combinator(ch)) return this.create_node(27, this.lexer.token_start, this.lexer.token_end);
283
+ }
284
+ if (has_whitespace) {
285
+ this.lexer.restore_position(saved_whitespace_start);
286
+ this.skip_whitespace();
287
+ return this.create_node(27, saved_whitespace_start.pos, this.lexer.pos, saved_whitespace_start.line, saved_whitespace_start.column);
288
+ }
289
+ this.lexer.restore_position(saved_whitespace_start);
290
+ return null;
291
+ }
292
+ parse_class_selector(dot_pos) {
293
+ const saved = this.lexer.save_position();
294
+ this.lexer.next_token_fast(false);
295
+ if (this.lexer.token_type !== 1) {
296
+ this.lexer.restore_position(saved);
297
+ return null;
298
+ }
299
+ return this.create_node(22, dot_pos, this.lexer.token_end);
300
+ }
301
+ parse_attribute_selector(start) {
302
+ let bracket_depth = 1;
303
+ let end = this.lexer.token_end;
304
+ let content_start = start + 1;
305
+ let content_end = content_start;
306
+ while (this.lexer.pos < this.selector_end && bracket_depth > 0) {
307
+ this.lexer.next_token_fast(false);
308
+ let token_type = this.lexer.token_type;
309
+ if (token_type === 19) bracket_depth++;
310
+ else if (token_type === 20) {
311
+ bracket_depth--;
312
+ if (bracket_depth === 0) {
313
+ content_end = this.lexer.token_start;
314
+ end = this.lexer.token_end;
315
+ break;
316
+ }
317
+ }
318
+ }
319
+ let node = this.create_node(24, start, end);
320
+ this.parse_attribute_content(node, content_start, content_end);
321
+ return node;
322
+ }
323
+ parse_attribute_content(node, start, end) {
324
+ start = skip_whitespace_and_comments_forward(this.source, start, end);
325
+ end = skip_whitespace_and_comments_backward(this.source, end, start);
326
+ if (start >= end) return;
327
+ let name_start = start;
328
+ let name_end = start;
329
+ let operator_end = -1;
330
+ let value_start = -1;
331
+ let value_end = -1;
332
+ while (name_end < end) {
333
+ let ch = this.source.charCodeAt(name_end);
334
+ if (is_whitespace(ch) || ch === 61 || ch === 126 || ch === 124 || ch === 94 || ch === 36 || ch === 42) break;
335
+ name_end++;
336
+ }
337
+ if (name_end > name_start) {
338
+ this.arena.set_content_start_delta(node, name_start - this.arena.get_start_offset(node));
339
+ this.arena.set_content_length(node, name_end - name_start);
340
+ }
341
+ let pos = skip_whitespace_and_comments_forward(this.source, name_end, end);
342
+ if (pos >= end) return;
343
+ let ch1 = this.source.charCodeAt(pos);
344
+ let ch2 = pos + 1 < end ? this.source.charCodeAt(pos + 1) : 0;
345
+ if (ch1 === 61) operator_end = pos + 1;
346
+ else if (ch1 === 126 && ch2 === 61) operator_end = pos + 2;
347
+ else if (ch1 === 124 && ch2 === 61) operator_end = pos + 2;
348
+ else if (ch1 === 94 && ch2 === 61) operator_end = pos + 2;
349
+ else if (ch1 === 36 && ch2 === 61) operator_end = pos + 2;
350
+ else if (ch1 === 42 && ch2 === 61) operator_end = pos + 2;
351
+ else return;
352
+ pos = skip_whitespace_and_comments_forward(this.source, operator_end, end);
353
+ if (pos >= end) return;
354
+ value_start = pos;
355
+ let ch = this.source.charCodeAt(pos);
356
+ if (ch === 39 || ch === 34) {
357
+ let quote = ch;
358
+ value_start = pos;
359
+ pos++;
360
+ while (pos < end) {
361
+ let c = this.source.charCodeAt(pos);
362
+ if (c === quote) {
363
+ pos++;
364
+ break;
365
+ }
366
+ if (c === 92) pos += 2;
367
+ else pos++;
368
+ }
369
+ } else while (pos < end) {
370
+ let c = this.source.charCodeAt(pos);
371
+ if (is_whitespace(c)) break;
372
+ pos++;
373
+ }
374
+ value_end = pos;
375
+ if (value_end > value_start) {
376
+ this.arena.set_value_start_delta(node, value_start - this.arena.get_start_offset(node));
377
+ this.arena.set_value_length(node, value_end - value_start);
378
+ }
379
+ }
380
+ parse_pseudo(start) {
381
+ const saved = this.lexer.save_position();
382
+ const saved_ws = this.lexer.save_position();
383
+ this.skip_whitespace();
384
+ let is_pseudo_element = false;
385
+ if (this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) === 58) {
386
+ is_pseudo_element = true;
387
+ this.lexer.pos++;
388
+ } else this.lexer.restore_position(saved_ws);
389
+ this.lexer.next_token_fast(false);
390
+ let token_type = this.lexer.token_type;
391
+ if (token_type === 1) {
392
+ let node = this.create_node(is_pseudo_element ? 26 : 25, start, this.lexer.token_end);
393
+ this.arena.set_content_start_delta(node, this.lexer.token_start - start);
394
+ this.arena.set_content_length(node, this.lexer.token_end - this.lexer.token_start);
395
+ return node;
396
+ } else if (token_type === 2) return this.parse_pseudo_function_after_colon(start, is_pseudo_element);
397
+ this.lexer.restore_position(saved);
398
+ return null;
399
+ }
400
+ parse_pseudo_function(_start, _end) {
401
+ return null;
402
+ }
403
+ parse_pseudo_function_after_colon(start, is_pseudo_element) {
404
+ let func_name_start = this.lexer.token_start;
405
+ let func_name_end = this.lexer.token_end - 1;
406
+ let content_start = this.lexer.pos;
407
+ let content_end = content_start;
408
+ let paren_depth = 1;
409
+ let end = this.lexer.token_end;
410
+ while (this.lexer.pos < this.selector_end && paren_depth > 0) {
411
+ this.lexer.next_token_fast(false);
412
+ let token_type = this.lexer.token_type;
413
+ if (token_type === 21 || token_type === 2) paren_depth++;
414
+ else if (token_type === 22) {
415
+ paren_depth--;
416
+ if (paren_depth === 0) {
417
+ content_end = this.lexer.token_start;
418
+ end = this.lexer.token_end;
419
+ break;
420
+ }
421
+ }
422
+ }
423
+ let node = this.create_node(is_pseudo_element ? 26 : 25, start, end);
424
+ this.arena.set_content_start_delta(node, func_name_start - start);
425
+ this.arena.set_content_length(node, func_name_end - func_name_start);
426
+ this.arena.set_flag(node, 64);
427
+ if (content_end > content_start) {
428
+ let func_name_substr = this.source.substring(func_name_start, func_name_end);
429
+ if (this.is_nth_pseudo(func_name_substr)) {
430
+ let child = this.parse_nth_expression(content_start, content_end);
431
+ if (child !== null) this.arena.set_first_child(node, child);
432
+ } else if (str_equals("lang", func_name_substr)) this.parse_lang_identifiers(content_start, content_end, node);
433
+ else {
434
+ let saved_selector_end = this.selector_end;
435
+ const saved = this.lexer.save_position();
436
+ let allow_relative = str_equals("has", func_name_substr);
437
+ let child_selector = this.parse_selector(content_start, content_end, this.lexer.line, this.lexer.column, allow_relative);
438
+ this.selector_end = saved_selector_end;
439
+ this.lexer.restore_position(saved);
440
+ if (child_selector !== null) this.arena.set_first_child(node, child_selector);
441
+ }
442
+ }
443
+ return node;
444
+ }
445
+ is_nth_pseudo(name) {
446
+ return str_equals("nth-child", name) || str_equals("nth-last-child", name) || str_equals("nth-of-type", name) || str_equals("nth-last-of-type", name) || str_equals("nth-col", name) || str_equals("nth-last-col", name);
447
+ }
448
+ parse_lang_identifiers(start, end, parent_node) {
449
+ const saved_position = this.lexer.save_position();
450
+ this.lexer.seek(start, this.lexer.line, this.lexer.column);
451
+ let saved_selector_end = this.selector_end;
452
+ this.selector_end = end;
453
+ let first_child = null;
454
+ let last_child = null;
455
+ while (this.lexer.pos < end) {
456
+ this.lexer.next_token_fast(false);
457
+ let token_type = this.lexer.token_type;
458
+ let token_start = this.lexer.token_start;
459
+ let token_end = this.lexer.token_end;
460
+ if (token_type === 13) continue;
461
+ if (token_type === 18) continue;
462
+ if (token_type === 5 || token_type === 1) {
463
+ let lang_node = this.create_node(56, token_start, token_end);
464
+ if (first_child === null) first_child = lang_node;
465
+ if (last_child !== null) this.arena.set_next_sibling(last_child, lang_node);
466
+ last_child = lang_node;
467
+ }
468
+ if (this.lexer.pos >= end) break;
469
+ }
470
+ if (first_child !== null) this.arena.set_first_child(parent_node, first_child);
471
+ this.selector_end = saved_selector_end;
472
+ this.lexer.restore_position(saved_position);
473
+ }
474
+ parse_nth_expression(start, end) {
475
+ let of_index = this.find_of_keyword(start, end);
476
+ let anplusb_parser = this.anplusb_parser;
477
+ if (of_index === -1) return anplusb_parser.parse_anplusb(start, end, this.lexer.line);
478
+ let anplusb_node = anplusb_parser.parse_anplusb(start, of_index, this.lexer.line);
479
+ let selector_start = of_index + 2;
480
+ selector_start = skip_whitespace_forward(this.source, selector_start, end);
481
+ let saved_selector_end = this.selector_end;
482
+ const saved = this.lexer.save_position();
483
+ this.selector_end = end;
484
+ this.lexer.pos = selector_start;
485
+ let selector_list = this.parse_selector_list();
486
+ this.selector_end = saved_selector_end;
487
+ this.lexer.restore_position(saved);
488
+ let of_node = this.arena.create_node(31, start, end - start, this.lexer.line, 1);
489
+ if (anplusb_node !== null && selector_list !== null) {
490
+ this.arena.set_first_child(of_node, anplusb_node);
491
+ this.arena.set_next_sibling(anplusb_node, selector_list);
492
+ } else if (anplusb_node !== null) this.arena.set_first_child(of_node, anplusb_node);
493
+ return of_node;
494
+ }
495
+ find_of_keyword(start, end) {
496
+ let i = start;
497
+ while (i < end - 1) {
498
+ i = skip_whitespace_and_comments_forward(this.source, i, end);
499
+ if (i >= end - 1) break;
500
+ let ch1 = this.source.charCodeAt(i);
501
+ let ch2 = this.source.charCodeAt(i + 1);
502
+ if ((ch1 === 111 || ch1 === 79) && (ch2 === 102 || ch2 === 70)) {
503
+ let before_ok = i === start || is_whitespace(this.source.charCodeAt(i - 1));
504
+ let after_ok = i + 2 >= end || is_whitespace(this.source.charCodeAt(i + 2));
505
+ if (before_ok && after_ok) return i;
506
+ }
507
+ i++;
508
+ }
509
+ return -1;
510
+ }
511
+ create_node(type, start, end, line = this.lexer.token_line, column = this.lexer.token_column) {
512
+ let node = this.arena.create_node(type, start, end - start, line, column);
513
+ this.arena.set_content_start_delta(node, 0);
514
+ this.arena.set_content_length(node, end - start);
515
+ return node;
516
+ }
517
+ skip_whitespace() {
518
+ this.lexer.skip_whitespace_in_range(this.selector_end);
519
+ }
520
+ };
521
+ function parse_selector_list(source) {
522
+ const arena = new CSSDataArena(CSSDataArena.capacity_for_source(source.length));
523
+ const selector_index = new SelectorParser(arena, source).parse_selector(0, source.length);
524
+ if (selector_index === null) {
525
+ const empty = arena.create_node(20, 0, 0, 1, 1);
526
+ return new CSSNode(arena, source, empty);
527
+ }
528
+ return new CSSNode(arena, source, selector_index);
529
+ }
530
+ function parse_selector(source) {
531
+ return parse_selector_list(source).first_child;
532
+ }
533
+ //#endregion
534
+ export { skip_whitespace_and_comments_backward as a, find_colon_at_depth_zero as i, parse_selector as n, skip_whitespace_and_comments_forward as o, parse_selector_list as r, trim_boundaries as s, SelectorParser as t };
@@ -1,5 +1,5 @@
1
- import { l as CSSDataArena } from "./arena-C-uRgG5-.js";
2
- import { I as Selector, L as SelectorList } from "./node-types-Dh1wEDRK.js";
1
+ import { l as CSSDataArena } from "./arena-DcrS77hW.js";
2
+ import { L as Selector, R as SelectorList } from "./node-types-u3Sbl3_p.js";
3
3
  //#region src/parse-selector.d.ts
4
4
  /** @internal */
5
5
  declare class SelectorParser {