iobroker.mywebui 1.37.20 → 1.37.22
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/io-package.json +1 -1
- package/package.json +1 -1
- package/www/dist/frontend/config/importDescriptions.json +2 -2
- package/www/node_modules/@node-projects/css-parser/LICENSE +11 -0
- package/www/node_modules/@node-projects/css-parser/README.md +161 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssParseError.d.ts +8 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssParseError.js +15 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssPosition.d.ts +25 -0
- package/www/node_modules/@node-projects/css-parser/dist/CssPosition.js +13 -0
- package/www/node_modules/@node-projects/css-parser/dist/index-min.js +56 -0
- package/www/node_modules/@node-projects/css-parser/dist/index-min.js.map +7 -0
- package/www/node_modules/@node-projects/css-parser/dist/index.d.ts +12 -0
- package/www/node_modules/@node-projects/css-parser/dist/index.js +8 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/index.d.ts +8 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/index.js +1293 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/lexer.d.ts +118 -0
- package/www/node_modules/@node-projects/css-parser/dist/parse/lexer.js +248 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/compiler.d.ts +172 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/compiler.js +732 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/index.d.ts +5 -0
- package/www/node_modules/@node-projects/css-parser/dist/stringify/index.js +5 -0
- package/www/node_modules/@node-projects/css-parser/dist/type.d.ts +205 -0
- package/www/node_modules/@node-projects/css-parser/dist/type.js +31 -0
- package/www/node_modules/@node-projects/css-parser/dist/utils/stringSearch.d.ts +53 -0
- package/www/node_modules/@node-projects/css-parser/dist/utils/stringSearch.js +166 -0
- package/www/node_modules/@node-projects/css-parser/docs/API.md +362 -0
- package/www/node_modules/@node-projects/css-parser/docs/AST.md +417 -0
- package/www/node_modules/@node-projects/css-parser/docs/CHANGELOG.md +205 -0
- package/www/node_modules/@node-projects/css-parser/docs/EXAMPLES.md +497 -0
- package/www/node_modules/@node-projects/css-parser/package.json +66 -0
package/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"file": "/mywebui/dist/frontend/common/Common.globals.d.ts"
|
|
5
5
|
},
|
|
6
6
|
{
|
|
7
|
-
"name": "inmemory://model/@
|
|
8
|
-
"file": "/mywebui/node_modules/@
|
|
7
|
+
"name": "inmemory://model/@gokturk413/base-custom-webcomponent.d.ts",
|
|
8
|
+
"file": "/mywebui/node_modules/@gokturk413/base-custom-webcomponent/dist/BaseCustomWebComponent.d.ts"
|
|
9
9
|
}
|
|
10
10
|
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
|
4
|
+
Copyright (c) 2022 Jean-Philippe Zolesio <holblin@gmail.com>
|
|
5
|
+
Copyright (c) 2026 Jochen Kühner <jochen.kuehner@gmx.de>
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# @node-projects/css-parser
|
|
2
|
+
|
|
3
|
+
> A modern CSS parser and stringifier with TypeScript support
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/%40adobe%2Fcss-tools)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Parse CSS into an Abstract Syntax Tree (AST) and convert it back to CSS with configurable formatting. Built with TypeScript for type safety and modern JavaScript features.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @node-projects/css-parser
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import { parse, stringify } from '@node-projects/css-parser'
|
|
20
|
+
|
|
21
|
+
// Parse CSS to AST
|
|
22
|
+
const ast = parse('body { font-size: 12px; }')
|
|
23
|
+
|
|
24
|
+
// Stringify AST back to CSS
|
|
25
|
+
const css = stringify(ast)
|
|
26
|
+
// => "body { font-size: 12px; }"
|
|
27
|
+
|
|
28
|
+
// Pretty print with custom indentation
|
|
29
|
+
const formatted = stringify(ast, { indent: ' ' })
|
|
30
|
+
// => "body {\n font-size: 12px;\n}"
|
|
31
|
+
|
|
32
|
+
// Minify output
|
|
33
|
+
const minified = stringify(ast, { compress: true })
|
|
34
|
+
// => "body{font-size:12px}"
|
|
35
|
+
|
|
36
|
+
// Identity mode: round-trip CSS exactly as written
|
|
37
|
+
const original = 'body { font-size: 12px; }'
|
|
38
|
+
const ast2 = parse(original, { preserveFormatting: true })
|
|
39
|
+
stringify(ast2, { identity: true }) === original // true
|
|
40
|
+
|
|
41
|
+
// Remove empty rules
|
|
42
|
+
const ast3 = parse('.empty {} .keep { color: red; }')
|
|
43
|
+
stringify(ast3, { removeEmptyRules: true })
|
|
44
|
+
// => ".keep {\n color: red;\n}"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
### `parse(code, options?)`
|
|
50
|
+
|
|
51
|
+
Parses CSS code and returns an Abstract Syntax Tree (AST).
|
|
52
|
+
|
|
53
|
+
**Parameters:**
|
|
54
|
+
- `code` (string) - The CSS code to parse
|
|
55
|
+
- `options` (object, optional) - Parsing options
|
|
56
|
+
- `silent` (boolean) - Silently fail on parse errors instead of throwing
|
|
57
|
+
- `source` (string) - File path for better error reporting
|
|
58
|
+
- `preserveFormatting` (boolean) - Insert whitespace AST nodes and store raw formatting properties for identity round-trip (default: `false`)
|
|
59
|
+
|
|
60
|
+
**Returns:** `CssStylesheetAST` - The parsed CSS as an AST
|
|
61
|
+
|
|
62
|
+
### `stringify(ast, options?)`
|
|
63
|
+
|
|
64
|
+
Converts a CSS AST back to CSS string with configurable formatting.
|
|
65
|
+
|
|
66
|
+
**Parameters:**
|
|
67
|
+
- `ast` (CssStylesheetAST) - The CSS AST to stringify
|
|
68
|
+
- `options` (object, optional) - Stringification options
|
|
69
|
+
- `indent` (string) - Indentation string (default: `' '`)
|
|
70
|
+
- `compress` (boolean) - Whether to compress/minify the output (default: `false`)
|
|
71
|
+
- `identity` (boolean) - Reproduce the original CSS exactly as parsed; requires `preserveFormatting` during parsing (default: `false`)
|
|
72
|
+
- `removeEmptyRules` (boolean) - Remove rules with empty declaration blocks (default: `false`)
|
|
73
|
+
|
|
74
|
+
**Returns:** `string` - The formatted CSS string
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
- **Complete CSS Support**: All standard CSS features including selectors, properties, values, at-rules, and comments
|
|
79
|
+
- **TypeScript Support**: Full type definitions for all AST nodes and functions
|
|
80
|
+
- **Error Handling**: Configurable error handling with detailed position information
|
|
81
|
+
- **Formatting Options**: Pretty print, minify, identity (round-trip), or custom formatting
|
|
82
|
+
- **Identity Round-Trip**: Parse and stringify CSS back to the exact original formatting
|
|
83
|
+
- **Empty Rule Removal**: Optionally strip rules with empty declaration blocks
|
|
84
|
+
- **Performance Optimized**: Efficient parsing and stringification for large CSS files
|
|
85
|
+
- **Source Maps**: Track original source positions for debugging and tooling
|
|
86
|
+
|
|
87
|
+
### Supported CSS Features
|
|
88
|
+
|
|
89
|
+
- **Selectors**: Element, class, ID, attribute, pseudo-class, pseudo-element selectors
|
|
90
|
+
- **Properties**: All standard CSS properties and custom properties
|
|
91
|
+
- **Values**: Colors, lengths, percentages, functions, calc(), etc.
|
|
92
|
+
- **At-rules**: @media, @keyframes, @import, @charset, @namespace, @font-face, @page, @document, @supports, @container, @layer, @starting-style, @host, @custom-media
|
|
93
|
+
- **Comments**: Both /* */ and // comments
|
|
94
|
+
- **Whitespace**: Preserves formatting information
|
|
95
|
+
- **Vendor prefixes**: Supports vendor-prefixed at-rules and properties
|
|
96
|
+
- **Nested rules**: Media queries, supports, containers, etc.
|
|
97
|
+
- **Complex selectors**: Combinators, pseudo-selectors, attribute selectors
|
|
98
|
+
|
|
99
|
+
## Examples
|
|
100
|
+
|
|
101
|
+
### Error Handling
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import { parse } from '@adobe/css-tools'
|
|
105
|
+
|
|
106
|
+
const malformedCss = `
|
|
107
|
+
body { color: red; }
|
|
108
|
+
{ color: blue; } /* Missing selector */
|
|
109
|
+
.valid { background: green; }
|
|
110
|
+
`
|
|
111
|
+
|
|
112
|
+
// Parse with silent error handling
|
|
113
|
+
const result = parse(malformedCss, { silent: true })
|
|
114
|
+
|
|
115
|
+
// Check for parsing errors
|
|
116
|
+
if (result.stylesheet.parsingErrors) {
|
|
117
|
+
console.log('Parsing errors:', result.stylesheet.parsingErrors.length)
|
|
118
|
+
result.stylesheet.parsingErrors.forEach(error => {
|
|
119
|
+
console.log(`Error at line ${error.line}: ${error.message}`)
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Valid rules are still parsed
|
|
124
|
+
console.log('Valid rules:', result.stylesheet.rules.length)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Source Tracking
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
import { parse } from '@adobe/css-tools'
|
|
131
|
+
|
|
132
|
+
const css = 'body { color: red; }'
|
|
133
|
+
const ast = parse(css, { source: 'styles.css' })
|
|
134
|
+
|
|
135
|
+
// Position information is available
|
|
136
|
+
const rule = ast.stylesheet.rules[0]
|
|
137
|
+
console.log(rule.position?.source) // "styles.css"
|
|
138
|
+
console.log(rule.position?.start) // { line: 1, column: 1 }
|
|
139
|
+
console.log(rule.position?.end) // { line: 1, column: 20 }
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
For more examples, see the [Examples documentation](docs/EXAMPLES.md).
|
|
143
|
+
|
|
144
|
+
## Performance
|
|
145
|
+
|
|
146
|
+
The library is optimized for performance and can handle large CSS files efficiently. For benchmarking information, see the `benchmark/` directory in the source code.
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
- [API Reference](docs/API.md) - Complete API documentation
|
|
151
|
+
- [AST Structure](docs/AST.md) - Detailed AST node types and structure
|
|
152
|
+
- [Examples](docs/EXAMPLES.md) - Comprehensive usage examples
|
|
153
|
+
- [Changelog](docs/CHANGELOG.md) - Version history and changes
|
|
154
|
+
|
|
155
|
+
## Background
|
|
156
|
+
|
|
157
|
+
This is a fork of the npm `@adobe/css-tools` package, with modern improvements including TypeScript support, enhanced performance, and security updates. It provides a robust foundation for CSS tooling, preprocessing, and analysis.
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default class CssParseError extends Error {
|
|
2
|
+
readonly reason: string;
|
|
3
|
+
readonly filename?: string;
|
|
4
|
+
readonly line: number;
|
|
5
|
+
readonly column: number;
|
|
6
|
+
readonly source: string;
|
|
7
|
+
constructor(filename: string, msg: string, lineno: number, column: number, css: string);
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default class CssParseError extends Error {
|
|
2
|
+
reason;
|
|
3
|
+
filename;
|
|
4
|
+
line;
|
|
5
|
+
column;
|
|
6
|
+
source;
|
|
7
|
+
constructor(filename, msg, lineno, column, css) {
|
|
8
|
+
super(`${filename}:${lineno}:${column}: ${msg}`);
|
|
9
|
+
this.reason = msg;
|
|
10
|
+
this.filename = filename;
|
|
11
|
+
this.line = lineno;
|
|
12
|
+
this.column = column;
|
|
13
|
+
this.source = css;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store position information for a node
|
|
3
|
+
*/
|
|
4
|
+
export default class Position {
|
|
5
|
+
start: {
|
|
6
|
+
line: number;
|
|
7
|
+
column: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
};
|
|
10
|
+
end: {
|
|
11
|
+
line: number;
|
|
12
|
+
column: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
};
|
|
15
|
+
source?: string;
|
|
16
|
+
constructor(start: {
|
|
17
|
+
line: number;
|
|
18
|
+
column: number;
|
|
19
|
+
offset?: number;
|
|
20
|
+
}, end: {
|
|
21
|
+
line: number;
|
|
22
|
+
column: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}, source: string);
|
|
25
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var v=class extends Error{reason;filename;line;column;source;constructor(t,e,i,u,c){super(`${t}:${i}:${u}: ${e}`),this.reason=e,this.filename=t,this.line=i,this.column=u,this.source=c}};var A=class{start;end;source;constructor(t,e,i){this.start=t,this.end=e,this.source=i}};var h;(function(n){n.stylesheet="stylesheet",n.rule="rule",n.declaration="declaration",n.comment="comment",n.whitespace="whitespace",n.atRule="at-rule",n.container="container",n.charset="charset",n.counterStyle="counter-style",n.document="document",n.customMedia="custom-media",n.fontFace="font-face",n.fontFeatureValues="font-feature-values",n.host="host",n.import="import",n.keyframes="keyframes",n.keyframe="keyframe",n.layer="layer",n.media="media",n.namespace="namespace",n.page="page",n.pageMarginBox="page-margin-box",n.positionTry="position-try",n.property="property",n.scope="scope",n.startingStyle="starting-style",n.supports="supports",n.viewTransition="view-transition"})(h||(h={}));var U=(n,t,e)=>{let i=e??0,u=1e4;do{let c=n.indexOf("\\",i);for(let y=0;y<t.length;y++){let l=n.indexOf(t[y],i);l!==-1&&(c===-1||l<c)&&(c=l)}if(c===-1)return-1;if(n.charCodeAt(c)===92)i=c+2,u--;else return c}while(u>0);throw new Error("Too many escaping")},R=(n,t,e)=>{let i=e??0,u=1e4;do{let c=-1;for(let w=0;w<t.length;w++){let b=n.indexOf(t[w],i);b!==-1&&(c===-1||b<c)&&(c=b)}let y=n.indexOf("(",i);y!==-1&&(c===-1||y<c)&&(c=y);let l=n.indexOf('"',i);l!==-1&&(c===-1||l<c)&&(c=l);let _=n.indexOf("'",i);_!==-1&&(c===-1||_<c)&&(c=_);let P=n.indexOf("\\",i);if(P!==-1&&(c===-1||P<c)&&(c=P),c===-1)return-1;switch(n.charCodeAt(c)){case 92:i=c+2;break;case 40:{let w=R(n,[")"],c+1);if(w===-1)return-1;i=w+1}break;case 34:{let w=U(n,['"'],c+1);if(w===-1)return-1;i=w+1}break;case 39:{let w=U(n,["'"],c+1);if(w===-1)return-1;i=w+1}break;default:return c}u--}while(u>0);throw new Error("Too many escaping")},D=(n,t)=>{let e=[],i=0;for(;i<n.length;){let u=R(n,t,i);if(u===-1)return e.push(n.substring(i)),e;e.push(n.substring(i,u)),i=u+1}return e};var W=class{input;pos;lineno;column;constructor(t){this.input=t,this.pos=0,this.lineno=1,this.column=1}get hasMore(){return this.pos<this.input.length}charCodeAt(t=0){return this.input.charCodeAt(this.pos+t)}charAt(t=0){return this.input[this.pos+t]??""}get remaining(){return this.input.slice(this.pos)}consume(t){let e=this.pos,i=e+t;return this._advanceRange(e,i),this.input.slice(e,i)}consumeTo(t){return this.consume(t-this.pos)}matchRegex(t){t.lastIndex=this.pos;let e=t.exec(this.input);return e&&this._advanceRange(this.pos,this.pos+e[0].length),e}skipWhitespace(){let t=this.input,e=t.length;for(;this.pos<e;){let i=t.charCodeAt(this.pos);if(i===10)this.lineno++,this.column=1,this.pos++;else if(i===32||i===9||i===13||i===12)this.column++,this.pos++;else break}}tryOpenBrace(){return this.input.charCodeAt(this.pos)!==123?!1:(this.pos++,this.column++,this.skipWhitespace(),!0)}tryCloseBrace(){return this.input.charCodeAt(this.pos)!==125?!1:(this.pos++,this.column++,!0)}tryColon(){return this.input.charCodeAt(this.pos)!==58?!1:(this.pos++,this.column++,this.skipWhitespace(),!0)}skipSemicolonAndWhitespace(){let t=this.input,e=t.length;for(;this.pos<e;){let i=t.charCodeAt(this.pos);if(i===10)this.lineno++,this.column=1,this.pos++;else if(i===59||i===32||i===9||i===13||i===12)this.column++,this.pos++;else break}}tryCommaAndWhitespace(){return this.input.charCodeAt(this.pos)!==44?!1:(this.pos++,this.column++,this.skipWhitespace(),!0)}getPosition(){return{line:this.lineno,column:this.column}}_advanceRange(t,e){let i=this.input;for(let u=t;u<e;u++)i.charCodeAt(u)===10?(this.lineno++,this.column=1):this.column++;this.pos=e}};var N=/\/\*[^]*?(?:\*\/|$)/g,Ot=/\/\*[^]*?\*\//y,$t=/(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/y,K=/((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/y,Ct=/@([-\w]+)?keyframes\s*/y,_t=/([-\w]+)\s*/y,Rt=/@supports *([^{]+)/y,At=/@host\s*/y,bt=/@container *([^{]+)/y,vt=/@layer *([^{;@]+)/y,Bt=/@media *([^{]+)/y,Vt=/@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/y,Et=/@page */y,Wt=/@([-\w]+)?document *([^{]+)/y,Mt=/@font-face\s*/y,Ft=/@property\s+(--[-\w]+)\s*/y,Nt=/@counter-style\s+([-\w]+)\s*/y,Lt=/@font-feature-values\s+([^{]+)/y,Tt=/@scope\s*([^{]*)/y,It=/@view-transition\s*/y,Qt=/@position-try\s+(--[-\w]+)\s*/y,jt=/@starting-style\s*/y,Ht=/@([-\w]+)\s*/y,Ut=["top-left-corner","top-left","top-center","top-right","top-right-corner","bottom-left-corner","bottom-left","bottom-center","bottom-right","bottom-right-corner","left-top","left-middle","left-bottom","right-top","right-middle","right-bottom"],Dt=new RegExp(`@(${Ut.join("|")})(?![\\w-])\\s*`,"y"),Kt=/@import\s*((?::?[^;'"]|"(?:\\"|[^"])*?"|'(?:\\'|[^'])*?')+)(?:;|$)/y,Gt=/@charset\s*((?::?[^;'"]|"(?:\\"|[^"])*?"|'(?:\\'|[^'])*?')+)(?:;|$)/y,Xt=/@namespace\s*((?::?[^;'"]|"(?:\\"|[^"])*?"|'(?:\\'|[^'])*?')+)(?:;|$)/y,qt=(n,t)=>{t=t||{};let e=new W(n),i=t.preserveFormatting??!1;function u(r,s,o){if(!i)return r;let a=[],p=s;for(let m of r){let f=m.position?.start?.offset;if(f!=null&&f>p){let S=n.slice(p,f);S&&a.push({type:h.whitespace,value:S})}a.push(m);let d=m.position?.end?.offset;d!=null&&(p=d)}if(p<o){let m=n.slice(p,o);m&&a.push({type:h.whitespace,value:m})}return a}function c(){let r=i?{...e.getPosition(),offset:e.pos}:e.getPosition();return s=>{let o=i?{...e.getPosition(),offset:e.pos}:e.getPosition();return s.position=new A(r,o,t?.source||""),e.skipWhitespace(),s}}let y=[];function l(r){let s=new v(t?.source||"",r,e.lineno,e.column,e.remaining);if(t?.silent)y.push(s);else throw s}function _(){let r=b();return{type:h.stylesheet,stylesheet:{source:t?.source,rules:u(r,0,n.length),parsingErrors:y}}}function P(){return e.tryOpenBrace()}function O(){let r=e.pos+1;return{ok:e.tryOpenBrace(),afterOpen:r}}function w(){return e.tryCloseBrace()}function b(){let r,s=[];for(e.skipWhitespace(),g(s);e.hasMore;){if(e.charCodeAt()===125){if(t?.silent){l("extra '}'"),e.consume(1),e.skipWhitespace(),g(s);continue}break}if(r=E()||F(),r)s.push(r),g(s);else{if(t?.silent){e.consume(1),e.skipWhitespace(),g(s);continue}break}}return s}function V(){e.skipWhitespace()}function g(r){r=r||[];let s=I();for(;s;)r.push(s),s=I();return r}function I(){let r=c();if(e.charCodeAt()!==47||e.charCodeAt(1)!==42)return;let s=e.matchRegex(Ot);return s?r({type:h.comment,comment:s[0].slice(2,-2)}):l("End of comment missing")}function Q(){let r=R(e.input,["{"],e.pos);if(r===-1||r===e.pos)return;let s=e.consumeTo(r),o=x(s).replace(N,"");return D(o,[","]).map(a=>x(a))}function k(){let r=c(),s=i?e.pos:0,o=e.matchRegex($t);if(!o)return;let p=x(o[0]).replace(N,"");if(!e.tryColon())return l("property missing ':'");let m=i?e.pos:0,f="",d="",S=R(e.input,[";","}"],e.pos);S!==-1&&(d=e.consumeTo(S),f=x(d).replace(N,""));let C=r({type:h.declaration,property:p,value:f,...i?{rawBetween:n.slice(s+p.length,m),rawValue:d}:{}});return e.skipSemicolonAndWhitespace(),C}function z(){let r=i?e.pos+1:0;if(!P()){l("missing '{'");return}let s=[];g(s);let o=k();for(;o;)s.push(o),g(s),o=k();for(;t?.silent&&e.hasMore&&e.charCodeAt()!==125;){let p=e.input.indexOf(";",e.pos),m=e.input.indexOf("}",e.pos);if(p!==-1&&(m===-1||p<m))for(e.consumeTo(p+1),V(),g(s),o=k();o;)s.push(o),g(s),o=k();else break}let a=i?e.pos:0;if(!w()){l("missing '}'");return}return{decls:u(s,r,a),afterOpen:r,beforeClose:a}}function j(){let r=e.pos,s=R(e.input,["{"],r);if(s===-1)return!1;let o=R(e.input,[";"],r),a=R(e.input,["}"],r);return!(o!==-1&&o<s||a!==-1&&a<s)}function J(){let r=[],s=i?e.pos+1:0;if(!P()){l("missing '{'");return}for(g(r);e.hasMore&&e.charCodeAt()!==125;){if(e.charCodeAt()===64){let p=E();if(p){r.push(p),g(r);continue}}if(j()){let p=F();if(p){r.push(p),g(r);continue}}let a=k();if(a){r.push(a),g(r);continue}if(t?.silent){let p=e.input.indexOf(";",e.pos),m=e.input.indexOf("}",e.pos);if(p!==-1&&(m===-1||p<m)){e.consumeTo(p+1),V(),g(r);continue}}break}let o=i?e.pos:0;if(!w()){l("missing '}'");return}return{items:u(r,s,o),afterOpen:s,beforeClose:o}}function $(r){let s=[];for(V(),g(s);e.hasMore&&e.charCodeAt()!==125;){if(e.charCodeAt()===64){let a=E();if(a){s.push(a),g(s);continue}}if(j()){let a=F();if(a){s.push(a),g(s);continue}}let o=k();if(o){s.push(o),g(s);continue}if(t?.silent){let a=e.input.indexOf(";",e.pos),p=e.input.indexOf("}",e.pos);if(a!==-1&&(p===-1||a<p)){e.consumeTo(a+1),V(),g(s);continue}}break}if(i&&r!=null){let o=e.pos;return u(s,r,o)}return s}function H(){let r=[],s=c(),o=i?e.pos:0,a=e.matchRegex(K);for(;a;)r.push(a[1]),e.tryCommaAndWhitespace(),a=e.matchRegex(K);if(!r.length)return;let p=i?e.pos:0,m=z();if(m)return s({type:h.keyframe,values:r,declarations:m.decls,...i?{rawPrelude:n.slice(o,p)}:{}})}function Y(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Ct);if(!o)return;let a=o[1],p=e.matchRegex(_t);if(!p)return l("@keyframes missing name");let m=p[1],f=i?e.pos:0,d=i?e.pos+1:0;if(!P())return l("@keyframes missing '{'");let S=g(),C=H();for(;C;)S.push(C),g(S),C=H();let kt=i?e.pos:0;return w()?r({type:h.keyframes,name:m,vendor:a,keyframes:u(S,d,kt),...i?{rawPrelude:n.slice(s,f)}:{}}):l("@keyframes missing '}'")}function Z(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Rt);if(!o)return;let a=x(o[1]),p=i?e.pos:0,{ok:m,afterOpen:f}=O();if(!m)return l("@supports missing '{'");let d=$(i?f:void 0);return w()?r({type:h.supports,supports:a,rules:d,...i?{rawPrelude:n.slice(s,p)}:{}}):l("@supports missing '}'")}function tt(){let r=c(),s=i?e.pos:0;if(!e.matchRegex(At))return;let a=i?e.pos:0,{ok:p,afterOpen:m}=O();if(!p)return l("@host missing '{'");let f=$(i?m:void 0);return w()?r({type:h.host,rules:f,...i?{rawPrelude:n.slice(s,a)}:{}}):l("@host missing '}'")}function et(){let r=c(),s=i?e.pos:0,o=e.matchRegex(bt);if(!o)return;let a=x(o[1]),p=i?e.pos:0,{ok:m,afterOpen:f}=O();if(!m)return l("@container missing '{'");let d=$(i?f:void 0);return w()?r({type:h.container,container:a,rules:d,...i?{rawPrelude:n.slice(s,p)}:{}}):l("@container missing '}'")}function it(){let r=c(),s=i?e.pos:0,o=e.matchRegex(vt);if(!o)return;let a=x(o[1]),p=i?e.pos:0,{ok:m,afterOpen:f}=O();if(!m){e.charCodeAt()===59&&e.consume(1);let S=i?n.slice(s,e.pos):void 0;return r({type:h.layer,layer:a,...S?{rawSource:S}:{}})}let d=$(i?f:void 0);return w()?r({type:h.layer,layer:a,rules:d,...i?{rawPrelude:n.slice(s,p)}:{}}):l("@layer missing '}'")}function st(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Bt);if(!o)return;let a=x(o[1]),p=i?e.pos:0,{ok:m,afterOpen:f}=O();if(!m)return l("@media missing '{'");let d=$(i?f:void 0);return w()?r({type:h.media,media:a,rules:d,...i?{rawPrelude:n.slice(s,p)}:{}}):l("@media missing '}'")}function rt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Vt);if(!o)return;let a=i?n.slice(s,e.pos):void 0;return r({type:h.customMedia,name:x(o[1]),media:x(o[2]),...a?{rawSource:a}:{}})}function nt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Dt);if(!o)return;let a=o[1],p=i?e.pos:0,m=i?e.pos+1:0;if(!P())return l(`@${a} missing '{'`);let f=g(),d=k();for(;d;)f.push(d),g(f),d=k();let S=i?e.pos:0;return w()?r({type:h.pageMarginBox,name:a,declarations:u(f,m,S),...i?{rawPrelude:n.slice(s,p)}:{}}):l(`@${a} missing '}'`)}function ot(){let r=c(),s=i?e.pos:0;if(!e.matchRegex(Et))return;let a=Q()||[],p=i?e.pos:0,m=i?e.pos+1:0;if(!P())return l("@page missing '{'");let f=[];for(g(f);e.hasMore&&e.charCodeAt()!==125;){if(e.charCodeAt()===64){let C=E();if(C){f.push(C),g(f);continue}}let S=k();if(S){f.push(S),g(f);continue}break}let d=i?e.pos:0;return w()?r({type:h.page,selectors:a,declarations:u(f,m,d),...i?{rawPrelude:n.slice(s,p)}:{}}):l("@page missing '}'")}function ct(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Wt);if(!o)return;let a=x(o[1]),p=x(o[2]),m=i?e.pos:0,{ok:f,afterOpen:d}=O();if(!f)return l("@document missing '{'");let S=$(i?d:void 0);return w()?r({type:h.document,document:p,vendor:a,rules:S,...i?{rawPrelude:n.slice(s,m)}:{}}):l("@document missing '}'")}function at(){let r=c(),s=i?e.pos:0;if(!e.matchRegex(Mt))return;let a=i?e.pos:0,p=i?e.pos+1:0;if(!P())return l("@font-face missing '{'");let m=g(),f=k();for(;f;)m.push(f),g(m),f=k();let d=i?e.pos:0;return w()?r({type:h.fontFace,declarations:u(m,p,d),...i?{rawPrelude:n.slice(s,a)}:{}}):l("@font-face missing '}'")}function ut(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Ft);if(!o)return;let a=o[1],p=i?e.pos:0,m=i?e.pos+1:0;if(!P())return l("@property missing '{'");let f=g(),d=k();for(;d;)f.push(d),g(f),d=k();let S=i?e.pos:0;return w()?r({type:h.property,name:a,declarations:u(f,m,S),...i?{rawPrelude:n.slice(s,p)}:{}}):l("@property missing '}'")}function ht(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Nt);if(!o)return;let a=o[1],p=i?e.pos:0,m=i?e.pos+1:0;if(!P())return l("@counter-style missing '{'");let f=g(),d=k();for(;d;)f.push(d),g(f),d=k();let S=i?e.pos:0;return w()?r({type:h.counterStyle,name:a,declarations:u(f,m,S),...i?{rawPrelude:n.slice(s,p)}:{}}):l("@counter-style missing '}'")}function pt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Lt);if(!o)return;let a=x(o[1]),p=i?e.pos:0,{ok:m,afterOpen:f}=O();if(!m)return l("@font-feature-values missing '{'");let d=$(i?f:void 0);return w()?r({type:h.fontFeatureValues,fontFamily:a,rules:d,...i?{rawPrelude:n.slice(s,p)}:{}}):l("@font-feature-values missing '}'")}function lt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Tt);if(!o)return;let a=x(o[1]),p=i?e.pos:0,{ok:m,afterOpen:f}=O();if(!m)return l("@scope missing '{'");let d=$(i?f:void 0);return w()?r({type:h.scope,scope:a,rules:d,...i?{rawPrelude:n.slice(s,p)}:{}}):l("@scope missing '}'")}function mt(){let r=c(),s=i?e.pos:0;if(!e.matchRegex(It))return;let a=i?e.pos:0,p=i?e.pos+1:0;if(!P())return l("@view-transition missing '{'");let m=g(),f=k();for(;f;)m.push(f),g(m),f=k();let d=i?e.pos:0;return w()?r({type:h.viewTransition,declarations:u(m,p,d),...i?{rawPrelude:n.slice(s,a)}:{}}):l("@view-transition missing '}'")}function ft(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Qt);if(!o)return;let a=o[1],p=i?e.pos:0,m=i?e.pos+1:0;if(!P())return l("@position-try missing '{'");let f=g(),d=k();for(;d;)f.push(d),g(f),d=k();let S=i?e.pos:0;return w()?r({type:h.positionTry,name:a,declarations:u(f,m,S),...i?{rawPrelude:n.slice(s,p)}:{}}):l("@position-try missing '}'")}function dt(){let r=c(),s=i?e.pos:0;if(!e.matchRegex(jt))return;let a=i?e.pos:0,{ok:p,afterOpen:m}=O();if(!p)return l("@starting-style missing '{'");let f=$(i?m:void 0);return w()?r({type:h.startingStyle,rules:f,...i?{rawPrelude:n.slice(s,a)}:{}}):l("@starting-style missing '}'")}function yt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Kt);if(!o)return;let a=i?n.slice(s,e.pos):void 0;return r({type:h.import,import:o[1].trim(),...a?{rawSource:a}:{}})}function gt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Gt);if(!o)return;let a=i?n.slice(s,e.pos):void 0;return r({type:h.charset,charset:o[1].trim(),...a?{rawSource:a}:{}})}function wt(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Xt);if(!o)return;let a=i?n.slice(s,e.pos):void 0;return r({type:h.namespace,namespace:o[1].trim(),...a?{rawSource:a}:{}})}function St(){let r=c(),s=i?e.pos:0,o=e.matchRegex(Ht);if(!o)return;let a=o[1],p="",m=R(e.input,["{",";"],e.pos);m!==-1&&m>e.pos&&(p=x(e.consumeTo(m)));let f=i?e.pos:0,{ok:d,afterOpen:S}=O();if(d){let C=$(i?S:void 0);return w()?r({type:h.atRule,name:a,prelude:p,rules:C,...i?{rawPrelude:n.slice(s,f)}:{}}):l(`@${a} missing '}'`)}return e.skipSemicolonAndWhitespace(),r({type:h.atRule,name:a,prelude:p})}function E(){if(e.charCodeAt()===64)return Y()||st()||rt()||Z()||yt()||gt()||wt()||ct()||ot()||tt()||at()||pt()||et()||dt()||it()||ut()||ht()||lt()||mt()||ft()||nt()||St()}function F(){let r=c(),s=i?e.pos:0,o=Q();if(!o)return l("selector missing");let a=i?e.pos:0;g();let p=J();return r({type:h.rule,selectors:o,declarations:p?.items||[],...i?{rawPrelude:n.slice(s,a)}:{}})}return L(_())};function x(n){return n?n.trim():""}function L(n,t){let e=n&&typeof n.type=="string",i=e?n:t;for(let u in n){let c=n[u];if(Array.isArray(c))for(let y=0;y<c.length;y++)L(c[y],i);else c&&typeof c=="object"&&!(c instanceof A)&&L(c,i)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}var G=qt;var T=class{level=0;indentation=" ";compress=!1;identity=!1;removeEmptyRules=!1;constructor(t){typeof t?.indent=="string"&&(this.indentation=t?.indent),t?.compress&&(this.compress=!0),t?.identity&&(this.identity=!0),t?.removeEmptyRules&&(this.removeEmptyRules=!0)}emit(t,e){return t}indent(t){return this.level=this.level||1,t?(this.level+=t,""):this.level>1?this.indentation.repeat(this.level-1):""}visit(t){switch(t.type){case h.stylesheet:return this.stylesheet(t);case h.rule:return this.rule(t);case h.declaration:return this.declaration(t);case h.comment:return this.comment(t);case h.whitespace:return this.whitespace(t);case h.container:return this.container(t);case h.charset:return this.charset(t);case h.counterStyle:return this.counterStyle(t);case h.document:return this.document(t);case h.customMedia:return this.customMedia(t);case h.fontFace:return this.fontFace(t);case h.fontFeatureValues:return this.fontFeatureValues(t);case h.host:return this.host(t);case h.import:return this.import(t);case h.keyframes:return this.keyframes(t);case h.keyframe:return this.keyframe(t);case h.layer:return this.layer(t);case h.media:return this.media(t);case h.namespace:return this.namespace(t);case h.page:return this.page(t);case h.pageMarginBox:return this.pageMarginBox(t);case h.positionTry:return this.positionTry(t);case h.property:return this.property(t);case h.scope:return this.scope(t);case h.startingStyle:return this.startingStyle(t);case h.supports:return this.supports(t);case h.viewTransition:return this.viewTransition(t);case h.atRule:return this.genericAtRule(t)}}mapVisit(t,e){let i="";e=e||"";for(let u=0,c=t.length;u<c;u++){let y=this.visit(t[u]);y&&(e&&i&&(i+=this.emit(e)),i+=y)}return i}rulesBlock(t,e,i,u){if(this.identity&&u){this.indent(1);let y=this.emit(u,i)+this.emit("{")+this.identityVisitBlock(this.filterEmptyRules(e),"rules")+this.emit("}");return this.indent(-1),y}let c=this.filterEmptyRules(this.stripWhitespace(e));return this.compress?this.emit(t,i)+this.emit("{")+this.mapVisit(c)+this.emit("}"):this.emit(`${this.indent()}${t}`,i)+this.emit(` {
|
|
2
|
+
${this.indent(1)}`)+this.mapVisit(c,`
|
|
3
|
+
|
|
4
|
+
`)+this.emit(`
|
|
5
|
+
${this.indent(-1)}${this.indent()}}`)}declsBlock(t,e,i,u){if(this.identity&&u){this.indent(1);let y=this.emit(u,i)+this.emit("{")+this.identityVisitBlock(e,"decls")+this.emit("}");return this.indent(-1),y}let c=this.stripWhitespace(e);return this.compress?this.emit(t,i)+this.emit("{")+this.mapVisit(c)+this.emit("}"):this.emit(`${t} `,i)+this.emit(`{
|
|
6
|
+
`)+this.emit(this.indent(1))+this.mapVisit(c,`
|
|
7
|
+
`)+this.emit(this.indent(-1))+this.emit(`
|
|
8
|
+
}`)}compile(t){return this.identity?this.identityCompile(t):this.compress?this.filterEmptyRules(this.stripWhitespace(t.stylesheet.rules)).map(this.visit,this).join(""):this.stylesheet(t)}identityCompile(t){let e=t.stylesheet.rules;return e.some(u=>u.type===h.whitespace)?this.identityVisitBlock(e,"stylesheet"):this.stylesheet(t)}stylesheet(t){return this.mapVisit(this.filterEmptyRules(this.stripWhitespace(t.stylesheet.rules)),`
|
|
9
|
+
|
|
10
|
+
`)}stripWhitespace(t){return t.filter(e=>e.type!==h.whitespace)}filterEmptyRules(t){return this.removeEmptyRules?t.filter(e=>e.type===h.rule?e.declarations.filter(u=>u.type!==h.whitespace).length>0:!0):t}isNewNode(t){switch(t.type){case h.whitespace:return!1;case h.comment:return!t.position;case h.declaration:return t.rawBetween==null;case h.rule:return t.rawPrelude==null;default:return"rawPrelude"in t?!t.rawPrelude:"rawSource"in t?!t.rawSource:!t.position}}identityVisitBlock(t,e){let i=this.filterEmptyRules(t);if(!i.some(y=>this.isNewNode(y)))return this.mapVisit(i);let u="",c=e==="rules"||e==="stylesheet";for(let y=0;y<i.length;y++){let l=i[y];if(!this.isNewNode(l)){u+=this.visit(l);continue}let _=u.lastIndexOf(`
|
|
11
|
+
`);_>=0&&u.slice(_+1).trim()===""?u=u.slice(0,_+1):(u.length===0&&e!=="stylesheet"||u.length>0)&&(u+=`
|
|
12
|
+
`),c&&u.length>1&&!u.endsWith(`
|
|
13
|
+
|
|
14
|
+
`)&&(u+=`
|
|
15
|
+
`);let O=this.visit(l);O&&(u+=O)}if(e!=="stylesheet"){let y=[...i].reverse().find(l=>l.type!==h.whitespace);y&&this.isNewNode(y)&&u.length>0&&!u.endsWith(`
|
|
16
|
+
`)&&(u+=`
|
|
17
|
+
`,this.indent(-1),u+=this.indent(),this.indent(1))}return u}whitespace(t){return this.identity?this.emit(t.value):""}comment(t){if(this.compress)return this.emit("",t.position);let e=this.identity&&t.position?"":this.indent();return this.emit(`${e}/*${t.comment}*/`,t.position)}container(t){return this.rulesBlock(`@container ${t.container}`,t.rules,t.position,t.rawPrelude)}layer(t){if(this.identity&&t.rawPrelude&&t.rules){this.indent(1);let i=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(this.filterEmptyRules(t.rules),"rules")+this.emit("}");return this.indent(-1),i}if(this.identity&&!t.rules&&t.rawSource)return this.emit(t.rawSource,t.position);let e=t.rules?this.stripWhitespace(t.rules):void 0;return this.compress?this.emit(`@layer ${t.layer}`,t.position)+(e?this.emit("{")+this.mapVisit(e)+this.emit("}"):";"):this.emit(`${this.indent()}@layer ${t.layer}`,t.position)+(e?this.emit(` {
|
|
18
|
+
${this.indent(1)}`)+this.mapVisit(e,`
|
|
19
|
+
|
|
20
|
+
`)+this.emit(`
|
|
21
|
+
${this.indent(-1)}${this.indent()}}`):";")}import(t){return this.identity&&t.rawSource?this.emit(t.rawSource,t.position):this.emit(`@import ${t.import};`,t.position)}media(t){return this.rulesBlock(`@media ${t.media}`,t.rules,t.position,t.rawPrelude)}document(t){let e=`@${t.vendor||""}document ${t.document}`;if(this.identity&&t.rawPrelude){this.indent(1);let u=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(this.filterEmptyRules(t.rules),"rules")+this.emit("}");return this.indent(-1),u}let i=this.stripWhitespace(t.rules);return this.compress?this.emit(e,t.position)+this.emit("{")+this.mapVisit(i)+this.emit("}"):this.emit(e,t.position)+this.emit(` {
|
|
22
|
+
${this.indent(1)}`)+this.mapVisit(i,`
|
|
23
|
+
|
|
24
|
+
`)+this.emit(`${this.indent(-1)}
|
|
25
|
+
}`)}charset(t){return this.identity&&t.rawSource?this.emit(t.rawSource,t.position):this.emit(`@charset ${t.charset};`,t.position)}namespace(t){return this.identity&&t.rawSource?this.emit(t.rawSource,t.position):this.emit(`@namespace ${t.namespace};`,t.position)}startingStyle(t){return this.rulesBlock("@starting-style",t.rules,t.position,t.rawPrelude)}supports(t){return this.rulesBlock(`@supports ${t.supports}`,t.rules,t.position,t.rawPrelude)}keyframes(t){if(this.identity&&t.rawPrelude){this.indent(1);let i=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(t.keyframes,"rules")+this.emit("}");return this.indent(-1),i}let e=this.stripWhitespace(t.keyframes);return this.compress?this.emit(`@${t.vendor||""}keyframes ${t.name}`,t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}"):this.emit(`@${t.vendor||""}keyframes ${t.name}`,t.position)+this.emit(` {
|
|
26
|
+
${this.indent(1)}`)+this.mapVisit(e,`
|
|
27
|
+
`)+this.emit(`${this.indent(-1)}}`)}keyframe(t){let e=t.declarations;if(this.identity&&t.rawPrelude){this.indent(1);let u=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(e,"decls")+this.emit("}");return this.indent(-1),u}let i=this.stripWhitespace(e);return this.compress?this.emit(t.values.join(","),t.position)+this.emit("{")+this.mapVisit(i)+this.emit("}"):this.emit(this.indent())+this.emit(t.values.join(", "),t.position)+this.emit(` {
|
|
28
|
+
${this.indent(1)}`)+this.mapVisit(i,`
|
|
29
|
+
`)+this.emit(`${this.indent(-1)}
|
|
30
|
+
${this.indent()}}
|
|
31
|
+
`)}page(t){if(this.identity&&t.rawPrelude){this.indent(1);let u=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(t.declarations,"decls")+this.emit("}");return this.indent(-1),u}let e=this.stripWhitespace(t.declarations);if(this.compress){let u=t.selectors.length?t.selectors.join(", "):"";return this.emit(`@page ${u}`,t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}")}let i=t.selectors.length?`${t.selectors.join(", ")} `:"";return this.emit(`@page ${i}`,t.position)+this.emit(`{
|
|
32
|
+
`)+this.emit(this.indent(1))+this.mapVisit(e,`
|
|
33
|
+
`)+this.emit(this.indent(-1))+this.emit(`
|
|
34
|
+
}`)}pageMarginBox(t){if(this.identity&&t.rawPrelude){this.indent(1);let i=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(t.declarations,"decls")+this.emit("}");return this.indent(-1),i}let e=this.stripWhitespace(t.declarations);return this.compress?this.emit(`@${t.name}`,t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}"):this.emit(`${this.indent()}@${t.name} `,t.position)+this.emit(`{
|
|
35
|
+
`)+this.emit(this.indent(1))+this.mapVisit(e,`
|
|
36
|
+
`)+this.emit(this.indent(-1))+this.emit(`
|
|
37
|
+
${this.indent()}}`)}fontFace(t){return this.declsBlock("@font-face",t.declarations,t.position,t.rawPrelude)}host(t){if(this.identity&&t.rawPrelude){this.indent(1);let i=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(this.filterEmptyRules(t.rules),"rules")+this.emit("}");return this.indent(-1),i}let e=this.stripWhitespace(t.rules);return this.compress?this.emit("@host",t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}"):this.emit("@host",t.position)+this.emit(` {
|
|
38
|
+
${this.indent(1)}`)+this.mapVisit(e,`
|
|
39
|
+
|
|
40
|
+
`)+this.emit(`${this.indent(-1)}
|
|
41
|
+
}`)}customMedia(t){return this.identity&&t.rawSource?this.emit(t.rawSource,t.position):this.emit(`@custom-media ${t.name} ${t.media};`,t.position)}property(t){return this.declsBlock(`@property ${t.name}`,t.declarations,t.position,t.rawPrelude)}counterStyle(t){return this.declsBlock(`@counter-style ${t.name}`,t.declarations,t.position,t.rawPrelude)}fontFeatureValues(t){return this.rulesBlock(`@font-feature-values ${t.fontFamily}`,t.rules,t.position,t.rawPrelude)}scope(t){if(this.identity&&t.rawPrelude){this.indent(1);let i=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(this.filterEmptyRules(t.rules),"rules")+this.emit("}");return this.indent(-1),i}let e=t.scope?` ${t.scope}`:"";return this.rulesBlock(`@scope${e}`,this.stripWhitespace(t.rules),t.position)}viewTransition(t){return this.declsBlock("@view-transition",t.declarations,t.position,t.rawPrelude)}positionTry(t){return this.declsBlock(`@position-try ${t.name}`,t.declarations,t.position,t.rawPrelude)}genericAtRule(t){if(this.identity&&t.rawPrelude&&t.rules){this.indent(1);let y=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(this.filterEmptyRules(t.rules),"rules")+this.emit("}");return this.indent(-1),y}let e=t.prelude?` ${t.prelude}`:"",i=t.rules?this.stripWhitespace(t.rules):void 0;if(this.compress)return this.emit(`@${t.name}${e}`,t.position)+(i?this.emit("{")+this.mapVisit(i)+this.emit("}"):";");if(!i)return this.emit(`${this.indent()}@${t.name}${e};`,t.position);let u=i.some(y=>y.type!==h.declaration&&y.type!==h.comment),c=u?`
|
|
42
|
+
|
|
43
|
+
`:`
|
|
44
|
+
`;return this.emit(`${this.indent()}@${t.name}${e}`,t.position)+this.emit(u?` {
|
|
45
|
+
${this.indent(1)}`:` {
|
|
46
|
+
`)+this.emit(u?"":this.indent(1))+this.mapVisit(i,c)+this.emit(u?`
|
|
47
|
+
${this.indent(-1)}${this.indent()}}`:`${this.indent(-1)}
|
|
48
|
+
${this.indent()}}`)}rule(t){let e=t.declarations;if(this.identity&&t.rawPrelude){this.indent(1);let c=this.emit(t.rawPrelude,t.position)+this.emit("{")+this.identityVisitBlock(e,"decls")+this.emit("}");return this.indent(-1),c}let i=this.stripWhitespace(e);if(this.compress)return this.removeEmptyRules&&!i.length?"":this.emit(t.selectors.join(","),t.position)+this.emit("{")+this.mapVisit(i)+this.emit("}");let u=this.indent();return i.length?this.emit(t.selectors.map(c=>u+c).join(`,
|
|
49
|
+
`),t.position)+this.emit(` {
|
|
50
|
+
`)+this.emit(this.indent(1))+this.mapVisit(i,`
|
|
51
|
+
`)+this.emit(this.indent(-1))+this.emit(`
|
|
52
|
+
${this.indent()}}`):this.removeEmptyRules?"":this.emit(t.selectors.map(c=>u+c).join(`,
|
|
53
|
+
`),t.position)+this.emit(" {}")}declaration(t){if(this.identity&&t.rawBetween!=null)return this.emit(`${t.property}${t.rawBetween}${t.rawValue??t.value}`,t.position);if(this.compress)return this.emit(`${t.property}:${t.value}`,t.position)+this.emit(";");if(t.property==="grid-template-areas"){let e=this.indent(),i=e.length+t.property.length+2,c=t.value.split(`
|
|
54
|
+
`).map((y,l)=>l===0?y:" ".repeat(i)+y.trimStart()).join(`
|
|
55
|
+
`);return this.emit(e)+this.emit(`${t.property}: ${c}`,t.position)+this.emit(";")}return this.emit(this.indent())+this.emit(`${t.property}: ${t.value}`,t.position)+this.emit(";")}},X=T;var q=(n,t)=>new X(t||{}).compile(n);var zt=G,Jt=q,de={parse:zt,stringify:Jt};export{h as CssTypes,de as default,zt as parse,Jt as stringify};
|
|
56
|
+
//# sourceMappingURL=index-min.js.map
|