diff --git a/dist/stylus-renderer.min.js b/dist/stylus-renderer.min.js index 6e4f8ae..2461c27 100644 --- a/dist/stylus-renderer.min.js +++ b/dist/stylus-renderer.min.js @@ -1,15 +1,14 @@ -var StylusRenderer=function(){"use strict";function assertPath(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function normalizeStringPosix(e,t){for(var n,i="",r=0,a=-1,o=0,h=0;h<=e.length;++h){if(h2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",r=0):r=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),a=h,o=0;continue}}else if(2===i.length||1===i.length){i="",r=0,a=h,o=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(a+1,h):i=e.slice(a+1,h),r=h-a-1;a=h,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var e={resolve:function resolve(){for(var e,t="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===e&&(e=process.cwd()),r=e),assertPath(r),0!==r.length&&(t=r+"/"+t,n=47===r.charCodeAt(0))}return t=normalizeStringPosix(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function normalize(e){if(assertPath(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=normalizeStringPosix(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function isAbsolute(e){return assertPath(e),e.length>0&&47===e.charCodeAt(0)},join:function join(){if(0===arguments.length)return".";for(var t,n=0;n0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":e.normalize(t)},relative:function relative(t,n){if(assertPath(t),assertPath(n),t===n)return"";if((t=e.resolve(t))===(n=e.resolve(n)))return"";for(var i=1;il){if(47===n.charCodeAt(o+u))return n.slice(o+u+1);if(0===u)return n.slice(o+u)}else a>l&&(47===t.charCodeAt(i+u)?c=u:0===u&&(c=0));break}var f=t.charCodeAt(i+u);if(f!==n.charCodeAt(o+u))break;47===f&&(c=u)}var m="";for(u=i+c+1;u<=r;++u)u!==r&&47!==t.charCodeAt(u)||(0===m.length?m+="..":m+="/..");return m.length>0?m+n.slice(o+c):(o+=c,47===n.charCodeAt(o)&&++o,n.slice(o))},_makeLong:function _makeLong(e){return e},dirname:function dirname(e){if(assertPath(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,i=-1,r=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!r){i=a;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function basename(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');assertPath(e);var n,i=0,r=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,h=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!a){i=n+1;break}}else-1===h&&(a=!1,h=n+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(r=n):(o=-1,r=h))}return i===r?r=h:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){i=n+1;break}}else-1===r&&(a=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname:function extname(e){assertPath(e);for(var t=-1,n=0,i=-1,r=!0,a=0,o=e.length-1;o>=0;--o){var h=e.charCodeAt(o);if(47!==h)-1===i&&(r=!1,i=o+1),46===h?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!r){n=o+1;break}}return-1===t||-1===i||0===a||1===a&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function format(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function _format(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}("/",e)},parse:function parse(e){assertPath(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0),r=47===i;r?(t.root="/",n=1):n=0;for(var a=-1,o=0,h=-1,l=!0,c=e.length-1,u=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===h&&(l=!1,h=c+1),46===i?-1===a?a=c:1!==u&&(u=1):-1!==a&&(u=-1);else if(!l){o=c+1;break}return-1===a||-1===h||0===u||1===u&&a===h-1&&a===o+1?-1!==h&&(t.base=t.name=0===o&&r?e.slice(1,h):e.slice(o,h)):(0===o&&r?(t.name=e.slice(1,a),t.base=e.slice(1,h)):(t.name=e.slice(o,a),t.base=e.slice(o,h)),t.ext=e.slice(a,h)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};e.posix=e; +var StylusRenderer=function(){"use strict";function assertPath(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function normalizeStringPosix(e,t){for(var n,i="",r=0,a=-1,o=0,h=0;h<=e.length;++h){if(h2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",r=0):r=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),a=h,o=0;continue}}else if(2===i.length||1===i.length){i="",r=0,a=h,o=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(a+1,h):i=e.slice(a+1,h),r=h-a-1;a=h,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var e={resolve:function resolve(){for(var e,t="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===e&&(e=process.cwd()),r=e),assertPath(r),0!==r.length&&(t=r+"/"+t,n=47===r.charCodeAt(0))}return t=normalizeStringPosix(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function normalize(e){if(assertPath(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=normalizeStringPosix(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function isAbsolute(e){return assertPath(e),e.length>0&&47===e.charCodeAt(0)},join:function join(){if(0===arguments.length)return".";for(var t,n=0;n0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":e.normalize(t)},relative:function relative(t,n){if(assertPath(t),assertPath(n),t===n)return"";if((t=e.resolve(t))===(n=e.resolve(n)))return"";for(var i=1;il){if(47===n.charCodeAt(o+u))return n.slice(o+u+1);if(0===u)return n.slice(o+u)}else a>l&&(47===t.charCodeAt(i+u)?c=u:0===u&&(c=0));break}var f=t.charCodeAt(i+u);if(f!==n.charCodeAt(o+u))break;47===f&&(c=u)}var d="";for(u=i+c+1;u<=r;++u)u!==r&&47!==t.charCodeAt(u)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(o+c):(o+=c,47===n.charCodeAt(o)&&++o,n.slice(o))},_makeLong:function _makeLong(e){return e},dirname:function dirname(e){if(assertPath(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,i=-1,r=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!r){i=a;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function basename(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');assertPath(e);var n,i=0,r=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,h=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!a){i=n+1;break}}else-1===h&&(a=!1,h=n+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(r=n):(o=-1,r=h))}return i===r?r=h:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){i=n+1;break}}else-1===r&&(a=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname:function extname(e){assertPath(e);for(var t=-1,n=0,i=-1,r=!0,a=0,o=e.length-1;o>=0;--o){var h=e.charCodeAt(o);if(47!==h)-1===i&&(r=!1,i=o+1),46===h?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!r){n=o+1;break}}return-1===t||-1===i||0===a||1===a&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function format(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function _format(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}("/",e)},parse:function parse(e){assertPath(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0),r=47===i;r?(t.root="/",n=1):n=0;for(var a=-1,o=0,h=-1,l=!0,c=e.length-1,u=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===h&&(l=!1,h=c+1),46===i?-1===a?a=c:1!==u&&(u=1):-1!==a&&(u=-1);else if(!l){o=c+1;break}return-1===a||-1===h||0===u||1===u&&a===h-1&&a===o+1?-1!==h&&(t.base=t.name=0===o&&r?e.slice(1,h):e.slice(o,h)):(0===o&&r?(t.name=e.slice(1,a),t.base=e.slice(1,h)):(t.name=e.slice(o,a),t.base=e.slice(o,h)),t.ext=e.slice(a,h)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};let t; /*! * Stylus - Token * Copyright (c) Automattic * MIT Licensed - */ -const t=class Token{constructor(e,t){this.type=e,this.val=t}inspect(){var e=" "+nodeUtil.inspect(this.val);return"[Token:"+this.lineno+":"+this.column+" "+this.type+""+(this.val?e:"")+"]"}toString(){return(void 0===this.val?this.type:this.val).toString()}},noop$2=()=>noop$2 + */e.posix=e,t=class Token{constructor(e,t){this.type=e,this.val=t}inspect(){var e=" "+nodeUtil.inspect(this.val);return"[Token:"+this.lineno+":"+this.column+" "+this.type+""+(this.val?e:"")+"]"}toString(){return(void 0===this.val?this.type:this.val).toString()}};const noop$2=()=>noop$2 /*! * Stylus - Visitor * Copyright (c) Automattic * MIT Licensed - */;var n=class Visitor{constructor(e){this.root=e}visit(e,t){var n="visit"+e.constructor.name;return this[n]?this[n](e):e}},i=["em","ex","ch","rem","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cm","mm","in","pt","pc","px","deg","grad","rad","turn","s","ms","Hz","kHz","dpi","dpcm","dppx","x","%","fr"],r=class Stack extends Array{constructor(){super(),Array.apply(this,arguments)}push(e){return e.stack=this,e.parent=this.currentFrame,[].push.apply(this,arguments)}get currentFrame(){return this[this.length-1]}getBlockFrame(e){for(var t=0;t @@ -20,25 +19,25 @@ const t=class Token{constructor(e,t){this.type=e,this.val=t}inspect(){var e=" "+ * Copyright (c) Automattic * MIT Licensed */ -var o=[">","+","~"],h=class SelectorParser{constructor(e,t,n){this.str=e,this.stack=t||[],this.parts=n||[],this.pos=0,this.level=2,this.nested=!0,this.ignore=!1}skip(e){this.str=this.str.substr(e),this.pos+=e}skipSpaces(){for(;" "==this.str[0];)this.skip(1)}advance(){return this.root()||this.relative()||this.initial()||this.escaped()||this.parent()||this.partial()||this.char()}root(){this.pos||"/"!=this.str[0]||"deep"==this.str.slice(1,5)||(this.nested=!1,this.skip(1))}relative(e){if((!this.pos||e)&&"../"==this.str.slice(0,3)){for(this.nested=!1,this.skip(3);this.relative(!0);)this.level++;if(!this.raw){var t=this.stack[this.stack.length-this.level];if(t)return t;this.ignore=!0}}}initial(){if(!this.pos&&"~"==this.str[0]&&"/"==this.str[1])return this.nested=!1,this.skip(2),this.stack[0]}escaped(){if("\\"==this.str[0]){var e=this.str[1];if("&"==e||"^"==e)return this.skip(2),e}}parent(){if("&"==this.str[0]){if(this.nested=!1,!this.pos&&(!this.stack.length||this.raw)){for(var e=0;" "==this.str[++e];);if(~o.indexOf(this.str[e]))return void this.skip(e+1)}if(this.skip(1),!this.raw)return this.stack[this.stack.length-1]}}partial(){if("^"==this.str[0]&&"["==this.str[1]){this.skip(2),this.skipSpaces();var e=this.range();if(this.skipSpaces(),"]"!=this.str[0])return"^[";if(this.nested=!1,this.skip(1),e)return e;this.ignore=!0}}number(){var e=0,t="";for("-"==this.str[e]&&(t+=this.str[e++]);this.str.charCodeAt(e)>=48&&this.str.charCodeAt(e)<=57;)t+=this.str[e++];if(t)return this.skip(e),Number(t)}range(){var e,t=this.number();if(".."==this.str.slice(0,2)){this.skip(2);var n=this.number(),i=this.parts.length;if(t<0&&(t=i+t-1),n<0&&(n=i+n-1),t>n){var r=t;t=n,n=r}n0?(100-i[t])*r/100:i[t]*(r/100)),i[t]+=r,i.rgba}function rgba(e,t,n,i){switch(arguments.length){case 1:return _export_assertColor_(e),e.rgba;case 2:_export_assertColor_(e);var r=e.rgba;return _export_assertType_(t,"unit","alpha"),"%"==(i=t.clone()).type&&(i.val/=100),new X.RGBA(r.r,r.g,r.b,i.val);default:_export_assertType_(e,"unit","red"),_export_assertType_(t,"unit","green"),_export_assertType_(n,"unit","blue"),_export_assertType_(i,"unit","alpha");var a="%"==e.type?Math.round(2.55*e.val):e.val,o="%"==t.type?Math.round(2.55*t.val):t.val,h="%"==n.type?Math.round(2.55*n.val):n.val;return(i=i.clone())&&"%"==i.type&&(i.val/=100),new X.RGBA(a,o,h,i.val)}}function alpha(e,t){return e=e.rgba,t?rgba(new X.Unit(e.r),new X.Unit(e.g),new X.Unit(e.b),t):new X.Unit(e.a,"")}function basename(t,n){return _export_assertString_(t,"path"),e.basename(t.val,n&&n.val)}function blend(e,t){return _export_assertColor_(e),e=e.rgba,t=t||new X.RGBA(255,255,255,1),_export_assertColor_(t),t=t.rgba,new X.RGBA(e.r*e.a+t.r*(1-e.a),e.g*e.a+t.g*(1-e.a),e.b*e.a+t.b*(1-e.a),e.a+t.a-e.a*t.a)}function blue(e,t){return e=e.rgba,t?rgba(new X.Unit(e.r),new X.Unit(e.g),t,new X.Unit(e.a)):new X.Unit(e.b,"")}(m=function addProperty(e,t){_export_assertType_(e,"expression","name"),e=_export_unwrap_(e).first,_export_assertString_(e,"name"),_export_assertType_(t,"expression","expr");var n=new X.Property([e],t),i=this.closestBlock,r=i.nodes.length,a=i.nodes.slice(0,i.index),o=i.nodes.slice(i.index++,r);return a.push(n),i.nodes=a.concat(o),n}).raw=!0,adjust$1.params=["color","prop","amount"],rgba.params=["red","green","blue","alpha"],alpha.params=["color","value"],(d=function(e,t,n){_export_assertPresent_(e,"number"),_export_assertPresent_(t,"base"),e=_export_unwrap_(e).nodes[0].val,t=_export_unwrap_(t).nodes[0].val,n=n&&_export_unwrap_(n).nodes[0].val||2;for(var i=Number(e).toString(t);i.length(e/=255)?e/12.92:Math.pow((e+.055)/1.055,2.4)}return _export_assertColor_(e),e=e.rgba,new X.Unit(.2126*processChannel(e.r)+.7152*processChannel(e.g)+.0722*processChannel(e.b))}function contrast(e,t){if("rgba"!=e.nodeName&&"hsla"!=e.nodeName)return new X.Literal("contrast("+(e.isNull?"":e.toString())+")");var n=new X.Object;function contrast(e,t){1>e.a&&(e=blend(e,t));var n=luminosity(t).val+.05,i=luminosity(e).val+.05,r=n/i;return i>n&&(r=1/r),Math.round(10*r)/10}if(e=e.rgba,t=t||new X.RGBA(255,255,255,1),_export_assertColor_(t),1<=(t=t.rgba).a){var i=new X.Unit(contrast(e,t));n.set("ratio",i),n.set("error",new X.Unit(0)),n.set("min",i),n.set("max",i)}else{var r=contrast(e,blend(t,new X.RGBA(0,0,0,1))),a=contrast(e,blend(t,new X.RGBA(255,255,255,1))),o=Math.max(r,a);function processChannel(e,n){return Math.min(Math.max(0,(e-n*t.a)/(1-t.a)),255)}var h=new X.RGBA(processChannel(e.r,t.r),processChannel(e.g,t.g),processChannel(e.b,t.b),1),l=contrast(e,blend(t,h));n.set("ratio",new X.Unit(Math.round(50*(l+o))/100)),n.set("error",new X.Unit(Math.round(50*(o-l))/100)),n.set("min",new X.Unit(l)),n.set("max",new X.Unit(o))}return n}function convert$1(e){return _export_assertString_(e,"str"),_export_parseString_(e.string)}function define(e,t,n){_export_assertType_(e,"string","name"),t=_export_unwrap_(t);var i=this.currentScope;n&&n.toBoolean().isTrue&&(i=this.global.scope);var r=new X.Ident(e.val,t);return i.add(r),X.null}function dirname$2(t){return _export_assertString_(t,"path"),e.dirname(t.val).replace(/\\/g,"/")}function error(e){_export_assertType_(e,"string","msg");var t=new Error(e.val);throw t.fromStylus=!0,t}function extname$1(t){return _export_assertString_(t,"path"),e.extname(t.val)}function green(e,t){return e=e.rgba,t?rgba(new X.Unit(e.r),t,new X.Unit(e.b),new X.Unit(e.a)):new X.Unit(e.g,"")}function hsla(e,t,n,i){switch(arguments.length){case 1:return _export_assertColor_(e),e.hsla;case 2:_export_assertColor_(e);var r=e.hsla;return _export_assertType_(t,"unit","alpha"),"%"==(i=t.clone()).type&&(i.val/=100),new X.HSLA(r.h,r.s,r.l,i.val);default:return _export_assertType_(e,"unit","hue"),_export_assertType_(t,"unit","saturation"),_export_assertType_(n,"unit","lightness"),_export_assertType_(i,"unit","alpha"),(i=i.clone())&&"%"==i.type&&(i.val/=100),new X.HSLA(e.val,t.val,n.val,i.val)}}function hsl(e,t,n){return 1==arguments.length?(_export_assertColor_(e,"color"),e.hsla):hsla(e,t,n,new X.Unit(1))}function hue(e,t){if(t){var n=e.hsla;return hsla(t,new X.Unit(n.s),new X.Unit(n.l),new X.Unit(n.a))}return component(e,new X.String("hue"))}component.params=["color","name"],luminosity.params=["color"],contrast.params=["top","bottom"],convert$1.params=["str"],define.params=["name","expr","global"],dirname$2.params=["p"],error.params=["msg"],extname$1.params=["p"],green.params=["color","value"],hsla.params=["hue","saturation","lightness","alpha"],hsl.params=["hue","saturation","lightness"],hue.params=["color","value"];const noop$1=()=>noop$1;function json(e,t,n){_export_assertString_(e,"path"),e=e.string;var i=_export_lookup_(e,this.options.paths,this.options.filename),r=t&&"object"==t.nodeName&&t;if(!i){if(r&&r.get("optional").toBoolean().isTrue)return X.null;throw new Error("failed to locate .json file "+e)}var a=JSON.parse(_export_readFileSync_(i));if(r)return function convert(e,t){var n=new X.Object,i=t.get("leave-strings").toBoolean();for(var r in e){var a=e[r];"object"==typeof a?n.set(r,convert(a,t)):("string"==(a=_export_coerce_(a)).nodeName&&i.isFalse&&(a=_export_parseString_(a.string)),n.set(r,a))}return n}(a,r);oldJson.call(this,a,t,n)}function oldJson(e,t,n){n?(_export_assertString_(n,"namePrefix"),n=n.val):n="";var i=(t=t?t.toBoolean():new X.Boolean(t)).isTrue?this.currentScope:this.global.scope;!function convert(e,t){for(var r in t=t?t+"-":"",e){var a=e[r],o=t+r;"object"==typeof a?convert(a,o):("string"==(a=_export_coerce_(a)).nodeName&&(a=_export_parseString_(a.string)),i.add({name:n+o,val:a}))}}(e)}let b,y,x,S,N,E,A,_;function lightness(e,t){if(t){var n=e.hsla;return hsla(new X.Unit(n.h),new X.Unit(n.s),t,new X.Unit(n.a))}return component(e,new X.String("lightness"))}function lookup(e){_export_assertType_(e,"string","name");var t=this.lookup(e.val);return t?this.visit(t):X.null}function match(e,t,n){_export_assertType_(e,"string","pattern"),_export_assertString_(t,"val");var i=new RegExp(e.val,function validateFlags(e){return!!(e=e&&e.string)&&e.split("").every((function(e){return~"igm".indexOf(e)}))}(n)?n.string:"");return t.string.match(i)}function math$1(e,t){return _export_assertType_(e,"unit","n"),_export_assertString_(t,"fn"),new X.Unit(Math[t.string](e.val),e.type)}function operate(e,t,n){return _export_assertType_(e,"string","op"),_export_assertPresent_(t,"left"),_export_assertPresent_(n,"right"),t.operate(e.val,n)}function range(e,t,n){if(_export_assertType_(e,"unit","start"),_export_assertType_(t,"unit","stop"),n){if(_export_assertType_(n,"unit","step"),0==n.val)throw new Error('ArgumentError: "step" argument must not be zero')}else n=new X.Unit(1);for(var i=new X.Expression,r=e.val;r<=t.val;r+=n.val)i.push(new X.Unit(r,e.type));return i}function red(e,t){return e=e.rgba,t?rgba(t,new X.Unit(e.g),new X.Unit(e.b),new X.Unit(e.a)):new X.Unit(e.r,"")}function remove(e,t){return _export_assertType_(e,"object","object"),_export_assertString_(t,"key"),delete e.vals[t.string],e}function replace(e,t,n){_export_assertString_(e,"pattern"),_export_assertString_(t,"replacement"),_export_assertString_(n,"val"),e=new RegExp(e.string,"g");var i=n.string.replace(e,t.string);return n instanceof X.Ident?new X.Ident(i):new X.String(i)}function rgb(e,t,n){if(1===arguments.length){_export_assertColor_(e);var i=e.rgba;return new X.RGBA(i.r,i.g,i.b,1)}return rgba(e,t,n,new X.Unit(1))}json.params=["path","local","namePrefix"],(b=function length(e){if(e){if(e.nodes){var t=_export_unwrap_(e).nodes;return 1==t.length&&"object"==t[0].nodeName?t[0].length:1==t.length&&"string"==t[0].nodeName?t[0].val.length:t.length}return 1}return 0}).raw=!0,lightness.params=["color","value"],(y=function listSeparator(e){return e=_export_unwrap_(e),new X.String(e.isList?",":" ")}).raw=!0,lookup.params=["name"],match.params=["pattern","val","flags"],math$1.params=["n","fn"],(x=function merge(e){_export_assertPresent_(e,"dest"),e=_export_unwrap_(e).first,_export_assertType_(e,"object","dest");for(var t=_export_unwrap_(arguments[arguments.length-1]).first,n=!0===t.val,i=1,r=arguments.length-n;i=0;--a)if("property"===e.nodes[a].nodeName){i=a;break}n&&(this.buf+=this.out(this.compress?"{":" {\n"),++this.indents),a=0;for(var o=e.nodes.length;a-1)return n.toString().replace("0.",".")+t}return(i?parseFloat(n.toFixed(15)):n).toString()+t}visitGroup(e){var t=this.keyframe?[]:this.stack,n=this.compress?",":",\n";if(t.push(e.nodes),e.block.hasProperties){var i=_export_compileSelectors_.call(this,t),r=i.length;if(r){this.keyframe&&(n=this.compress?",":", ");for(var a=0;a0&&!~r.indexOf("&")&&(r="/"+r),(a=new X.Selector([new X.Literal(r)])).val=r,a.block=e.block,e.nodes[i++]=a}})),n.push(e.nodes);var r=_export_compileSelectors_(n,!0);return r.forEach((function(t){i[t]=i[t]||[],i[t].push(e)})),this.extend(e,r),n.pop(),e}visitFunction(){return X.null}visitMedia(e){var t,n=[],i=this.closestGroup(e.block);return function mergeQueries(t){t.nodes.forEach((function(i,r){switch(i.nodeName){case"media":i.val=e.val.merge(i.val),n.push(i),t.nodes[r]=X.null;break;case"block":mergeQueries(i);break;default:i.block&&i.block.nodes&&mergeQueries(i.block)}}))}(e.block),this.bubble(e),n.length&&n.forEach((function(e){i?i.block.push(e):this.root.nodes.splice(++this.rootIndex,0,e),e=this.visit(e),t=e.block.parent,!e.bubbled||i&&"group"!=t.node.nodeName||(e.group.block=e.block.nodes[0].block,e.block.nodes[0]=e.group)}),this),e}visitSupports(e){return this.bubble(e),e}visitAtrule(e){return e.block&&(e.block=this.visit(e.block)),e}visitKeyframes(e){var t=e.block.nodes.filter((function(e){return e.block&&e.block.hasProperties}));return e.frames=t.length,e}visitImport(e){return this.imports.push(e),this.hoist?X.null:e}visitCharset(e){return this.charset=e,this.hoist?X.null:e}extend(e,t){var n=this.map,i=this,r=this.closestGroup(e.block);e.extends.forEach((function(e){var a=n[e.selector];if(!a){if(e.optional)return;if(!(a=i._checkForPrefixedGroups(e.selector))){var o=new Error('Failed to @extend "'+e.selector+'"');throw o.lineno=e.lineno,o.column=e.column,o}}t.forEach((function(e){var n=new X.Selector;n.val=e,n.inherits=!1,a.forEach((function(e){r&&r==e||i.extend(e,t),e.push(n)}))}))})),e.block=this.visit(e.block)}_checkForPrefixedGroups(e){for(var t=[],n=this.map,i=null,r=0;r1&&(n.isList?pushToStack(n.nodes,e):e.push(parse$1(n.nodes.map((function(e){return _export_assertString_(e,"selector"),e.string})).join(" "))))}else t.length>1&&pushToStack(t,e);return e.length?_export_compileSelectors_(e).join(","):"&"}).raw=!0,(I=function(e){return(e=_export_unwrap_(e)).nodes.shift()}).raw=!0,split.params=["delim","val"],substr.params=["val","start","length"],(U=function slice(e,t,n){if(t=t&&t.nodes[0].val,n=n&&n.nodes[0].val,(e=_export_unwrap_(e).nodes).length>1)return _export_coerce_(e.slice(t,n),!0);var i=e[0].string.slice(t,n);return e[0]instanceof X.Ident?new X.Ident(i):new X.String(i)}).raw=!0,tan.params=["angle"],transparentify.params=["top","bottom","alpha"],type.params=["node"],unit.params=["unit","type"],unquote.params=["string"],(R=function(e){e=_export_unwrap_(e);for(var t=1,n=arguments.length;t1)t.push(new X.String(r.map((function(e){return((i=new h(e.val).parse().nested)&&n?"& ":"")+e.val})).join(",")));else{var a=r[0].val;i=new h(a).parse().nested,t.push(new X.String((i&&n?"& ":"")+a))}}else t.push(new X.String("&"));return t},M.shift=I,M.split=split,M.substr=substr,M.slice=U,M.tan=tan,M.trace=function trace(){return console.log(this.stack),X.null},M.transparentify=transparentify,M.type=M.typeof=M["type-of"]=type,M.unit=unit,M.unquote=unquote,M.unshift=M.prepend=R,M.use=use,M.warn=warn,M["-math-prop"]=math,M["-prefix-classes"]=prefixClasses; +var h=[">","+","~"],l=class SelectorParser{constructor(e,t,n){this.str=e,this.stack=t||[],this.parts=n||[],this.pos=0,this.level=2,this.nested=!0,this.ignore=!1}skip(e){this.str=this.str.substr(e),this.pos+=e}skipSpaces(){for(;" "==this.str[0];)this.skip(1)}advance(){return this.root()||this.relative()||this.initial()||this.escaped()||this.parent()||this.partial()||this.char()}root(){this.pos||"/"!=this.str[0]||"deep"==this.str.slice(1,5)||(this.nested=!1,this.skip(1))}relative(e){if((!this.pos||e)&&"../"==this.str.slice(0,3)){for(this.nested=!1,this.skip(3);this.relative(!0);)this.level++;if(!this.raw){var t=this.stack[this.stack.length-this.level];if(t)return t;this.ignore=!0}}}initial(){if(!this.pos&&"~"==this.str[0]&&"/"==this.str[1])return this.nested=!1,this.skip(2),this.stack[0]}escaped(){if("\\"==this.str[0]){var e=this.str[1];if("&"==e||"^"==e)return this.skip(2),e}}parent(){if("&"==this.str[0]){if(this.nested=!1,!this.pos&&(!this.stack.length||this.raw)){for(var e=0;" "==this.str[++e];);if(~h.indexOf(this.str[e]))return void this.skip(e+1)}if(this.skip(1),!this.raw)return this.stack[this.stack.length-1]}}partial(){if("^"==this.str[0]&&"["==this.str[1]){this.skip(2),this.skipSpaces();var e=this.range();if(this.skipSpaces(),"]"!=this.str[0])return"^[";if(this.nested=!1,this.skip(1),e)return e;this.ignore=!0}}number(){var e=0,t="";for("-"==this.str[e]&&(t+=this.str[e++]);this.str.charCodeAt(e)>=48&&this.str.charCodeAt(e)<=57;)t+=this.str[e++];if(t)return this.skip(e),Number(t)}range(){var e,t=this.number();if(".."==this.str.slice(0,2)){this.skip(2);var n=this.number(),i=this.parts.length;if(t<0&&(t=i+t-1),n<0&&(n=i+n-1),t>n){var r=t;t=n,n=r}n0?(100-i[t])*r/100:i[t]*(r/100)),i[t]+=r,i.rgba}function rgba(e,t,n,i){switch(arguments.length){case 1:return _export_assertColor_(e),e.rgba;case 2:_export_assertColor_(e);var r=e.rgba;return _export_assertType_(t,"unit","alpha"),"%"==(i=t.clone()).type&&(i.val/=100),new de.RGBA(r.r,r.g,r.b,i.val);default:_export_assertType_(e,"unit","red"),_export_assertType_(t,"unit","green"),_export_assertType_(n,"unit","blue"),_export_assertType_(i,"unit","alpha");var a="%"==e.type?Math.round(2.55*e.val):e.val,o="%"==t.type?Math.round(2.55*t.val):t.val,h="%"==n.type?Math.round(2.55*n.val):n.val;return(i=i.clone())&&"%"==i.type&&(i.val/=100),new de.RGBA(a,o,h,i.val)}}function alpha(e,t){return e=e.rgba,t?rgba(new de.Unit(e.r),new de.Unit(e.g),new de.Unit(e.b),t):new de.Unit(e.a,"")}function basename(t,n){return _export_assertString_(t,"path"),e.basename(t.val,n&&n.val)}function blend(e,t){return _export_assertColor_(e),e=e.rgba,t=t||new de.RGBA(255,255,255,1),_export_assertColor_(t),t=t.rgba,new de.RGBA(e.r*e.a+t.r*(1-e.a),e.g*e.a+t.g*(1-e.a),e.b*e.a+t.b*(1-e.a),e.a+t.a-e.a*t.a)}function blue(e,t){return e=e.rgba,t?rgba(new de.Unit(e.r),new de.Unit(e.g),t,new de.Unit(e.a)):new de.Unit(e.b,"")}(A=function addProperty(e,t){_export_assertType_(e,"expression","name"),e=v(e).first,_export_assertString_(e,"name"),_export_assertType_(t,"expression","expr");var n=new de.Property([e],t),i=this.closestBlock,r=i.nodes.length,a=i.nodes.slice(0,i.index),o=i.nodes.slice(i.index++,r);return a.push(n),i.nodes=a.concat(o),n}).raw=!0,adjust$1.params=["color","prop","amount"],rgba.params=["red","green","blue","alpha"],alpha.params=["color","value"],(_=function(e,t,n){m(e,"number"),m(t,"base"),e=v(e).nodes[0].val,t=v(t).nodes[0].val,n=n&&v(n).nodes[0].val||2;for(var i=Number(e).toString(t);i.length(e/=255)?e/12.92:Math.pow((e+.055)/1.055,2.4)}return _export_assertColor_(e),e=e.rgba,new de.Unit(.2126*processChannel(e.r)+.7152*processChannel(e.g)+.0722*processChannel(e.b))}function contrast(e,t){if("rgba"!=e.nodeName&&"hsla"!=e.nodeName)return new de.Literal("contrast("+(e.isNull?"":e.toString())+")");var n=new de.Object;function contrast(e,t){1>e.a&&(e=blend(e,t));var n=luminosity(t).val+.05,i=luminosity(e).val+.05,r=n/i;return i>n&&(r=1/r),Math.round(10*r)/10}if(e=e.rgba,t=t||new de.RGBA(255,255,255,1),_export_assertColor_(t),1<=(t=t.rgba).a){var i=new de.Unit(contrast(e,t));n.set("ratio",i),n.set("error",new de.Unit(0)),n.set("min",i),n.set("max",i)}else{var r=contrast(e,blend(t,new de.RGBA(0,0,0,1))),a=contrast(e,blend(t,new de.RGBA(255,255,255,1))),o=Math.max(r,a);function processChannel(e,n){return Math.min(Math.max(0,(e-n*t.a)/(1-t.a)),255)}var h=new de.RGBA(processChannel(e.r,t.r),processChannel(e.g,t.g),processChannel(e.b,t.b),1),l=contrast(e,blend(t,h));n.set("ratio",new de.Unit(Math.round(50*(l+o))/100)),n.set("error",new de.Unit(Math.round(50*(o-l))/100)),n.set("min",new de.Unit(l)),n.set("max",new de.Unit(o))}return n}function convert$1(e){return _export_assertString_(e,"str"),_export_parseString_(e.string)}function define(e,t,n){_export_assertType_(e,"string","name"),t=v(t);var i=this.currentScope;n&&n.toBoolean().isTrue&&(i=this.global.scope);var r=new de.Ident(e.val,t);return i.add(r),de.null}function dirname$2(t){return _export_assertString_(t,"path"),e.dirname(t.val).replace(/\\/g,"/")}function error(e){_export_assertType_(e,"string","msg");var t=new Error(e.val);throw t.fromStylus=!0,t}function extname$1(t){return _export_assertString_(t,"path"),e.extname(t.val)}function green(e,t){return e=e.rgba,t?rgba(new de.Unit(e.r),t,new de.Unit(e.b),new de.Unit(e.a)):new de.Unit(e.g,"")}function hsla(e,t,n,i){switch(arguments.length){case 1:return _export_assertColor_(e),e.hsla;case 2:_export_assertColor_(e);var r=e.hsla;return _export_assertType_(t,"unit","alpha"),"%"==(i=t.clone()).type&&(i.val/=100),new de.HSLA(r.h,r.s,r.l,i.val);default:return _export_assertType_(e,"unit","hue"),_export_assertType_(t,"unit","saturation"),_export_assertType_(n,"unit","lightness"),_export_assertType_(i,"unit","alpha"),(i=i.clone())&&"%"==i.type&&(i.val/=100),new de.HSLA(e.val,t.val,n.val,i.val)}}function hsl(e,t,n){return 1==arguments.length?(_export_assertColor_(e,"color"),e.hsla):hsla(e,t,n,new de.Unit(1))}function hue(e,t){if(t){var n=e.hsla;return hsla(t,new de.Unit(n.s),new de.Unit(n.l),new de.Unit(n.a))}return component(e,new de.String("hue"))}component.params=["color","name"],luminosity.params=["color"],contrast.params=["top","bottom"],convert$1.params=["str"],define.params=["name","expr","global"],dirname$2.params=["p"],error.params=["msg"],extname$1.params=["p"],green.params=["color","value"],hsla.params=["hue","saturation","lightness","alpha"],hsl.params=["hue","saturation","lightness"],hue.params=["color","value"];const noop$1=()=>noop$1;function json(e,t,n){_export_assertString_(e,"path"),e=e.string;var i=u(e,this.options.paths,this.options.filename),r=t&&"object"==t.nodeName&&t;if(!i){if(r&&r.get("optional").toBoolean().isTrue)return de.null;throw new Error("failed to locate .json file "+e)}var a=JSON.parse(_export_readFileSync_(i));if(r)return function convert(e,t){var n=new de.Object,i=t.get("leave-strings").toBoolean();for(var r in e){var a=e[r];"object"==typeof a?n.set(r,convert(a,t)):("string"==(a=g(a)).nodeName&&i.isFalse&&(a=_export_parseString_(a.string)),n.set(r,a))}return n}(a,r);oldJson.call(this,a,t,n)}function oldJson(e,t,n){n?(_export_assertString_(n,"namePrefix"),n=n.val):n="";var i=(t=t?t.toBoolean():new de.Boolean(t)).isTrue?this.currentScope:this.global.scope;!function convert(e,t){for(var r in t=t?t+"-":"",e){var a=e[r],o=t+r;"object"==typeof a?convert(a,o):("string"==(a=g(a)).nodeName&&(a=_export_parseString_(a.string)),i.add({name:n+o,val:a}))}}(e)}let j,P,I,U,R,M,F,q;function lightness(e,t){if(t){var n=e.hsla;return hsla(new de.Unit(n.h),new de.Unit(n.s),t,new de.Unit(n.a))}return component(e,new de.String("lightness"))}function lookup(e){_export_assertType_(e,"string","name");var t=this.lookup(e.val);return t?this.visit(t):de.null}function match(e,t,n){_export_assertType_(e,"string","pattern"),_export_assertString_(t,"val");var i=new RegExp(e.val,function validateFlags(e){return!!(e=e&&e.string)&&e.split("").every((function(e){return~"igm".indexOf(e)}))}(n)?n.string:"");return t.string.match(i)}function math$1(e,t){return _export_assertType_(e,"unit","n"),_export_assertString_(t,"fn"),new de.Unit(Math[t.string](e.val),e.type)}function operate(e,t,n){return _export_assertType_(e,"string","op"),m(t,"left"),m(n,"right"),t.operate(e.val,n)}function range(e,t,n){if(_export_assertType_(e,"unit","start"),_export_assertType_(t,"unit","stop"),n){if(_export_assertType_(n,"unit","step"),0==n.val)throw new Error('ArgumentError: "step" argument must not be zero')}else n=new de.Unit(1);for(var i=new de.Expression,r=e.val;r<=t.val;r+=n.val)i.push(new de.Unit(r,e.type));return i}function red(e,t){return e=e.rgba,t?rgba(t,new de.Unit(e.g),new de.Unit(e.b),new de.Unit(e.a)):new de.Unit(e.r,"")}function remove(e,t){return _export_assertType_(e,"object","object"),_export_assertString_(t,"key"),delete e.vals[t.string],e}function replace(e,t,n){_export_assertString_(e,"pattern"),_export_assertString_(t,"replacement"),_export_assertString_(n,"val"),e=new RegExp(e.string,"g");var i=n.string.replace(e,t.string);return n instanceof de.Ident?new de.Ident(i):new de.String(i)}function rgb(e,t,n){if(1===arguments.length){_export_assertColor_(e);var i=e.rgba;return new de.RGBA(i.r,i.g,i.b,1)}return rgba(e,t,n,new de.Unit(1))}json.params=["path","local","namePrefix"],(j=function length(e){if(e){if(e.nodes){var t=v(e).nodes;return 1==t.length&&"object"==t[0].nodeName?t[0].length:1==t.length&&"string"==t[0].nodeName?t[0].val.length:t.length}return 1}return 0}).raw=!0,lightness.params=["color","value"],(P=function listSeparator(e){return e=v(e),new de.String(e.isList?",":" ")}).raw=!0,lookup.params=["name"],match.params=["pattern","val","flags"],math$1.params=["n","fn"],(I=function merge(e){m(e,"dest"),e=v(e).first,_export_assertType_(e,"object","dest");for(var t=!0===v(arguments[arguments.length-1]).first.val,n=1,i=arguments.length-t;n=0;--a)if("property"===e.nodes[a].nodeName){i=a;break}n&&(this.buf+=this.out(this.compress?"{":" {\n"),++this.indents),a=0;for(var o=e.nodes.length;a-1)return n.toString().replace("0.",".")+t}return(i?parseFloat(n.toFixed(15)):n).toString()+t}visitGroup(e){var t=this.keyframe?[]:this.stack,n=this.compress?",":",\n";if(t.push(e.nodes),e.block.hasProperties){var i=_export_compileSelectors_.call(this,t),r=i.length;if(r){this.keyframe&&(n=this.compress?",":", ");for(var a=0;a0&&!~r.indexOf("&")&&(r="/"+r),(a=new de.Selector([new de.Literal(r)])).val=r,a.block=e.block,e.nodes[i++]=a}})),n.push(e.nodes);var r=_export_compileSelectors_(n,!0);return r.forEach((function(t){i[t]=i[t]||[],i[t].push(e)})),this.extend(e,r),n.pop(),e}visitFunction(){return de.null}visitMedia(e){var t,n=[],i=this.closestGroup(e.block);return function mergeQueries(t){t.nodes.forEach((function(i,r){switch(i.nodeName){case"media":i.val=e.val.merge(i.val),n.push(i),t.nodes[r]=de.null;break;case"block":mergeQueries(i);break;default:i.block&&i.block.nodes&&mergeQueries(i.block)}}))}(e.block),this.bubble(e),n.length&&n.forEach((function(e){i?i.block.push(e):this.root.nodes.splice(++this.rootIndex,0,e),e=this.visit(e),t=e.block.parent,!e.bubbled||i&&"group"!=t.node.nodeName||(e.group.block=e.block.nodes[0].block,e.block.nodes[0]=e.group)}),this),e}visitSupports(e){return this.bubble(e),e}visitAtrule(e){return e.block&&(e.block=this.visit(e.block)),e}visitKeyframes(e){var t=e.block.nodes.filter((function(e){return e.block&&e.block.hasProperties}));return e.frames=t.length,e}visitImport(e){return this.imports.push(e),this.hoist?de.null:e}visitCharset(e){return this.charset=e,this.hoist?de.null:e}extend(e,t){var n=this.map,i=this,r=this.closestGroup(e.block);e.extends.forEach((function(e){var a=n[e.selector];if(!a){if(e.optional)return;if(!(a=i._checkForPrefixedGroups(e.selector))){var o=new Error('Failed to @extend "'+e.selector+'"');throw o.lineno=e.lineno,o.column=e.column,o}}t.forEach((function(e){var n=new de.Selector;n.val=e,n.inherits=!1,a.forEach((function(e){r&&r==e||i.extend(e,t),e.push(n)}))}))})),e.block=this.visit(e.block)}_checkForPrefixedGroups(e){for(var t=[],n=this.map,i=null,r=0;r1&&(n.isList?pushToStack(n.nodes,e):e.push(parse$1(n.nodes.map((function(e){return _export_assertString_(e,"selector"),e.string})).join(" "))))}else t.length>1&&pushToStack(t,e);return e.length?_export_compileSelectors_(e).join(","):"&"}).raw=!0,(Q=function(e){return(e=v(e)).nodes.shift()}).raw=!0,split.params=["delim","val"],substr.params=["val","start","length"],(W=function slice(e,t,n){if(t=t&&t.nodes[0].val,n=n&&n.nodes[0].val,(e=v(e).nodes).length>1)return g(e.slice(t,n),!0);var i=e[0].string.slice(t,n);return e[0]instanceof de.Ident?new de.Ident(i):new de.String(i)}).raw=!0,tan.params=["angle"],transparentify.params=["top","bottom","alpha"],type.params=["node"],unit.params=["unit","type"],unquote.params=["string"],(K=function(e){e=v(e);for(var t=1,n=arguments.length;t1)t.push(new de.String(r.map((function(e){return((i=new l(e.val).parse().nested)&&n?"& ":"")+e.val})).join(",")));else{var a=r[0].val;i=new l(a).parse().nested,t.push(new de.String((i&&n?"& ":"")+a))}}else t.push(new de.String("&"));return t},D.shift=Q,D.split=split,D.substr=substr,D.slice=W,D.tan=tan,D.trace=function trace(){return console.log(this.stack),de.null},D.transparentify=transparentify,D.type=D.typeof=D["type-of"]=type,D.unit=unit,D.unquote=unquote,D.unshift=D.prepend=K,D.use=use,D.warn=warn,D["-math-prop"]=math,D["-prefix-classes"]=prefixClasses; /*! * Stylus - colors * Copyright (c) Automattic * MIT Licensed */ -var F={aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],transparent:[0,0,0,0],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1],rebeccapurple:[102,51,153,1]},q=e.extname,G={".gif":"image/gif",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".svg":"image/svg+xml",".webp":"image/webp",".ttf":"application/x-font-ttf",".eot":"application/vnd.ms-fontobject",".woff":"application/font-woff",".woff2":"application/font-woff2"};const _module_exports_$4=function(e){var t=(e=e||{}).paths||[],n=null!=e.limit?e.limit:3e4,i=e.mimes||G;function fn(e,r){var a=new B(e),o="base64";a.isURL=!0,e=function parse(e){return new URL(e)}(e=e.nodes.map((function(e){return a.visit(e)})).join(""));var h,l,c=q(e.pathname||""),u=i[c],f=e.hash||"",m=new X.Literal('url("'+e.href+'")'),d=t.concat(this.paths);if(!u)return m;if(e.protocol)return m;var v=_export_lookup_(e.pathname,d);return v?(h=_export_readFileSync_(v),!1!==n&&h.length>n?m:(r&&"utf8"==r.first.val.toLowerCase()?(o="charset=utf-8",l=h.toString().replace(/\s+/g," ").replace(/[{}\|\\\^~\[\]`"<>#%]/g,(function(e){return"%"+e[0].charCodeAt(0).toString(16).toUpperCase()})).trim()):l=h.toString(o)+f,new X.Literal('url("data:'+u+";"+o+","+l+'")'))):(fe.emit("file not found","File "+m+" could not be found, literal url retained!"),m)}return fn.raw=!0,fn};_module_exports_$4.mimes=G;var T=e.dirname,$=noop$2();function importFile(e,t,n){var i,r=this.importStack,a=oe;if(e.once){if(this.requireHistory[t])return X.null;if(this.requireHistory[t]=!0,n&&!this.includeCSS)return e}if(~r.indexOf(t))throw new Error("import loop has been found");var o=_export_readFileSync_(t);if(!o.trim())return X.null;if(e.path=t,e.dirname=T(t),i=_export_statSync_(t),e.mtime=i.mtime,this.paths.push(e.dirname),this.options._imports&&this.options._imports.push(e.clone()),r.push(t),X.filename=t,n&&((n=new X.Literal(o.replace(/\r\n?/g,"\n"))).lineno=n.column=1,!this.resolveURL))return n;var h=new X.Block,l=new a(o,_export_merge_({root:h},this.options));try{h=l.parse()}catch(e){var c=l.lexer.lineno,u=l.lexer.column;if(n&&this.includeCSS&&this.resolveURL)return this.warn("ParseError: "+t+":"+c+":"+u+". This file included as-is"),n;throw e.filename=t,e.lineno=c,e.column=u,e.input=o,e}(h=h.clone(this.currentBlock)).parent=this.currentBlock,h.scope=!1;var f=this.visit(h);return r.pop(),this.resolveURL&&!this.resolveURL.nocheck||this.paths.pop(),f}var J=class Evaluator extends n{constructor(e,t){super(e),t=t||{};var n=this.functions=t.functions||{};this.stack=new r,this.imports=t.imports||[],this.globals=t.globals||{},this.paths=t.paths||[],this.prefix=t.prefix||"",this.filename=t.filename,this.includeCSS=t["include css"],this.resolveURL=n.url&&"resolver"==n.url.name&&n.url.options,this.paths.push(T(t.filename||".")),this.stack.push(this.global=new a(e)),this.warnings=t.warn,this.options=t,this.calling=[],this.importStack=[],this.requireHistory={},this.return=0}visit(e){try{return super.visit(e)}catch(t){if(t.filename)throw t;t.lineno=e.lineno,t.column=e.column,t.filename=e.filename,t.stylusStack=this.stack.toString();try{t.input=_export_readFileSync_(t.filename)}catch(e){}throw t}}setup(){var e=this.root,t=[];this.populateGlobalScope(),this.imports.forEach((function(e){var n=new X.Expression;n.push(new X.String(e)),t.push(new X.Import(n))}),this),e.nodes=t.concat(e.nodes)}populateGlobalScope(){var e=this.global.scope;Object.keys(F).forEach((function(t){var n=F[t],i=new X.RGBA(n[0],n[1],n[2],n[3]),r=new X.Ident(t,i);i.name=t,e.add(r)})),e.add(new X.Ident("embedurl",new X.Function("embedurl",_module_exports_$4({limit:!1}))));var t=this.globals;Object.keys(t).forEach((function(n){var i=t[n];i.nodeName||(i=new X.Literal(i)),e.add(new X.Ident(n,i))}))}evaluate(){return $("eval %s",this.filename),this.setup(),this.visit(this.root)}visitGroup(e){return e.nodes=e.nodes.map((function(e){return e.val=this.interpolate(e),$("ruleset %s",e.val),e}),this),e.block=this.visit(e.block),e}visitReturn(e){throw e.expr=this.visit(e.expr),e}visitMedia(e){return e.block=this.visit(e.block),e.val=this.visit(e.val),e}visitQueryList(e){var t,n;if(e.nodes.forEach(this.visit,this),1==e.nodes.length&&(n=e.nodes[0],t=this.lookup(n.type))){if(!(t=t.first.string))return e;var i=new oe(t,this.options);e=this.visit(i.queries())}return e}visitQuery(e){return e.predicate=this.visit(e.predicate),e.type=this.visit(e.type),e.nodes.forEach(this.visit,this),e}visitFeature(e){return e.name=this.interpolate(e),e.expr&&(this.return++,e.expr=this.visit(e.expr),this.return--),e}visitObject(e){for(var t in e.vals)e.vals[t]=this.visit(e.vals[t]);return e}visitMember(e){var t=e.left,n=e.right,i=this.visit(t).first;if("object"!=i.nodeName)throw new Error(t.toString()+" has no property ."+n);return e.val&&(this.return++,i.set(n.name,this.visit(e.val)),this.return--),i.get(n.name)}visitKeyframes(e){var t;return e.fabricated?e:(e.val=this.interpolate(e).trim(),(t=this.lookup(e.val))&&(e.val=t.first.string||t.first.name),e.block=this.visit(e.block),"official"!=e.prefix?e:(this.vendors.forEach((function(t){if("ms"!=t){var n=e.clone();n.val=e.val,n.prefix=t,n.block=e.block,n.fabricated=!0,this.currentBlock.push(n)}}),this),X.null))}visitFunction(e){var t=this.stack.currentFrame.scope.lookup(e.name);return t&&this.warn("local "+t.nodeName+' "'+e.name+'" previously defined in this scope'),this.functions[e.name]&&this.warn('user-defined function "'+e.name+'" is already defined'),M[e.name]&&this.warn('built-in function "'+e.name+'" is already defined'),e}visitEach(e){this.return++;var t,n,i=_export_unwrap_(this.visit(e.expr)),r=i.nodes.length,a=new X.Ident(e.val),o=new X.Ident(e.key||"__index__"),h=this.currentScope,l=this.currentBlock,c=[],u=this;function visitBody(n,i){h.add(i),h.add(n),t=u.visit(e.block.clone()),c=c.concat(t.nodes)}if(this.return--,e.block.scope=!1,1==r&&"object"==i.nodes[0].nodeName)for(var f in(n=i.nodes[0]).vals)a.val=new X.String(f),o.val=n.get(f),visitBody(o,a);else for(var m=0;m200)throw new RangeError("Maximum stylus call stack size exceeded");"expression"==i.nodeName&&(i=i.first),this.return++;var r=this.visit(e.args);for(var a in r.map)r.map[a]=this.visit(r.map[a].clone());return this.return--,i.fn?n=this.invokeBuiltin(i.fn,r):"function"==i.nodeName&&(e.block&&(e.block=this.visit(e.block)),n=this.invokeFunction(i,r,e.block)),this.calling.pop(),this.ignoreColors=!1,n}visitIdent(e){var t;if(e.property)return(t=this.lookupProperty(e.name))?this.visit(t.expr.clone()):X.null;if(e.val.isNull){var n=this.lookup(e.name);return n&&e.mixin&&this.mixinNode(n),n?this.visit(n):e}return this.return++,e.val=this.visit(e.val),this.return--,this.currentScope.add(e),e.val}visitBinOp(e){if("is defined"==e.op)return this.isDefined(e.left);this.return++;var t=e.op,n=this.visit(e.left),i="||"==t||"&&"==t?e.right:this.visit(e.right),r=e.val?this.visit(e.val):null;this.return--;try{return this.visit(n.operate(t,i,r))}catch(e){if("CoercionError"==e.name)switch(t){case"==":return X.false;case"!=":return X.true}throw e}}visitUnaryOp(e){var t=e.op,n=this.visit(e.expr);switch("!"!=t&&(n=n.first.clone(),_export_assertType_(n,"unit")),t){case"-":n.val=-n.val;break;case"+":n.val=+n.val;break;case"~":n.val=~n.val;break;case"!":return n.toBoolean().negate()}return n}visitTernary(e){return this.visit(e.cond).toBoolean().isTrue?this.visit(e.trueExpr):this.visit(e.falseExpr)}visitExpression(e){for(var t=0,n=e.nodes.length;t1)for(var a=0;a=":return new X.Boolean(this.hash>=t.hash);case"<=":return new X.Boolean(this.hash<=t.hash);case">":return new X.Boolean(this.hash>t.hash);case"<":return new X.Boolean(this.hash=":case"<":case">":case"is a":case"||":case"&&":return this.rgba.operate(e,t);default:return this.rgba.operate(e,t).hsla}}adjustLightness(e){return this.l=clampPercentage(this.l+this.l*(e/100)),this}adjustHue(e){return this.h=clampDegrees(this.h+e),this}static fromRGBA(e){var t,n,i=e.r/255,r=e.g/255,a=e.b/255,o=e.a,h=Math.min(i,r,a),l=Math.max(i,r,a),c=(l+h)/2,u=l-h;switch(l){case h:t=0;break;case i:t=60*(r-a)/u;break;case r:t=60*(a-i)/u+120;break;case a:t=60*(i-r)/u+240}return n=l==h?0:c<.5?u/(2*c):u/(2-2*c),new HSLA(t%=360,n*=100,c*=100,o)}};function clampDegrees(e){return(e%=360)>=0?e:360+e}function clampPercentage(e){return Math.max(0,Math.min(e,100))}var K=M.adjust;function clamp(e){return Math.max(0,Math.min(e.toFixed(0),255))}var D=class Atrule extends z{constructor(e){super(),this.type=e}get hasOnlyProperties(){if(!this.block)return!1;for(var e=this.block.nodes,t=0,n=e.length;tu;)i.nodes[t]=X.null;i.nodes[r]=n}else e.string&&(a=i.nodes[0])&&"object"==a.nodeName&&a.set(e.string,n.clone())})),n;case"[]":var a,o=new X.Expression,h=_export_unwrap_(this).nodes;return(r=_export_unwrap_(t).nodes).forEach((function(e){"unit"==e.nodeName?a=h[e.val<0?h.length+e.val:e.val]:"object"==h[0].nodeName&&(a=h[0].get(e.string)),a&&o.push(a)})),o.isEmpty?X.null:_export_unwrap_(o);case"||":return this.toBoolean().isTrue?this:t;case"in":return super.operate(e,t);case"!=":return this.operate("==",t,n).negate();case"==":var l,c,u=this.nodes.length;if(t=t.toExpression(),u!=t.nodes.length)return X.false;for(var f=0;f1?X.true:this.first.toBoolean()}toString(){return"("+this.nodes.map((function(e){return e.toString()})).join(this.isList?", ":" ")+")"}toJSON(){return{__type:"Expression",isList:this.isList,preserve:this.preserve,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}}},Y=Z; +var V={aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],transparent:[0,0,0,0],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1],rebeccapurple:[102,51,153,1]};let Z={};var Y=e.extname,X={".gif":"image/gif",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".svg":"image/svg+xml",".webp":"image/webp",".ttf":"application/x-font-ttf",".eot":"application/vnd.ms-fontobject",".woff":"application/font-woff",".woff2":"application/font-woff2"};Z=function(e){var t=(e=e||{}).paths||[],n=null!=e.limit?e.limit:3e4,i=e.mimes||X;function fn(e,r){var a=new $(e),o="base64";a.isURL=!0,e=function parse(e){return new URL(e)}(e=e.nodes.map((function(e){return a.visit(e)})).join(""));var h,l,c=Y(e.pathname||""),f=i[c],d=e.hash||"",m=new de.Literal('url("'+e.href+'")'),v=t.concat(this.paths);if(!f)return m;if(e.protocol)return m;var g=u(e.pathname,v);return g?(h=_export_readFileSync_(g),!1!==n&&h.length>n?m:(r&&"utf8"==r.first.val.toLowerCase()?(o="charset=utf-8",l=h.toString().replace(/\s+/g," ").replace(/[{}\|\\\^~\[\]`"<>#%]/g,(function(e){return"%"+e[0].charCodeAt(0).toString(16).toUpperCase()})).trim()):l=h.toString(o)+d,new de.Literal('url("data:'+f+";"+o+","+l+'")'))):(Be.emit("file not found","File "+m+" could not be found, literal url retained!"),m)}return fn.raw=!0,fn},Z.mimes=X;var ee=e.dirname,te=noop$2();function importFile(e,t,n){var i,r=this.importStack,a=Ne;if(e.once){if(this.requireHistory[t])return de.null;if(this.requireHistory[t]=!0,n&&!this.includeCSS)return e}if(~r.indexOf(t))throw new Error("import loop has been found");var o=_export_readFileSync_(t);if(!o.trim())return de.null;if(e.path=t,e.dirname=ee(t),i=_export_statSync_(t),e.mtime=i.mtime,this.paths.push(e.dirname),this.options._imports&&this.options._imports.push(e.clone()),r.push(t),de.filename=t,n&&((n=new de.Literal(o.replace(/\r\n?/g,"\n"))).lineno=n.column=1,!this.resolveURL))return n;var h=new de.Block,l=new a(o,b({root:h},this.options));try{h=l.parse()}catch(e){var c=l.lexer.lineno,u=l.lexer.column;if(n&&this.includeCSS&&this.resolveURL)return this.warn("ParseError: "+t+":"+c+":"+u+". This file included as-is"),n;throw e.filename=t,e.lineno=c,e.column=u,e.input=o,e}(h=h.clone(this.currentBlock)).parent=this.currentBlock,h.scope=!1;var f=this.visit(h);return r.pop(),this.resolveURL&&!this.resolveURL.nocheck||this.paths.pop(),f}var se=class Evaluator extends n{constructor(e,t){super(e),t=t||{};var n=this.functions=t.functions||{};this.stack=new r,this.imports=t.imports||[],this.globals=t.globals||{},this.paths=t.paths||[],this.prefix=t.prefix||"",this.filename=t.filename,this.includeCSS=t["include css"],this.resolveURL=n.url&&"resolver"==n.url.name&&n.url.options,this.paths.push(ee(t.filename||".")),this.stack.push(this.global=new o(e)),this.warnings=t.warn,this.options=t,this.calling=[],this.importStack=[],this.requireHistory={},this.return=0}visit(e){try{return super.visit(e)}catch(t){if(t.filename)throw t;t.lineno=e.lineno,t.column=e.column,t.filename=e.filename,t.stylusStack=this.stack.toString();try{t.input=_export_readFileSync_(t.filename)}catch(e){}throw t}}setup(){var e=this.root,t=[];this.populateGlobalScope(),this.imports.forEach((function(e){var n=new de.Expression;n.push(new de.String(e)),t.push(new de.Import(n))}),this),e.nodes=t.concat(e.nodes)}populateGlobalScope(){var e=this.global.scope;Object.keys(V).forEach((function(t){var n=V[t],i=new de.RGBA(n[0],n[1],n[2],n[3]),r=new de.Ident(t,i);i.name=t,e.add(r)})),e.add(new de.Ident("embedurl",new de.Function("embedurl",Z({limit:!1}))));var t=this.globals;Object.keys(t).forEach((function(n){var i=t[n];i.nodeName||(i=new de.Literal(i)),e.add(new de.Ident(n,i))}))}evaluate(){return te("eval %s",this.filename),this.setup(),this.visit(this.root)}visitGroup(e){return e.nodes=e.nodes.map((function(e){return e.val=this.interpolate(e),te("ruleset %s",e.val),e}),this),e.block=this.visit(e.block),e}visitReturn(e){throw e.expr=this.visit(e.expr),e}visitMedia(e){return e.block=this.visit(e.block),e.val=this.visit(e.val),e}visitQueryList(e){var t,n;if(e.nodes.forEach(this.visit,this),1==e.nodes.length&&(n=e.nodes[0],t=this.lookup(n.type))){if(!(t=t.first.string))return e;var i=new Ne(t,this.options);e=this.visit(i.queries())}return e}visitQuery(e){return e.predicate=this.visit(e.predicate),e.type=this.visit(e.type),e.nodes.forEach(this.visit,this),e}visitFeature(e){return e.name=this.interpolate(e),e.expr&&(this.return++,e.expr=this.visit(e.expr),this.return--),e}visitObject(e){for(var t in e.vals)e.vals[t]=this.visit(e.vals[t]);return e}visitMember(e){var t=e.left,n=e.right,i=this.visit(t).first;if("object"!=i.nodeName)throw new Error(t.toString()+" has no property ."+n);return e.val&&(this.return++,i.set(n.name,this.visit(e.val)),this.return--),i.get(n.name)}visitKeyframes(e){var t;return e.fabricated?e:(e.val=this.interpolate(e).trim(),(t=this.lookup(e.val))&&(e.val=t.first.string||t.first.name),e.block=this.visit(e.block),"official"!=e.prefix?e:(this.vendors.forEach((function(t){if("ms"!=t){var n=e.clone();n.val=e.val,n.prefix=t,n.block=e.block,n.fabricated=!0,this.currentBlock.push(n)}}),this),de.null))}visitFunction(e){var t=this.stack.currentFrame.scope.lookup(e.name);return t&&this.warn("local "+t.nodeName+' "'+e.name+'" previously defined in this scope'),this.functions[e.name]&&this.warn('user-defined function "'+e.name+'" is already defined'),D[e.name]&&this.warn('built-in function "'+e.name+'" is already defined'),e}visitEach(e){this.return++;var t,n,i=v(this.visit(e.expr)),r=i.nodes.length,a=new de.Ident(e.val),o=new de.Ident(e.key||"__index__"),h=this.currentScope,l=this.currentBlock,c=[],u=this;function visitBody(n,i){h.add(i),h.add(n),t=u.visit(e.block.clone()),c=c.concat(t.nodes)}if(this.return--,e.block.scope=!1,1==r&&"object"==i.nodes[0].nodeName)for(var f in(n=i.nodes[0]).vals)a.val=new de.String(f),o.val=n.get(f),visitBody(o,a);else for(var d=0;d200)throw new RangeError("Maximum stylus call stack size exceeded");"expression"==i.nodeName&&(i=i.first),this.return++;var r=this.visit(e.args);for(var a in r.map)r.map[a]=this.visit(r.map[a].clone());return this.return--,i.fn?n=this.invokeBuiltin(i.fn,r):"function"==i.nodeName&&(e.block&&(e.block=this.visit(e.block)),n=this.invokeFunction(i,r,e.block)),this.calling.pop(),this.ignoreColors=!1,n}visitIdent(e){var t;if(e.property)return(t=this.lookupProperty(e.name))?this.visit(t.expr.clone()):de.null;if(e.val.isNull){var n=this.lookup(e.name);return n&&e.mixin&&this.mixinNode(n),n?this.visit(n):e}return this.return++,e.val=this.visit(e.val),this.return--,this.currentScope.add(e),e.val}visitBinOp(e){if("is defined"==e.op)return this.isDefined(e.left);this.return++;var t=e.op,n=this.visit(e.left),i="||"==t||"&&"==t?e.right:this.visit(e.right),r=e.val?this.visit(e.val):null;this.return--;try{return this.visit(n.operate(t,i,r))}catch(e){if("CoercionError"==e.name)switch(t){case"==":return de.false;case"!=":return de.true}throw e}}visitUnaryOp(e){var t=e.op,n=this.visit(e.expr);switch("!"!=t&&(n=n.first.clone(),_export_assertType_(n,"unit")),t){case"-":n.val=-n.val;break;case"+":n.val=+n.val;break;case"~":n.val=~n.val;break;case"!":return n.toBoolean().negate()}return n}visitTernary(e){return this.visit(e.cond).toBoolean().isTrue?this.visit(e.trueExpr):this.visit(e.falseExpr)}visitExpression(e){for(var t=0,n=e.nodes.length;t1)for(var a=0;a=":return new de.Boolean(this.hash>=t.hash);case"<=":return new de.Boolean(this.hash<=t.hash);case">":return new de.Boolean(this.hash>t.hash);case"<":return new de.Boolean(this.hash=0?e:360+e}function clampPercentage(e){return Math.max(0,Math.min(e,100))}oe=class HSLA extends ie{constructor(e,t,n,i){super(),this.h=clampDegrees(e),this.s=clampPercentage(t),this.l=clampPercentage(n),this.a=function clampAlpha$1(e){return Math.max(0,Math.min(e,1))}(i),this.hsla=this}toString(){return"hsla("+this.h+","+this.s.toFixed(0)+"%,"+this.l.toFixed(0)+"%,"+this.a+")"}clone(e){var t=new HSLA(this.h,this.s,this.l,this.a);return t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t}toJSON(){return{__type:"HSLA",h:this.h,s:this.s,l:this.l,a:this.a,lineno:this.lineno,column:this.column,filename:this.filename}}get rgba(){return de.RGBA.fromHSLA(this)}get hash(){return this.rgba.toString()}add(e,t,n){return new HSLA(this.h+e,this.s+t,this.l+n,this.a)}sub(e,t,n){return this.add(-e,-t,-n)}operate(e,t){switch(e){case"==":case"!=":case"<=":case">=":case"<":case">":case"is a":case"||":case"&&":return this.rgba.operate(e,t);default:return this.rgba.operate(e,t).hsla}}adjustLightness(e){return this.l=clampPercentage(this.l+this.l*(e/100)),this}adjustHue(e){return this.h=clampDegrees(this.h+e),this}static fromRGBA(e){var t,n,i=e.r/255,r=e.g/255,a=e.b/255,o=e.a,h=Math.min(i,r,a),l=Math.max(i,r,a),c=(l+h)/2,u=l-h;switch(l){case h:t=0;break;case i:t=60*(r-a)/u;break;case r:t=60*(a-i)/u+120;break;case a:t=60*(i-r)/u+240}return n=l==h?0:c<.5?u/(2*c):u/(2-2*c),new HSLA(t%=360,n*=100,c*=100,o)}};var le=D.adjust;function clamp(e){return Math.max(0,Math.min(e.toFixed(0),255))}he=class RGBA extends ie{constructor(e,t,n,i){super(),this.r=clamp(e),this.g=clamp(t),this.b=clamp(n),this.a=function clampAlpha(e){return Math.max(0,Math.min(e,1))}(i),this.name="",this.rgba=this}static withoutClamping(e,t,n,i){var r=new RGBA(0,0,0,0);return r.r=e,r.g=t,r.b=n,r.a=i,r}clone(){var e=new RGBA(this.r,this.g,this.b,this.a);return e.raw=this.raw,e.name=this.name,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e}toJSON(){return{__type:"RGBA",r:this.r,g:this.g,b:this.b,a:this.a,raw:this.raw,name:this.name,lineno:this.lineno,column:this.column,filename:this.filename}}toBoolean(){return de.true}get hsla(){return oe.fromRGBA(this)}get hash(){return this.toString()}add(e,t,n,i){return new RGBA(this.r+e,this.g+t,this.b+n,this.a+i)}sub(e,t,n,i){return new RGBA(this.r-e,this.g-t,this.b-n,1==i?this.a:this.a-i)}multiply(e){return new RGBA(this.r*e,this.g*e,this.b*e,this.a)}divide(e){return new RGBA(this.r/e,this.g/e,this.b/e,this.a)}operate(e,t){switch("in"!=e&&(t=t.first),e){case"is a":if("string"==t.nodeName&&"color"==t.string)return de.true;break;case"+":switch(t.nodeName){case"unit":var n=t.val;switch(t.type){case"%":return le(this,new de.String("lightness"),t);case"deg":return this.hsla.adjustHue(n).rgba;default:return this.add(n,n,n,0)}case"rgba":return this.add(t.r,t.g,t.b,t.a);case"hsla":return this.hsla.add(t.h,t.s,t.l)}break;case"-":switch(t.nodeName){case"unit":switch(n=t.val,t.type){case"%":return le(this,new de.String("lightness"),new de.Unit(-n,"%"));case"deg":return this.hsla.adjustHue(-n).rgba;default:return this.sub(n,n,n,0)}case"rgba":return this.sub(t.r,t.g,t.b,t.a);case"hsla":return this.hsla.sub(t.h,t.s,t.l)}break;case"*":if("unit"===t.nodeName)return this.multiply(t.val);break;case"/":if("unit"===t.nodeName)return this.divide(t.val)}return super.operate(e,t)}toString(){function pad(e){return e<16?"0"+e.toString(16):e.toString(16)}if("transparent"==this.name)return this.name;if(1==this.a){var e=pad(this.r),t=pad(this.g),n=pad(this.b);return e[0]==e[1]&&t[0]==t[1]&&n[0]==n[1]?"#"+e[0]+t[0]+n[0]:"#"+e+t+n}return"rgba("+this.r+","+this.g+","+this.b+","+ +this.a.toFixed(3)+")"}static fromHSLA(e){var t=e.h/360,n=e.s/100,i=e.l/100,r=e.a,a=i<=.5?i*(n+1):i+n-i*n,o=2*i-a,h=255*hue(t+1/3),l=255*hue(t),c=255*hue(t-1/3);function hue(e){return e<0&&++e,e>1&&--e,6*e<1?o+(a-o)*e*6:2*e<1?a:3*e<2?o+(a-o)*(2/3-e)*6:o}return new RGBA(h,l,c,r)}};var ce=class Atrule extends ie{constructor(e){super(),this.type=e}get hasOnlyProperties(){if(!this.block)return!1;for(var e=this.block.nodes,t=0,n=e.length;tu;)i.nodes[t]=de.null;i.nodes[r]=n}else e.string&&(a=i.nodes[0])&&"object"==a.nodeName&&a.set(e.string,n.clone())})),n;case"[]":var a,o=new de.Expression,h=v(this).nodes;return(r=v(t).nodes).forEach((function(e){"unit"==e.nodeName?a=h[e.val<0?h.length+e.val:e.val]:"object"==h[0].nodeName&&(a=h[0].get(e.string)),a&&o.push(a)})),o.isEmpty?de.null:v(o);case"||":return this.toBoolean().isTrue?this:t;case"in":return super.operate(e,t);case"!=":return this.operate("==",t,n).negate();case"==":var l,c,u=this.nodes.length;if(t=t.toExpression(),u!=t.nodes.length)return de.false;for(var f=0;f1?de.true:this.first.toBoolean()}toString(){return"("+this.nodes.map((function(e){return e.toString()})).join(this.isList?", ":" ")+")"}toJSON(){return{__type:"Expression",isList:this.isList,preserve:this.preserve,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}}},fe=pe;const de={ /*! * Stylus - nodes * Copyright (c) Automattic * MIT Licensed */ -const X={lineno:null,column:null,filename:null};X.Node=z,X.Root=class Root extends z{constructor(){super(),this.nodes=[]}push(e){this.nodes.push(e)}unshift(e){this.nodes.unshift(e)}clone(){var e=new Root;return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,this.nodes.forEach((function(t){e.push(t.clone(e,e))})),e}toString(){return"[Root]"}toJSON(){return{__type:"Root",nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}}},X.Null=class Null extends z{toString(){return"null"}inspect(){return"null"}toBoolean(){return X.false}get isNull(){return!0}get hash(){return null}toJSON(){return{__type:"Null",lineno:this.lineno,column:this.column,filename:this.filename}}},X.Each=class Each extends z{constructor(e,t,n,i){super(),this.val=e,this.key=t,this.expr=n,this.block=i}clone(e){var t=new Each(this.val,this.key);return t.expr=this.expr.clone(e,t),t.block=this.block.clone(e,t),t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t}toJSON(){return{__type:"Each",val:this.val,key:this.key,expr:this.expr,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}}},X.If=class If extends z{constructor(e,t){super(),this.cond=e,this.elses=[],t&&t.nodeName?this.block=t:this.negate=t}clone(e){var t=new If;return t.cond=this.cond.clone(e,t),t.block=this.block.clone(e,t),t.elses=this.elses.map((function(n){return n.clone(e,t)})),t.negate=this.negate,t.postfix=this.postfix,t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t}toJSON(){return{__type:"If",cond:this.cond,block:this.block,elses:this.elses,negate:this.negate,postfix:this.postfix,lineno:this.lineno,column:this.column,filename:this.filename}}},X.Call=class Call extends z{constructor(e,t){super(),this.name=e,this.args=t}clone(e){var t=new Call(this.name);return t.args=this.args.clone(e,t),this.block&&(t.block=this.block.clone(e,t)),t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t}toString(){var e=this.args.nodes.map((function(e){var t=e.toString();return t.slice(1,t.length-1)})).join(", ");return this.name+"("+e+")"}toJSON(){var e={__type:"Call",name:this.name,args:this.args,lineno:this.lineno,column:this.column,filename:this.filename};return this.block&&(e.block=this.block),e}},X.UnaryOp=class UnaryOp extends z{constructor(e,t){super(),this.op=e,this.expr=t}clone(e){var t=new UnaryOp(this.op);return t.expr=this.expr.clone(e,t),t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t}toJSON(){return{__type:"UnaryOp",op:this.op,expr:this.expr,lineno:this.lineno,column:this.column,filename:this.filename}}},X.BinOp=class BinOp extends z{constructor(e,t,n){super(),this.op=e,this.left=t,this.right=n}clone(e){var t=new BinOp(this.op);return t.left=this.left.clone(e,t),t.right=this.right&&this.right.clone(e,t),t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,this.val&&(t.val=this.val.clone(e,t)),t}toString(){return this.left.toString()+" "+this.op+" "+this.right.toString()}toJSON(){var e={__type:"BinOp",left:this.left,right:this.right,op:this.op,lineno:this.lineno,column:this.column,filename:this.filename};return this.val&&(e.val=this.val),e}},X.Ternary=class Ternary extends z{constructor(e,t,n){super(),this.cond=e,this.trueExpr=t,this.falseExpr=n}clone(e){var t=new Ternary;return t.cond=this.cond.clone(e,t),t.trueExpr=this.trueExpr.clone(e,t),t.falseExpr=this.falseExpr.clone(e,t),t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t}toJSON(){return{__type:"Ternary",cond:this.cond,trueExpr:this.trueExpr,falseExpr:this.falseExpr,lineno:this.lineno,column:this.column,filename:this.filename}}},X.Block=class Block extends z{constructor(e,t){super(),this.nodes=[],this.parent=e,this.node=t,this.scope=!0}get hasProperties(){for(var e=0,t=this.nodes.length;e=r:--i>r);return a}return super.operate(e,t)}coerce(e){if("unit"==e.nodeName){var t=this,n=e,i=H[t.type],r=H[n.type];if(i&&r&&i.label==r.label){var a=n.val*(r.val/i.val);return new X.Unit(a,t.type)}return new X.Unit(n.val,t.type)}if("string"==e.nodeName){if("%"==e.val)return new X.Unit(0,"%");var o=parseFloat(e.val);return isNaN(o)&&super.coerce(e),new X.Unit(o)}return super.coerce(e)}},X.String=class String extends z{constructor(e,t){super(),this.val=e,this.string=e,this.prefixed=!1,this.quote="string"!=typeof t?"'":t}toString(){return this.quote+this.val+this.quote}clone(){var e=new String(this.val,this.quote);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e}toJSON(){return{__type:"String",val:this.val,quote:this.quote,lineno:this.lineno,column:this.column,filename:this.filename}}toBoolean(){return new X.Boolean(this.val.length)}coerce(e){switch(e.nodeName){case"string":return e;case"expression":return new String(e.nodes.map((function(e){return this.coerce(e).val}),this).join(" "));default:return new String(e.toString())}}operate(e,t){switch(e){case"%":(i=new X.Expression).push(this);var n="expression"==t.nodeName?_export_unwrap_(t).nodes:[t];return Q.apply(null,[i].concat(n));case"+":var i;return(i=new X.Expression).push(new String(this.val+this.coerce(t).val)),i;default:return super.operate(e,t)}}},X.HSLA=W,X.RGBA=class RGBA extends z{constructor(e,t,n,i){super(),this.r=clamp(e),this.g=clamp(t),this.b=clamp(n),this.a=function clampAlpha(e){return Math.max(0,Math.min(e,1))}(i),this.name="",this.rgba=this}static withoutClamping(e,t,n,i){var r=new RGBA(0,0,0,0);return r.r=e,r.g=t,r.b=n,r.a=i,r}clone(){var e=new RGBA(this.r,this.g,this.b,this.a);return e.raw=this.raw,e.name=this.name,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e}toJSON(){return{__type:"RGBA",r:this.r,g:this.g,b:this.b,a:this.a,raw:this.raw,name:this.name,lineno:this.lineno,column:this.column,filename:this.filename}}toBoolean(){return X.true}get hsla(){return W.fromRGBA(this)}get hash(){return this.toString()}add(e,t,n,i){return new RGBA(this.r+e,this.g+t,this.b+n,this.a+i)}sub(e,t,n,i){return new RGBA(this.r-e,this.g-t,this.b-n,1==i?this.a:this.a-i)}multiply(e){return new RGBA(this.r*e,this.g*e,this.b*e,this.a)}divide(e){return new RGBA(this.r/e,this.g/e,this.b/e,this.a)}operate(e,t){switch("in"!=e&&(t=t.first),e){case"is a":if("string"==t.nodeName&&"color"==t.string)return X.true;break;case"+":switch(t.nodeName){case"unit":var n=t.val;switch(t.type){case"%":return K(this,new X.String("lightness"),t);case"deg":return this.hsla.adjustHue(n).rgba;default:return this.add(n,n,n,0)}case"rgba":return this.add(t.r,t.g,t.b,t.a);case"hsla":return this.hsla.add(t.h,t.s,t.l)}break;case"-":switch(t.nodeName){case"unit":switch(n=t.val,t.type){case"%":return K(this,new X.String("lightness"),new X.Unit(-n,"%"));case"deg":return this.hsla.adjustHue(-n).rgba;default:return this.sub(n,n,n,0)}case"rgba":return this.sub(t.r,t.g,t.b,t.a);case"hsla":return this.hsla.sub(t.h,t.s,t.l)}break;case"*":if("unit"===t.nodeName)return this.multiply(t.val);break;case"/":if("unit"===t.nodeName)return this.divide(t.val)}return super.operate(e,t)}toString(){function pad(e){return e<16?"0"+e.toString(16):e.toString(16)}if("transparent"==this.name)return this.name;if(1==this.a){var e=pad(this.r),t=pad(this.g),n=pad(this.b);return e[0]==e[1]&&t[0]==t[1]&&n[0]==n[1]?"#"+e[0]+t[0]+n[0]:"#"+e+t+n}return"rgba("+this.r+","+this.g+","+this.b+","+ +this.a.toFixed(3)+")"}static fromHSLA(e){var t=e.h/360,n=e.s/100,i=e.l/100,r=e.a,a=i<=.5?i*(n+1):i+n-i*n,o=2*i-a,h=255*hue(t+1/3),l=255*hue(t),c=255*hue(t-1/3);function hue(e){return e<0&&++e,e>1&&--e,6*e<1?o+(a-o)*e*6:2*e<1?a:3*e<2?o+(a-o)*(2/3-e)*6:o}return new RGBA(h,l,c,r)}},X.Ident=class Ident extends z{constructor(e,t,n){super(),this.name=e,this.string=e,this.val=t||X.null,this.mixin=!!n}get isEmpty(){return null==this.val}get hash(){return this.name}clone(e){var t=new Ident(this.name);return t.val=this.val.clone(e,t),t.mixin=this.mixin,t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t.property=this.property,t.rest=this.rest,t}toJSON(){return{__type:"Ident",name:this.name,val:this.val,mixin:this.mixin,property:this.property,rest:this.rest,lineno:this.lineno,column:this.column,filename:this.filename}}toString(){return this.name}coerce(e){switch(e.nodeName){case"ident":case"string":case"literal":return new Ident(e.string);case"unit":return new Ident(e.toString());default:return super.coerce(e)}}operate(e,t){var n=t.first;switch(e){case"-":if("unit"==n.nodeName){var i=new X.Expression;return(n=n.clone()).val=-n.val,i.push(this),i.push(n),i}case"+":return new X.Ident(this.string+this.coerce(n).string)}return super.operate(e,t)}},X.Group=class Group extends z{constructor(){super(),this.nodes=[],this.extends=[]}push(e){this.nodes.push(e)}get block(){return this.nodes[0].block}set block(e){for(var t=0,n=this.nodes.length;t=r:--i>r);return a}return super.operate(e,t)}coerce(e){if("unit"==e.nodeName){var t=this,n=e,i=re[t.type],r=re[n.type];if(i&&r&&i.label==r.label){var a=n.val*(r.val/i.val);return new de.Unit(a,t.type)}return new de.Unit(n.val,t.type)}if("string"==e.nodeName){if("%"==e.val)return new de.Unit(0,"%");var o=parseFloat(e.val);return isNaN(o)&&super.coerce(e),new de.Unit(o)}return super.coerce(e)}},de.String=class String extends ie{constructor(e,t){super(),this.val=e,this.string=e,this.prefixed=!1,this.quote="string"!=typeof t?"'":t}toString(){return this.quote+this.val+this.quote}clone(){var e=new String(this.val,this.quote);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e}toJSON(){return{__type:"String",val:this.val,quote:this.quote,lineno:this.lineno,column:this.column,filename:this.filename}}toBoolean(){return new de.Boolean(this.val.length)}coerce(e){switch(e.nodeName){case"string":return e;case"expression":return new String(e.nodes.map((function(e){return this.coerce(e).val}),this).join(" "));default:return new String(e.toString())}}operate(e,t){switch(e){case"%":(i=new de.Expression).push(this);var n="expression"==t.nodeName?v(t).nodes:[t];return ae.apply(null,[i].concat(n));case"+":var i;return(i=new de.Expression).push(new String(this.val+this.coerce(t).val)),i;default:return super.operate(e,t)}}},de.HSLA=oe,de.RGBA=he,de.Ident=class Ident extends ie{constructor(e,t,n){super(),this.name=e,this.string=e,this.val=t||de.null,this.mixin=!!n}get isEmpty(){return null==this.val}get hash(){return this.name}clone(e){var t=new Ident(this.name);return t.val=this.val.clone(e,t),t.mixin=this.mixin,t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t.property=this.property,t.rest=this.rest,t}toJSON(){return{__type:"Ident",name:this.name,val:this.val,mixin:this.mixin,property:this.property,rest:this.rest,lineno:this.lineno,column:this.column,filename:this.filename}}toString(){return this.name}coerce(e){switch(e.nodeName){case"ident":case"string":case"literal":return new Ident(e.string);case"unit":return new Ident(e.toString());default:return super.coerce(e)}}operate(e,t){var n=t.first;switch(e){case"-":if("unit"==n.nodeName){var i=new de.Expression;return(n=n.clone()).val=-n.val,i.push(this),i.push(n),i}case"+":return new de.Ident(this.string+this.coerce(n).string)}return super.operate(e,t)}},de.Group=class Group extends ie{constructor(){super(),this.nodes=[],this.extends=[]}push(e){this.nodes.push(e)}get block(){return this.nodes[0].block}set block(e){for(var t=0,n=this.nodes.length;t * MIT Licensed */ -class ParseError extends Error{constructor(e){super(),this.name="ParseError",this.message=e,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}}class SyntaxError extends Error{constructor(e){super(),this.name="SyntaxError",this.message=e,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}}var ee={and:"&&",or:"||",is:"==",isnt:"!=","is not":"!=",":=":"?="},te=65407===new Uint16Array(new Uint8Array([127,255]).buffer)[0];function hexify(e){for(var t="",n=8;n--;)t+=(e>>>(n<<2)&15).toString(16);return t}function parity(e,t,n){return e^t^n}function majority(e,t,n){return e&t^e&n^t&n}function rotateLeft(e,t){return e<>>32-t}var se=new Uint32Array(80),getCache=function(e,t){return"function"==typeof e?new e(t):(n="memory"===e?class MemoryCache{constructor(e){e=e||{},this.limit=e["cache limit"]||256,this._cache={},this.length=0,this.head=this.tail=null}set(e,t){var n,i=t.clone();i.filename=X.filename,i.lineno=X.lineno,i.column=X.column,n={key:e,value:i},this._cache[e]=n,this.tail?(this.tail.next=n,n.prev=this.tail):this.head=n,this.tail=n,this.length++==this.limit&&this.purge()}get(e){var t=this._cache[e],n=t.value.clone();return t==this.tail||(t.next&&(t==this.head&&(this.head=t.next),t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t.next=null,t.prev=this.tail,this.tail&&(this.tail.next=t),this.tail=t),n}has(e){return!!this._cache[e]}key(e,t){var n=function createHash(){let e="";return{update:function update(t){e+=t},digest:function digest(){return function sha1(e){if(!(e instanceof Uint8Array))throw new TypeError("Input data must be a Uint8Array.");var t,n=new ArrayBuffer(function align(e,t){var n=t-1;return e+n&~n}(e.byteLength+9,64)),i=new Uint32Array(n),r=new Uint8Array(n);if(r.set(e),r[e.byteLength]=128,te)for(var a=0,o=i.length;a>24&255|t>>8&65280|t<<8&16711680|t<<24&4278190080;var h=8*e.byteLength;i[i.length-2]=h/Math.pow(2,32),i[i.length-1]=h;for(var l,c=1732584193,u=4023233417,f=2562383102,m=271733878,d=3285377520,v=void 0,g=void 0,k=void 0,w=void 0,b=void 0,y=void 0,x=void 0,S=0,N=i.length;S","=",":","&","&&","~","{","}",".","..","/"],ae=["is","has","where","not","dir","lang","any-link","link","visited","local-link","target","scope","hover","active","focus","drop","current","past","future","enabled","disabled","read-only","read-write","placeholder-shown","checked","indeterminate","valid","invalid","in-range","out-of-range","required","optional","user-error","root","empty","blank","nth-child","nth-last-child","first-child","last-child","only-child","nth-of-type","nth-last-of-type","first-of-type","last-of-type","only-of-type","nth-match","nth-last-match","nth-column","nth-last-column","first-line","first-letter","before","after","selection"],oe=class Parser{constructor(e,n){var i=this;n=n||{},Parser.cache=Parser.cache||Parser.getCache(n),this.hash=Parser.cache.key(e,n),this.lexer={},Parser.cache.has(this.hash)||(this.lexer=new class Lexer{constructor(e,t){function comment(e,t,n,i){var r=i.lastIndexOf("/*",n)>i.lastIndexOf("*/",n),a=i.lastIndexOf("//",n),o=i.lastIndexOf("\n",n),h=0,l=0;if(~a&&a>o)for(;o!=n;){if("'"==i[o]&&(l?l--:l++),'"'==i[o]&&(h?h--:h++),"/"==i[o]&&"/"==i[o+1]){r=!l&&!h;break}++o}return r?e:","===t&&/^[,\t\n]+$/.test(e)?e.replace(/\n/,"\r"):t+"\r"}this.stash=[],this.indentStack=[],this.indentRe=null,this.lineno=1,this.column=1,"\ufeff"==e.charAt(0)&&(e=e.slice(1)),this.str=e.replace(/\s+$/,"\n").replace(/\r\n?/g,"\n").replace(/\\ *\n/g,"\r").replace(/([,(:](?!\/\/[^ ])) *(?:\/\/[^\n]*|\/\*.*?\*\/)?\n\s*/g,comment).replace(/\s*\n[ \t]*([,)])/g,comment)}inspect(){for(var e,t=this.str,n=[];"eos"!=(e=this.next()).type;)n.push(e.inspect());return this.str=t,n.concat(e.inspect()).join("\n")}lookahead(e){for(var t=e-this.stash.length;t-- >0;)this.stash.push(this.advance());return this.stash[--e]}skip(e){var t=e[0];e=t?t.length:e,this.str=this.str.substr(e),t?this.move(t):this.column+=e}move(e){var t=e.match(/\n/g),n=e.lastIndexOf("\n");t&&(this.lineno+=t.length),this.column=~n?e.length-n:this.column+e.length}next(){var e=this.stashed()||this.advance();return this.prev=e,e}isPartOfSelector(){var e=this.stash[this.stash.length-1]||this.prev;switch(e&&e.type){case"color":return 2==e.val.raw.length;case".":case"[":return!0}return!1}advance(){var e=this.column,t=this.lineno,n=this.eos()||this.null()||this.sep()||this.keyword()||this.urlchars()||this.comment()||this.newline()||this.escaped()||this.important()||this.literal()||this.anonFunc()||this.atrule()||this.function()||this.brace()||this.paren()||this.color()||this.string()||this.unit()||this.namedop()||this.boolean()||this.unicode()||this.ident()||this.op()||function(){var n=this.eol();return n&&(e=n.column,t=n.lineno),n}.call(this)||this.space()||this.selector();return n.lineno=t,n.column=e,n}peek(){return this.lookahead(1)}stashed(){return this.stash.shift()}eos(){if(!this.str.length)return this.indentStack.length?(this.indentStack.shift(),new t("outdent")):new t("eos")}urlchars(){var e;if(this.isURL)return(e=/^[\/:@.;?&=*!,<>#%0-9]+/.exec(this.str))?(this.skip(e),new t("literal",new X.Literal(e[0]))):void 0}sep(){var e;if(e=/^;[ \t]*/.exec(this.str))return this.skip(e),new t(";")}eol(){if("\r"==this.str[0]){for(++this.lineno,this.skip(1),this.column=1;this.space(););return this.advance()}}space(){var e;if(e=/^([ \t]+)/.exec(this.str))return this.skip(e),new t("space")}escaped(){var e;if(e=/^\\(.)[ \t]*/.exec(this.str)){var n=e[1];return this.skip(e),new t("ident",new X.Literal(n))}}literal(){var e;if(e=/^@css[ \t]*\{/.exec(this.str)){this.skip(e);for(var n,i,r=1,a="";n=this.str[0];){switch(this.str=this.str.substr(1),n){case"{":++r;break;case"}":--r;break;case"\n":case"\r":++this.lineno}if(a+=n,!r)break}return a=a.replace(/\s*}$/,""),(i=new X.Literal(a)).css=!0,new t("literal",i)}}important(){var e;if(e=/^!important[ \t]*/.exec(this.str))return this.skip(e),new t("ident",new X.Literal("!important"))}brace(){var e;if(e=/^([{}])/.exec(this.str)){this.skip(1);var n=e[1];return new t(n,n)}}paren(){var e;if(e=/^([()])([ \t]*)/.exec(this.str)){var n=e[1];this.skip(e),")"==n&&(this.isURL=!1);var i=new t(n,n);return i.space=e[2],i}}null(){var e;if(e=/^(null)\b[ \t]*/.exec(this.str))return this.skip(e),this.isPartOfSelector()?new t("ident",new X.Ident(e[0])):new t("null",X.null)}keyword(){var e;if(e=/^(return|if|else|unless|for|in)\b(?!-)[ \t]*/.exec(this.str)){var n=e[1];return this.skip(e),this.isPartOfSelector()?new t("ident",new X.Ident(e[0])):new t(n,n)}}namedop(){var e,n;if(e=/^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)){var i=e[1];return this.skip(e),(n=this.isPartOfSelector()?new t("ident",new X.Ident(e[0])):new t(i=ee[i]||i,i)).space=e[2],n}}op(){var e;if(e=/^([.]{1,3}|&&|\|\||[!<>=?:]=|\*\*|[-+*\/%]=?|[,=?:!~<>&\[\]])([ \t]*)/.exec(this.str)){var n=e[1];this.skip(e);var i=new t(n=ee[n]||n,n);return i.space=e[2],this.isURL=!1,i}}anonFunc(){var e;if("@"==this.str[0]&&"("==this.str[1])return this.skip(2),(e=new t("function",new X.Ident("anonymous"))).anonymous=!0,e}atrule(){var e;if(e=/^@(?!apply)(?:-(\w+)-)?([a-zA-Z0-9-_]+)[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=e[2];switch(i){case"require":case"import":case"charset":case"namespace":case"media":case"scope":case"supports":return new t(i);case"document":return new t("-moz-document");case"block":return new t("atblock");case"extend":case"extends":return new t("extend");case"keyframes":return new t(i,n);default:return new t("atrule",n?"-"+n+"-"+i:i)}}}comment(){if("/"==this.str[0]&&"/"==this.str[1])return-1==(e=this.str.indexOf("\n"))&&(e=this.str.length),this.skip(e),this.advance();if("/"==this.str[0]&&"*"==this.str[1]){var e;-1==(e=this.str.indexOf("*/"))&&(e=this.str.length);var n=this.str.substr(0,e+2),i=n.split(/\n|\r/).length-1,r=!0,a=!1;return this.lineno+=i,this.skip(e+2),"!"==n[2]&&(n=n.replace("*!","*"),r=!1),this.prev&&";"==this.prev.type&&(a=!0),new t("comment",new X.Comment(n,r,a))}}boolean(){var e;if(e=/^(true|false)\b([ \t]*)/.exec(this.str)){var n=new X.Boolean("true"==e[1]);this.skip(e);var i=new t("boolean",n);return i.space=e[2],i}}unicode(){var e;if(e=/^u\+[0-9a-f?]{1,6}(?:-[0-9a-f]{1,6})?/i.exec(this.str))return this.skip(e),new t("literal",new X.Literal(e[0]))}function(){var e;if(e=/^(-*[_a-zA-Z$][-\w\d$]*)\(([ \t]*)/.exec(this.str)){var n=e[1];this.skip(e),this.isURL="url"==n;var i=new t("function",new X.Ident(n));return i.space=e[2],i}}ident(){var e;if(e=/^-*([_a-zA-Z$]|@apply)[-\w\d$]*/.exec(this.str))return this.skip(e),new t("ident",new X.Ident(e[0]))}newline(){var e,n;if(this.indentRe?e=this.indentRe.exec(this.str):((e=(n=/^\n([\t]*)[ \t]*/).exec(this.str))&&!e[1].length&&(e=(n=/^\n([ \t]*)/).exec(this.str)),e&&e[1].length&&(this.indentRe=n)),e){var i,r=e[1].length;if(this.skip(e)," "===this.str[0]||"\t"===this.str[0])throw new SyntaxError("Invalid indentation. You can use tabs or spaces to indent, but not both.");if("\n"==this.str[0])return this.advance();if(this.indentStack.length&&rr;)this.stash.push(new t("outdent")),this.indentStack.shift();i=this.stash.pop()}else r&&r!=this.indentStack[0]?(this.indentStack.unshift(r),i=new t("indent")):i=new t("newline");return i}}unit(){var e;if(e=/^(-)?(\d+\.\d+|\d+|\.\d+)(%|[a-zA-Z]+)?[ \t]*/.exec(this.str)){this.skip(e);var n=parseFloat(e[2]);"-"==e[1]&&(n=-n);var i=new X.Unit(n,e[3]);return i.raw=e[0],new t("unit",i)}}string(){var e;if(e=/^("[^"]*"|'[^']*')[ \t]*/.exec(this.str)){var n=e[1],i=e[0][0];return this.skip(e),n=n.slice(1,-1).replace(/\\n/g,"\n"),new t("string",new X.String(n,i))}}color(){return this.rrggbbaa()||this.rrggbb()||this.rgba()||this.rgb()||this.nn()||this.n()}n(){var e;if(e=/^#([a-fA-F0-9]{1})[ \t]*/.exec(this.str)){this.skip(e);var n=parseInt(e[1]+e[1],16),i=new X.RGBA(n,n,n,1);return i.raw=e[0],new t("color",i)}}nn(){var e;if(e=/^#([a-fA-F0-9]{2})[ \t]*/.exec(this.str)){this.skip(e);var n=parseInt(e[1],16),i=new X.RGBA(n,n,n,1);return i.raw=e[0],new t("color",i)}}rgb(){var e;if(e=/^#([a-fA-F0-9]{3})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16),o=new X.RGBA(i,r,a,1);return o.raw=e[0],new t("color",o)}}rgba(){var e;if(e=/^#([a-fA-F0-9]{4})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16),o=parseInt(n[3]+n[3],16),h=new X.RGBA(i,r,a,o/255);return h.raw=e[0],new t("color",h)}}rrggbb(){var e;if(e=/^#([a-fA-F0-9]{6})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),a=parseInt(n.substr(4,2),16),o=new X.RGBA(i,r,a,1);return o.raw=e[0],new t("color",o)}}rrggbbaa(){var e;if(e=/^#([a-fA-F0-9]{8})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),a=parseInt(n.substr(4,2),16),o=parseInt(n.substr(6,2),16),h=new X.RGBA(i,r,a,o/255);return h.raw=e[0],new t("color",h)}}selector(){var e;if(e=/^\^|.*?(?=\/\/(?![^\[]*\])|[,\n{])/.exec(this.str)){var n=e[0];return this.skip(e),new t("selector",n)}}}(e,n)),this.prefix=n.prefix||"",this.root=n.root||new X.Root,this.state=["root"],this.stash=[],this.parens=0,this.css=0,this.state.pop=function(){i.prevState=[].pop.call(this)}}static getCache(e){return!1===e.cache?getCache(!1):getCache(e.cache||"memory",e)}currentState(){return this.state[this.state.length-1]}previousState(){return this.state[this.state.length-2]}parse(){var e=this.parent=this.root;if(Parser.cache.has(this.hash))"block"==(e=Parser.cache.get(this.hash)).nodeName&&(e.constructor=X.Root);else{for(;"eos"!=this.peek().type&&(this.skipWhitespace(),"eos"!=this.peek().type);){var t=this.statement();this.accept(";"),t||this.error("unexpected token {peek}, not allowed at the root level"),e.push(t)}Parser.cache.set(this.hash,e)}return e}error(e){var t=this.peek().type,n=null==this.peek().val?"":" "+this.peek().toString();throw n.trim()==t.trim()&&(n=""),new ParseError(e.replace("{peek}",'"'+t+n+'"'))}accept(e){if(e==this.peek().type)return this.next()}expect(e){return e!=this.peek().type&&this.error('expected "'+e+'", got {peek}'),this.next()}next(){var e=this.stash.length?this.stash.pop():this.lexer.next(),t=e.lineno,n=e.column||1;return e.val&&e.val.nodeName&&(e.val.lineno=t,e.val.column=n),X.lineno=t,X.column=n,ie.lexer("%s %s",e.type,e.val||""),e}peek(){return this.lexer.peek()}lookahead(e){return this.lexer.lookahead(e)}isSelectorToken(e){var t=this.lookahead(e).type;switch(t){case"for":return this.bracketed;case"[":return this.bracketed=!0,!0;case"]":return this.bracketed=!1,!0;default:return~re.indexOf(t)}}isPseudoSelector(e){var t=this.lookahead(e).val;return t&&~ae.indexOf(t.name)}lineContains(e){for(var t,n=1;t=this.lookahead(n++);){if(~["indent","outdent","newline","eos"].indexOf(t.type))return;if(e==t.type)return!0}}selectorToken(){if(this.isSelectorToken(1)){if("{"==this.peek().type){if(!this.lineContains("}"))return;for(var e,t=0;e=this.lookahead(++t);){if("}"==e.type){if(2==t||3==t&&"space"==this.lookahead(t-1).type)return;break}if(":"==e.type)return}}return this.next()}}skip(e){for(;~e.indexOf(this.peek().type);)this.next()}skipWhitespace(){this.skip(["space","indent","outdent","newline"])}skipNewlines(){for(;"newline"==this.peek().type;)this.next()}skipSpaces(){for(;"space"==this.peek().type;)this.next()}skipSpacesAndComments(){for(;"space"==this.peek().type||"comment"==this.peek().type;)this.next()}looksLikeFunctionDefinition(e){return"indent"==this.lookahead(e).type||"{"==this.lookahead(e).type}looksLikeSelector(e){var t,n,i=1;if(e&&":"==this.lookahead(i+1).type&&(this.lookahead(i+1).space||"indent"==this.lookahead(i+2).type))return!1;for(;"ident"==this.lookahead(i).type&&("newline"==this.lookahead(i+1).type||","==this.lookahead(i+1).type);)i+=2;for(;this.isSelectorToken(i)||","==this.lookahead(i).type;){if("selector"==this.lookahead(i).type)return!0;if("&"==this.lookahead(i+1).type)return!0;if(i>1&&"ident"===this.lookahead(i-1).type&&"."===this.lookahead(i).type&&"ident"===this.lookahead(i+1).type){for(;t=this.lookahead(i+2);){if(-1!==["indent","outdent","{",";","eos","selector","media","if","atrule",")","}","unit","[","for","function"].indexOf(t.type)){if("["!==t.type){if(this.isPseudoSelector(i+2))return!0;if(")"===t.type&&this.lookahead(i+3)&&"}"===this.lookahead(i+3).type)break;return-1===["outdent",";","eos","media","if","atrule",")","}","unit","for","function"].indexOf(t.type)}for(;(t=this.lookahead(i+3))&&"]"!==t.type;){if(~[".","unit"].indexOf(t.type))return!1;i+=1}}i+=1}return!0}if("."==this.lookahead(i).type&&"ident"==this.lookahead(i+1).type)return!0;if("*"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i).type&&":"==this.lookahead(i+1).type)return!0;if("color"==this.lookahead(i).type&&"newline"==this.lookahead(i-1).type)return!0;if(this.looksLikeAttributeSelector(i))return!0;if(("="==this.lookahead(i).type||"function"==this.lookahead(i).type)&&"{"==this.lookahead(i+1).type)return!1;if(":"==this.lookahead(i).type&&!this.isPseudoSelector(i+1)&&this.lineContains("."))return!1;if("{"==this.lookahead(i).type?n=!0:"}"==this.lookahead(i).type&&(n=!1),n&&":"==this.lookahead(i).type)return!0;if("space"==this.lookahead(i).type&&"{"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i++).type&&!this.lookahead(i-1).space&&this.isPseudoSelector(i))return!0;if("space"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type&&"{"==this.lookahead(i+2).type)return!0;if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0}if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if("{"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(this.css&&(";"==this.lookahead(i).type||"}"==this.lookahead(i-1).type))return!1;for(;!~["indent","outdent","newline","for","if",";","}","eos"].indexOf(this.lookahead(i).type);)++i;return"indent"==this.lookahead(i).type||void 0}looksLikeAttributeSelector(e){var t=this.lookahead(e).type;return!("="!=t||!this.bracketed)||("ident"==t||"string"==t)&&"]"==this.lookahead(e+1).type&&("newline"==this.lookahead(e+2).type||this.isSelectorToken(e+2))&&!this.lineContains(":")&&!this.lineContains("=")}looksLikeKeyframe(){var e,t=2;switch(this.lookahead(t).type){case"{":case"indent":case",":return!0;case"newline":for(;"unit"==this.lookahead(++t).type||"newline"==this.lookahead(t).type;);return"indent"==(e=this.lookahead(t).type)||"{"==e}}stateAllowsSelector(){switch(this.currentState()){case"root":case"atblock":case"selector":case"conditional":case"function":case"atrule":case"for":return!0}}assignAtblock(e){try{e.push(this.atblock(e))}catch(e){this.error("invalid right-hand side operand in assignment, got {peek}")}}statement(){var e,t,n=this.stmt(),i=this.prevState;switch(this.allowPostfix&&(this.allowPostfix=!1,i="expression"),i){case"assignment":case"expression":case"function arguments":for(;t=this.accept("if")||this.accept("unless")||this.accept("for");)switch(t.type){case"if":case"unless":(n=new X.If(this.expression(),n)).postfix=!0,n.negate="unless"==t.type,this.accept(";");break;case"for":var r,a=this.id().name;this.accept(",")&&(r=this.id().name),this.expect("in");var o=new X.Each(a,r,this.expression());(e=new X.Block(this.parent,o)).push(n),o.block=e,n=o}}return n}stmt(){var e,t=this.peek();switch(t.type){case"keyframes":return this.keyframes();case"-moz-document":return this.mozdocument();case"comment":case"selector":case"literal":case"charset":case"namespace":case"import":case"require":case"extend":case"media":case"atrule":case"ident":case"scope":case"supports":case"unless":case"function":case"for":case"if":return this[t.type]();case"return":return this.return();case"{":return this.property();default:if(this.stateAllowsSelector())switch(t.type){case"color":case"~":case">":case"<":case":":case"&":case"&&":case"[":case".":case"/":return(e=this.selector()).column=t.column,e.lineno=t.lineno,e;case"..":if("/"==this.lookahead(2).type)return this.selector();case"+":return"function"==this.lookahead(2).type?this.functionCall():this.selector();case"*":return this.property();case"unit":if(this.looksLikeKeyframe())return(e=this.selector()).column=t.column,e.lineno=t.lineno,e;case"-":if("{"==this.lookahead(2).type)return this.property()}var n=this.expression();return n.isEmpty&&this.error("unexpected {peek}"),n}}block(e,t){var n,i,r,a=this.parent=new X.Block(this.parent,e);for(!1===t&&(a.scope=!1),this.accept("newline"),this.accept("{")?(this.css++,n="}",this.skipWhitespace()):(n="outdent",this.expect("indent"));n!=this.peek().type;){if(this.css){if(this.accept("newline")||this.accept("indent"))continue;i=this.statement(),this.accept(";"),this.skipWhitespace()}else{if(this.accept("newline"))continue;if(r=this.lookahead(2).type,"indent"==this.peek().type&&~["outdent","newline","comment"].indexOf(r)){this.skip(["indent","outdent"]);continue}if("eos"==this.peek().type)return a;i=this.statement(),this.accept(";")}i||this.error("unexpected token {peek} in block"),a.push(i)}return this.css?(this.skipWhitespace(),this.expect("}"),this.skipSpaces(),this.css--):this.expect("outdent"),this.parent=a.parent,a}comment(){var e=this.next().val;return this.skipSpaces(),e}for(){this.expect("for");var e,t=this.id().name;this.accept(",")&&(e=this.id().name),this.expect("in"),this.state.push("for"),this.cond=!0;var n=new X.Each(t,e,this.expression());return this.cond=!1,n.block=this.block(n,!1),this.state.pop(),n}return(){this.expect("return");var e=this.expression();return e.isEmpty?new X.Return:new X.Return(e)}unless(){this.expect("unless"),this.state.push("conditional"),this.cond=!0;var e=new X.If(this.expression(),!0);return this.cond=!1,e.block=this.block(e,!1),this.state.pop(),e}if(){var e=this.expect("if");this.state.push("conditional"),this.cond=!0;var t,n,i,r=new X.If(this.expression());for(r.column=e.column,this.cond=!1,r.block=this.block(r,!1),this.skip(["newline","comment"]);this.accept("else");){if(!(e=this.accept("if"))){r.elses.push(this.block(r,!1));break}this.cond=!0,t=this.expression(),this.cond=!1,n=this.block(r,!1),(i=new X.If(t,n)).column=e.column,r.elses.push(i),this.skip(["newline","comment"])}return this.state.pop(),r}atblock(e){return e||this.expect("atblock"),e=new X.Atblock,this.state.push("atblock"),e.block=this.block(e,!1),this.state.pop(),e}atrule(){var e,t=this.expect("atrule").val,n=new X.Atrule(t);return this.skipSpacesAndComments(),n.segments=this.selectorParts(),this.skipSpacesAndComments(),("indent"==(e=this.peek().type)||"{"==e||"newline"==e&&"{"==this.lookahead(2).type)&&(this.state.push("atrule"),n.block=this.block(n),this.state.pop()),n}scope(){this.expect("scope");var e=this.selectorParts().map((function(e){return e.val})).join("");return this.selectorScope=e.trim(),X.null}supports(){this.expect("supports");var e=new X.Supports(this.supportsCondition());return this.state.push("atrule"),e.block=this.block(e),this.state.pop(),e}supportsCondition(){var e=this.supportsNegation()||this.supportsOp();return e||(this.cond=!0,e=this.expression(),this.cond=!1),e}supportsNegation(){if(this.accept("not")){var e=new X.Expression;return e.push(new X.Literal("not")),e.push(this.supportsFeature()),e}}supportsOp(){var e,t,n=this.supportsFeature();if(n){for((t=new X.Expression).push(n);e=this.accept("&&")||this.accept("||");)t.push(new X.Literal("&&"==e.val?"and":"or")),t.push(this.supportsFeature());return t}}supportsFeature(){if(this.skipSpacesAndComments(),"("==this.peek().type){var e=this.lookahead(2).type;if("ident"==e||"{"==e)return this.feature();this.expect("(");var t=new X.Expression;return t.push(new X.Literal("(")),t.push(this.supportsCondition()),this.expect(")"),t.push(new X.Literal(")")),this.skipSpacesAndComments(),t}}extend(){var e,t,n,i=this.expect("extend"),r=[];do{(n=this.selectorParts()).length&&(e=new X.Selector(n),r.push(e),"!"===this.peek().type&&"ident"===(i=this.lookahead(2)).type&&"optional"===i.val.name&&(this.skip(["!","ident"]),e.optional=!0))}while(this.accept(","));return(t=new X.Extend(r)).lineno=i.lineno,t.column=i.column,t}media(){this.expect("media"),this.state.push("atrule");var e=new X.Media(this.queries());return e.block=this.block(e),this.state.pop(),e}queries(){var e=new X.QueryList,t=["comment","newline","space"];do{this.skip(t),e.push(this.query()),this.skip(t)}while(this.accept(","));return e}query(){var e,t,n,i=new X.Query;if("ident"==this.peek().type&&("."==this.lookahead(2).type||"["==this.lookahead(2).type))return this.cond=!0,e=this.expression(),this.cond=!1,i.push(new X.Feature(e.nodes)),i;if((t=this.accept("ident")||this.accept("not"))&&(t=new X.Literal(t.val.string||t.val),this.skipSpacesAndComments(),(n=this.accept("ident"))?(i.type=n.val,i.predicate=t):i.type=t,this.skipSpacesAndComments(),!this.accept("&&")))return i;do{i.push(this.feature())}while(this.accept("&&"));return i}feature(){this.skipSpacesAndComments(),this.expect("("),this.skipSpacesAndComments();var e=new X.Feature(this.interpolate());return this.skipSpacesAndComments(),this.accept(":"),this.skipSpacesAndComments(),this.inProperty=!0,e.expr=this.list(),this.inProperty=!1,this.skipSpacesAndComments(),this.expect(")"),this.skipSpacesAndComments(),e}mozdocument(){this.expect("-moz-document");var e=new X.Atrule("-moz-document"),t=[];do{this.skipSpacesAndComments(),t.push(this.functionCall()),this.skipSpacesAndComments()}while(this.accept(","));return e.segments=[new X.Literal(t.join(", "))],this.state.push("atrule"),e.block=this.block(e,!1),this.state.pop(),e}import(){return this.expect("import"),this.allowPostfix=!0,new X.Import(this.expression(),!1)}require(){return this.expect("require"),this.allowPostfix=!0,new X.Import(this.expression(),!0)}charset(){this.expect("charset");var e=this.expect("string").val;return this.allowPostfix=!0,new X.Charset(e)}namespace(){var e,t;return this.expect("namespace"),this.skipSpacesAndComments(),(t=this.accept("ident"))&&(t=t.val),this.skipSpacesAndComments(),e=this.accept("string")||this.url(),this.allowPostfix=!0,new X.Namespace(e,t)}keyframes(){var e,t=this.expect("keyframes");return this.skipSpacesAndComments(),(e=new X.Keyframes(this.selectorParts(),t.val)).column=t.column,this.skipSpacesAndComments(),this.state.push("atrule"),e.block=this.block(e),this.state.pop(),e}literal(){return this.expect("literal").val}id(){var e=this.expect("ident");return this.accept("space"),e.val}ident(){for(var e=2,t=this.lookahead(e).type;"space"==t;)t=this.lookahead(++e).type;switch(t){case"=":case"?=":case"-=":case"+=":case"*=":case"/=":case"%=":return this.assignment();case".":if("space"==this.lookahead(e-1).type)return this.selector();if(this._ident==this.peek())return this.id();for(;"="!=this.lookahead(++e).type&&!~["[",",","newline","indent","eos"].indexOf(this.lookahead(e).type););if("="==this.lookahead(e).type)return this._ident=this.peek(),this.expression();if(this.looksLikeSelector()&&this.stateAllowsSelector())return this.selector();case"[":if(this._ident==this.peek())return this.id();for(;"]"!=this.lookahead(e++).type&&"selector"!=this.lookahead(e).type&&"eos"!=this.lookahead(e).type;);if("="==this.lookahead(e).type)return this._ident=this.peek(),this.expression();if(this.looksLikeSelector()&&this.stateAllowsSelector())return this.selector();case"-":case"+":case"/":case"*":case"%":case"**":case"&&":case"||":case">":case"<":case">=":case"<=":case"!=":case"==":case"?":case"in":case"is a":case"is defined":if(this._ident==this.peek())return this.id();switch(this._ident=this.peek(),this.currentState()){case"for":case"selector":return this.property();case"root":case"atblock":case"atrule":return"["==t?this.subscript():this.selector();case"function":case"conditional":return this.looksLikeSelector()?this.selector():this.expression();default:return this.operand?this.id():this.expression()}default:switch(this.currentState()){case"root":return this.selector();case"for":case"selector":case"function":case"conditional":case"atblock":case"atrule":return this.property();default:var n=this.id();return"interpolation"==this.previousState()&&(n.mixin=!0),n}}}interpolate(){var e,t=[];for(this.accept("*")&&t.push(new X.Literal("*"));;)if(this.accept("{"))this.state.push("interpolation"),t.push(this.expression()),this.expect("}"),this.state.pop();else if(e=this.accept("-"))t.push(new X.Literal("-"));else{if(!(e=this.accept("ident")))break;t.push(e.val)}return t.length||this.expect("ident"),t}property(){if(this.looksLikeSelector(!0))return this.selector();var e=this.interpolate(),t=new X.Property(e),n=t;return this.accept("space"),this.accept(":")&&this.accept("space"),this.state.push("property"),this.inProperty=!0,t.expr=this.list(),t.expr.isEmpty&&(n=e[0]),this.inProperty=!1,this.allowPostfix=!0,this.state.pop(),this.accept(";"),n}selector(){var e,t,n=new X.Group,i=this.selectorScope,r="root"==this.currentState();do{this.accept("newline"),e=this.selectorParts(),r&&i&&e.unshift(new X.Literal(i+" ")),e.length&&((t=new X.Selector(e)).lineno=e[0].lineno,t.column=e[0].column,n.push(t))}while(this.accept(",")||this.accept("newline"));return"selector-parts"==this.currentState()?n.nodes:(this.state.push("selector"),n.block=this.block(n),this.state.pop(),n)}selectorParts(){for(var e,t=[];e=this.selectorToken();)switch(e.type){case"{":this.skipSpaces();var n=this.expression();this.skipSpaces(),this.expect("}"),t.push(n);break;case this.prefix&&".":var i=new X.Literal(e.val+this.prefix);i.prefixed=!0,t.push(i);break;case"comment":break;case"color":case"unit":t.push(new X.Literal(e.val.raw));break;case"space":t.push(new X.Literal(" "));break;case"function":t.push(new X.Literal(e.val.name+"("));break;case"ident":t.push(new X.Literal(e.val.name||e.val.string));break;default:t.push(new X.Literal(e.val)),e.space&&t.push(new X.Literal(" "))}return t}assignment(){var e,t,n=this.id(),i=n.name;if(e=this.accept("=")||this.accept("?=")||this.accept("+=")||this.accept("-=")||this.accept("*=")||this.accept("/=")||this.accept("%=")){this.state.push("assignment");var r=this.list();switch(r.isEmpty&&this.assignAtblock(r),(t=new X.Ident(i,r)).lineno=n.lineno,t.column=n.column,this.state.pop(),e.type){case"?=":var a=new X.BinOp("is defined",t),o=new X.Expression;o.push(new X.Ident(i)),t=new X.Ternary(a,o,t);break;case"+=":case"-=":case"*=":case"/=":case"%=":t.val=new X.BinOp(e.type[0],new X.Ident(i),r)}}return t}function(){var e,t=1,n=2;e:for(;e=this.lookahead(n++);)switch(e.type){case"function":case"(":++t;break;case")":if(!--t)break e;break;case"eos":this.error('failed to find closing paren ")"')}return"expression"===this.currentState()?this.functionCall():this.looksLikeFunctionDefinition(n)?this.functionDefinition():this.expression()}url(){this.expect("function"),this.state.push("function arguments");var e=this.args();return this.expect(")"),this.state.pop(),new X.Call("url",e)}functionCall(){var e=this.accept("+");if("url"==this.peek().val.name)return this.url();var t=this.expect("function").val,n=t.name;this.state.push("function arguments"),this.parens++;var i=this.args();this.expect(")"),this.parens--,this.state.pop();var r=new X.Call(n,i);return r.column=t.column,r.lineno=t.lineno,e&&(this.state.push("function"),r.block=this.block(r),this.state.pop()),r}functionDefinition(){var e=this.expect("function"),t=e.val.name;this.state.push("function params"),this.skipWhitespace();var n=this.params();this.skipWhitespace(),this.expect(")"),this.state.pop(),this.state.push("function");var i=new X.Function(t,n);return i.column=e.column,i.lineno=e.lineno,i.block=this.block(i),this.state.pop(),new X.Ident(t,i)}params(){for(var e,t,n=new X.Params;e=this.accept("ident");)this.accept("space"),n.push(t=e.val),this.accept("...")?t.rest=!0:this.accept("=")&&(t.val=this.expression()),this.skipWhitespace(),this.accept(","),this.skipWhitespace();return n}args(){var e,t=new X.Arguments;do{"ident"==this.peek().type&&":"==this.lookahead(2).type?(e=this.next().val.string,this.expect(":"),t.map[e]=this.expression()):t.push(this.expression())}while(this.accept(","));return t}list(){for(var e=this.expression();this.accept(",");)if(e.isList)t.push(this.expression());else{var t=new X.Expression(!0);t.push(e),t.push(this.expression()),e=t}return e}expression(){var e,t=new X.Expression;for(this.state.push("expression");e=this.negation();)e||this.error("unexpected token {peek} in expression"),t.push(e);return this.state.pop(),t.nodes.length&&(t.lineno=t.nodes[0].lineno,t.column=t.nodes[0].column),t}negation(){return this.accept("not")?new X.UnaryOp("!",this.negation()):this.ternary()}ternary(){var e=this.logical();if(this.accept("?")){var t=this.expression();this.expect(":");var n=this.expression();e=new X.Ternary(e,t,n)}return e}logical(){for(var e,t=this.typecheck();e=this.accept("&&")||this.accept("||");)t=new X.BinOp(e.type,t,this.typecheck());return t}typecheck(){for(var e,t=this.equality();e=this.accept("is a");)this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new X.BinOp(e.type,t,this.equality()),this.operand=!1;return t}equality(){for(var e,t=this.in();e=this.accept("==")||this.accept("!=");)this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new X.BinOp(e.type,t,this.in()),this.operand=!1;return t}in(){for(var e=this.relational();this.accept("in");)this.operand=!0,e||this.error('illegal unary "in", missing left-hand operand'),e=new X.BinOp("in",e,this.relational()),this.operand=!1;return e}relational(){for(var e,t=this.range();e=this.accept(">=")||this.accept("<=")||this.accept("<")||this.accept(">");)this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new X.BinOp(e.type,t,this.range()),this.operand=!1;return t}range(){var e,t=this.additive();return(e=this.accept("...")||this.accept(".."))&&(this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new X.BinOp(e.val,t,this.additive()),this.operand=!1),t}additive(){for(var e,t=this.multiplicative();e=this.accept("+")||this.accept("-");)this.operand=!0,t=new X.BinOp(e.type,t,this.multiplicative()),this.operand=!1;return t}multiplicative(){for(var e,n=this.defined();e=this.accept("**")||this.accept("*")||this.accept("/")||this.accept("%");){if(this.operand=!0,"/"==e&&this.inProperty&&!this.parens)return this.stash.push(new t("literal",new X.Literal("/"))),this.operand=!1,n;n||this.error('illegal unary "'+e+'", missing left-hand operand'),n=new X.BinOp(e.type,n,this.defined()),this.operand=!1}return n}defined(){var e=this.unary();return this.accept("is defined")&&(e||this.error('illegal unary "is defined", missing left-hand operand'),e=new X.BinOp("is defined",e)),e}unary(){var e,t;return(e=this.accept("!")||this.accept("~")||this.accept("+")||this.accept("-"))?(this.operand=!0,(t=this.unary())||this.error('illegal unary "'+e+'"'),t=new X.UnaryOp(e.type,t),this.operand=!1,t):this.subscript()}subscript(){for(var e=this.member();this.accept("[");)e=new X.BinOp("[]",e,this.expression()),this.expect("]");return this.accept("=")&&(e.op+="=",e.val=this.list(),e.val.isEmpty&&this.assignAtblock(e.val)),e}member(){var e=this.primary();if(e){for(;this.accept(".");){var t=new X.Ident(this.expect("ident").val.string);e=new X.Member(e,t)}this.skipSpaces(),this.accept("=")&&(e.val=this.list(),e.val.isEmpty&&this.assignAtblock(e.val))}return e}object(){var e,t,n,i,r=new X.Object;for(this.expect("{"),this.skipWhitespace();!this.accept("}");)this.accept("comment")||this.accept("newline")||(n||this.accept(","),(e=this.accept("ident")||this.accept("string"))||this.error('expected "ident" or "string", got {peek}'),i=e.val.hash,this.skipSpacesAndComments(),this.expect(":"),t=this.expression(),r.setValue(i,t),r.setKey(i,e.val),n=this.accept(","),this.skipWhitespace());return r}primary(){var e;if(this.skipSpaces(),this.accept("(")){++this.parens;var t=this.expression(),n=this.expect(")");return--this.parens,this.accept("%")&&t.push(new X.Ident("%")),e=this.peek(),!n.space&&"ident"==e.type&&~i.indexOf(e.val.string)&&(t.push(new X.Ident(e.val.string)),this.next()),t}switch((e=this.peek()).type){case"null":case"unit":case"color":case"string":case"literal":case"boolean":case"comment":return this.next().val;case!this.cond&&"{":return this.object();case"atblock":return this.atblock();case"atrule":var r=new X.Ident(this.next().val);return r.property=!0,r;case"ident":return this.ident();case"function":return e.anonymous?this.functionDefinition():this.functionCall()}}};const he={exports:{}};!function(e){void 0!==he&&(he.exports=e);var t={on:function on(e,t){return getListeners(this,e).push(t),this},once:function once(e,t){var n=this;return wrap.originalListener=t,getListeners(n,e).push(wrap),n;function wrap(){off.call(n,e,wrap),t.apply(this,arguments)}},off:off,emit:function emit(e,t){var n=this,i=getListeners(n,e,!0);if(!i)return!1;var r=arguments.length;if(1===r)i.forEach(zeroarg);else if(2===r)i.forEach(onearg);else{var a=Array.prototype.slice.call(arguments,1);i.forEach(moreargs)}return!!i.length;function zeroarg(e){e.call(n)}function onearg(e){e.call(n,t)}function moreargs(e){e.apply(n,a)}}};function mixin(e){for(var n in t)e[n]=t[n];return e}function off(e,t){var n,i=this;if(arguments.length){if(t){if(n=getListeners(i,e,!0)){if(!(n=n.filter(ne)).length)return off.call(i,e);i.listeners[e]=n}}else if((n=i.listeners)&&(delete n[e],!Object.keys(n).length))return off.call(i)}else delete i.listeners;return i;function ne(e){return e!==t&&e.originalListener!==t}}function getListeners(e,t,n){if(!n||e.listeners){var i=e.listeners||(e.listeners={});return i[t]||(i[t]=[])}}mixin(e.prototype),e.mixin=mixin}(( +class ParseError extends Error{constructor(e){super(),this.name="ParseError",this.message=e,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}}class SyntaxError extends Error{constructor(e){super(),this.name="SyntaxError",this.message=e,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}}let me;var ve={and:"&&",or:"||",is:"==",isnt:"!=","is not":"!=",":=":"?="};me=class Lexer{constructor(e,t){function comment(e,t,n,i){var r=i.lastIndexOf("/*",n)>i.lastIndexOf("*/",n),a=i.lastIndexOf("//",n),o=i.lastIndexOf("\n",n),h=0,l=0;if(~a&&a>o)for(;o!=n;){if("'"==i[o]&&(l?l--:l++),'"'==i[o]&&(h?h--:h++),"/"==i[o]&&"/"==i[o+1]){r=!l&&!h;break}++o}return r?e:","===t&&/^[,\t\n]+$/.test(e)?e.replace(/\n/,"\r"):t+"\r"}this.stash=[],this.indentStack=[],this.indentRe=null,this.lineno=1,this.column=1,"\ufeff"==e.charAt(0)&&(e=e.slice(1)),this.str=e.replace(/\s+$/,"\n").replace(/\r\n?/g,"\n").replace(/\\ *\n/g,"\r").replace(/([,(:](?!\/\/[^ ])) *(?:\/\/[^\n]*|\/\*.*?\*\/)?\n\s*/g,comment).replace(/\s*\n[ \t]*([,)])/g,comment)}inspect(){for(var e,t=this.str,n=[];"eos"!=(e=this.next()).type;)n.push(e.inspect());return this.str=t,n.concat(e.inspect()).join("\n")}lookahead(e){for(var t=e-this.stash.length;t-- >0;)this.stash.push(this.advance());return this.stash[--e]}skip(e){var t=e[0];e=t?t.length:e,this.str=this.str.substr(e),t?this.move(t):this.column+=e}move(e){var t=e.match(/\n/g),n=e.lastIndexOf("\n");t&&(this.lineno+=t.length),this.column=~n?e.length-n:this.column+e.length}next(){var e=this.stashed()||this.advance();return this.prev=e,e}isPartOfSelector(){var e=this.stash[this.stash.length-1]||this.prev;switch(e&&e.type){case"color":return 2==e.val.raw.length;case".":case"[":return!0}return!1}advance(){var e=this.column,t=this.lineno,n=this.eos()||this.null()||this.sep()||this.keyword()||this.urlchars()||this.comment()||this.newline()||this.escaped()||this.important()||this.literal()||this.anonFunc()||this.atrule()||this.function()||this.brace()||this.paren()||this.color()||this.string()||this.unit()||this.namedop()||this.boolean()||this.unicode()||this.ident()||this.op()||function(){var n=this.eol();return n&&(e=n.column,t=n.lineno),n}.call(this)||this.space()||this.selector();return n.lineno=t,n.column=e,n}peek(){return this.lookahead(1)}stashed(){return this.stash.shift()}eos(){if(!this.str.length)return this.indentStack.length?(this.indentStack.shift(),new t("outdent")):new t("eos")}urlchars(){var e;if(this.isURL)return(e=/^[\/:@.;?&=*!,<>#%0-9]+/.exec(this.str))?(this.skip(e),new t("literal",new de.Literal(e[0]))):void 0}sep(){var e;if(e=/^;[ \t]*/.exec(this.str))return this.skip(e),new t(";")}eol(){if("\r"==this.str[0]){for(++this.lineno,this.skip(1),this.column=1;this.space(););return this.advance()}}space(){var e;if(e=/^([ \t]+)/.exec(this.str))return this.skip(e),new t("space")}escaped(){var e;if(e=/^\\(.)[ \t]*/.exec(this.str)){var n=e[1];return this.skip(e),new t("ident",new de.Literal(n))}}literal(){var e;if(e=/^@css[ \t]*\{/.exec(this.str)){this.skip(e);for(var n,i,r=1,a="";n=this.str[0];){switch(this.str=this.str.substr(1),n){case"{":++r;break;case"}":--r;break;case"\n":case"\r":++this.lineno}if(a+=n,!r)break}return a=a.replace(/\s*}$/,""),(i=new de.Literal(a)).css=!0,new t("literal",i)}}important(){var e;if(e=/^!important[ \t]*/.exec(this.str))return this.skip(e),new t("ident",new de.Literal("!important"))}brace(){var e;if(e=/^([{}])/.exec(this.str)){this.skip(1);var n=e[1];return new t(n,n)}}paren(){var e;if(e=/^([()])([ \t]*)/.exec(this.str)){var n=e[1];this.skip(e),")"==n&&(this.isURL=!1);var i=new t(n,n);return i.space=e[2],i}}null(){var e;if(e=/^(null)\b[ \t]*/.exec(this.str))return this.skip(e),this.isPartOfSelector()?new t("ident",new de.Ident(e[0])):new t("null",de.null)}keyword(){var e;if(e=/^(return|if|else|unless|for|in)\b(?!-)[ \t]*/.exec(this.str)){var n=e[1];return this.skip(e),this.isPartOfSelector()?new t("ident",new de.Ident(e[0])):new t(n,n)}}namedop(){var e,n;if(e=/^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)){var i=e[1];return this.skip(e),(n=this.isPartOfSelector()?new t("ident",new de.Ident(e[0])):new t(i=ve[i]||i,i)).space=e[2],n}}op(){var e;if(e=/^([.]{1,3}|&&|\|\||[!<>=?:]=|\*\*|[-+*\/%]=?|[,=?:!~<>&\[\]])([ \t]*)/.exec(this.str)){var n=e[1];this.skip(e);var i=new t(n=ve[n]||n,n);return i.space=e[2],this.isURL=!1,i}}anonFunc(){var e;if("@"==this.str[0]&&"("==this.str[1])return this.skip(2),(e=new t("function",new de.Ident("anonymous"))).anonymous=!0,e}atrule(){var e;if(e=/^@(?!apply)(?:-(\w+)-)?([a-zA-Z0-9-_]+)[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=e[2];switch(i){case"require":case"import":case"charset":case"namespace":case"media":case"scope":case"supports":return new t(i);case"document":return new t("-moz-document");case"block":return new t("atblock");case"extend":case"extends":return new t("extend");case"keyframes":return new t(i,n);default:return new t("atrule",n?"-"+n+"-"+i:i)}}}comment(){if("/"==this.str[0]&&"/"==this.str[1])return-1==(e=this.str.indexOf("\n"))&&(e=this.str.length),this.skip(e),this.advance();if("/"==this.str[0]&&"*"==this.str[1]){var e;-1==(e=this.str.indexOf("*/"))&&(e=this.str.length);var n=this.str.substr(0,e+2),i=n.split(/\n|\r/).length-1,r=!0,a=!1;return this.lineno+=i,this.skip(e+2),"!"==n[2]&&(n=n.replace("*!","*"),r=!1),this.prev&&";"==this.prev.type&&(a=!0),new t("comment",new de.Comment(n,r,a))}}boolean(){var e;if(e=/^(true|false)\b([ \t]*)/.exec(this.str)){var n=new de.Boolean("true"==e[1]);this.skip(e);var i=new t("boolean",n);return i.space=e[2],i}}unicode(){var e;if(e=/^u\+[0-9a-f?]{1,6}(?:-[0-9a-f]{1,6})?/i.exec(this.str))return this.skip(e),new t("literal",new de.Literal(e[0]))}function(){var e;if(e=/^(-*[_a-zA-Z$][-\w\d$]*)\(([ \t]*)/.exec(this.str)){var n=e[1];this.skip(e),this.isURL="url"==n;var i=new t("function",new de.Ident(n));return i.space=e[2],i}}ident(){var e;if(e=/^-*([_a-zA-Z$]|@apply)[-\w\d$]*/.exec(this.str))return this.skip(e),new t("ident",new de.Ident(e[0]))}newline(){var e,n;if(this.indentRe?e=this.indentRe.exec(this.str):((e=(n=/^\n([\t]*)[ \t]*/).exec(this.str))&&!e[1].length&&(e=(n=/^\n([ \t]*)/).exec(this.str)),e&&e[1].length&&(this.indentRe=n)),e){var i,r=e[1].length;if(this.skip(e)," "===this.str[0]||"\t"===this.str[0])throw new SyntaxError("Invalid indentation. You can use tabs or spaces to indent, but not both.");if("\n"==this.str[0])return this.advance();if(this.indentStack.length&&rr;)this.stash.push(new t("outdent")),this.indentStack.shift();i=this.stash.pop()}else r&&r!=this.indentStack[0]?(this.indentStack.unshift(r),i=new t("indent")):i=new t("newline");return i}}unit(){var e;if(e=/^(-)?(\d+\.\d+|\d+|\.\d+)(%|[a-zA-Z]+)?[ \t]*/.exec(this.str)){this.skip(e);var n=parseFloat(e[2]);"-"==e[1]&&(n=-n);var i=new de.Unit(n,e[3]);return i.raw=e[0],new t("unit",i)}}string(){var e;if(e=/^("[^"]*"|'[^']*')[ \t]*/.exec(this.str)){var n=e[1],i=e[0][0];return this.skip(e),n=n.slice(1,-1).replace(/\\n/g,"\n"),new t("string",new de.String(n,i))}}color(){return this.rrggbbaa()||this.rrggbb()||this.rgba()||this.rgb()||this.nn()||this.n()}n(){var e;if(e=/^#([a-fA-F0-9]{1})[ \t]*/.exec(this.str)){this.skip(e);var n=parseInt(e[1]+e[1],16),i=new de.RGBA(n,n,n,1);return i.raw=e[0],new t("color",i)}}nn(){var e;if(e=/^#([a-fA-F0-9]{2})[ \t]*/.exec(this.str)){this.skip(e);var n=parseInt(e[1],16),i=new de.RGBA(n,n,n,1);return i.raw=e[0],new t("color",i)}}rgb(){var e;if(e=/^#([a-fA-F0-9]{3})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16),o=new de.RGBA(i,r,a,1);return o.raw=e[0],new t("color",o)}}rgba(){var e;if(e=/^#([a-fA-F0-9]{4})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16),o=parseInt(n[3]+n[3],16),h=new de.RGBA(i,r,a,o/255);return h.raw=e[0],new t("color",h)}}rrggbb(){var e;if(e=/^#([a-fA-F0-9]{6})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),a=parseInt(n.substr(4,2),16),o=new de.RGBA(i,r,a,1);return o.raw=e[0],new t("color",o)}}rrggbbaa(){var e;if(e=/^#([a-fA-F0-9]{8})[ \t]*/.exec(this.str)){this.skip(e);var n=e[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),a=parseInt(n.substr(4,2),16),o=parseInt(n.substr(6,2),16),h=new de.RGBA(i,r,a,o/255);return h.raw=e[0],new t("color",h)}}selector(){var e;if(e=/^\^|.*?(?=\/\/(?![^\[]*\])|[,\n{])/.exec(this.str)){var n=e[0];return this.skip(e),new t("selector",n)}}};var ge=class NullCache{set(e,t){}get(e){}has(e){return!1}key(e,t){return""}},ke=65407===new Uint16Array(new Uint8Array([127,255]).buffer)[0];function hexify(e){for(var t="",n=8;n--;)t+=(e>>>(n<<2)&15).toString(16);return t}function parity(e,t,n){return e^t^n}function majority(e,t,n){return e&t^e&n^t&n}function rotateLeft(e,t){return e<>>32-t}var we=new Uint32Array(80),be=class MemoryCache{constructor(e){e=e||{},this.limit=e["cache limit"]||256,this._cache={},this.length=0,this.head=this.tail=null}set(e,t){var n,i=t.clone();i.filename=de.filename,i.lineno=de.lineno,i.column=de.column,n={key:e,value:i},this._cache[e]=n,this.tail?(this.tail.next=n,n.prev=this.tail):this.head=n,this.tail=n,this.length++==this.limit&&this.purge()}get(e){var t=this._cache[e],n=t.value.clone();return t==this.tail||(t.next&&(t==this.head&&(this.head=t.next),t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t.next=null,t.prev=this.tail,this.tail&&(this.tail.next=t),this.tail=t),n}has(e){return!!this._cache[e]}key(e,t){var n=function createHash(){let e="";return{update:function update(t){e+=t},digest:function digest(){return function sha1(e){if(!(e instanceof Uint8Array))throw new TypeError("Input data must be a Uint8Array.");var t,n=new ArrayBuffer(function align(e,t){var n=t-1;return e+n&~n}(e.byteLength+9,64)),i=new Uint32Array(n),r=new Uint8Array(n);if(r.set(e),r[e.byteLength]=128,ke)for(var a=0,o=i.length;a>24&255|t>>8&65280|t<<8&16711680|t<<24&4278190080;var h=8*e.byteLength;i[i.length-2]=h/Math.pow(2,32),i[i.length-1]=h;for(var l,c=1732584193,u=4023233417,f=2562383102,d=271733878,m=3285377520,v=void 0,g=void 0,k=void 0,w=void 0,b=void 0,y=void 0,x=void 0,S=0,N=i.length;S","=",":","&","&&","~","{","}",".","..","/"],Se=["is","has","where","not","dir","lang","any-link","link","visited","local-link","target","scope","hover","active","focus","drop","current","past","future","enabled","disabled","read-only","read-write","placeholder-shown","checked","indeterminate","valid","invalid","in-range","out-of-range","required","optional","user-error","root","empty","blank","nth-child","nth-last-child","first-child","last-child","only-child","nth-of-type","nth-last-of-type","first-of-type","last-of-type","only-of-type","nth-match","nth-last-match","nth-column","nth-last-column","first-line","first-letter","before","after","selection"],Ne=class Parser{constructor(e,t){var n=this;t=t||{},Parser.cache=Parser.cache||Parser.getCache(t),this.hash=Parser.cache.key(e,t),this.lexer={},Parser.cache.has(this.hash)||(this.lexer=new me(e,t)),this.prefix=t.prefix||"",this.root=t.root||new de.Root,this.state=["root"],this.stash=[],this.parens=0,this.css=0,this.state.pop=function(){n.prevState=[].pop.call(this)}}static getCache(e){return!1===e.cache?getCache(!1):getCache(e.cache||"memory",e)}currentState(){return this.state[this.state.length-1]}previousState(){return this.state[this.state.length-2]}parse(){var e=this.parent=this.root;if(Parser.cache.has(this.hash))"block"==(e=Parser.cache.get(this.hash)).nodeName&&(e.constructor=de.Root);else{for(;"eos"!=this.peek().type&&(this.skipWhitespace(),"eos"!=this.peek().type);){var t=this.statement();this.accept(";"),t||this.error("unexpected token {peek}, not allowed at the root level"),e.push(t)}Parser.cache.set(this.hash,e)}return e}error(e){var t=this.peek().type,n=null==this.peek().val?"":" "+this.peek().toString();throw n.trim()==t.trim()&&(n=""),new ParseError(e.replace("{peek}",'"'+t+n+'"'))}accept(e){if(e==this.peek().type)return this.next()}expect(e){return e!=this.peek().type&&this.error('expected "'+e+'", got {peek}'),this.next()}next(){var e=this.stash.length?this.stash.pop():this.lexer.next(),t=e.lineno,n=e.column||1;return e.val&&e.val.nodeName&&(e.val.lineno=t,e.val.column=n),de.lineno=t,de.column=n,ye.lexer("%s %s",e.type,e.val||""),e}peek(){return this.lexer.peek()}lookahead(e){return this.lexer.lookahead(e)}isSelectorToken(e){var t=this.lookahead(e).type;switch(t){case"for":return this.bracketed;case"[":return this.bracketed=!0,!0;case"]":return this.bracketed=!1,!0;default:return~xe.indexOf(t)}}isPseudoSelector(e){var t=this.lookahead(e).val;return t&&~Se.indexOf(t.name)}lineContains(e){for(var t,n=1;t=this.lookahead(n++);){if(~["indent","outdent","newline","eos"].indexOf(t.type))return;if(e==t.type)return!0}}selectorToken(){if(this.isSelectorToken(1)){if("{"==this.peek().type){if(!this.lineContains("}"))return;for(var e,t=0;e=this.lookahead(++t);){if("}"==e.type){if(2==t||3==t&&"space"==this.lookahead(t-1).type)return;break}if(":"==e.type)return}}return this.next()}}skip(e){for(;~e.indexOf(this.peek().type);)this.next()}skipWhitespace(){this.skip(["space","indent","outdent","newline"])}skipNewlines(){for(;"newline"==this.peek().type;)this.next()}skipSpaces(){for(;"space"==this.peek().type;)this.next()}skipSpacesAndComments(){for(;"space"==this.peek().type||"comment"==this.peek().type;)this.next()}looksLikeFunctionDefinition(e){return"indent"==this.lookahead(e).type||"{"==this.lookahead(e).type}looksLikeSelector(e){var t,n,i=1;if(e&&":"==this.lookahead(i+1).type&&(this.lookahead(i+1).space||"indent"==this.lookahead(i+2).type))return!1;for(;"ident"==this.lookahead(i).type&&("newline"==this.lookahead(i+1).type||","==this.lookahead(i+1).type);)i+=2;for(;this.isSelectorToken(i)||","==this.lookahead(i).type;){if("selector"==this.lookahead(i).type)return!0;if("&"==this.lookahead(i+1).type)return!0;if(i>1&&"ident"===this.lookahead(i-1).type&&"."===this.lookahead(i).type&&"ident"===this.lookahead(i+1).type){for(;t=this.lookahead(i+2);){if(-1!==["indent","outdent","{",";","eos","selector","media","if","atrule",")","}","unit","[","for","function"].indexOf(t.type)){if("["!==t.type){if(this.isPseudoSelector(i+2))return!0;if(")"===t.type&&this.lookahead(i+3)&&"}"===this.lookahead(i+3).type)break;return-1===["outdent",";","eos","media","if","atrule",")","}","unit","for","function"].indexOf(t.type)}for(;(t=this.lookahead(i+3))&&"]"!==t.type;){if(~[".","unit"].indexOf(t.type))return!1;i+=1}}i+=1}return!0}if("."==this.lookahead(i).type&&"ident"==this.lookahead(i+1).type)return!0;if("*"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i).type&&":"==this.lookahead(i+1).type)return!0;if("color"==this.lookahead(i).type&&"newline"==this.lookahead(i-1).type)return!0;if(this.looksLikeAttributeSelector(i))return!0;if(("="==this.lookahead(i).type||"function"==this.lookahead(i).type)&&"{"==this.lookahead(i+1).type)return!1;if(":"==this.lookahead(i).type&&!this.isPseudoSelector(i+1)&&this.lineContains("."))return!1;if("{"==this.lookahead(i).type?n=!0:"}"==this.lookahead(i).type&&(n=!1),n&&":"==this.lookahead(i).type)return!0;if("space"==this.lookahead(i).type&&"{"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i++).type&&!this.lookahead(i-1).space&&this.isPseudoSelector(i))return!0;if("space"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type&&"{"==this.lookahead(i+2).type)return!0;if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0}if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if("{"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(this.css&&(";"==this.lookahead(i).type||"}"==this.lookahead(i-1).type))return!1;for(;!~["indent","outdent","newline","for","if",";","}","eos"].indexOf(this.lookahead(i).type);)++i;return"indent"==this.lookahead(i).type||void 0}looksLikeAttributeSelector(e){var t=this.lookahead(e).type;return!("="!=t||!this.bracketed)||("ident"==t||"string"==t)&&"]"==this.lookahead(e+1).type&&("newline"==this.lookahead(e+2).type||this.isSelectorToken(e+2))&&!this.lineContains(":")&&!this.lineContains("=")}looksLikeKeyframe(){var e,t=2;switch(this.lookahead(t).type){case"{":case"indent":case",":return!0;case"newline":for(;"unit"==this.lookahead(++t).type||"newline"==this.lookahead(t).type;);return"indent"==(e=this.lookahead(t).type)||"{"==e}}stateAllowsSelector(){switch(this.currentState()){case"root":case"atblock":case"selector":case"conditional":case"function":case"atrule":case"for":return!0}}assignAtblock(e){try{e.push(this.atblock(e))}catch(e){this.error("invalid right-hand side operand in assignment, got {peek}")}}statement(){var e,t,n=this.stmt(),i=this.prevState;switch(this.allowPostfix&&(this.allowPostfix=!1,i="expression"),i){case"assignment":case"expression":case"function arguments":for(;t=this.accept("if")||this.accept("unless")||this.accept("for");)switch(t.type){case"if":case"unless":(n=new de.If(this.expression(),n)).postfix=!0,n.negate="unless"==t.type,this.accept(";");break;case"for":var r,a=this.id().name;this.accept(",")&&(r=this.id().name),this.expect("in");var o=new de.Each(a,r,this.expression());(e=new de.Block(this.parent,o)).push(n),o.block=e,n=o}}return n}stmt(){var e,t=this.peek();switch(t.type){case"keyframes":return this.keyframes();case"-moz-document":return this.mozdocument();case"comment":case"selector":case"literal":case"charset":case"namespace":case"import":case"require":case"extend":case"media":case"atrule":case"ident":case"scope":case"supports":case"unless":case"function":case"for":case"if":return this[t.type]();case"return":return this.return();case"{":return this.property();default:if(this.stateAllowsSelector())switch(t.type){case"color":case"~":case">":case"<":case":":case"&":case"&&":case"[":case".":case"/":return(e=this.selector()).column=t.column,e.lineno=t.lineno,e;case"..":if("/"==this.lookahead(2).type)return this.selector();case"+":return"function"==this.lookahead(2).type?this.functionCall():this.selector();case"*":return this.property();case"unit":if(this.looksLikeKeyframe())return(e=this.selector()).column=t.column,e.lineno=t.lineno,e;case"-":if("{"==this.lookahead(2).type)return this.property()}var n=this.expression();return n.isEmpty&&this.error("unexpected {peek}"),n}}block(e,t){var n,i,r,a=this.parent=new de.Block(this.parent,e);for(!1===t&&(a.scope=!1),this.accept("newline"),this.accept("{")?(this.css++,n="}",this.skipWhitespace()):(n="outdent",this.expect("indent"));n!=this.peek().type;){if(this.css){if(this.accept("newline")||this.accept("indent"))continue;i=this.statement(),this.accept(";"),this.skipWhitespace()}else{if(this.accept("newline"))continue;if(r=this.lookahead(2).type,"indent"==this.peek().type&&~["outdent","newline","comment"].indexOf(r)){this.skip(["indent","outdent"]);continue}if("eos"==this.peek().type)return a;i=this.statement(),this.accept(";")}i||this.error("unexpected token {peek} in block"),a.push(i)}return this.css?(this.skipWhitespace(),this.expect("}"),this.skipSpaces(),this.css--):this.expect("outdent"),this.parent=a.parent,a}comment(){var e=this.next().val;return this.skipSpaces(),e}for(){this.expect("for");var e,t=this.id().name;this.accept(",")&&(e=this.id().name),this.expect("in"),this.state.push("for"),this.cond=!0;var n=new de.Each(t,e,this.expression());return this.cond=!1,n.block=this.block(n,!1),this.state.pop(),n}return(){this.expect("return");var e=this.expression();return e.isEmpty?new de.Return:new de.Return(e)}unless(){this.expect("unless"),this.state.push("conditional"),this.cond=!0;var e=new de.If(this.expression(),!0);return this.cond=!1,e.block=this.block(e,!1),this.state.pop(),e}if(){var e=this.expect("if");this.state.push("conditional"),this.cond=!0;var t,n,i,r=new de.If(this.expression());for(r.column=e.column,this.cond=!1,r.block=this.block(r,!1),this.skip(["newline","comment"]);this.accept("else");){if(!(e=this.accept("if"))){r.elses.push(this.block(r,!1));break}this.cond=!0,t=this.expression(),this.cond=!1,n=this.block(r,!1),(i=new de.If(t,n)).column=e.column,r.elses.push(i),this.skip(["newline","comment"])}return this.state.pop(),r}atblock(e){return e||this.expect("atblock"),e=new de.Atblock,this.state.push("atblock"),e.block=this.block(e,!1),this.state.pop(),e}atrule(){var e,t=this.expect("atrule").val,n=new de.Atrule(t);return this.skipSpacesAndComments(),n.segments=this.selectorParts(),this.skipSpacesAndComments(),("indent"==(e=this.peek().type)||"{"==e||"newline"==e&&"{"==this.lookahead(2).type)&&(this.state.push("atrule"),n.block=this.block(n),this.state.pop()),n}scope(){this.expect("scope");var e=this.selectorParts().map((function(e){return e.val})).join("");return this.selectorScope=e.trim(),de.null}supports(){this.expect("supports");var e=new de.Supports(this.supportsCondition());return this.state.push("atrule"),e.block=this.block(e),this.state.pop(),e}supportsCondition(){var e=this.supportsNegation()||this.supportsOp();return e||(this.cond=!0,e=this.expression(),this.cond=!1),e}supportsNegation(){if(this.accept("not")){var e=new de.Expression;return e.push(new de.Literal("not")),e.push(this.supportsFeature()),e}}supportsOp(){var e,t,n=this.supportsFeature();if(n){for((t=new de.Expression).push(n);e=this.accept("&&")||this.accept("||");)t.push(new de.Literal("&&"==e.val?"and":"or")),t.push(this.supportsFeature());return t}}supportsFeature(){if(this.skipSpacesAndComments(),"("==this.peek().type){var e=this.lookahead(2).type;if("ident"==e||"{"==e)return this.feature();this.expect("(");var t=new de.Expression;return t.push(new de.Literal("(")),t.push(this.supportsCondition()),this.expect(")"),t.push(new de.Literal(")")),this.skipSpacesAndComments(),t}}extend(){var e,t,n,i=this.expect("extend"),r=[];do{(n=this.selectorParts()).length&&(e=new de.Selector(n),r.push(e),"!"===this.peek().type&&"ident"===(i=this.lookahead(2)).type&&"optional"===i.val.name&&(this.skip(["!","ident"]),e.optional=!0))}while(this.accept(","));return(t=new de.Extend(r)).lineno=i.lineno,t.column=i.column,t}media(){this.expect("media"),this.state.push("atrule");var e=new de.Media(this.queries());return e.block=this.block(e),this.state.pop(),e}queries(){var e=new de.QueryList,t=["comment","newline","space"];do{this.skip(t),e.push(this.query()),this.skip(t)}while(this.accept(","));return e}query(){var e,t,n,i=new de.Query;if("ident"==this.peek().type&&("."==this.lookahead(2).type||"["==this.lookahead(2).type))return this.cond=!0,e=this.expression(),this.cond=!1,i.push(new de.Feature(e.nodes)),i;if((t=this.accept("ident")||this.accept("not"))&&(t=new de.Literal(t.val.string||t.val),this.skipSpacesAndComments(),(n=this.accept("ident"))?(i.type=n.val,i.predicate=t):i.type=t,this.skipSpacesAndComments(),!this.accept("&&")))return i;do{i.push(this.feature())}while(this.accept("&&"));return i}feature(){this.skipSpacesAndComments(),this.expect("("),this.skipSpacesAndComments();var e=new de.Feature(this.interpolate());return this.skipSpacesAndComments(),this.accept(":"),this.skipSpacesAndComments(),this.inProperty=!0,e.expr=this.list(),this.inProperty=!1,this.skipSpacesAndComments(),this.expect(")"),this.skipSpacesAndComments(),e}mozdocument(){this.expect("-moz-document");var e=new de.Atrule("-moz-document"),t=[];do{this.skipSpacesAndComments(),t.push(this.functionCall()),this.skipSpacesAndComments()}while(this.accept(","));return e.segments=[new de.Literal(t.join(", "))],this.state.push("atrule"),e.block=this.block(e,!1),this.state.pop(),e}import(){return this.expect("import"),this.allowPostfix=!0,new de.Import(this.expression(),!1)}require(){return this.expect("require"),this.allowPostfix=!0,new de.Import(this.expression(),!0)}charset(){this.expect("charset");var e=this.expect("string").val;return this.allowPostfix=!0,new de.Charset(e)}namespace(){var e,t;return this.expect("namespace"),this.skipSpacesAndComments(),(t=this.accept("ident"))&&(t=t.val),this.skipSpacesAndComments(),e=this.accept("string")||this.url(),this.allowPostfix=!0,new de.Namespace(e,t)}keyframes(){var e,t=this.expect("keyframes");return this.skipSpacesAndComments(),(e=new de.Keyframes(this.selectorParts(),t.val)).column=t.column,this.skipSpacesAndComments(),this.state.push("atrule"),e.block=this.block(e),this.state.pop(),e}literal(){return this.expect("literal").val}id(){var e=this.expect("ident");return this.accept("space"),e.val}ident(){for(var e=2,t=this.lookahead(e).type;"space"==t;)t=this.lookahead(++e).type;switch(t){case"=":case"?=":case"-=":case"+=":case"*=":case"/=":case"%=":return this.assignment();case".":if("space"==this.lookahead(e-1).type)return this.selector();if(this._ident==this.peek())return this.id();for(;"="!=this.lookahead(++e).type&&!~["[",",","newline","indent","eos"].indexOf(this.lookahead(e).type););if("="==this.lookahead(e).type)return this._ident=this.peek(),this.expression();if(this.looksLikeSelector()&&this.stateAllowsSelector())return this.selector();case"[":if(this._ident==this.peek())return this.id();for(;"]"!=this.lookahead(e++).type&&"selector"!=this.lookahead(e).type&&"eos"!=this.lookahead(e).type;);if("="==this.lookahead(e).type)return this._ident=this.peek(),this.expression();if(this.looksLikeSelector()&&this.stateAllowsSelector())return this.selector();case"-":case"+":case"/":case"*":case"%":case"**":case"&&":case"||":case">":case"<":case">=":case"<=":case"!=":case"==":case"?":case"in":case"is a":case"is defined":if(this._ident==this.peek())return this.id();switch(this._ident=this.peek(),this.currentState()){case"for":case"selector":return this.property();case"root":case"atblock":case"atrule":return"["==t?this.subscript():this.selector();case"function":case"conditional":return this.looksLikeSelector()?this.selector():this.expression();default:return this.operand?this.id():this.expression()}default:switch(this.currentState()){case"root":return this.selector();case"for":case"selector":case"function":case"conditional":case"atblock":case"atrule":return this.property();default:var n=this.id();return"interpolation"==this.previousState()&&(n.mixin=!0),n}}}interpolate(){var e,t=[];for(this.accept("*")&&t.push(new de.Literal("*"));;)if(this.accept("{"))this.state.push("interpolation"),t.push(this.expression()),this.expect("}"),this.state.pop();else if(e=this.accept("-"))t.push(new de.Literal("-"));else{if(!(e=this.accept("ident")))break;t.push(e.val)}return t.length||this.expect("ident"),t}property(){if(this.looksLikeSelector(!0))return this.selector();var e=this.interpolate(),t=new de.Property(e),n=t;return this.accept("space"),this.accept(":")&&this.accept("space"),this.state.push("property"),this.inProperty=!0,t.expr=this.list(),t.expr.isEmpty&&(n=e[0]),this.inProperty=!1,this.allowPostfix=!0,this.state.pop(),this.accept(";"),n}selector(){var e,t,n=new de.Group,i=this.selectorScope,r="root"==this.currentState();do{this.accept("newline"),e=this.selectorParts(),r&&i&&e.unshift(new de.Literal(i+" ")),e.length&&((t=new de.Selector(e)).lineno=e[0].lineno,t.column=e[0].column,n.push(t))}while(this.accept(",")||this.accept("newline"));return"selector-parts"==this.currentState()?n.nodes:(this.state.push("selector"),n.block=this.block(n),this.state.pop(),n)}selectorParts(){for(var e,t=[];e=this.selectorToken();)switch(e.type){case"{":this.skipSpaces();var n=this.expression();this.skipSpaces(),this.expect("}"),t.push(n);break;case this.prefix&&".":var i=new de.Literal(e.val+this.prefix);i.prefixed=!0,t.push(i);break;case"comment":break;case"color":case"unit":t.push(new de.Literal(e.val.raw));break;case"space":t.push(new de.Literal(" "));break;case"function":t.push(new de.Literal(e.val.name+"("));break;case"ident":t.push(new de.Literal(e.val.name||e.val.string));break;default:t.push(new de.Literal(e.val)),e.space&&t.push(new de.Literal(" "))}return t}assignment(){var e,t,n=this.id(),i=n.name;if(e=this.accept("=")||this.accept("?=")||this.accept("+=")||this.accept("-=")||this.accept("*=")||this.accept("/=")||this.accept("%=")){this.state.push("assignment");var r=this.list();switch(r.isEmpty&&this.assignAtblock(r),(t=new de.Ident(i,r)).lineno=n.lineno,t.column=n.column,this.state.pop(),e.type){case"?=":var a=new de.BinOp("is defined",t),o=new de.Expression;o.push(new de.Ident(i)),t=new de.Ternary(a,o,t);break;case"+=":case"-=":case"*=":case"/=":case"%=":t.val=new de.BinOp(e.type[0],new de.Ident(i),r)}}return t}function(){var e,t=1,n=2;e:for(;e=this.lookahead(n++);)switch(e.type){case"function":case"(":++t;break;case")":if(! --t)break e;break;case"eos":this.error('failed to find closing paren ")"')}return"expression"===this.currentState()?this.functionCall():this.looksLikeFunctionDefinition(n)?this.functionDefinition():this.expression()}url(){this.expect("function"),this.state.push("function arguments");var e=this.args();return this.expect(")"),this.state.pop(),new de.Call("url",e)}functionCall(){var e=this.accept("+");if("url"==this.peek().val.name)return this.url();var t=this.expect("function").val,n=t.name;this.state.push("function arguments"),this.parens++;var i=this.args();this.expect(")"),this.parens--,this.state.pop();var r=new de.Call(n,i);return r.column=t.column,r.lineno=t.lineno,e&&(this.state.push("function"),r.block=this.block(r),this.state.pop()),r}functionDefinition(){var e=this.expect("function"),t=e.val.name;this.state.push("function params"),this.skipWhitespace();var n=this.params();this.skipWhitespace(),this.expect(")"),this.state.pop(),this.state.push("function");var i=new de.Function(t,n);return i.column=e.column,i.lineno=e.lineno,i.block=this.block(i),this.state.pop(),new de.Ident(t,i)}params(){for(var e,t,n=new de.Params;e=this.accept("ident");)this.accept("space"),n.push(t=e.val),this.accept("...")?t.rest=!0:this.accept("=")&&(t.val=this.expression()),this.skipWhitespace(),this.accept(","),this.skipWhitespace();return n}args(){var e,t=new de.Arguments;do{"ident"==this.peek().type&&":"==this.lookahead(2).type?(e=this.next().val.string,this.expect(":"),t.map[e]=this.expression()):t.push(this.expression())}while(this.accept(","));return t}list(){for(var e=this.expression();this.accept(",");)if(e.isList)t.push(this.expression());else{var t=new de.Expression(!0);t.push(e),t.push(this.expression()),e=t}return e}expression(){var e,t=new de.Expression;for(this.state.push("expression");e=this.negation();)e||this.error("unexpected token {peek} in expression"),t.push(e);return this.state.pop(),t.nodes.length&&(t.lineno=t.nodes[0].lineno,t.column=t.nodes[0].column),t}negation(){return this.accept("not")?new de.UnaryOp("!",this.negation()):this.ternary()}ternary(){var e=this.logical();if(this.accept("?")){var t=this.expression();this.expect(":");var n=this.expression();e=new de.Ternary(e,t,n)}return e}logical(){for(var e,t=this.typecheck();e=this.accept("&&")||this.accept("||");)t=new de.BinOp(e.type,t,this.typecheck());return t}typecheck(){for(var e,t=this.equality();e=this.accept("is a");)this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new de.BinOp(e.type,t,this.equality()),this.operand=!1;return t}equality(){for(var e,t=this.in();e=this.accept("==")||this.accept("!=");)this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new de.BinOp(e.type,t,this.in()),this.operand=!1;return t}in(){for(var e=this.relational();this.accept("in");)this.operand=!0,e||this.error('illegal unary "in", missing left-hand operand'),e=new de.BinOp("in",e,this.relational()),this.operand=!1;return e}relational(){for(var e,t=this.range();e=this.accept(">=")||this.accept("<=")||this.accept("<")||this.accept(">");)this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new de.BinOp(e.type,t,this.range()),this.operand=!1;return t}range(){var e,t=this.additive();return(e=this.accept("...")||this.accept(".."))&&(this.operand=!0,t||this.error('illegal unary "'+e+'", missing left-hand operand'),t=new de.BinOp(e.val,t,this.additive()),this.operand=!1),t}additive(){for(var e,t=this.multiplicative();e=this.accept("+")||this.accept("-");)this.operand=!0,t=new de.BinOp(e.type,t,this.multiplicative()),this.operand=!1;return t}multiplicative(){for(var e,n=this.defined();e=this.accept("**")||this.accept("*")||this.accept("/")||this.accept("%");){if(this.operand=!0,"/"==e&&this.inProperty&&!this.parens)return this.stash.push(new t("literal",new de.Literal("/"))),this.operand=!1,n;n||this.error('illegal unary "'+e+'", missing left-hand operand'),n=new de.BinOp(e.type,n,this.defined()),this.operand=!1}return n}defined(){var e=this.unary();return this.accept("is defined")&&(e||this.error('illegal unary "is defined", missing left-hand operand'),e=new de.BinOp("is defined",e)),e}unary(){var e,t;return(e=this.accept("!")||this.accept("~")||this.accept("+")||this.accept("-"))?(this.operand=!0,(t=this.unary())||this.error('illegal unary "'+e+'"'),t=new de.UnaryOp(e.type,t),this.operand=!1,t):this.subscript()}subscript(){for(var e=this.member();this.accept("[");)e=new de.BinOp("[]",e,this.expression()),this.expect("]");return this.accept("=")&&(e.op+="=",e.val=this.list(),e.val.isEmpty&&this.assignAtblock(e.val)),e}member(){var e=this.primary();if(e){for(;this.accept(".");){var t=new de.Ident(this.expect("ident").val.string);e=new de.Member(e,t)}this.skipSpaces(),this.accept("=")&&(e.val=this.list(),e.val.isEmpty&&this.assignAtblock(e.val))}return e}object(){var e,t,n,i,r=new de.Object;for(this.expect("{"),this.skipWhitespace();!this.accept("}");)this.accept("comment")||this.accept("newline")||(n||this.accept(","),(e=this.accept("ident")||this.accept("string"))||this.error('expected "ident" or "string", got {peek}'),i=e.val.hash,this.skipSpacesAndComments(),this.expect(":"),t=this.expression(),r.setValue(i,t),r.setKey(i,e.val),n=this.accept(","),this.skipWhitespace());return r}primary(){var e;if(this.skipSpaces(),this.accept("(")){++this.parens;var t=this.expression(),n=this.expect(")");return--this.parens,this.accept("%")&&t.push(new de.Ident("%")),e=this.peek(),!n.space&&"ident"==e.type&&~i.indexOf(e.val.string)&&(t.push(new de.Ident(e.val.string)),this.next()),t}switch((e=this.peek()).type){case"null":case"unit":case"color":case"string":case"literal":case"boolean":case"comment":return this.next().val;case!this.cond&&"{":return this.object();case"atblock":return this.atblock();case"atrule":var r=new de.Ident(this.next().val);return r.property=!0,r;case"ident":return this.ident();case"function":return e.anonymous?this.functionDefinition():this.functionCall()}}};const Ee={exports:{}};!function(e){void 0!==Ee&&(Ee.exports=e);var t="listeners",n={on:function on(e,t){return getListeners(this,e).push(t),this},once:function once(e,t){var n=this;return wrap.originalListener=t,getListeners(n,e).push(wrap),n;function wrap(){off.call(n,e,wrap),t.apply(this,arguments)}},off:off,emit:function emit(e,t){var n=this,i=getListeners(n,e,!0);if(!i)return!1;var r=arguments.length;if(1===r)i.forEach((function zeroarg(e){e.call(n)}));else if(2===r)i.forEach((function onearg(e){e.call(n,t)}));else{var a=Array.prototype.slice.call(arguments,1);i.forEach((function moreargs(e){e.apply(n,a)}))}return!!i.length}};function mixin(e){for(var t in n)e[t]=n[t];return e}function off(e,n){var i,r=this;if(arguments.length){if(n){if(i=getListeners(r,e,!0)){if(!(i=i.filter((function ne(e){return e!==n&&e.originalListener!==n}))).length)return off.call(r,e);r[t][e]=i}}else if((i=r[t])&&(delete i[e],!Object.keys(i).length))return off.call(r)}else delete r[t];return r}function getListeners(e,n,i){if(!i||e[t]){var r=e[t]||(e[t]={});return r[n]||(r[n]=[])}}mixin(e.prototype),e.mixin=mixin}(( /** * event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped) * @@ -61,4 +60,4 @@ class ParseError extends Error{constructor(e){super(),this.name="ParseError",thi * obj.emit("bar"); // dispatch another event * obj.off("foo"); // remove event listener */ -function EventLite(){if(!(this instanceof EventLite))return new EventLite}));var le=he.exports;const ce=class{constructor(){this.events=new le}on(...e){return this.events.on(...e)}off(...e){return this.events.off(...e)}once(...e){return this.events.once(...e)}emit(...e){return this.events.emit(...e)}listeners(e){return this.events.listeners&&this.events.listeners[e]||[]}},noop=()=>noop;var ue=e.dirname,pe=class DepsResolver extends n{constructor(e,t){super(e),this.filename=t.filename,this.paths=t.paths||[],this.paths.push(ue(t.filename||".")),this.options=t,this.functions={},this.deps=[]}visit(e){switch(e.nodeName){case"root":case"block":case"expression":this.visitRoot(e);break;case"group":case"media":case"atblock":case"atrule":case"keyframes":case"each":case"supports":this.visit(e.block);break;default:super.visit(e)}}visitRoot(e){for(var t=0,n=e.nodes.length;tnoop;var Le=e.dirname,Oe=class DepsResolver extends n{constructor(e,t){super(e),this.filename=t.filename,this.paths=t.paths||[],this.paths.push(Le(t.filename||".")),this.options=t,this.functions={},this.deps=[]}visit(e){switch(e.nodeName){case"root":case"block":case"expression":this.visitRoot(e);break;case"group":case"media":case"atblock":case"atrule":case"keyframes":case"each":case"supports":this.visit(e.block);break;default:super.visit(e)}}visitRoot(e){for(var t=0,n=e.nodes.length;t", "homepage": "http://stylus-lang.com/", "keywords": [