css-blank-pseudo 3.0.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changes to CSS Blank Pseudo
2
2
 
3
+ ### 4.0.0 (July 8, 2022)
4
+
5
+ - Updated: The polyfill now only attaches a single listener to the body so it's
6
+ more efficient and also does less work at the MutationObserver handler.
7
+ - Breaking: removed old CDN urls
8
+ - Breaking: removed old CLI
9
+ - Fix case insensitive matching.
10
+
11
+ #### How to migrate:
12
+
13
+ - If you use a CDN url, please update it.
14
+ - Re-build your CSS with the new version of the library.
15
+
16
+ ```diff
17
+ - <script src="https://unpkg.com/css-blank-pseudo/browser"></script>
18
+ - <script src="https://unpkg.com/css-blank-pseudo/browser.min"></script>
19
+ + <script src="https://unpkg.com/css-blank-pseudo/dist/browser-global.js"></script>
20
+ ```
21
+
22
+ ```diff
23
+ - cssBlankPseudo(document)
24
+ + cssBlankPseudoInit()
25
+ ```
26
+
27
+ ```diff
28
+ - cssBlankPseudo({
29
+ - attr: false,
30
+ - className: 'blank'
31
+ - })
32
+ + cssBlankPseudoInit({
33
+ + replaceWith: '.blank'
34
+ + })
35
+ ```
36
+
3
37
  ### 3.0.3 (February 5, 2022)
4
38
 
5
39
  - Rebuild of browser polyfills
package/README.md CHANGED
@@ -1,104 +1,166 @@
1
- # CSS Blank Pseudo [<img src="http://jonathantneal.github.io/js-logo.svg" alt="" width="90" height="90" align="right">][CSS Blank Pseudo]
1
+ # PostCSS Blank Pseudo [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
2
2
 
3
- [![NPM Version][npm-img]][npm-url]
4
- [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
3
+ [<img alt="npm version" src="https://img.shields.io/npm/v/css-blank-pseudo.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/blank-pseudo-class.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
5
4
 
6
- [CSS Blank Pseudo] lets you style form elements when they are empty, following
5
+ [PostCSS Blank Pseudo] lets you style form elements when they are empty, following
7
6
  the [Selectors Level 4] specification.
8
7
 
9
- ```css
10
- input {
11
- /* style an input */
8
+ ```pcss
9
+ input:blank {
10
+ background-color: yellow;
12
11
  }
13
12
 
13
+ /* becomes */
14
+
15
+ input[blank].js-blank-pseudo, .js-blank-pseudo input[blank] {
16
+ background-color: yellow;
17
+ }
14
18
  input:blank {
15
- /* style an input without a value */
19
+ background-color: yellow;
16
20
  }
17
21
  ```
18
22
 
19
23
  ## Usage
20
24
 
21
- From the command line, transform CSS files that use `:blank` selectors:
25
+ Add [PostCSS Blank Pseudo] to your project:
22
26
 
23
27
  ```bash
24
- npx css-blank-pseudo SOURCE.css --output TRANSFORMED.css
28
+ npm install postcss css-blank-pseudo --save-dev
25
29
  ```
26
30
 
27
- Next, use your transformed CSS with this script:
31
+ Use it as a [PostCSS] plugin:
28
32
 
29
- ```html
30
- <link rel="stylesheet" href="TRANSFORMED.css">
31
- <script src="https://unpkg.com/css-blank-pseudo/dist/browser-global.js"></script>
32
- <script>cssBlankPseudo(document)</script>
33
+ ```js
34
+ const postcss = require('postcss');
35
+ const postcssBlankPseudo = require('css-blank-pseudo');
36
+
37
+ postcss([
38
+ postcssBlankPseudo(/* pluginOptions */)
39
+ ]).process(YOUR_CSS /*, processOptions */);
33
40
  ```
34
41
 
35
- ⚠️ Please use a versioned url, like this : `https://unpkg.com/css-blank-pseudo@3.0.0/dist/browser-global.js`
36
- Without the version, you might unexpectedly get a new major version of the library with breaking changes.
42
+ [PostCSS Blank Pseudo] runs in all Node environments, with special
43
+ instructions for:
37
44
 
38
- ⚠️ If you were using an older version via a CDN, please update the entire url.
39
- The old URL will no longer work in a future release.
45
+ | [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
46
+ | --- | --- | --- | --- | --- | --- |
40
47
 
41
- That’s it. The script works in most browsers.
48
+ ## Options
42
49
 
43
- ## How it works
50
+ ### preserve
44
51
 
45
- The [PostCSS plugin](README-POSTCSS.md) clones rules containing `:blank`,
46
- replacing them with an alternative `[blank]` selector.
52
+ The `preserve` option determines whether the original notation
53
+ is preserved. By default, it is preserved.
54
+
55
+ ```js
56
+ postcssBlankPseudo({ preserve: false })
57
+ ```
47
58
 
48
- ```css
59
+ ```pcss
49
60
  input:blank {
50
- background-color: yellow;
61
+ background-color: yellow;
51
62
  }
52
63
 
53
64
  /* becomes */
54
65
 
55
- input[blank] {
56
- background-color: yellow;
66
+ input[blank].js-blank-pseudo, .js-blank-pseudo input[blank] {
67
+ background-color: yellow;
57
68
  }
69
+ ```
70
+
71
+ ### replaceWith
72
+
73
+ The `replaceWith` option determines the selector to use when replacing
74
+ the `:blank` pseudo. By default is `[blank]`
75
+
76
+ ```js
77
+ postcssBlankPseudo({ replaceWith: '.css-blank' })
78
+ ```
58
79
 
80
+ ```pcss
59
81
  input:blank {
60
- background-color: yellow;
82
+ background-color: yellow;
61
83
  }
84
+
85
+ /* becomes */
86
+
87
+ .foo {
88
+ color: blue;
89
+ color: red;
90
+ }
91
+
92
+ .baz {
93
+ color: green;
94
+ }
95
+ ```
96
+
97
+ Note that changing this option implies that it needs to be passed to the
98
+ browser polyfill as well.
99
+
100
+ ## Browser
101
+
102
+ ```js
103
+ import cssBlankPseudoInit from 'css-blank-pseudo/browser';
104
+
105
+ cssBlankPseudoInit();
62
106
  ```
63
107
 
64
- Next, the [JavaScript library](README-BROWSER.md) adds a `blank` attribute to
65
- elements otherwise matching `:blank` natively.
108
+ or
66
109
 
67
110
  ```html
68
- <input value="" blank>
69
- <input value="This element has a value">
111
+ <!-- When using a CDN url you will have to manually update the version number -->
112
+ <script src="https://unpkg.com/css-blank-pseudo@3.0.3/dist/browser-global.js"></script>
113
+ <script>cssBlankPseudoInit()</script>
70
114
  ```
71
115
 
72
- ## ⚠️ `:not(:blank)`
116
+ [PostCSS Blank Pseudo] works in all major browsers, including Safari 6+ and
117
+ Internet Explorer 9+ without any additional polyfills.
73
118
 
74
- with option : `preserve` `true`
119
+ This plugin conditionally uses `MutationObserver` to ensure recently inserted
120
+ inputs get correct styling upon insertion. If you intend to rely on that
121
+ behaviour for browsers that do not support `MutationObserver`, you have two
122
+ options:
75
123
 
76
- ```css
77
- input:not(:blank) {
78
- background-color: yellow;
79
- }
124
+ 1. Polyfill `MutationObserver`. As long as it runs before `cssBlankPseudoInit`,
125
+ the polyfill will work.
126
+ 2. If you don't want to polyfill `MutationObserver` you can also manually fire
127
+ a `change` event upon insertion so they're automatically inspected by the
128
+ polyfill.
80
129
 
81
- /* becomes */
130
+ ### Browser Usage
82
131
 
83
- input:not([blank]) {
84
- background-color: yellow;
85
- }
132
+ #### force
86
133
 
87
- input:not(:blank) {
88
- background-color: yellow;
89
- }
134
+ The `force` option determines whether the library runs even if the browser
135
+ supports the selector or not. By default, it won't run if the browser does
136
+ support the selector.
137
+
138
+ ```js
139
+ cssBlankPseudoInit({ force: true });
90
140
  ```
91
141
 
92
- When you do not include the JS polyfill one will always match in browsers that support `:blank` natively.
93
- In browsers that do not support `:blank` natively the rule will be invalid.
142
+ #### replaceWith
143
+
144
+ Similar to the option for the PostCSS Plugin, `replaceWith` determines the
145
+ attribute or class to apply to an element when it's considered to be `:blank`.
94
146
 
95
- _currently no browsers support `:blank`_
147
+ ```js
148
+ cssBlankPseudoInit({ replaceWith: '.css-blank' });
149
+ ```
96
150
 
151
+ This option should be used if it was changed at PostCSS configuration level.
152
+ Please note that using a class, leverages `classList` under the hood which
153
+ might not be supported on some old browsers such as IE9, so you may need
154
+ to polyfill `classList` in those cases.
97
155
 
156
+ [cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
157
+ [css-url]: https://cssdb.org/#blank-pseudo-class
98
158
  [discord]: https://discord.gg/bUadyRwkJS
99
- [npm-img]: https://img.shields.io/npm/v/css-blank-pseudo.svg
100
159
  [npm-url]: https://www.npmjs.com/package/css-blank-pseudo
101
160
 
102
- [CSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
103
- [PostCSS Preset Env]: https://preset-env.cssdb.org/
104
- [Selectors Level 4]: https://drafts.csswg.org/selectors-4/#blank
161
+ [Gulp PostCSS]: https://github.com/postcss/gulp-postcss
162
+ [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
163
+ [PostCSS]: https://github.com/postcss/postcss
164
+ [PostCSS Loader]: https://github.com/postcss/postcss-loader
165
+ [PostCSS Blank Pseudo]: https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo
166
+ [Selectors Level 4]: https://www.w3.org/TR/selectors-4/#blank
@@ -1,2 +1,2 @@
1
- self.cssBlankPseudo=function(e,t){var n=Object(t).className,r=Object(t).attr||"blank",o=Object(t).force;try{if(e.querySelector(":blank"),!o)return}catch(e){}var a,i,s,c=(e.ownerDocument||e).defaultView;d(c.HTMLInputElement),d(c.HTMLSelectElement),d(c.HTMLTextAreaElement),a=c.HTMLOptionElement,i=Object.getOwnPropertyDescriptor(a.prototype,"selected"),s=i.set,i.set=function(t){s.apply(this,arguments);var n=e.createEvent("Event");n.initEvent("change",!0,!0),this.dispatchEvent(n)},Object.defineProperty(a.prototype,"selected",i);var l=/^(INPUT|SELECT|TEXTAREA)$/;function p(){this.value||"SELECT"===this.nodeName&&this.options[this.selectedIndex].value?(r&&this.removeAttribute(r),n&&this.classList.remove(n),this.removeAttribute("blank")):(r&&this.setAttribute("blank",r),n&&this.classList.add(n))}function d(e){var t=Object.getOwnPropertyDescriptor(e.prototype,"value"),n=t.set;t.set=function(e){n.apply(this,arguments),p.apply(this)},Object.defineProperty(e.prototype,"value",t)}Array.prototype.forEach.call(e.querySelectorAll("INPUT,SELECT,TEXTAREA"),(function(e){"SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e)})),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e))})),Array.prototype.forEach.call(e.removedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.removeEventListener("change",p):e.removeEventListener("input",p))}))}))})).observe(e,{childList:!0,subtree:!0})};
1
+ !function(){var e=[" ",">","~",":","+","@","#","(",")"];var t="js-blank-pseudo";function n(e){return"INPUT"===e.nodeName||"SELECT"===e.nodeName||"TEXTAREA"===e.nodeName}function r(e){var t;return"function"==typeof Event?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),t}function o(e,t){var n=Object.getOwnPropertyDescriptor(e.prototype,"value"),r=n.set;n.set=function(){r.apply(this,arguments),t({target:this})},Object.defineProperty(e.prototype,"value",n)}self.cssBlankPseudoInit=function(c){var i={force:!1,replaceWith:"[blank]"};if(void 0!==c&&"force"in c&&(i.force=c.force),void 0!==c&&"replaceWith"in c&&(i.replaceWith=c.replaceWith),!function(t){for(var n=!0,r=0,o=e.length;r<o&&n;r++)t.indexOf(e[r])>-1&&(n=!1);return n}(i.replaceWith))throw new Error(i.replaceWith+" is not a valid replacement since it can't be applied to single elements.");try{if(document.querySelector(":blank"),!i.force)return}catch(e){}var a,d,l,u,s,f,p,v=("."===(a=i.replaceWith)[0]?(d=a.slice(1),l=function(e){return e.classList.remove(d)},u=function(e){return e.classList.add(d)}):(d=a.slice(1,-1),l=function(e){return e.removeAttribute(d,"")},u=function(e){return e.setAttribute(d,"")}),function(e){var t=e.target;n(t)&&(("SELECT"===t.nodeName?t.options[t.selectedIndex].value:t.value)?l(t):u(t))}),m=function(){document.body&&(document.body.addEventListener("change",v),document.body.addEventListener("input",v))},E=function(){Array.prototype.forEach.call(document.querySelectorAll("input, select, textarea"),(function(e){v({target:e})}))};if(document.body?m():window.addEventListener("load",m),-1===document.documentElement.className.indexOf(t)&&(document.documentElement.className+=" js-blank-pseudo"),o(self.HTMLInputElement,v),o(self.HTMLSelectElement,v),o(self.HTMLTextAreaElement,v),s=self.HTMLOptionElement,f=Object.getOwnPropertyDescriptor(s.prototype,"selected"),p=f.set,f.set=function(e){p.apply(this,arguments);var t=r("change");this.parentElement.dispatchEvent(t)},Object.defineProperty(s.prototype,"selected",f),E(),void 0!==self.MutationObserver)new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&n(e)&&v({target:e})}))}))})).observe(document,{childList:!0,subtree:!0});else{var y=function(){return E()};window.addEventListener("load",y),window.addEventListener("DOMContentLoaded",y)}}}();
2
2
  //# sourceMappingURL=browser-global.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser-global.js","sources":["../src/browser-global.js","../src/browser.js"],"sourcesContent":["/* global self */\nimport { default as cssBlankPseudo } from './browser';\nself.cssBlankPseudo = cssBlankPseudo;\n","/* global MutationObserver */\nexport default function cssBlankPseudo(document, opts) {\n\t// configuration\n\tconst className = Object(opts).className;\n\tconst attr = Object(opts).attr || 'blank';\n\tconst force = Object(opts).force;\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\t// observe value changes on <input>, <select>, and <textarea>\n\tconst window = (document.ownerDocument || document).defaultView;\n\n\tobserveValueOfHTMLElement(window.HTMLInputElement);\n\tobserveValueOfHTMLElement(window.HTMLSelectElement);\n\tobserveValueOfHTMLElement(window.HTMLTextAreaElement);\n\tobserveSelectedOfHTMLElement(window.HTMLOptionElement);\n\n\t// form control elements selector\n\tconst selector = 'INPUT,SELECT,TEXTAREA';\n\tconst selectorRegExp = /^(INPUT|SELECT|TEXTAREA)$/;\n\n\t// conditionally update all form control elements\n\tArray.prototype.forEach.call(\n\t\tdocument.querySelectorAll(selector),\n\t\tnode => {\n\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\tnode.addEventListener('change', configureCssBlankAttribute);\n\t\t\t} else {\n\t\t\t\tnode.addEventListener('input', configureCssBlankAttribute);\n\t\t\t}\n\n\t\t\tconfigureCssBlankAttribute.call(node);\n\t\t},\n\t);\n\n\t// conditionally observe added or unobserve removed form control elements\n\tnew MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tmutation.addedNodes || [],\n\t\t\t\tnode => {\n\t\t\t\t\tif (node.nodeType === 1 && selectorRegExp.test(node.nodeName)) {\n\t\t\t\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\t\t\t\tnode.addEventListener('change', configureCssBlankAttribute);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.addEventListener('input', configureCssBlankAttribute);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconfigureCssBlankAttribute.call(node);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tmutation.removedNodes || [],\n\t\t\t\tnode => {\n\t\t\t\t\tif (node.nodeType === 1 && selectorRegExp.test(node.nodeName)) {\n\t\t\t\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\t\t\t\tnode.removeEventListener('change', configureCssBlankAttribute);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.removeEventListener('input', configureCssBlankAttribute);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}).observe(document, { childList: true, subtree: true });\n\n\t// update a form control element’s css-blank attribute\n\tfunction configureCssBlankAttribute () {\n\t\tif (this.value || this.nodeName === 'SELECT' && this.options[this.selectedIndex].value) {\n\t\t\tif (attr) {\n\t\t\t\tthis.removeAttribute(attr);\n\t\t\t}\n\n\t\t\tif (className) {\n\t\t\t\tthis.classList.remove(className);\n\t\t\t}\n\t\t\tthis.removeAttribute('blank');\n\t\t} else {\n\t\t\tif (attr) {\n\t\t\t\tthis.setAttribute('blank', attr);\n\t\t\t}\n\n\t\t\tif (className) {\n\t\t\t\tthis.classList.add(className);\n\t\t\t}\n\t\t}\n\t}\n\n\t// observe changes to the \"value\" property on an HTML Element\n\tfunction observeValueOfHTMLElement (HTMLElement) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\t\tconst nativeSet = descriptor.set;\n\n\t\tdescriptor.set = function set (value) { // eslint-disable-line no-unused-vars\n\t\t\tnativeSet.apply(this, arguments);\n\n\t\t\tconfigureCssBlankAttribute.apply(this);\n\t\t};\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n\t}\n\n\t// observe changes to the \"selected\" property on an HTML Element\n\tfunction observeSelectedOfHTMLElement (HTMLElement) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\t\tconst nativeSet = descriptor.set;\n\n\t\tdescriptor.set = function set (value) { // eslint-disable-line no-unused-vars\n\t\t\tnativeSet.apply(this, arguments);\n\n\t\t\tconst event = document.createEvent('Event');\n\t\t\tevent.initEvent('change', true, true);\n\t\t\tthis.dispatchEvent(event);\n\t\t};\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n\t}\n}\n"],"names":["self","cssBlankPseudo","document","opts","className","Object","attr","force","querySelector","ignoredError","HTMLElement","descriptor","nativeSet","window","ownerDocument","defaultView","observeValueOfHTMLElement","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","getOwnPropertyDescriptor","prototype","set","value","apply","this","arguments","event","createEvent","initEvent","dispatchEvent","defineProperty","selectorRegExp","configureCssBlankAttribute","nodeName","options","selectedIndex","removeAttribute","classList","remove","setAttribute","add","Array","forEach","call","querySelectorAll","node","addEventListener","MutationObserver","mutationsList","mutation","addedNodes","nodeType","test","removedNodes","removeEventListener","observe","childList","subtree"],"mappings":"AAEAA,KAAKC,eCDU,SAAwBC,EAAUC,OAE1CC,EAAYC,OAAOF,GAAMC,UACzBE,EAAOD,OAAOF,GAAMG,MAAQ,QAC5BC,EAAQF,OAAOF,GAAMI,aAG1BL,EAASM,cAAc,WAElBD,SAGJ,MAAOE,QAkG8BC,EAChCC,EACAC,EAjGDC,GAAUX,EAASY,eAAiBZ,GAAUa,YAEpDC,EAA0BH,EAAOI,kBACjCD,EAA0BH,EAAOK,mBACjCF,EAA0BH,EAAOM,qBA2FMT,EA1FVG,EAAOO,kBA2F7BT,EAAaN,OAAOgB,yBAAyBX,EAAYY,UAAW,YACpEV,EAAYD,EAAWY,IAE7BZ,EAAWY,IAAM,SAAcC,GAC9BZ,EAAUa,MAAMC,KAAMC,eAEhBC,EAAQ1B,EAAS2B,YAAY,SACnCD,EAAME,UAAU,UAAU,GAAM,QAC3BC,cAAcH,IAGpBvB,OAAO2B,eAAetB,EAAYY,UAAW,WAAYX,OAlGpDsB,EAAiB,qCAkDdC,IACJR,KAAKF,OAA2B,WAAlBE,KAAKS,UAAyBT,KAAKU,QAAQV,KAAKW,eAAeb,OAC5ElB,QACEgC,gBAAgBhC,GAGlBF,QACEmC,UAAUC,OAAOpC,QAElBkC,gBAAgB,WAEjBhC,QACEmC,aAAa,QAASnC,GAGxBF,QACEmC,UAAUG,IAAItC,aAMbY,EAA2BN,OAC7BC,EAAaN,OAAOgB,yBAAyBX,EAAYY,UAAW,SACpEV,EAAYD,EAAWY,IAE7BZ,EAAWY,IAAM,SAAcC,GAC9BZ,EAAUa,MAAMC,KAAMC,WAEtBO,EAA2BT,MAAMC,OAGlCrB,OAAO2B,eAAetB,EAAYY,UAAW,QAASX,GA/EvDgC,MAAMrB,UAAUsB,QAAQC,KACvB3C,EAAS4C,iBALO,0BAMhB,SAAAC,GACuB,WAAlBA,EAAKZ,SACRY,EAAKC,iBAAiB,SAAUd,GAEhCa,EAAKC,iBAAiB,QAASd,GAGhCA,EAA2BW,KAAKE,UAK9BE,kBAAiB,SAAAC,GACpBA,EAAcN,SAAQ,SAAAO,GACrBR,MAAMrB,UAAUsB,QAAQC,KACvBM,EAASC,YAAc,IACvB,SAAAL,GACuB,IAAlBA,EAAKM,UAAkBpB,EAAeqB,KAAKP,EAAKZ,YAC7B,WAAlBY,EAAKZ,SACRY,EAAKC,iBAAiB,SAAUd,GAEhCa,EAAKC,iBAAiB,QAASd,GAGhCA,EAA2BW,KAAKE,OAKnCJ,MAAMrB,UAAUsB,QAAQC,KACvBM,EAASI,cAAgB,IACzB,SAAAR,GACuB,IAAlBA,EAAKM,UAAkBpB,EAAeqB,KAAKP,EAAKZ,YAC7B,WAAlBY,EAAKZ,SACRY,EAAKS,oBAAoB,SAAUtB,GAEnCa,EAAKS,oBAAoB,QAAStB,aAMrCuB,QAAQvD,EAAU,CAAEwD,WAAW,EAAMC,SAAS"}
1
+ {"version":3,"file":"browser-global.js","sources":["../src/is-valid-replacement.mjs","../src/browser.js","../src/browser-global.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.mjs';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement, handler);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n","/* global self */\nimport { default as cssBlankPseudoInit } from './browser';\nself.cssBlankPseudoInit = cssBlankPseudoInit;\n"],"names":["INVALID_SELECTOR_CHAR","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","self","cssBlankPseudoInit","opts","options","force","replaceWith","selector","isValid","i","length","indexOf","isValidReplacement","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"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"}
package/dist/browser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- module.exports=function(e,t){var n=Object(t).className,r=Object(t).attr||"blank",o=Object(t).force;try{if(e.querySelector(":blank"),!o)return}catch(e){}var a,i,c,s=(e.ownerDocument||e).defaultView;d(s.HTMLInputElement),d(s.HTMLSelectElement),d(s.HTMLTextAreaElement),a=s.HTMLOptionElement,i=Object.getOwnPropertyDescriptor(a.prototype,"selected"),c=i.set,i.set=function(t){c.apply(this,arguments);var n=e.createEvent("Event");n.initEvent("change",!0,!0),this.dispatchEvent(n)},Object.defineProperty(a.prototype,"selected",i);var l=/^(INPUT|SELECT|TEXTAREA)$/;function p(){this.value||"SELECT"===this.nodeName&&this.options[this.selectedIndex].value?(r&&this.removeAttribute(r),n&&this.classList.remove(n),this.removeAttribute("blank")):(r&&this.setAttribute("blank",r),n&&this.classList.add(n))}function d(e){var t=Object.getOwnPropertyDescriptor(e.prototype,"value"),n=t.set;t.set=function(e){n.apply(this,arguments),p.apply(this)},Object.defineProperty(e.prototype,"value",t)}Array.prototype.forEach.call(e.querySelectorAll("INPUT,SELECT,TEXTAREA"),(function(e){"SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e)})),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e))})),Array.prototype.forEach.call(e.removedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.removeEventListener("change",p):e.removeEventListener("input",p))}))}))})).observe(e,{childList:!0,subtree:!0})};
1
+ var e=[" ",">","~",":","+","@","#","(",")"];function t(e){return"INPUT"===e.nodeName||"SELECT"===e.nodeName||"TEXTAREA"===e.nodeName}function n(e){var t;return"function"==typeof Event?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),t}function r(e,t){var n=Object.getOwnPropertyDescriptor(e.prototype,"value"),r=n.set;n.set=function(){r.apply(this,arguments),t({target:this})},Object.defineProperty(e.prototype,"value",n)}module.exports=function(o){var c={force:!1,replaceWith:"[blank]"};if(void 0!==o&&"force"in o&&(c.force=o.force),void 0!==o&&"replaceWith"in o&&(c.replaceWith=o.replaceWith),!function(t){for(var n=!0,r=0,o=e.length;r<o&&n;r++)t.indexOf(e[r])>-1&&(n=!1);return n}(c.replaceWith))throw new Error(c.replaceWith+" is not a valid replacement since it can't be applied to single elements.");try{if(document.querySelector(":blank"),!c.force)return}catch(e){}var i,a,d,l,u,s,p,f=("."===(i=c.replaceWith)[0]?(a=i.slice(1),d=function(e){return e.classList.remove(a)},l=function(e){return e.classList.add(a)}):(a=i.slice(1,-1),d=function(e){return e.removeAttribute(a,"")},l=function(e){return e.setAttribute(a,"")}),function(e){var n=e.target;t(n)&&(("SELECT"===n.nodeName?n.options[n.selectedIndex].value:n.value)?d(n):l(n))}),v=function(){document.body&&(document.body.addEventListener("change",f),document.body.addEventListener("input",f))},m=function(){Array.prototype.forEach.call(document.querySelectorAll("input, select, textarea"),(function(e){f({target:e})}))};if(document.body?v():window.addEventListener("load",v),-1===document.documentElement.className.indexOf("js-blank-pseudo")&&(document.documentElement.className+=" js-blank-pseudo"),r(self.HTMLInputElement,f),r(self.HTMLSelectElement,f),r(self.HTMLTextAreaElement,f),u=self.HTMLOptionElement,s=Object.getOwnPropertyDescriptor(u.prototype,"selected"),p=s.set,s.set=function(e){p.apply(this,arguments);var t=n("change");this.parentElement.dispatchEvent(t)},Object.defineProperty(u.prototype,"selected",s),m(),void 0!==self.MutationObserver)new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&t(e)&&f({target:e})}))}))})).observe(document,{childList:!0,subtree:!0});else{var E=function(){return m()};window.addEventListener("load",E),window.addEventListener("DOMContentLoaded",E)}};
2
2
  //# sourceMappingURL=browser.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.cjs","sources":["../src/browser.js"],"sourcesContent":["/* global MutationObserver */\nexport default function cssBlankPseudo(document, opts) {\n\t// configuration\n\tconst className = Object(opts).className;\n\tconst attr = Object(opts).attr || 'blank';\n\tconst force = Object(opts).force;\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\t// observe value changes on <input>, <select>, and <textarea>\n\tconst window = (document.ownerDocument || document).defaultView;\n\n\tobserveValueOfHTMLElement(window.HTMLInputElement);\n\tobserveValueOfHTMLElement(window.HTMLSelectElement);\n\tobserveValueOfHTMLElement(window.HTMLTextAreaElement);\n\tobserveSelectedOfHTMLElement(window.HTMLOptionElement);\n\n\t// form control elements selector\n\tconst selector = 'INPUT,SELECT,TEXTAREA';\n\tconst selectorRegExp = /^(INPUT|SELECT|TEXTAREA)$/;\n\n\t// conditionally update all form control elements\n\tArray.prototype.forEach.call(\n\t\tdocument.querySelectorAll(selector),\n\t\tnode => {\n\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\tnode.addEventListener('change', configureCssBlankAttribute);\n\t\t\t} else {\n\t\t\t\tnode.addEventListener('input', configureCssBlankAttribute);\n\t\t\t}\n\n\t\t\tconfigureCssBlankAttribute.call(node);\n\t\t},\n\t);\n\n\t// conditionally observe added or unobserve removed form control elements\n\tnew MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tmutation.addedNodes || [],\n\t\t\t\tnode => {\n\t\t\t\t\tif (node.nodeType === 1 && selectorRegExp.test(node.nodeName)) {\n\t\t\t\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\t\t\t\tnode.addEventListener('change', configureCssBlankAttribute);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.addEventListener('input', configureCssBlankAttribute);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconfigureCssBlankAttribute.call(node);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tmutation.removedNodes || [],\n\t\t\t\tnode => {\n\t\t\t\t\tif (node.nodeType === 1 && selectorRegExp.test(node.nodeName)) {\n\t\t\t\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\t\t\t\tnode.removeEventListener('change', configureCssBlankAttribute);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.removeEventListener('input', configureCssBlankAttribute);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}).observe(document, { childList: true, subtree: true });\n\n\t// update a form control element’s css-blank attribute\n\tfunction configureCssBlankAttribute () {\n\t\tif (this.value || this.nodeName === 'SELECT' && this.options[this.selectedIndex].value) {\n\t\t\tif (attr) {\n\t\t\t\tthis.removeAttribute(attr);\n\t\t\t}\n\n\t\t\tif (className) {\n\t\t\t\tthis.classList.remove(className);\n\t\t\t}\n\t\t\tthis.removeAttribute('blank');\n\t\t} else {\n\t\t\tif (attr) {\n\t\t\t\tthis.setAttribute('blank', attr);\n\t\t\t}\n\n\t\t\tif (className) {\n\t\t\t\tthis.classList.add(className);\n\t\t\t}\n\t\t}\n\t}\n\n\t// observe changes to the \"value\" property on an HTML Element\n\tfunction observeValueOfHTMLElement (HTMLElement) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\t\tconst nativeSet = descriptor.set;\n\n\t\tdescriptor.set = function set (value) { // eslint-disable-line no-unused-vars\n\t\t\tnativeSet.apply(this, arguments);\n\n\t\t\tconfigureCssBlankAttribute.apply(this);\n\t\t};\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n\t}\n\n\t// observe changes to the \"selected\" property on an HTML Element\n\tfunction observeSelectedOfHTMLElement (HTMLElement) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\t\tconst nativeSet = descriptor.set;\n\n\t\tdescriptor.set = function set (value) { // eslint-disable-line no-unused-vars\n\t\t\tnativeSet.apply(this, arguments);\n\n\t\t\tconst event = document.createEvent('Event');\n\t\t\tevent.initEvent('change', true, true);\n\t\t\tthis.dispatchEvent(event);\n\t\t};\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n\t}\n}\n"],"names":["document","opts","className","Object","attr","force","querySelector","ignoredError","HTMLElement","descriptor","nativeSet","window","ownerDocument","defaultView","observeValueOfHTMLElement","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","getOwnPropertyDescriptor","prototype","set","value","apply","this","arguments","event","createEvent","initEvent","dispatchEvent","defineProperty","selectorRegExp","configureCssBlankAttribute","nodeName","options","selectedIndex","removeAttribute","classList","remove","setAttribute","add","Array","forEach","call","querySelectorAll","node","addEventListener","MutationObserver","mutationsList","mutation","addedNodes","nodeType","test","removedNodes","removeEventListener","observe","childList","subtree"],"mappings":"eACe,SAAwBA,EAAUC,OAE1CC,EAAYC,OAAOF,GAAMC,UACzBE,EAAOD,OAAOF,GAAMG,MAAQ,QAC5BC,EAAQF,OAAOF,GAAMI,aAG1BL,EAASM,cAAc,WAElBD,SAGJ,MAAOE,QAkG8BC,EAChCC,EACAC,EAjGDC,GAAUX,EAASY,eAAiBZ,GAAUa,YAEpDC,EAA0BH,EAAOI,kBACjCD,EAA0BH,EAAOK,mBACjCF,EAA0BH,EAAOM,qBA2FMT,EA1FVG,EAAOO,kBA2F7BT,EAAaN,OAAOgB,yBAAyBX,EAAYY,UAAW,YACpEV,EAAYD,EAAWY,IAE7BZ,EAAWY,IAAM,SAAcC,GAC9BZ,EAAUa,MAAMC,KAAMC,eAEhBC,EAAQ1B,EAAS2B,YAAY,SACnCD,EAAME,UAAU,UAAU,GAAM,QAC3BC,cAAcH,IAGpBvB,OAAO2B,eAAetB,EAAYY,UAAW,WAAYX,OAlGpDsB,EAAiB,qCAkDdC,IACJR,KAAKF,OAA2B,WAAlBE,KAAKS,UAAyBT,KAAKU,QAAQV,KAAKW,eAAeb,OAC5ElB,QACEgC,gBAAgBhC,GAGlBF,QACEmC,UAAUC,OAAOpC,QAElBkC,gBAAgB,WAEjBhC,QACEmC,aAAa,QAASnC,GAGxBF,QACEmC,UAAUG,IAAItC,aAMbY,EAA2BN,OAC7BC,EAAaN,OAAOgB,yBAAyBX,EAAYY,UAAW,SACpEV,EAAYD,EAAWY,IAE7BZ,EAAWY,IAAM,SAAcC,GAC9BZ,EAAUa,MAAMC,KAAMC,WAEtBO,EAA2BT,MAAMC,OAGlCrB,OAAO2B,eAAetB,EAAYY,UAAW,QAASX,GA/EvDgC,MAAMrB,UAAUsB,QAAQC,KACvB3C,EAAS4C,iBALO,0BAMhB,SAAAC,GACuB,WAAlBA,EAAKZ,SACRY,EAAKC,iBAAiB,SAAUd,GAEhCa,EAAKC,iBAAiB,QAASd,GAGhCA,EAA2BW,KAAKE,UAK9BE,kBAAiB,SAAAC,GACpBA,EAAcN,SAAQ,SAAAO,GACrBR,MAAMrB,UAAUsB,QAAQC,KACvBM,EAASC,YAAc,IACvB,SAAAL,GACuB,IAAlBA,EAAKM,UAAkBpB,EAAeqB,KAAKP,EAAKZ,YAC7B,WAAlBY,EAAKZ,SACRY,EAAKC,iBAAiB,SAAUd,GAEhCa,EAAKC,iBAAiB,QAASd,GAGhCA,EAA2BW,KAAKE,OAKnCJ,MAAMrB,UAAUsB,QAAQC,KACvBM,EAASI,cAAgB,IACzB,SAAAR,GACuB,IAAlBA,EAAKM,UAAkBpB,EAAeqB,KAAKP,EAAKZ,YAC7B,WAAlBY,EAAKZ,SACRY,EAAKS,oBAAoB,SAAUtB,GAEnCa,EAAKS,oBAAoB,QAAStB,aAMrCuB,QAAQvD,EAAU,CAAEwD,WAAW,EAAMC,SAAS"}
1
+ {"version":3,"file":"browser.cjs","sources":["../src/is-valid-replacement.mjs","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.mjs';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement, handler);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","opts","options","force","replaceWith","selector","isValid","i","length","indexOf","isValidReplacement","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"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"}
package/dist/browser.mjs CHANGED
@@ -1,2 +1,2 @@
1
- function e(e,t){var n=Object(t).className,r=Object(t).attr||"blank",o=Object(t).force;try{if(e.querySelector(":blank"),!o)return}catch(e){}var a,i,c,s=(e.ownerDocument||e).defaultView;d(s.HTMLInputElement),d(s.HTMLSelectElement),d(s.HTMLTextAreaElement),a=s.HTMLOptionElement,i=Object.getOwnPropertyDescriptor(a.prototype,"selected"),c=i.set,i.set=function(t){c.apply(this,arguments);var n=e.createEvent("Event");n.initEvent("change",!0,!0),this.dispatchEvent(n)},Object.defineProperty(a.prototype,"selected",i);var l=/^(INPUT|SELECT|TEXTAREA)$/;function p(){this.value||"SELECT"===this.nodeName&&this.options[this.selectedIndex].value?(r&&this.removeAttribute(r),n&&this.classList.remove(n),this.removeAttribute("blank")):(r&&this.setAttribute("blank",r),n&&this.classList.add(n))}function d(e){var t=Object.getOwnPropertyDescriptor(e.prototype,"value"),n=t.set;t.set=function(e){n.apply(this,arguments),p.apply(this)},Object.defineProperty(e.prototype,"value",t)}Array.prototype.forEach.call(e.querySelectorAll("INPUT,SELECT,TEXTAREA"),(function(e){"SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e)})),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e))})),Array.prototype.forEach.call(e.removedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.removeEventListener("change",p):e.removeEventListener("input",p))}))}))})).observe(e,{childList:!0,subtree:!0})}export{e as default};
1
+ var e=[" ",">","~",":","+","@","#","(",")"];function t(e){return"INPUT"===e.nodeName||"SELECT"===e.nodeName||"TEXTAREA"===e.nodeName}function n(e){var t;return"function"==typeof Event?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),t}function r(e,t){var n=Object.getOwnPropertyDescriptor(e.prototype,"value"),r=n.set;n.set=function(){r.apply(this,arguments),t({target:this})},Object.defineProperty(e.prototype,"value",n)}function o(o){var c={force:!1,replaceWith:"[blank]"};if(void 0!==o&&"force"in o&&(c.force=o.force),void 0!==o&&"replaceWith"in o&&(c.replaceWith=o.replaceWith),!function(t){for(var n=!0,r=0,o=e.length;r<o&&n;r++)t.indexOf(e[r])>-1&&(n=!1);return n}(c.replaceWith))throw new Error(c.replaceWith+" is not a valid replacement since it can't be applied to single elements.");try{if(document.querySelector(":blank"),!c.force)return}catch(e){}var i,a,d,l,u,s,p,f=("."===(i=c.replaceWith)[0]?(a=i.slice(1),d=function(e){return e.classList.remove(a)},l=function(e){return e.classList.add(a)}):(a=i.slice(1,-1),d=function(e){return e.removeAttribute(a,"")},l=function(e){return e.setAttribute(a,"")}),function(e){var n=e.target;t(n)&&(("SELECT"===n.nodeName?n.options[n.selectedIndex].value:n.value)?d(n):l(n))}),v=function(){document.body&&(document.body.addEventListener("change",f),document.body.addEventListener("input",f))},m=function(){Array.prototype.forEach.call(document.querySelectorAll("input, select, textarea"),(function(e){f({target:e})}))};if(document.body?v():window.addEventListener("load",v),-1===document.documentElement.className.indexOf("js-blank-pseudo")&&(document.documentElement.className+=" js-blank-pseudo"),r(self.HTMLInputElement,f),r(self.HTMLSelectElement,f),r(self.HTMLTextAreaElement,f),u=self.HTMLOptionElement,s=Object.getOwnPropertyDescriptor(u.prototype,"selected"),p=s.set,s.set=function(e){p.apply(this,arguments);var t=n("change");this.parentElement.dispatchEvent(t)},Object.defineProperty(u.prototype,"selected",s),m(),void 0!==self.MutationObserver)new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&t(e)&&f({target:e})}))}))})).observe(document,{childList:!0,subtree:!0});else{var E=function(){return m()};window.addEventListener("load",E),window.addEventListener("DOMContentLoaded",E)}}export{o as default};
2
2
  //# sourceMappingURL=browser.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.mjs","sources":["../src/browser.js"],"sourcesContent":["/* global MutationObserver */\nexport default function cssBlankPseudo(document, opts) {\n\t// configuration\n\tconst className = Object(opts).className;\n\tconst attr = Object(opts).attr || 'blank';\n\tconst force = Object(opts).force;\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\t// observe value changes on <input>, <select>, and <textarea>\n\tconst window = (document.ownerDocument || document).defaultView;\n\n\tobserveValueOfHTMLElement(window.HTMLInputElement);\n\tobserveValueOfHTMLElement(window.HTMLSelectElement);\n\tobserveValueOfHTMLElement(window.HTMLTextAreaElement);\n\tobserveSelectedOfHTMLElement(window.HTMLOptionElement);\n\n\t// form control elements selector\n\tconst selector = 'INPUT,SELECT,TEXTAREA';\n\tconst selectorRegExp = /^(INPUT|SELECT|TEXTAREA)$/;\n\n\t// conditionally update all form control elements\n\tArray.prototype.forEach.call(\n\t\tdocument.querySelectorAll(selector),\n\t\tnode => {\n\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\tnode.addEventListener('change', configureCssBlankAttribute);\n\t\t\t} else {\n\t\t\t\tnode.addEventListener('input', configureCssBlankAttribute);\n\t\t\t}\n\n\t\t\tconfigureCssBlankAttribute.call(node);\n\t\t},\n\t);\n\n\t// conditionally observe added or unobserve removed form control elements\n\tnew MutationObserver(mutationsList => {\n\t\tmutationsList.forEach(mutation => {\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tmutation.addedNodes || [],\n\t\t\t\tnode => {\n\t\t\t\t\tif (node.nodeType === 1 && selectorRegExp.test(node.nodeName)) {\n\t\t\t\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\t\t\t\tnode.addEventListener('change', configureCssBlankAttribute);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.addEventListener('input', configureCssBlankAttribute);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconfigureCssBlankAttribute.call(node);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tmutation.removedNodes || [],\n\t\t\t\tnode => {\n\t\t\t\t\tif (node.nodeType === 1 && selectorRegExp.test(node.nodeName)) {\n\t\t\t\t\t\tif (node.nodeName === 'SELECT') {\n\t\t\t\t\t\t\tnode.removeEventListener('change', configureCssBlankAttribute);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.removeEventListener('input', configureCssBlankAttribute);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}).observe(document, { childList: true, subtree: true });\n\n\t// update a form control element’s css-blank attribute\n\tfunction configureCssBlankAttribute () {\n\t\tif (this.value || this.nodeName === 'SELECT' && this.options[this.selectedIndex].value) {\n\t\t\tif (attr) {\n\t\t\t\tthis.removeAttribute(attr);\n\t\t\t}\n\n\t\t\tif (className) {\n\t\t\t\tthis.classList.remove(className);\n\t\t\t}\n\t\t\tthis.removeAttribute('blank');\n\t\t} else {\n\t\t\tif (attr) {\n\t\t\t\tthis.setAttribute('blank', attr);\n\t\t\t}\n\n\t\t\tif (className) {\n\t\t\t\tthis.classList.add(className);\n\t\t\t}\n\t\t}\n\t}\n\n\t// observe changes to the \"value\" property on an HTML Element\n\tfunction observeValueOfHTMLElement (HTMLElement) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\t\tconst nativeSet = descriptor.set;\n\n\t\tdescriptor.set = function set (value) { // eslint-disable-line no-unused-vars\n\t\t\tnativeSet.apply(this, arguments);\n\n\t\t\tconfigureCssBlankAttribute.apply(this);\n\t\t};\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n\t}\n\n\t// observe changes to the \"selected\" property on an HTML Element\n\tfunction observeSelectedOfHTMLElement (HTMLElement) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\t\tconst nativeSet = descriptor.set;\n\n\t\tdescriptor.set = function set (value) { // eslint-disable-line no-unused-vars\n\t\t\tnativeSet.apply(this, arguments);\n\n\t\t\tconst event = document.createEvent('Event');\n\t\t\tevent.initEvent('change', true, true);\n\t\t\tthis.dispatchEvent(event);\n\t\t};\n\n\t\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n\t}\n}\n"],"names":["cssBlankPseudo","document","opts","className","Object","attr","force","querySelector","ignoredError","HTMLElement","descriptor","nativeSet","window","ownerDocument","defaultView","observeValueOfHTMLElement","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","getOwnPropertyDescriptor","prototype","set","value","apply","this","arguments","event","createEvent","initEvent","dispatchEvent","defineProperty","selectorRegExp","configureCssBlankAttribute","nodeName","options","selectedIndex","removeAttribute","classList","remove","setAttribute","add","Array","forEach","call","querySelectorAll","node","addEventListener","MutationObserver","mutationsList","mutation","addedNodes","nodeType","test","removedNodes","removeEventListener","observe","childList","subtree"],"mappings":"AACe,SAASA,EAAeC,EAAUC,OAE1CC,EAAYC,OAAOF,GAAMC,UACzBE,EAAOD,OAAOF,GAAMG,MAAQ,QAC5BC,EAAQF,OAAOF,GAAMI,aAG1BL,EAASM,cAAc,WAElBD,SAGJ,MAAOE,QAkG8BC,EAChCC,EACAC,EAjGDC,GAAUX,EAASY,eAAiBZ,GAAUa,YAEpDC,EAA0BH,EAAOI,kBACjCD,EAA0BH,EAAOK,mBACjCF,EAA0BH,EAAOM,qBA2FMT,EA1FVG,EAAOO,kBA2F7BT,EAAaN,OAAOgB,yBAAyBX,EAAYY,UAAW,YACpEV,EAAYD,EAAWY,IAE7BZ,EAAWY,IAAM,SAAcC,GAC9BZ,EAAUa,MAAMC,KAAMC,eAEhBC,EAAQ1B,EAAS2B,YAAY,SACnCD,EAAME,UAAU,UAAU,GAAM,QAC3BC,cAAcH,IAGpBvB,OAAO2B,eAAetB,EAAYY,UAAW,WAAYX,OAlGpDsB,EAAiB,qCAkDdC,IACJR,KAAKF,OAA2B,WAAlBE,KAAKS,UAAyBT,KAAKU,QAAQV,KAAKW,eAAeb,OAC5ElB,QACEgC,gBAAgBhC,GAGlBF,QACEmC,UAAUC,OAAOpC,QAElBkC,gBAAgB,WAEjBhC,QACEmC,aAAa,QAASnC,GAGxBF,QACEmC,UAAUG,IAAItC,aAMbY,EAA2BN,OAC7BC,EAAaN,OAAOgB,yBAAyBX,EAAYY,UAAW,SACpEV,EAAYD,EAAWY,IAE7BZ,EAAWY,IAAM,SAAcC,GAC9BZ,EAAUa,MAAMC,KAAMC,WAEtBO,EAA2BT,MAAMC,OAGlCrB,OAAO2B,eAAetB,EAAYY,UAAW,QAASX,GA/EvDgC,MAAMrB,UAAUsB,QAAQC,KACvB3C,EAAS4C,iBALO,0BAMhB,SAAAC,GACuB,WAAlBA,EAAKZ,SACRY,EAAKC,iBAAiB,SAAUd,GAEhCa,EAAKC,iBAAiB,QAASd,GAGhCA,EAA2BW,KAAKE,UAK9BE,kBAAiB,SAAAC,GACpBA,EAAcN,SAAQ,SAAAO,GACrBR,MAAMrB,UAAUsB,QAAQC,KACvBM,EAASC,YAAc,IACvB,SAAAL,GACuB,IAAlBA,EAAKM,UAAkBpB,EAAeqB,KAAKP,EAAKZ,YAC7B,WAAlBY,EAAKZ,SACRY,EAAKC,iBAAiB,SAAUd,GAEhCa,EAAKC,iBAAiB,QAASd,GAGhCA,EAA2BW,KAAKE,OAKnCJ,MAAMrB,UAAUsB,QAAQC,KACvBM,EAASI,cAAgB,IACzB,SAAAR,GACuB,IAAlBA,EAAKM,UAAkBpB,EAAeqB,KAAKP,EAAKZ,YAC7B,WAAlBY,EAAKZ,SACRY,EAAKS,oBAAoB,SAAUtB,GAEnCa,EAAKS,oBAAoB,QAAStB,aAMrCuB,QAAQvD,EAAU,CAAEwD,WAAW,EAAMC,SAAS"}
1
+ {"version":3,"file":"browser.mjs","sources":["../src/is-valid-replacement.mjs","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.mjs';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement, handler);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","selector","isValid","i","length","indexOf","isValidReplacement","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"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"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("postcss-selector-parser"));const r=e=>{const r=String(Object(e).replaceWith||"[blank]"),s=t.default().astSync(r),o=Boolean(!("preserve"in Object(e))||e.preserve);return{postcssPlugin:"css-blank-pseudo",Rule:(e,{result:r})=>{if(-1===e.selector.indexOf(":blank"))return;let n;try{const r=t.default((e=>{e.walkPseudos((e=>{":blank"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(s.clone()))}))})).processSync(e.selector);n=String(r)}catch(t){return void e.warn(r,`Failed to parse selector : ${e.selector}`)}if(void 0===n)return;if(n===e.selector)return;const c=e.clone({selector:n});o?e.before(c):e.replaceWith(c)}}};r.postcss=!0,module.exports=r;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=e(require("postcss-selector-parser"));const n=[" ",">","~",":","+","@","#","(",")"];const t=e=>{const t=Object.assign({preserve:!0,replaceWith:"[blank]"},e),l=s.default().astSync(t.replaceWith);return function(e){let s=!0;for(let t=0,l=n.length;t<l&&s;t++)e.indexOf(n[t])>-1&&(s=!1);return s}(t.replaceWith)?{postcssPlugin:"css-blank-pseudo",Rule(e,{result:n}){if(!e.selector.toLowerCase().includes(":blank"))return;const o=e.selectors.flatMap((t=>{if(!t.toLowerCase().includes(":blank"))return[t];let o;try{o=s.default().astSync(t)}catch(s){return e.warn(n,`Failed to parse selector : ${t}`),t}if(void 0===o)return[t];let r=!1;if(o.walkPseudos((e=>{":blank"===e.value.toLowerCase()&&(e.nodes&&e.nodes.length||(r=!0,e.replaceWith(l.clone({}))))})),!r)return[t];const a=o.clone();var u,c,d,i,p;if(null!=(u=o.nodes)&&null!=(c=u[0])&&null!=(d=c.nodes)&&d.length)for(let e=0;e<o.nodes[0].nodes.length;e++){const n=o.nodes[0].nodes[e];if("combinator"===n.type||s.default.isPseudoElement(n)){o.nodes[0].insertBefore(n,s.default.className({value:"js-blank-pseudo"}));break}if(e===o.nodes[0].nodes.length-1){o.nodes[0].append(s.default.className({value:"js-blank-pseudo"}));break}}return null!=(i=o.nodes)&&null!=(p=i[0])&&p.nodes&&(a.nodes[0].prepend(s.default.combinator({value:" "})),a.nodes[0].prepend(s.default.className({value:"js-blank-pseudo"}))),[o.toString(),a.toString()]}));o.join(",")!==e.selectors.join(",")&&(e.cloneBefore({selectors:o}),t.preserve||e.remove())}}:{postcssPlugin:"css-blank-pseudo",Once:(e,{result:s})=>{e.warn(s,`${t.replaceWith} is not a valid replacement since it can't be applied to single elements.`)}}};t.postcss=!0,module.exports=t;
@@ -0,0 +1,7 @@
1
+ import type { PluginCreator } from 'postcss';
2
+ declare type pluginOptions = {
3
+ preserve?: boolean;
4
+ replaceWith?: string;
5
+ };
6
+ declare const creator: PluginCreator<pluginOptions>;
7
+ export default creator;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import e from"postcss-selector-parser";const r=r=>{const s=String(Object(r).replaceWith||"[blank]"),t=e().astSync(s),o=Boolean(!("preserve"in Object(r))||r.preserve);return{postcssPlugin:"css-blank-pseudo",Rule:(r,{result:s})=>{if(-1===r.selector.indexOf(":blank"))return;let c;try{const s=e((e=>{e.walkPseudos((e=>{":blank"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(t.clone()))}))})).processSync(r.selector);c=String(s)}catch(e){return void r.warn(s,`Failed to parse selector : ${r.selector}`)}if(void 0===c)return;if(c===r.selector)return;const n=r.clone({selector:c});o?r.before(n):r.replaceWith(n)}}};r.postcss=!0;export{r as default};
1
+ import e from"postcss-selector-parser";const s=[" ",">","~",":","+","@","#","(",")"];const n=n=>{const t=Object.assign({preserve:!0,replaceWith:"[blank]"},n),o=e().astSync(t.replaceWith);return function(e){let n=!0;for(let t=0,o=s.length;t<o&&n;t++)e.indexOf(s[t])>-1&&(n=!1);return n}(t.replaceWith)?{postcssPlugin:"css-blank-pseudo",Rule(s,{result:n}){if(!s.selector.toLowerCase().includes(":blank"))return;const l=s.selectors.flatMap((t=>{if(!t.toLowerCase().includes(":blank"))return[t];let l;try{l=e().astSync(t)}catch(e){return s.warn(n,`Failed to parse selector : ${t}`),t}if(void 0===l)return[t];let r=!1;if(l.walkPseudos((e=>{":blank"===e.value.toLowerCase()&&(e.nodes&&e.nodes.length||(r=!0,e.replaceWith(o.clone({}))))})),!r)return[t];const a=l.clone();var c,i,d,u,p;if(null!=(c=l.nodes)&&null!=(i=c[0])&&null!=(d=i.nodes)&&d.length)for(let s=0;s<l.nodes[0].nodes.length;s++){const n=l.nodes[0].nodes[s];if("combinator"===n.type||e.isPseudoElement(n)){l.nodes[0].insertBefore(n,e.className({value:"js-blank-pseudo"}));break}if(s===l.nodes[0].nodes.length-1){l.nodes[0].append(e.className({value:"js-blank-pseudo"}));break}}return null!=(u=l.nodes)&&null!=(p=u[0])&&p.nodes&&(a.nodes[0].prepend(e.combinator({value:" "})),a.nodes[0].prepend(e.className({value:"js-blank-pseudo"}))),[l.toString(),a.toString()]}));l.join(",")!==s.selectors.join(",")&&(s.cloneBefore({selectors:l}),t.preserve||s.remove())}}:{postcssPlugin:"css-blank-pseudo",Once:(e,{result:s})=>{e.warn(s,`${t.replaceWith} is not a valid replacement since it can't be applied to single elements.`)}}};n.postcss=!0;export{n as default};
package/package.json CHANGED
@@ -1,82 +1,108 @@
1
1
  {
2
- "name": "css-blank-pseudo",
3
- "version": "3.0.3",
4
- "description": "Style form elements when they are empty",
5
- "author": "Jonathan Neal <jonathantneal@hotmail.com>",
6
- "license": "CC0-1.0",
7
- "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo#readme",
8
- "bugs": "https://github.com/csstools/postcss-plugins/issues",
9
- "main": "dist/index.cjs",
10
- "module": "dist/index.mjs",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.mjs",
14
- "require": "./dist/index.cjs",
15
- "default": "./dist/index.mjs"
16
- },
17
- "./browser": {
18
- "import": "./dist/browser.mjs",
19
- "require": "./dist/browser.cjs",
20
- "default": "./dist/browser.mjs"
21
- },
22
- "./browser-global": {
23
- "default": "./dist/browser-global.js"
24
- }
25
- },
26
- "files": [
27
- "CHANGELOG.md",
28
- "LICENSE.md",
29
- "README.md",
30
- "dist",
31
- "browser.js"
32
- ],
33
- "bin": {
34
- "css-blank-pseudo": "dist/cli.cjs"
35
- },
36
- "scripts": {
37
- "build": "rollup -c ../../rollup/default.js && npm run copy-browser-scripts-to-old-location",
38
- "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"",
39
- "copy-browser-scripts-to-old-location": "node -e \"fs.copyFileSync('./dist/browser-global.js', './browser.js'); fs.copyFileSync('./dist/browser-global.js', './browser-legacy.js')\"",
40
- "lint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
41
- "prepublishOnly": "npm run clean && npm run build && npm run test",
42
- "stryker": "stryker run --logLevel error",
43
- "test": "node .tape.mjs && npm run test:exports",
44
- "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs",
45
- "cli": "css-blank-pseudo",
46
- "test:exports": "node ./test/_import.mjs && node ./test/_require.cjs"
47
- },
48
- "engines": {
49
- "node": "^12 || ^14 || >=16"
50
- },
51
- "dependencies": {
52
- "postcss-selector-parser": "^6.0.9"
53
- },
54
- "peerDependencies": {
55
- "postcss": "^8.4"
56
- },
57
- "keywords": [
58
- "postcss",
59
- "css",
60
- "postcss-plugin",
61
- "javascript",
62
- "js",
63
- "polyfill",
64
- "blank",
65
- "empty",
66
- "pseudo",
67
- "selectors",
68
- "accessibility",
69
- "a11y",
70
- "input",
71
- "select",
72
- "textarea"
73
- ],
74
- "repository": {
75
- "type": "git",
76
- "url": "https://github.com/csstools/postcss-plugins.git",
77
- "directory": "plugins/css-blank-pseudo"
78
- },
79
- "volta": {
80
- "extends": "../../package.json"
81
- }
2
+ "name": "css-blank-pseudo",
3
+ "description": "Style form elements when they are empty",
4
+ "version": "4.0.0",
5
+ "contributors": [
6
+ {
7
+ "name": "Antonio Laguna",
8
+ "email": "antonio@laguna.es",
9
+ "url": "https://antonio.laguna.es"
10
+ },
11
+ {
12
+ "name": "Romain Menke",
13
+ "email": "romainmenke@gmail.com"
14
+ },
15
+ {
16
+ "name": "Jonathan Neal",
17
+ "email": "jonathantneal@hotmail.com"
18
+ }
19
+ ],
20
+ "license": "CC0-1.0",
21
+ "funding": {
22
+ "type": "opencollective",
23
+ "url": "https://opencollective.com/csstools"
24
+ },
25
+ "engines": {
26
+ "node": "^12 || ^14 || >=16"
27
+ },
28
+ "main": "dist/index.cjs",
29
+ "module": "dist/index.mjs",
30
+ "types": "dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "import": "./dist/index.mjs",
34
+ "require": "./dist/index.cjs",
35
+ "default": "./dist/index.mjs"
36
+ },
37
+ "./browser": {
38
+ "import": "./dist/browser.mjs",
39
+ "require": "./dist/browser.cjs",
40
+ "default": "./dist/browser.mjs"
41
+ },
42
+ "./browser-global": {
43
+ "default": "./dist/browser-global.js"
44
+ }
45
+ },
46
+ "files": [
47
+ "CHANGELOG.md",
48
+ "LICENSE.md",
49
+ "README.md",
50
+ "dist"
51
+ ],
52
+ "dependencies": {
53
+ "postcss-selector-parser": "^6.0.10"
54
+ },
55
+ "peerDependencies": {
56
+ "postcss": "^8.2"
57
+ },
58
+ "devDependencies": {
59
+ "puppeteer": "^15.1.1"
60
+ },
61
+ "scripts": {
62
+ "build": "rollup -c ../../rollup/default.js",
63
+ "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"",
64
+ "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs",
65
+ "lint": "npm run lint:eslint && npm run lint:package-json",
66
+ "lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
67
+ "lint:package-json": "node ../../.github/bin/format-package-json.mjs",
68
+ "prepublishOnly": "npm run clean && npm run build && npm run test",
69
+ "test": "node .tape.mjs && npm run test:exports && npm run test:invalid-replacement",
70
+ "test:browser": "node ./test/_browser.mjs",
71
+ "test:exports": "node ./test/_import.mjs && node ./test/_require.cjs",
72
+ "test:invalid-replacement": "node ./test/_valid-replacements.mjs",
73
+ "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
74
+ },
75
+ "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo#readme",
76
+ "repository": {
77
+ "type": "git",
78
+ "url": "https://github.com/csstools/postcss-plugins.git",
79
+ "directory": "plugins/css-blank-pseudo"
80
+ },
81
+ "bugs": "https://github.com/csstools/postcss-plugins/issues",
82
+ "keywords": [
83
+ "a11y",
84
+ "accessibility",
85
+ "blank",
86
+ "css",
87
+ "empty",
88
+ "input",
89
+ "javascript",
90
+ "js",
91
+ "polyfill",
92
+ "postcss",
93
+ "postcss-plugin",
94
+ "pseudo",
95
+ "select",
96
+ "selectors",
97
+ "textarea"
98
+ ],
99
+ "csstools": {
100
+ "cssdbId": "blank-pseudo-class",
101
+ "exportName": "postcssBlankPseudo",
102
+ "humanReadableName": "PostCSS Blank Pseudo",
103
+ "specUrl": "https://www.w3.org/TR/selectors-4/#blank"
104
+ },
105
+ "volta": {
106
+ "extends": "../../package.json"
107
+ }
82
108
  }
package/browser.js DELETED
@@ -1,2 +0,0 @@
1
- self.cssBlankPseudo=function(e,t){var n=Object(t).className,r=Object(t).attr||"blank",o=Object(t).force;try{if(e.querySelector(":blank"),!o)return}catch(e){}var a,i,s,c=(e.ownerDocument||e).defaultView;d(c.HTMLInputElement),d(c.HTMLSelectElement),d(c.HTMLTextAreaElement),a=c.HTMLOptionElement,i=Object.getOwnPropertyDescriptor(a.prototype,"selected"),s=i.set,i.set=function(t){s.apply(this,arguments);var n=e.createEvent("Event");n.initEvent("change",!0,!0),this.dispatchEvent(n)},Object.defineProperty(a.prototype,"selected",i);var l=/^(INPUT|SELECT|TEXTAREA)$/;function p(){this.value||"SELECT"===this.nodeName&&this.options[this.selectedIndex].value?(r&&this.removeAttribute(r),n&&this.classList.remove(n),this.removeAttribute("blank")):(r&&this.setAttribute("blank",r),n&&this.classList.add(n))}function d(e){var t=Object.getOwnPropertyDescriptor(e.prototype,"value"),n=t.set;t.set=function(e){n.apply(this,arguments),p.apply(this)},Object.defineProperty(e.prototype,"value",t)}Array.prototype.forEach.call(e.querySelectorAll("INPUT,SELECT,TEXTAREA"),(function(e){"SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e)})),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.addEventListener("change",p):e.addEventListener("input",p),p.call(e))})),Array.prototype.forEach.call(e.removedNodes||[],(function(e){1===e.nodeType&&l.test(e.nodeName)&&("SELECT"===e.nodeName?e.removeEventListener("change",p):e.removeEventListener("input",p))}))}))})).observe(e,{childList:!0,subtree:!0})};
2
- //# sourceMappingURL=browser-global.js.map
package/dist/cli.cjs DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- "use strict";var e=require("postcss-selector-parser"),t=require("tty"),r=require("path"),n=require("url"),s=require("fs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),a=i(t),l=i(r),u=i(n),c=i(s);const h=e=>{const t=String(Object(e).replaceWith||"[blank]"),r=o.default().astSync(t),n=Boolean(!("preserve"in Object(e))||e.preserve);return{postcssPlugin:"css-blank-pseudo",Rule:(e,{result:t})=>{if(-1===e.selector.indexOf(":blank"))return;let s;try{const t=o.default((e=>{e.walkPseudos((e=>{":blank"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(r.clone()))}))})).processSync(e.selector);s=String(t)}catch(r){return void e.warn(t,`Failed to parse selector : ${e.selector}`)}if(void 0===s)return;if(s===e.selector)return;const i=e.clone({selector:s});n?e.before(i):e.replaceWith(i)}}};var p;h.postcss=!0,function(e){e.InvalidArguments="INVALID_ARGUMENTS"}(p||(p={}));var f={exports:{}};let d=a.default,g=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||d.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),m=(e,t,r=e)=>n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+w(s,t,r,i)+t:e+s+t},w=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),o=i.indexOf(t);return~o?s+w(i,t,r,o):s+i},y=(e=g)=>({isColorSupported:e,reset:e?e=>`${e}`:String,bold:e?m("","",""):String,dim:e?m("","",""):String,italic:e?m("",""):String,underline:e?m("",""):String,inverse:e?m("",""):String,hidden:e?m("",""):String,strikethrough:e?m("",""):String,black:e?m("",""):String,red:e?m("",""):String,green:e?m("",""):String,yellow:e?m("",""):String,blue:e?m("",""):String,magenta:e?m("",""):String,cyan:e?m("",""):String,white:e?m("",""):String,gray:e?m("",""):String,bgBlack:e?m("",""):String,bgRed:e?m("",""):String,bgGreen:e?m("",""):String,bgYellow:e?m("",""):String,bgBlue:e?m("",""):String,bgMagenta:e?m("",""):String,bgCyan:e?m("",""):String,bgWhite:e?m("",""):String});f.exports=y(),f.exports.createColors=y;const v="'".charCodeAt(0),S='"'.charCodeAt(0),C="\\".charCodeAt(0),b="/".charCodeAt(0),_="\n".charCodeAt(0),x=" ".charCodeAt(0),O="\f".charCodeAt(0),A="\t".charCodeAt(0),M="\r".charCodeAt(0),k="[".charCodeAt(0),E="]".charCodeAt(0),L="(".charCodeAt(0),R=")".charCodeAt(0),P="{".charCodeAt(0),I="}".charCodeAt(0),j=";".charCodeAt(0),N="*".charCodeAt(0),U=":".charCodeAt(0),B="@".charCodeAt(0),D=/[\t\n\f\r "#'()/;[\\\]{}]/g,F=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,T=/.[\n"'(/\\]/,$=/[\da-f]/i;var G=function(e,t={}){let r,n,s,i,o,a,l,u,c,h,p=e.css.valueOf(),f=t.ignoreErrors,d=p.length,g=0,m=[],w=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){w.push(e)},nextToken:function(e){if(w.length)return w.pop();if(g>=d)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(g),r){case _:case x:case A:case M:case O:n=g;do{n+=1,r=p.charCodeAt(n)}while(r===x||r===_||r===A||r===M||r===O);h=["space",p.slice(g,n)],g=n-1;break;case k:case E:case P:case I:case U:case j:case R:{let e=String.fromCharCode(r);h=[e,e,g];break}case L:if(u=m.length?m.pop()[1]:"",c=p.charCodeAt(g+1),"url"===u&&c!==v&&c!==S&&c!==x&&c!==_&&c!==A&&c!==O&&c!==M){n=g;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(f||t){n=g;break}y("bracket")}for(l=n;p.charCodeAt(l-1)===C;)l-=1,a=!a}while(a);h=["brackets",p.slice(g,n+1),g,n],g=n}else n=p.indexOf(")",g+1),i=p.slice(g,n+1),-1===n||T.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case v:case S:s=r===v?"'":'"',n=g;do{if(a=!1,n=p.indexOf(s,n+1),-1===n){if(f||t){n=g+1;break}y("string")}for(l=n;p.charCodeAt(l-1)===C;)l-=1,a=!a}while(a);h=["string",p.slice(g,n+1),g,n],g=n;break;case B:D.lastIndex=g+1,D.test(p),n=0===D.lastIndex?p.length-1:D.lastIndex-2,h=["at-word",p.slice(g,n+1),g,n],g=n;break;case C:for(n=g,o=!0;p.charCodeAt(n+1)===C;)n+=1,o=!o;if(r=p.charCodeAt(n+1),o&&r!==b&&r!==x&&r!==_&&r!==A&&r!==M&&r!==O&&(n+=1,$.test(p.charAt(n)))){for(;$.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===x&&(n+=1)}h=["word",p.slice(g,n+1),g,n],g=n;break;default:r===b&&p.charCodeAt(g+1)===N?(n=p.indexOf("*/",g+2)+1,0===n&&(f||t?n=p.length:y("comment")),h=["comment",p.slice(g,n+1),g,n],g=n):(F.lastIndex=g+1,F.test(p),n=0===F.lastIndex?p.length-1:F.lastIndex-2,h=["word",p.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},endOfFile:function(){return 0===w.length&&g>=d},position:function(){return g}}};let z,W=f.exports,V=G;const J={brackets:W.cyan,"at-word":W.cyan,comment:W.gray,string:W.green,class:W.yellow,hash:W.magenta,call:W.cyan,"(":W.cyan,")":W.cyan,"{":W.yellow,"}":W.yellow,"[":W.yellow,"]":W.yellow,":":W.yellow,";":W.yellow};function q([e,t],r){if("word"===e){if("."===t[0])return"class";if("#"===t[0])return"hash"}if(!r.endOfFile()){let e=r.nextToken();if(r.back(e),"brackets"===e[0]||"("===e[0])return"call"}return e}function Y(e){let t=V(new z(e),{ignoreErrors:!0}),r="";for(;!t.endOfFile();){let e=t.nextToken(),n=J[q(e,t)];r+=n?e[1].split(/\r?\n/).map((e=>n(e))).join("\n"):e[1]}return r}Y.registerInput=function(e){z=e};var Q=Y;let Z=f.exports,H=Q;class K extends Error{constructor(e,t,r,n,s,i){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,K)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Z.isColorSupported),H&&e&&(t=H(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,red:t,gray:s}=Z.createColors(!0);r=r=>e(t(r)),n=e=>s(e)}else r=n=e=>e;return s.slice(i,o).map(((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}var X=K;K.default=K;var ee={};ee.isClean=Symbol("isClean"),ee.my=Symbol("my");const te={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:!1};class re{constructor(e){this.builder=e}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)}document(e){this.body(e)}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return te[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var o;return void 0===n&&(n=te[r]),i.rawCache[r]=n,n}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}}var ne=re;re.default=re;let se=ne;function ie(e,t){new se(t).stringify(e)}var oe=ie;ie.default=ie;let{isClean:ae,my:le}=ee,ue=X,ce=ne,he=oe;function pe(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map((e=>pe(e,r))):("object"===i&&null!==s&&(s=pe(s)),r[n]=s)}return r}class fe{constructor(e={}){this.raws={},this[ae]=!1,this[le]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}error(e,t={}){if(this.source){let{start:r,end:n}=this.rangeBy(t);return this.source.input.error(e,{line:r.line,column:r.column},{line:n.line,column:n.column},t)}return new ue(e)}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=he){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}assign(e={}){for(let t in e)this[t]=e[t];return this}clone(e={}){let t=pe(this);for(let r in e)t[r]=e[r];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}raw(e,t){return(new ce).raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={inputId:i,start:n.start,end:n.end}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}positionInside(e){let t=this.toString(),r=this.source.start.column,n=this.source.start.line;for(let s=0;s<e;s++)"\n"===t[s]?(r=1,n+=1):r+=1;return{line:n,column:r}}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r=this.toString().indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}rangeBy(e){let t={line:this.source.start.line,column:this.source.start.column},r=this.source.end?{line:this.source.end.line,column:this.source.end.column+1}:{line:t.line,column:t.column+1};if(e.word){let n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n),r=this.positionInside(n+e.word.length))}else e.start?t={line:e.start.line,column:e.start.column}:e.index&&(t=this.positionInside(e.index)),e.end?r={line:e.end.line,column:e.end.column}:e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={line:t.line,column:t.column+1}),{start:t,end:r}}getProxyProcessor(){return{set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}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}markDirty(){if(this[ae]){this[ae]=!1;let e=this;for(;e=e.parent;)e[ae]=!1}}get proxyOf(){return this}}var de=fe;fe.default=fe;let ge=de;class me extends ge{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}var we=me;me.default=me;var ye={},ve={},Se={},Ce={},be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ce.encode=function(e){if(0<=e&&e<be.length)return be[e];throw new TypeError("Must be between 0 and 63: "+e)},Ce.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1};var _e=Ce;Se.encode=function(e){var t,r="",n=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&n,(n>>>=5)>0&&(t|=32),r+=_e.encode(t)}while(n>0);return r},Se.decode=function(e,t,r){var n,s,i,o,a=e.length,l=0,u=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=_e.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(32&s),l+=(s&=31)<<u,u+=5}while(n);r.value=(o=(i=l)>>1,1==(1&i)?-o:o),r.rest=t};var xe={};!function(e){e.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function n(e){var r=e.match(t);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}function s(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}e.urlParse=n,e.urlGenerate=s;var i,o,a=(i=function(t){var r=t,i=n(t);if(i){if(!i.path)return t;r=i.path}for(var o=e.isAbsolute(r),a=[],l=0,u=0;;){if(l=u,-1===(u=r.indexOf("/",l))){a.push(r.slice(l));break}for(a.push(r.slice(l,u));u<r.length&&"/"===r[u];)u++}var c,h=0;for(u=a.length-1;u>=0;u--)"."===(c=a[u])?a.splice(u,1):".."===c?h++:h>0&&(""===c?(a.splice(u+1,h),h=0):(a.splice(u,2),h--));return""===(r=a.join("/"))&&(r=o?"/":"."),i?(i.path=r,s(i)):r},o=[],function(e){for(var t=0;t<o.length;t++)if(o[t].input===e){var r=o[0];return o[0]=o[t],o[t]=r,o[0].result}var n=i(e);return o.unshift({input:e,result:n}),o.length>32&&o.pop(),n});function l(e,t){""===e&&(e="."),""===t&&(t=".");var i=n(t),o=n(e);if(o&&(e=o.path||"/"),i&&!i.scheme)return o&&(i.scheme=o.scheme),s(i);if(i||t.match(r))return t;if(o&&!o.host&&!o.path)return o.host=t,s(o);var l="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return o?(o.path=l,s(o)):l}e.normalize=a,e.join=l,e.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},e.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}e.toSetString=u?c:function(e){return h(e)?"$"+e:e},e.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},e.compareByOriginalPositions=function(e,t,r){var n=p(e.source,t.source);return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},e.compareByOriginalPositionsNoSource=function(e,t,r){var n;return 0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},e.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.compareByGeneratedPositionsDeflatedNoLine=function(e,t,r){var n=e.generatedColumn-t.generatedColumn;return 0!==n||r||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=p(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},e.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(e,t,r){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),r){var i=n(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var o=i.path.lastIndexOf("/");o>=0&&(i.path=i.path.substring(0,o+1))}t=l(s(i),t)}return a(t)}}(xe);var Oe={},Ae=xe,Me=Object.prototype.hasOwnProperty,ke="undefined"!=typeof Map;function Ee(){this._array=[],this._set=ke?new Map:Object.create(null)}Ee.fromArray=function(e,t){for(var r=new Ee,n=0,s=e.length;n<s;n++)r.add(e[n],t);return r},Ee.prototype.size=function(){return ke?this._set.size:Object.getOwnPropertyNames(this._set).length},Ee.prototype.add=function(e,t){var r=ke?e:Ae.toSetString(e),n=ke?this.has(e):Me.call(this._set,r),s=this._array.length;n&&!t||this._array.push(e),n||(ke?this._set.set(e,s):this._set[r]=s)},Ee.prototype.has=function(e){if(ke)return this._set.has(e);var t=Ae.toSetString(e);return Me.call(this._set,t)},Ee.prototype.indexOf=function(e){if(ke){var t=this._set.get(e);if(t>=0)return t}else{var r=Ae.toSetString(e);if(Me.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},Ee.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},Ee.prototype.toArray=function(){return this._array.slice()},Oe.ArraySet=Ee;var Le={},Re=xe;function Pe(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Pe.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},Pe.prototype.add=function(e){var t,r,n,s,i,o;t=this._last,r=e,n=t.generatedLine,s=r.generatedLine,i=t.generatedColumn,o=r.generatedColumn,s>n||s==n&&o>=i||Re.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},Pe.prototype.toArray=function(){return this._sorted||(this._array.sort(Re.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},Le.MappingList=Pe;var Ie=Se,je=xe,Ne=Oe.ArraySet,Ue=Le.MappingList;function Be(e){e||(e={}),this._file=je.getArg(e,"file",null),this._sourceRoot=je.getArg(e,"sourceRoot",null),this._skipValidation=je.getArg(e,"skipValidation",!1),this._sources=new Ne,this._names=new Ne,this._mappings=new Ue,this._sourcesContents=null}Be.prototype._version=3,Be.fromSourceMap=function(e){var t=e.sourceRoot,r=new Be({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=je.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(n){var s=n;null!==t&&(s=je.relative(t,n)),r._sources.has(s)||r._sources.add(s);var i=e.sourceContentFor(n);null!=i&&r.setSourceContent(n,i)})),r},Be.prototype.addMapping=function(e){var t=je.getArg(e,"generated"),r=je.getArg(e,"original",null),n=je.getArg(e,"source",null),s=je.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,s),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:s})},Be.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=je.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[je.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[je.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},Be.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var s=this._sourceRoot;null!=s&&(n=je.relative(s,n));var i=new Ne,o=new Ne;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=je.join(r,t.source)),null!=s&&(t.source=je.relative(s,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||i.has(l)||i.add(l);var u=t.name;null==u||o.has(u)||o.add(u)}),this),this._sources=i,this._names=o,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=je.join(r,t)),null!=s&&(t=je.relative(s,t)),this.setSourceContent(t,n))}),this)},Be.prototype._validateMapping=function(e,t,r,n){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},Be.prototype._serializeMappings=function(){for(var e,t,r,n,s=0,i=1,o=0,a=0,l=0,u=0,c="",h=this._mappings.toArray(),p=0,f=h.length;p<f;p++){if(e="",(t=h[p]).generatedLine!==i)for(s=0;t.generatedLine!==i;)e+=";",i++;else if(p>0){if(!je.compareByGeneratedPositionsInflated(t,h[p-1]))continue;e+=","}e+=Ie.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=Ie.encode(n-u),u=n,e+=Ie.encode(t.originalLine-1-a),a=t.originalLine-1,e+=Ie.encode(t.originalColumn-o),o=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=Ie.encode(r-l),l=r)),c+=e}return c},Be.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=je.relative(t,e));var r=je.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},Be.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},Be.prototype.toString=function(){return JSON.stringify(this.toJSON())},ve.SourceMapGenerator=Be;var De={},Fe={};!function(e){function t(r,n,s,i,o,a){var l=Math.floor((n-r)/2)+r,u=o(s,i[l],!0);return 0===u?l:u>0?n-l>1?t(l,n,s,i,o,a):a==e.LEAST_UPPER_BOUND?n<i.length?n:-1:l:l-r>1?t(r,l,s,i,o,a):a==e.LEAST_UPPER_BOUND?l:r<0?-1:r}e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function(r,n,s,i){if(0===n.length)return-1;var o=t(-1,n.length,r,n,s,i||e.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===s(n[o],n[o-1],!0);)--o;return o}}(Fe);var Te={};function $e(e){function t(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}return function e(r,n,s,i){if(s<i){var o=s-1;t(r,(c=s,h=i,Math.round(c+Math.random()*(h-c))),i);for(var a=r[i],l=s;l<i;l++)n(r[l],a,!1)<=0&&t(r,o+=1,l);t(r,o+1,l);var u=o+1;e(r,n,s,u-1),e(r,n,u+1,i)}var c,h}}let Ge=new WeakMap;Te.quickSort=function(e,t,r=0){let n=Ge.get(t);void 0===n&&(n=function(e){let t=$e.toString();return new Function(`return ${t}`)()(e)}(t),Ge.set(t,n)),n(e,t,r,e.length-1)};var ze=xe,We=Fe,Ve=Oe.ArraySet,Je=Se,qe=Te.quickSort;function Ye(e,t){var r=e;return"string"==typeof e&&(r=ze.parseSourceMapInput(e)),null!=r.sections?new Xe(r,t):new Qe(r,t)}function Qe(e,t){var r=e;"string"==typeof e&&(r=ze.parseSourceMapInput(e));var n=ze.getArg(r,"version"),s=ze.getArg(r,"sources"),i=ze.getArg(r,"names",[]),o=ze.getArg(r,"sourceRoot",null),a=ze.getArg(r,"sourcesContent",null),l=ze.getArg(r,"mappings"),u=ze.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=ze.normalize(o)),s=s.map(String).map(ze.normalize).map((function(e){return o&&ze.isAbsolute(o)&&ze.isAbsolute(e)?ze.relative(o,e):e})),this._names=Ve.fromArray(i.map(String),!0),this._sources=Ve.fromArray(s,!0),this._absoluteSources=this._sources.toArray().map((function(e){return ze.computeSourceURL(o,e,t)})),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=t,this.file=u}function Ze(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Ye.fromSourceMap=function(e,t){return Qe.fromSourceMap(e,t)},Ye.prototype._version=3,Ye.prototype.__generatedMappings=null,Object.defineProperty(Ye.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),Ye.prototype.__originalMappings=null,Object.defineProperty(Ye.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),Ye.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},Ye.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},Ye.GENERATED_ORDER=1,Ye.ORIGINAL_ORDER=2,Ye.GREATEST_LOWER_BOUND=1,Ye.LEAST_UPPER_BOUND=2,Ye.prototype.eachMapping=function(e,t,r){var n,s=t||null;switch(r||Ye.GENERATED_ORDER){case Ye.GENERATED_ORDER:n=this._generatedMappings;break;case Ye.ORIGINAL_ORDER:n=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var i=this.sourceRoot,o=e.bind(s),a=this._names,l=this._sources,u=this._sourceMapURL,c=0,h=n.length;c<h;c++){var p=n[c],f=null===p.source?null:l.at(p.source);o({source:f=ze.computeSourceURL(i,f,u),generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:null===p.name?null:a.at(p.name)})}},Ye.prototype.allGeneratedPositionsFor=function(e){var t=ze.getArg(e,"line"),r={source:ze.getArg(e,"source"),originalLine:t,originalColumn:ze.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var n=[],s=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",ze.compareByOriginalPositions,We.LEAST_UPPER_BOUND);if(s>=0){var i=this._originalMappings[s];if(void 0===e.column)for(var o=i.originalLine;i&&i.originalLine===o;)n.push({line:ze.getArg(i,"generatedLine",null),column:ze.getArg(i,"generatedColumn",null),lastColumn:ze.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++s];else for(var a=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==a;)n.push({line:ze.getArg(i,"generatedLine",null),column:ze.getArg(i,"generatedColumn",null),lastColumn:ze.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++s]}return n},De.SourceMapConsumer=Ye,Qe.prototype=Object.create(Ye.prototype),Qe.prototype.consumer=Ye,Qe.prototype._findSourceIndex=function(e){var t,r=e;if(null!=this.sourceRoot&&(r=ze.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},Qe.fromSourceMap=function(e,t){var r=Object.create(Qe.prototype),n=r._names=Ve.fromArray(e._names.toArray(),!0),s=r._sources=Ve.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=t,r._absoluteSources=r._sources.toArray().map((function(e){return ze.computeSourceURL(r.sourceRoot,e,t)}));for(var i=e._mappings.toArray().slice(),o=r.__generatedMappings=[],a=r.__originalMappings=[],l=0,u=i.length;l<u;l++){var c=i[l],h=new Ze;h.generatedLine=c.generatedLine,h.generatedColumn=c.generatedColumn,c.source&&(h.source=s.indexOf(c.source),h.originalLine=c.originalLine,h.originalColumn=c.originalColumn,c.name&&(h.name=n.indexOf(c.name)),a.push(h)),o.push(h)}return qe(r.__originalMappings,ze.compareByOriginalPositions),r},Qe.prototype._version=3,Object.defineProperty(Qe.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const He=ze.compareByGeneratedPositionsDeflatedNoLine;function Ke(e,t){let r=e.length,n=e.length-t;if(!(n<=1))if(2==n){let r=e[t],n=e[t+1];He(r,n)>0&&(e[t]=n,e[t+1]=r)}else if(n<20)for(let n=t;n<r;n++)for(let r=n;r>t;r--){let t=e[r-1],n=e[r];if(He(t,n)<=0)break;e[r-1]=n,e[r]=t}else qe(e,He,t)}function Xe(e,t){var r=e;"string"==typeof e&&(r=ze.parseSourceMapInput(e));var n=ze.getArg(r,"version"),s=ze.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Ve,this._names=new Ve;var i={line:-1,column:0};this._sections=s.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=ze.getArg(e,"offset"),n=ze.getArg(r,"line"),s=ze.getArg(r,"column");if(n<i.line||n===i.line&&s<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=r,{generatedOffset:{generatedLine:n+1,generatedColumn:s+1},consumer:new Ye(ze.getArg(e,"map"),t)}}))}Qe.prototype._parseMappings=function(e,t){var r,n,s,i,o=1,a=0,l=0,u=0,c=0,h=0,p=e.length,f=0,d={},g=[],m=[];let w=0;for(;f<p;)if(";"===e.charAt(f))o++,f++,a=0,Ke(m,w),w=m.length;else if(","===e.charAt(f))f++;else{for((r=new Ze).generatedLine=o,s=f;s<p&&!this._charIsMappingSeparator(e,s);s++);for(e.slice(f,s),n=[];f<s;)Je.decode(e,f,d),i=d.value,f=d.rest,n.push(i);if(2===n.length)throw new Error("Found a source, but no line and column");if(3===n.length)throw new Error("Found a source and line, but no column");if(r.generatedColumn=a+n[0],a=r.generatedColumn,n.length>1&&(r.source=c+n[1],c+=n[1],r.originalLine=l+n[2],l=r.originalLine,r.originalLine+=1,r.originalColumn=u+n[3],u=r.originalColumn,n.length>4&&(r.name=h+n[4],h+=n[4])),m.push(r),"number"==typeof r.originalLine){let e=r.source;for(;g.length<=e;)g.push(null);null===g[e]&&(g[e]=[]),g[e].push(r)}}Ke(m,w),this.__generatedMappings=m;for(var y=0;y<g.length;y++)null!=g[y]&&qe(g[y],ze.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...g)},Qe.prototype._findMapping=function(e,t,r,n,s,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return We.search(e,t,s,i)},Qe.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},Qe.prototype.originalPositionFor=function(e){var t={generatedLine:ze.getArg(e,"line"),generatedColumn:ze.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",ze.compareByGeneratedPositionsDeflated,ze.getArg(e,"bias",Ye.GREATEST_LOWER_BOUND));if(r>=0){var n=this._generatedMappings[r];if(n.generatedLine===t.generatedLine){var s=ze.getArg(n,"source",null);null!==s&&(s=this._sources.at(s),s=ze.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var i=ze.getArg(n,"name",null);return null!==i&&(i=this._names.at(i)),{source:s,line:ze.getArg(n,"originalLine",null),column:ze.getArg(n,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},Qe.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},Qe.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var n,s=e;if(null!=this.sourceRoot&&(s=ze.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(n=ze.urlParse(this.sourceRoot))){var i=s.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!n.path||"/"==n.path)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(t)return null;throw new Error('"'+s+'" is not in the SourceMap.')},Qe.prototype.generatedPositionFor=function(e){var t=ze.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:ze.getArg(e,"line"),originalColumn:ze.getArg(e,"column")},n=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",ze.compareByOriginalPositions,ze.getArg(e,"bias",Ye.GREATEST_LOWER_BOUND));if(n>=0){var s=this._originalMappings[n];if(s.source===r.source)return{line:ze.getArg(s,"generatedLine",null),column:ze.getArg(s,"generatedColumn",null),lastColumn:ze.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},De.BasicSourceMapConsumer=Qe,Xe.prototype=Object.create(Ye.prototype),Xe.prototype.constructor=Ye,Xe.prototype._version=3,Object.defineProperty(Xe.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),Xe.prototype.originalPositionFor=function(e){var t={generatedLine:ze.getArg(e,"line"),generatedColumn:ze.getArg(e,"column")},r=We.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},Xe.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},Xe.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},Xe.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer._findSourceIndex(ze.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n)return{line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},Xe.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],s=n.consumer._generatedMappings,i=0;i<s.length;i++){var o=s[i],a=n.consumer._sources.at(o.source);a=ze.computeSourceURL(n.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var l=null;o.name&&(l=n.consumer._names.at(o.name),this._names.add(l),l=this._names.indexOf(l));var u={source:a,generatedLine:o.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(n.generatedOffset.generatedLine===o.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:l};this.__generatedMappings.push(u),"number"==typeof u.originalLine&&this.__originalMappings.push(u)}qe(this.__generatedMappings,ze.compareByGeneratedPositionsDeflated),qe(this.__originalMappings,ze.compareByOriginalPositions)},De.IndexedSourceMapConsumer=Xe;var et={},tt=ve.SourceMapGenerator,rt=xe,nt=/(\r?\n)/,st="$$$isSourceNode$$$";function it(e,t,r,n,s){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==s?null:s,this[st]=!0,null!=n&&this.add(n)}it.fromStringWithSourceMap=function(e,t,r){var n=new it,s=e.split(nt),i=0,o=function(){return e()+(e()||"");function e(){return i<s.length?s[i++]:void 0}},a=1,l=0,u=null;return t.eachMapping((function(e){if(null!==u){if(!(a<e.generatedLine)){var t=(r=s[i]||"").substr(0,e.generatedColumn-l);return s[i]=r.substr(e.generatedColumn-l),l=e.generatedColumn,c(u,t),void(u=e)}c(u,o()),a++,l=0}for(;a<e.generatedLine;)n.add(o()),a++;if(l<e.generatedColumn){var r=s[i]||"";n.add(r.substr(0,e.generatedColumn)),s[i]=r.substr(e.generatedColumn),l=e.generatedColumn}u=e}),this),i<s.length&&(u&&c(u,o()),n.add(s.splice(i).join(""))),t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=r&&(e=rt.join(r,e)),n.setSourceContent(e,s))})),n;function c(e,t){if(null===e||void 0===e.source)n.add(t);else{var s=r?rt.join(r,e.source):e.source;n.add(new it(e.originalLine,e.originalColumn,s,t,e.name))}}},it.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[st]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},it.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[st]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},it.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[st]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},it.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},it.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[st]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},it.prototype.setSourceContent=function(e,t){this.sourceContents[rt.toSetString(e)]=t},it.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][st]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(rt.fromSetString(n[t]),this.sourceContents[n[t]])},it.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},it.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new tt(e),n=!1,s=null,i=null,o=null,a=null;return this.walk((function(e,l){t.code+=e,null!==l.source&&null!==l.line&&null!==l.column?(s===l.source&&i===l.line&&o===l.column&&a===l.name||r.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),s=l.source,i=l.line,o=l.column,a=l.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),s=null,n=!1);for(var u=0,c=e.length;u<c;u++)10===e.charCodeAt(u)?(t.line++,t.column=0,u+1===c?(s=null,n=!1):n&&r.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},et.SourceNode=it,ye.SourceMapGenerator=ve.SourceMapGenerator,ye.SourceMapConsumer=De.SourceMapConsumer,ye.SourceNode=et.SourceNode;var ot={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t)=>()=>{let r="",n=t;for(;n--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:at,SourceMapGenerator:lt}=ye,{existsSync:ut,readFileSync:ct}=c.default,{dirname:ht,join:pt}=l.default;class ft{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ht(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new at(this.text)),this.consumerCache}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}startWith(e,t){return!!e&&e.substr(0,t.length)===t}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}loadFile(e){if(this.root=ht(e),ut(e))return this.mapFile=e,ct(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof at)return lt.fromSourceMap(t).toString();if(t instanceof lt)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=pt(ht(e),t)),this.loadFile(t)}}}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}}var dt=ft;ft.default=ft;let{SourceMapConsumer:gt,SourceMapGenerator:mt}=ye,{fileURLToPath:wt,pathToFileURL:yt}=u.default,{resolve:vt,isAbsolute:St}=l.default,{nanoid:Ct}=ot,bt=Q,_t=X,xt=dt,Ot=Symbol("fromOffsetCache"),At=Boolean(gt&&mt),Mt=Boolean(vt&&St);class kt{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Mt||/^\w+:\/\//.test(t.from)||St(t.from)?this.file=t.from:this.file=vt(t.from)),Mt&&At){let e=new xt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Ct(6)+">"),this.map&&(this.map.file=this.from)}fromOffset(e){let t,r;if(this[Ot])r=this[Ot];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Ot]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{line:n+1,col:e-r[n]+1}}error(e,t,r,n={}){let s,i,o;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof t.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new _t(e,void 0===a.endLine?a.line:{line:a.line,column:a.column},void 0===a.endLine?a.column:{line:a.endLine,column:a.endColumn},a.source,a.file,n.plugin):new _t(e,void 0===i?t:{line:t,column:r},void 0===i?r:{line:i,column:o},this.css,this.file,n.plugin),s.input={line:t,column:r,endLine:i,endColumn:o,source:this.css},this.file&&(yt&&(s.input.url=yt(this.file).toString()),s.input.file=this.file),s}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({line:e,column:t});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({line:r,column:n})),i=St(a.source)?yt(a.source):new URL(a.source,this.map.consumer().sourceRoot||yt(this.map.mapFile));let l={url:i.toString(),line:a.line,column:a.column,endLine:s&&s.line,endColumn:s&&s.column};if("file:"===i.protocol){if(!wt)throw new Error("file: protocol is not available in this PostCSS build");l.file=wt(i)}let u=o.sourceContentFor(a.source);return u&&(l.source=u),l}mapResolve(e){return/^\w+:\/\//.test(e)?e:vt(this.map.consumer().sourceRoot||this.map.root||".",e)}get from(){return this.file||this.id}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}var Et=kt;kt.default=kt,bt&&bt.registerInput&&bt.registerInput(kt);let{SourceMapConsumer:Lt,SourceMapGenerator:Rt}=ye,{dirname:Pt,resolve:It,relative:jt,sep:Nt}=l.default,{pathToFileURL:Ut}=u.default,Bt=Et,Dt=Boolean(Lt&&Rt),Ft=Boolean(Pt&&It&&jt&&Nt);var Tt=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}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 Bt(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;r&&!e[r]&&(e[r]=!0,this.map.setSourceContent(this.toUrl(this.path(r)),t.source.input.css))}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Pt(e.file);!1===this.mapOpts.sourcesContent?(t=new Lt(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Rt.fromSourceMap(e)}else this.map=new Rt({file:this.outputFile()}),this.map.addMapping({source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",generated:{line:1,column:0},original:{line:1,column:0}});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]}path(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;if(this.mapOpts.absolute)return e;let t=this.opts.to?Pt(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=Pt(It(t,this.mapOpts.annotation))),e=jt(t,e)}toUrl(e){return"\\"===Nt&&(e=e.replace(/\\/g,"/")),encodeURI(e).replace(/[#?]/g,encodeURIComponent)}sourcePath(e){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);if(this.mapOpts.absolute){if(Ut)return Ut(e.source.input.from).toString();throw new Error("`map.absolute` option is not available in this PostCSS build")}return this.toUrl(this.path(e.source.input.from))}generateString(){this.css="",this.map=new Rt({file:this.outputFile()});let e,t,r=1,n=1,s="<no source>",i={source:"",generated:{line:0,column:0},original:{line:0,column:0}};this.stringify(this.root,((o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"!==a.type||a!==e.last||e.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}}))}generate(){if(this.clearAnnotation(),Ft&&Dt&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}};let $t=de;class Gt extends $t{constructor(e){super(e),this.type="comment"}}var zt=Gt;Gt.default=Gt;let Wt,Vt,Jt,{isClean:qt,my:Yt}=ee,Qt=we,Zt=zt,Ht=de;function Kt(e){return e.map((e=>(e.nodes&&(e.nodes=Kt(e.nodes)),delete e.source,e)))}function Xt(e){if(e[qt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xt(t)}class er extends Ht{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let r,n=0===(e=this.index(e))&&"prepend",s=this.normalize(t,this.proxyOf.nodes[e],n).reverse();for(let t of s)this.proxyOf.nodes.splice(e,0,t);for(let t in this.indexes)r=this.indexes[t],e<=r&&(this.indexes[t]=r+s.length);return this.markDirty(),this}insertAfter(e,t){e=this.index(e);let r,n=this.normalize(t,this.proxyOf.nodes[e]).reverse();for(let t of n)this.proxyOf.nodes.splice(e+1,0,t);for(let t in this.indexes)r=this.indexes[t],e<r&&(this.indexes[t]=r+n.length);return this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}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]}normalize(e,t){if("string"==typeof e)e=Kt(Wt(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Qt(e)]}else if(e.selector)e=[new Vt(e)];else if(e.name)e=[new Jt(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Zt(e)]}return e.map((e=>(e[Yt]||er.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[qt]&&Xt(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this,e)))}getProxyProcessor(){return{set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]}}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}}er.registerParse=e=>{Wt=e},er.registerRule=e=>{Vt=e},er.registerAtRule=e=>{Jt=e};var tr=er;er.default=er,er.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Jt.prototype):"rule"===e.type?Object.setPrototypeOf(e,Vt.prototype):"decl"===e.type?Object.setPrototypeOf(e,Qt.prototype):"comment"===e.type&&Object.setPrototypeOf(e,Zt.prototype),e[Yt]=!0,e.nodes&&e.nodes.forEach((e=>{er.rebuild(e)}))};let rr,nr,sr=tr;class ir extends sr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new rr(new nr,this,e).stringify()}}ir.registerLazyResult=e=>{rr=e},ir.registerProcessor=e=>{nr=e};var or=ir;ir.default=ir;let ar={};var lr=function(e){ar[e]||(ar[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};class ur{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}var cr=ur;ur.default=ur;let hr=cr;class pr{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,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 r=new hr(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}var fr=pr;pr.default=pr;let dr=tr;class gr extends dr{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 mr=gr;gr.default=gr,dr.registerAtRule(gr);let wr,yr,vr=tr;class Sr extends vr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}toResult(e={}){return new wr(new yr,this,e).stringify()}}Sr.registerLazyResult=e=>{wr=e},Sr.registerProcessor=e=>{yr=e};var Cr=Sr;Sr.default=Sr;let br={split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l=!1;for(let r of e)l?l=!1:"\\"===r?l=!0:a?r===a&&(a=!1):'"'===r||"'"===r?a=r:"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n},space:e=>br.split(e,[" ","\n","\t"]),comma:e=>br.split(e,[","],!0)};var _r=br;br.default=br;let xr=tr,Or=_r;class Ar extends xr{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Or.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}var Mr=Ar;Ar.default=Ar,xr.registerRule(Ar);let kr=we,Er=G,Lr=zt,Rr=mr,Pr=Cr,Ir=Mr;var jr=class{constructor(e){this.input=e,this.root=new Pr,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{offset:0,line:1,column:1}}}createTokenizer(){this.tokenizer=Er(this.input)}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)}this.endFile()}comment(e){let t=new Lr;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]);let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}emptyRule(e){let t=new Ir;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}other(e){let t=!1,r=null,n=!1,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}rule(e){e.pop();let t=new Ir;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}decl(e,t){let r=new kr;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]);"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=o.map((e=>e[1])).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}atrule(e){let t,r,n,s=new Rr;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]))}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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=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}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{offset:e,line:t.line,column:t.col}}init(e,t){this.current.push(e),e.source={start:this.getPosition(t),input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}raw(e,t,r,n){let s,i,o,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1],o=r[e+1],a&&o&&"space"!==a[0]&&"space"!==o[0]?u+=s[1]:c=!1):u+=s[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={value:u,raw:n}}e[t]=u}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}unclosedBracket(e){throw this.input.error("Unclosed bracket",{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})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}precheckMissedSemicolon(){}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}};let Nr=tr,Ur=jr,Br=Et;function Dr(e,t){let r=new Br(e,t),n=new Ur(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Fr=Dr;Dr.default=Dr,Nr.registerParse(Dr);let{isClean:Tr,my:$r}=ee,Gr=Tt,zr=oe,Wr=tr,Vr=or,Jr=lr,qr=fr,Yr=Fr,Qr=Cr;const Zr={document:"Document",root:"Root",atrule:"AtRule",rule:"Rule",decl:"Declaration",comment:"Comment"},Hr={postcssPlugin:!0,prepare:!0,Once:!0,Document:!0,Root:!0,Declaration:!0,Rule:!0,AtRule:!0,Comment:!0,DeclarationExit:!0,RuleExit:!0,AtRuleExit:!0,CommentExit:!0,RootExit:!0,DocumentExit:!0,OnceExit:!0},Kr={postcssPlugin:!0,prepare:!0,Once:!0};function Xr(e){return"object"==typeof e&&"function"==typeof e.then}function en(e){let t=!1,r=Zr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function tn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:en(e),{node:e,events:t,eventIndex:0,visitors:[],visitorIndex:0,iterator:0}}function rn(e){return e[Tr]=!1,e.nodes&&e.nodes.forEach((e=>rn(e))),e}let nn={};class sn{constructor(e,t,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof sn||t instanceof qr)n=rn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=Yr;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(t,r)}catch(e){this.processed=!0,this.error=e}n&&!n[$r]&&Wr.rebuild(n)}else n=rn(t);this.result=new qr(e,n,r),this.helpers={...nn,result:this.result,postcss:nn},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}get[Symbol.toStringTag](){return"LazyResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.stringify().css}get content(){return this.stringify().content}get map(){return this.stringify().map}get root(){return this.sync().root}get messages(){return this.sync().messages}warnings(){return this.sync().warnings()}toString(){return this.css}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Jr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}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){if(Xr(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Tr];)e[Tr]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=zr;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Gr(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}walkSync(e){e[Tr]=!0;let t=en(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[Tr]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Xr(e))throw this.getAsyncError()}}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return Xr(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Xr(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Tr];){e[Tr]=!0;let t=[tn(e)];for(;t.length>0;){let e=this.visitTick(t);if(Xr(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Hr[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Kr[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[Tr])return n[Tr]=!0,void e.push(tn(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Tr]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}}sn.registerPostcss=e=>{nn=e};var on=sn;sn.default=sn,Qr.registerLazyResult(sn),Vr.registerLazyResult(sn);let an=Tt,ln=oe,un=lr,cn=Fr;const hn=fr;class pn{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=ln;this.result=new hn(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new an(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}get[Symbol.toStringTag](){return"NoWorkResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.result.css}get content(){return this.result.css}get map(){return this.result.map}get root(){if(this._root)return this._root;let e,t=cn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get messages(){return[]}warnings(){return[]}toString(){return this._css}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||un("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}sync(){if(this.error)throw this.error;return this.result}}var fn=pn;pn.default=pn;let dn=fn,gn=on,mn=or,wn=Cr;class yn{constructor(e=[]){this.version="8.4.6",this.plugins=this.normalize(e)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new dn(this,e,t):new gn(this,e,t)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}}var vn=yn;yn.default=yn,wn.registerProcessor(yn),mn.registerProcessor(yn);let Sn=we,Cn=dt,bn=zt,_n=mr,xn=Et,On=Cr,An=Mr;function Mn(e,t){if(Array.isArray(e))return e.map((e=>Mn(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:xn.prototype};r.map&&(r.map={...r.map,__proto__:Cn.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Mn(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new On(n);if("decl"===n.type)return new Sn(n);if("rule"===n.type)return new An(n);if("comment"===n.type)return new bn(n);if("atrule"===n.type)return new _n(n);throw new Error("Unknown node type: "+e.type)}var kn=Mn;Mn.default=Mn;let En=X,Ln=we,Rn=on,Pn=tr,In=vn,jn=oe,Nn=kn,Un=or,Bn=cr,Dn=zt,Fn=mr,Tn=fr,$n=Et,Gn=Fr,zn=_r,Wn=Mr,Vn=Cr,Jn=de;function qn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new In(e)}qn.plugin=function(e,t){function r(...r){let n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new In).version,n}let n;return console&&console.warn&&(console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226")),Object.defineProperty(r,"postcss",{get:()=>(n||(n=r()),n)}),r.process=function(e,t,n){return qn([r(n)]).process(e,t)},r},qn.stringify=jn,qn.parse=Gn,qn.fromJSON=Nn,qn.list=zn,qn.comment=e=>new Dn(e),qn.atRule=e=>new Fn(e),qn.decl=e=>new Ln(e),qn.rule=e=>new Wn(e),qn.root=e=>new Vn(e),qn.document=e=>new Un(e),qn.CssSyntaxError=En,qn.Declaration=Ln,qn.Container=Pn,qn.Processor=In,qn.Document=Un,qn.Comment=Dn,qn.Warning=Bn,qn.AtRule=Fn,qn.Result=Tn,qn.Input=$n,qn.Rule=Wn,qn.Root=Vn,qn.Node=Jn,Rn.registerPostcss(qn);var Yn=qn;async function Qn(){return new Promise((e=>{let t="",r=!1;if(setTimeout((()=>{r=!0,e("")}),1e4),process.stdin.isTTY){if(r)return;e(t)}else process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let e;for(;e=process.stdin.read();)t+=e})),process.stdin.on("end",(()=>{r||e(t)}))}))}qn.default=qn,async function(e,t,r,n=!0){const i=function(e,t,r){const n=e.map((e=>e.trim())).filter((e=>!!e)),s={stdin:!1,stdout:!1,output:null,outputDir:null,inputs:[],inlineMap:!0,externalMap:!1,replace:!1,pluginOptions:{},debug:!1};let i=null,o=!1;for(let e=0;e<n.length;e++){const t=n[e];switch(t){case"-o":case"--output":s.output=n[e+1],e++,o=!0;break;case"-m":case"--map":s.externalMap=!0,s.inlineMap=!1,o=!0;break;case"--no-map":s.externalMap=!1,s.inlineMap=!1,o=!0;break;case"-r":case"--replace":s.replace=!0,o=!0;break;case"--debug":s.debug=!0,o=!0;break;case"-d":case"--dir":s.outputDir=n[e+1],e++,o=!0;break;case"-p":case"--plugin-options":i=n[e+1],e++,o=!0;break;default:if(0===t.indexOf("-"))return console.warn(`[error] unknown argument : ${t}\n`),r(),p.InvalidArguments;if(!o){s.inputs.push(t);break}return r(),p.InvalidArguments}}if(s.replace&&(s.output=null,s.outputDir=null),s.outputDir&&(s.output=null),s.inputs.length>1&&s.output)return console.warn('[error] omit "--output" when processing multiple inputs\n'),r(),p.InvalidArguments;0===s.inputs.length&&(s.stdin=!0),s.output||s.outputDir||s.replace||(s.stdout=!0),s.stdout&&(s.externalMap=!1);let a={};if(i)try{a=JSON.parse(i)}catch(e){return console.warn("[error] plugin options must be valid JSON\n"),r(),p.InvalidArguments}for(const e in a){const n=a[e];if(!t.includes(e))return console.warn(`[error] unknown plugin option: ${e}\n`),r(),p.InvalidArguments;s.pluginOptions[e]=n}return s}(process.argv.slice(n?2:3),t,r);i===p.InvalidArguments&&process.exit(1);const o=e(i.pluginOptions);i.stdin&&i.stdout?await async function(e,t,r){let n="";try{const s=await Qn();s||(r(),process.exit(1));const i=await Yn([e]).process(s,{from:"stdin",to:"stdout",map:!!t.inlineMap&&{inline:!0}});i.warnings().forEach((e=>{console.warn(e.toString())})),n=i.css}catch(e){console.error(t.debug?e:e.message),process.exit(1)}process.stdout.write(n+(t.inlineMap?"\n":"")),process.exit(0)}(o,i,r):i.stdin?await async function(e,t,r){let n=t.output;!n&&t.outputDir&&(n=l.default.join(t.outputDir,"output.css"));try{const i=await Qn();i||(r(),process.exit(1));const o=await Yn([e]).process(i,{from:"stdin",to:n,map:!(!t.inlineMap&&!t.externalMap)&&{inline:t.inlineMap}});o.warnings().forEach((e=>{console.warn(e.toString())})),t.externalMap&&o.map?await Promise.all([await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":"")),await s.promises.writeFile(`${n}.map`,o.map.toString())]):await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":""))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}console.log(`CSS was written to "${l.default.normalize(n)}"`),process.exit(0)}(o,i,r):i.stdout?await async function(e,t){let r=[];try{r=await Promise.all(t.inputs.map((async t=>{const r=await s.promises.readFile(t),n=await Yn([e]).process(r,{from:t,to:"stdout",map:!1});return n.warnings().forEach((e=>{console.warn(e.toString())})),n.css})))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}for(const e of r)process.stdout.write(e);process.exit(0)}(o,i):await async function(e,t){try{await Promise.all(t.inputs.map((async r=>{let n=t.output;t.outputDir&&(n=l.default.join(t.outputDir,l.default.basename(r))),t.replace&&(n=r);const i=await s.promises.readFile(r),o=await Yn([e]).process(i,{from:r,to:n,map:!(!t.inlineMap&&!t.externalMap)&&{inline:t.inlineMap}});o.warnings().forEach((e=>{console.warn(e.toString())})),t.externalMap&&o.map?await Promise.all([await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":"")),await s.promises.writeFile(`${n}.map`,o.map.toString())]):await s.promises.writeFile(n,o.css+(t.inlineMap?"\n":"")),console.log(`CSS was written to "${l.default.normalize(n)}"`)})))}catch(e){console.error(t.debug?e:e.message),process.exit(1)}process.exit(0)}(o,i)}(h,["preserve","replaceWith"],function(e,t,r,n=null){let s=[];if(n){const e=Math.max(...Object.keys(n).map((e=>e.length))),t=new Array(e).fill(" ").join("");t.length&&(s=["\nPlugin Options:",...Object.keys(n).map((e=>` ${(e+t).slice(0,t.length)} ${typeof n[e]}`))],s.push(`\n ${JSON.stringify(n,null,2).split("\n").join("\n ")}`))}const i=[`${t}\n`,` ${r}\n`,"Usage:",` ${e} [input.css] [OPTIONS] [-o|--output output.css]`,` ${e} <input.css>... [OPTIONS] --dir <output-directory>`,` ${e} <input.css>... [OPTIONS] --replace`,"\nOptions:"," -o, --output Output file"," -d, --dir Output directory"," -r, --replace Replace (overwrite) the input file"," -m, --map Create an external sourcemap"," --no-map Disable the default inline sourcemaps"," -p, --plugin-options Stringified JSON object with plugin options"];return s.length>0&&i.push(...s),()=>{console.warn(i.join("\n"))}}("css-blank-pseudo","PostCSS Blank Pseudo","Lets you style form elements when they are empty, following the Selectors Level 4 specification.",{preserve:!0,replaceWith:".css-blank"}));