106 lines
148 KiB
JavaScript
106 lines
148 KiB
JavaScript
var StylusRenderer=function(){"use strict";function assertPath(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function normalizeStringPosix(t,e){for(var n,i="",r=0,o=-1,a=0,h=0;h<=t.length;++h){if(h<t.length)n=t.charCodeAt(h);else{if(47===n)break;n=47}if(47===n){if(o===h-1||1===a);else if(o!==h-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",r=0):r=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),o=h,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=h,a=0;continue}e&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+t.slice(o+1,h):i=t.slice(o+1,h),r=h-o-1;o=h,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var t={resolve:function resolve(){for(var t,e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===t&&(t=process.cwd()),r=t),assertPath(r),0!==r.length&&(e=r+"/"+e,n=47===r.charCodeAt(0))}return e=normalizeStringPosix(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function normalize(t){if(assertPath(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=normalizeStringPosix(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function isAbsolute(t){return assertPath(t),t.length>0&&47===t.charCodeAt(0)},join:function join(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];assertPath(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":t.normalize(e)},relative:function relative(e,n){if(assertPath(e),assertPath(n),e===n)return"";if((e=t.resolve(e))===(n=t.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var r=e.length,o=r-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var h=n.length-a,l=o<h?o:h,c=-1,u=0;u<=l;++u){if(u===l){if(h>l){if(47===n.charCodeAt(a+u))return n.slice(a+u+1);if(0===u)return n.slice(a+u)}else o>l&&(47===e.charCodeAt(i+u)?c=u:0===u&&(c=0));break}var f=e.charCodeAt(i+u);if(f!==n.charCodeAt(a+u))break;47===f&&(c=u)}var d="";for(u=i+c+1;u<=r;++u)u!==r&&47!==e.charCodeAt(u)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+c):(a+=c,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function _makeLong(t){return t},dirname:function dirname(t){if(assertPath(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function basename(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');assertPath(t);var n,i=0,r=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,h=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!o){i=n+1;break}}else-1===h&&(o=!1,h=n+1),a>=0&&(l===e.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=h))}return i===r?r=h:-1===r&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":t.slice(i,r)},extname:function extname(t){assertPath(t);for(var e=-1,n=0,i=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var h=t.charCodeAt(a);if(47!==h)-1===i&&(r=!1,i=a+1),46===h?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function format(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function _format(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function parse(t){assertPath(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),r=47===i;r?(e.root="/",n=1):n=0;for(var o=-1,a=0,h=-1,l=!0,c=t.length-1,u=0;c>=n;--c)if(47!==(i=t.charCodeAt(c)))-1===h&&(l=!1,h=c+1),46===i?-1===o?o=c:1!==u&&(u=1):-1!==o&&(u=-1);else if(!l){a=c+1;break}return-1===o||-1===h||0===u||1===u&&o===h-1&&o===a+1?-1!==h&&(e.base=e.name=0===a&&r?t.slice(1,h):t.slice(a,h)):(0===a&&r?(e.name=t.slice(1,o),e.base=t.slice(1,h)):(e.name=t.slice(a,o),e.base=t.slice(a,h)),e.ext=t.slice(o,h)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};
|
||
/*!
|
||
* Stylus - Token
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
let e;t.posix=t;var n=e=e=function Token(t,e){this.type=t,this.val=e};n.prototype.inspect=function(){var t=" "+nodeUtil.inspect(this.val);return"[Token:"+this.lineno+":"+this.column+" [32m"+this.type+"[0m[33m"+(this.val?t:"")+"[0m]"},n.prototype.toString=function(){return(void 0===this.val?this.type:this.val).toString()};const noop$2=()=>noop$2
|
||
/*!
|
||
* Stylus - Visitor
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/;var i=function Visitor(t){this.root=t};i.prototype.visit=function(t,e){var n="visit"+t.constructor.name;return this[n]?this[n](t):t};
|
||
/*!
|
||
* Stylus - units
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var r=["em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","in","pt","pc","px","deg","grad","rad","turn","s","ms","Hz","kHz","dpi","dpcm","dppx","x","%","fr"],o=function Stack(){Array.apply(this,arguments)};
|
||
/*!
|
||
* Stylus - Stack
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/o.prototype.__proto__=Array.prototype,o.prototype.push=function(t){return t.stack=this,t.parent=this.currentFrame,[].push.apply(this,arguments)},o.prototype.__defineGetter__("currentFrame",(function(){return this[this.length-1]})),o.prototype.getBlockFrame=function(t){for(var e=0;e<this.length;++e)if(t==this[e].block)return this[e]},o.prototype.lookup=function(t){var e,n=this.currentFrame.block;do{var i=this.getBlockFrame(n);if(i&&(e=i.lookup(t)))return e}while(n=n.parent)},o.prototype.inspect=function(){return this.reverse().map((function(t){return t.inspect()})).join("\n")},o.prototype.toString=function(){for(var t,e,n=[],i=this.length;i--;)if(t=this[i].block.node)switch(e="("+t.filename+":"+(t.lineno+1)+":"+t.column+")",t.nodeName){case"function":n.push(" at "+t.name+"() "+e);break;case"group":n.push(' at "'+t.nodes[0].val+'" '+e)}return n.join("\n")};
|
||
/*!
|
||
* Stylus - stack - Scope
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var a=function Scope(){this.locals={}};a.prototype.add=function(t){this.locals[t.name]=t.val},a.prototype.lookup=function(t){return function hasOwnProperty(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(this.locals,t)?this.locals[t]:void 0},a.prototype.inspect=function(){var t=Object.keys(this.locals).map((function(t){return"@"+t}));return"[Scope"+(t.length?" "+t.join(", "):"")+"]"};var h=function Frame(t){this._scope=!1===t.scope?null:new a,this.block=t};h.prototype.__defineGetter__("scope",(function(){return this._scope||this.parent.scope})),h.prototype.lookup=function(t){return this.scope.lookup(t)},h.prototype.inspect=function(){return"[Frame "+(!1===this.block.scope?"scope-less":this.scope.inspect())+"]"};const _export_sync_=t=>"functions/index.styl"===t?[t]:[];function notImplemented(){throw new Error("Not implemented")}const _export_statSync_=t=>"functions/index.styl"===t?{mtime:0}:notImplemented(),_export_readFileSync_=t=>"functions/index.styl"===t?"called-from = ()\n\nvendors = moz webkit o ms official\n\n// stringify the given arg\n\n-string(arg)\n type(arg) + ' ' + arg\n\n// require a color\n\nrequire-color(color)\n unless color is a 'color'\n error('RGB or HSL value expected, got a ' + -string(color))\n\n// require a unit\n\nrequire-unit(n)\n unless n is a 'unit'\n error('unit expected, got a ' + -string(n))\n\n// require a string\n\nrequire-string(str)\n unless str is a 'string' or str is a 'ident'\n error('string expected, got a ' + -string(str))\n\n// Math functions\n\nabs(n) { math(n, 'abs') }\nmin(a, b) { a < b ? a : b }\nmax(a, b) { a > b ? a : b }\n\n// Trigonometrics\nPI = -math-prop('PI')\n\nradians-to-degrees(angle)\n angle * (180 / PI)\n\ndegrees-to-radians(angle)\n angle * (PI / 180)\n\nsin(n)\n n = unit(n) == 'deg' ? degrees-to-radians(unit(n, '')) : unit(n, '')\n round(math(n, 'sin'), 9)\n\ncos(n)\n n = unit(n) == 'deg' ? degrees-to-radians(unit(n, '')) : unit(n, '')\n round(math(n, 'cos'), 9)\n\n// Rounding Math functions\n\nceil(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'ceil') / multiplier\n\nfloor(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'floor') / multiplier\n\nround(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'round') / multiplier\n\n// return the sum of the given numbers\n\nsum(nums)\n sum = 0\n sum += n for n in nums\n\n// return the average of the given numbers\n\navg(nums)\n sum(nums) / length(nums)\n\n// return a unitless number, or pass through\n\nremove-unit(n)\n if typeof(n) is \"unit\"\n unit(n, \"\")\n else\n n\n\n// convert a percent to a decimal, or pass through\n\npercent-to-decimal(n)\n if unit(n) is \"%\"\n remove-unit(n) / 100\n else\n n\n\n// check if n is an odd number\n\nodd(n)\n 1 == n % 2\n\n// check if n is an even number\n\neven(n)\n 0 == n % 2\n\n// check if color is light\n\nlight(color)\n lightness(color) >= 50%\n\n// check if color is dark\n\ndark(color)\n lightness(color) < 50%\n\n// desaturate color by amount\n\ndesaturate(color, amount)\n adjust(color, 'saturation', - amount)\n\n// saturate color by amount\n\nsaturate(color = '', amount = 100%)\n if color is a 'color'\n adjust(color, 'saturation', amount)\n else\n unquote( \"saturate(\" + color + \")\" )\n\n// darken by the given amount\n\ndarken(color, amount)\n adjust(color, 'lightness', - amount)\n\n// lighten by the given amount\n\nlighten(color, amount)\n adjust(color, 'lightness', amount)\n\n// decrease opacity by amount\n\nfade-out(color, amount)\n color - rgba(black, percent-to-decimal(amount))\n\n// increase opacity by amount\n\nfade-in(color, amount)\n color + rgba(black, percent-to-decimal(amount))\n\n// spin hue by a given amount\n\nspin(color, amount)\n color + unit(amount, deg)\n\n// mix two colors by a given amount\n\nmix(color1, color2, weight = 50%)\n unless weight in 0..100\n error(\"Weight must be between 0% and 100%\")\n\n if length(color1) == 2\n weight = color1[0]\n color1 = color1[1]\n\n else if length(color2) == 2\n weight = 100 - color2[0]\n color2 = color2[1]\n\n require-color(color1)\n require-color(color2)\n\n p = unit(weight / 100, '')\n w = p * 2 - 1\n\n a = alpha(color1) - alpha(color2)\n\n w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2\n w2 = 1 - w1\n\n channels = (red(color1) red(color2)) (green(color1) green(color2)) (blue(color1) blue(color2))\n rgb = ()\n\n for pair in channels\n push(rgb, floor(pair[0] * w1 + pair[1] * w2))\n\n a1 = alpha(color1) * p\n a2 = alpha(color2) * (1 - p)\n alpha = a1 + a2\n\n rgba(rgb[0], rgb[1], rgb[2], alpha)\n\n// invert colors, leave alpha intact\n\ninvert(color = '')\n if color is a 'color'\n rgba(#fff - color, alpha(color))\n else\n unquote( \"invert(\" + color + \")\" )\n\n// give complement of the given color\n\ncomplement( color )\n spin( color, 180 )\n\n// give grayscale of the given color\n\ngrayscale( color = '' )\n if color is a 'color'\n desaturate( color, 100% )\n else\n unquote( \"grayscale(\" + color + \")\" )\n\n// mix the given color with white\n\ntint( color, percent )\n mix( white, color, percent )\n\n// mix the given color with black\n\nshade( color, percent )\n mix( black, color, percent )\n\n// return the last value in the given expr\n\nlast(expr)\n expr[length(expr) - 1]\n\n// return keys in the given pairs or object\n\nkeys(pairs)\n ret = ()\n if type(pairs) == 'object'\n for key in pairs\n push(ret, key)\n else\n for pair in pairs\n push(ret, pair[0]);\n ret\n\n// return values in the given pairs or object\n\nvalues(pairs)\n ret = ()\n if type(pairs) == 'object'\n for key, val in pairs\n push(ret, val)\n else\n for pair in pairs\n push(ret, pair[1]);\n ret\n\n// join values with the given delimiter\n\njoin(delim, vals...)\n buf = ''\n vals = vals[0] if length(vals) == 1\n for val, i in vals\n buf += i ? delim + val : val\n\n// add a CSS rule to the containing block\n\n// - This definition allows add-property to be used as a mixin\n// - It has the same effect as interpolation but allows users\n// to opt for a functional style\n\nadd-property-function = add-property\nadd-property(name, expr)\n if mixin\n {name} expr\n else\n add-property-function(name, expr)\n\nprefix-classes(prefix)\n -prefix-classes(prefix, block)\n\n// Caching mixin, use inside your functions to enable caching by extending.\n\n$stylus_mixin_cache = {}\ncache()\n $key = (current-media() or 'no-media') + '__' + called-from[0] + '__' + arguments\n if $key in $stylus_mixin_cache\n @extend {\"$cache_placeholder_for_\" + $stylus_mixin_cache[$key]}\n else if 'cache' in called-from\n {block}\n else\n $id = length($stylus_mixin_cache)\n\n &,\n /$cache_placeholder_for_{$id}\n $stylus_mixin_cache[$key] = $id\n {block}\n\n// Percentage function to convert a number, e.g. \".45\", into a percentage, e.g. \"45%\"\n\npercentage(num)\n return unit(num * 100, '%')\n\n// Returns the position of a `value` within a `list`\n\nindex(list, value)\n for val, i in list\n return i if val == value\n":notImplemented();
|
||
/*!
|
||
* Stylus - Selector Parser
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var l=[">","+","~"],c=function SelectorParser(t,e,n){this.str=t,this.stack=e||[],this.parts=n||[],this.pos=0,this.level=2,this.nested=!0,this.ignore=!1};c.prototype.skip=function(t){this.str=this.str.substr(t),this.pos+=t},c.prototype.skipSpaces=function(){for(;" "==this.str[0];)this.skip(1)},c.prototype.advance=function(){return this.root()||this.relative()||this.initial()||this.escaped()||this.parent()||this.partial()||this.char()},c.prototype.root=function(){this.pos||"/"!=this.str[0]||"deep"==this.str.slice(1,5)||(this.nested=!1,this.skip(1))},c.prototype.relative=function(t){if((!this.pos||t)&&"../"==this.str.slice(0,3)){for(this.nested=!1,this.skip(3);this.relative(!0);)this.level++;if(!this.raw){var e=this.stack[this.stack.length-this.level];if(e)return e;this.ignore=!0}}},c.prototype.initial=function(){if(!this.pos&&"~"==this.str[0]&&"/"==this.str[1])return this.nested=!1,this.skip(2),this.stack[0]},c.prototype.escaped=function(){if("\\"==this.str[0]){var t=this.str[1];if("&"==t||"^"==t)return this.skip(2),t}},c.prototype.parent=function(){if("&"==this.str[0]){if(this.nested=!1,!this.pos&&(!this.stack.length||this.raw)){for(var t=0;" "==this.str[++t];);if(~l.indexOf(this.str[t]))return void this.skip(t+1)}if(this.skip(1),!this.raw)return this.stack[this.stack.length-1]}},c.prototype.partial=function(){if("^"==this.str[0]&&"["==this.str[1]){this.skip(2),this.skipSpaces();var t=this.range();if(this.skipSpaces(),"]"!=this.str[0])return"^[";if(this.nested=!1,this.skip(1),t)return t;this.ignore=!0}},c.prototype.number=function(){var t=0,e="";for("-"==this.str[t]&&(e+=this.str[t++]);this.str.charCodeAt(t)>=48&&this.str.charCodeAt(t)<=57;)e+=this.str[t++];if(e)return this.skip(t),Number(e)},c.prototype.range=function(){var t,e=this.number();if(".."==this.str.slice(0,2)){this.skip(2);var n=this.number(),i=this.parts.length;if(e<0&&(e=i+e-1),n<0&&(n=i+n-1),e>n){var r=e;e=n,n=r}n<i-1&&(t=this.parts.slice(e,n+1).map((function(t){var e=new c(t,this.stack,this.parts);return e.raw=!0,e.parse()}),this).map((function(t){return(t.nested?" ":"")+t.val})).join("").trim())}else t=this.stack[e<0?this.stack.length+e-1:e];if(t)return t;this.ignore=!0},c.prototype.char=function(){var t=this.str[0];return this.skip(1),t},c.prototype.parse=function(){for(var t="";this.str.length;)if(t+=this.advance()||"",this.ignore){t="";break}return{val:t.trimRight(),nested:this.nested}};var u=t.basename,f=t.relative,d=t.join;const m=t.isAbsolute||function(t){return"\\\\"==t.substr(0,2)||"/"===t.charAt(0)||/^[a-z]:[\\\/]/i.test(t)},_export_lookup_=function(t,e,n){var i,r=e.length;if(m(t))try{return _export_statSync_(t),t}catch(t){}for(;r--;)try{if(n==(i=d(e[r],t)))continue;return _export_statSync_(i),i}catch(t){}},_export_find_=function(t,e,n){var i,r,o=e.length;if(m(t)&&(r=_export_sync_(t)).length)return r;for(;o--;)if(n!=(i=d(e[o],t))&&(r=_export_sync_(i)).length)return r},_export_lookupIndex_=function(t,e,n){var i=_export_find_(d(t,"index.styl"),e,n);return i||(i=_export_find_(d(t,u(t).replace(/\.styl/i,"")+".styl"),e,n)),i||~t.indexOf("node_modules")||(i=function lookupPackage(t){var r=_export_lookup_(d(t,"package.json"),e,n);if(!r)return/\.styl$/i.test(t)?_export_lookupIndex_(t,e,n):lookupPackage(t+".styl");var o=require(f("/",r)).main;return i=o?_export_find_(d(t,o),e,n):_export_lookupIndex_(t,e,n)}(d("node_modules",t))),i},_export_formatException_=function(t,e){var n=e.lineno,i=e.column,r=e.filename,o=e.input,a=(a=e.context||8)/2,h=("\n"+o).split("\n"),l=Math.max(n-a,1),c=Math.min(h.length,n+a),u=c.toString().length;return a=h.slice(l,c).map((function(t,e){var r=e+l;return" "+Array(u-r.toString().length+1).join(" ")+r+"| "+t+(r==n?"\n"+Array(r.toString().length+5+i).join("-")+"^":"")})).join("\n"),t.message=r+":"+n+":"+i+"\n"+a+"\n\n"+t.message+"\n"+(t.stylusStack?t.stylusStack+"\n":""),t.fromStylus&&(t.stack="Error: "+t.message),t},_export_assertType_=function(t,e,n){if(_export_assertPresent_(t,n),t.nodeName!=e){var i=t.nodeName;throw new Error("TypeError: expected "+(n?'"'+n+'" to be a ':"")+e+", but got "+i+":"+t)}},_export_assertString_=function(t,e){switch(_export_assertPresent_(t,e),t.nodeName){case"string":case"ident":case"literal":return;default:var n=t.nodeName;throw new Error("TypeError: expected string, ident or literal, but got "+n+":"+t)}},_export_assertColor_=function(t,e){switch(_export_assertPresent_(t,e),t.nodeName){case"rgba":case"hsla":return;default:var n=t.nodeName;throw new Error("TypeError: expected rgba or hsla, but got "+n+":"+t)}},_export_assertPresent_=function(t,e){if(!t){if(e)throw new Error('"'+e+'" argument required');throw new Error("argument missing")}},_export_unwrap_=function(t){return t.preserve||"arguments"!=t.nodeName&&"expression"!=t.nodeName||1!=t.nodes.length||"arguments"!=t.nodes[0].nodeName&&"expression"!=t.nodes[0].nodeName?t:_export_unwrap_(t.nodes[0])},_export_coerce_=function(t,e){switch(typeof t){case"function":return t;case"string":return new qt.String(t);case"boolean":return new qt.Boolean(t);case"number":return new qt.Unit(t);default:return null==t?qt.null:Array.isArray(t)?_export_coerceArray_(t,e):t.nodeName?t:_export_coerceObject_(t,e)}},_export_coerceArray_=function(t,e){var n=new qt.Expression;return t.forEach((function(t){n.push(_export_coerce_(t,e))})),n},_export_coerceObject_=function(t,e){var n,i=e?new qt.Object:new qt.Expression;for(var r in t)n=_export_coerce_(t[r],e),r=new qt.Ident(r),e?i.set(r,n):i.push(_export_coerceArray_([r,n]));return i},_export_merge_=function(t,e,n){for(var i in e)if(n&&t[i]){var r=_export_unwrap_(t[i]).first,o=_export_unwrap_(e[i]).first;"object"==r.nodeName&&"object"==o.nodeName?t[i].first.vals=_export_merge_(r.vals,o.vals,n):t[i]=e[i]}else t[i]=e[i];return t},_export_uniq_=function(t){for(var e={},n=[],i=0,r=t.length;i<r;++i)t[i]in e||(e[t[i]]=!0,n.push(t[i]));return n},_export_compileSelectors_=function(t,e){var n=[],i=c,r=this&&this.indent||"",o=[];function parse(t,e){var n=[t.val],r=new i(n[0],o,n).parse().val,o=[];if(e.length)for(var a=0,h=e.length;a<h;++a){n.push(e[a]),o.push(r);var l=new i(e[a],o,n).parse();l.nested?r+=" "+l.val:r=l.val}return r.trim()}return function compile(t,i){i?t[i].forEach((function(a){!e&&a.isPlaceholder||(a.inherits?(o.unshift(a.val),compile(t,i-1),o.shift()):n.push(r+parse(a,o)))})):t[0].forEach((function(t){if(e||!t.isPlaceholder){var i=parse(t,o);i&&n.push(r+i)}}))}(t,t.length-1),_export_uniq_(n)},_export_parseString_=function(t){var e,n=Dt;try{e=new n(t).list()}catch(n){e=new qt.Literal(t)}return e};let v,y,g;function adjust$1(t,e,n){_export_assertColor_(t,"color"),_export_assertString_(e,"prop"),_export_assertType_(n,"unit","amount");var i=t.hsla.clone();if(!(e={hue:"h",saturation:"s",lightness:"l"}[e.string]))throw new Error("invalid adjustment property");var r=n.val;return"%"==n.type&&(r="l"==e&&r>0?(100-i[e])*r/100:i[e]*(r/100)),i[e]+=r,i.rgba}function rgba(t,e,n,i){switch(arguments.length){case 1:return _export_assertColor_(t),t.rgba;case 2:_export_assertColor_(t);var r=t.rgba;return _export_assertType_(e,"unit","alpha"),"%"==(i=e.clone()).type&&(i.val/=100),new qt.RGBA(r.r,r.g,r.b,i.val);default:_export_assertType_(t,"unit","red"),_export_assertType_(e,"unit","green"),_export_assertType_(n,"unit","blue"),_export_assertType_(i,"unit","alpha");var o="%"==t.type?Math.round(2.55*t.val):t.val,a="%"==e.type?Math.round(2.55*e.val):e.val,h="%"==n.type?Math.round(2.55*n.val):n.val;return(i=i.clone())&&"%"==i.type&&(i.val/=100),new qt.RGBA(o,a,h,i.val)}}function alpha(t,e){return t=t.rgba,e?rgba(new qt.Unit(t.r),new qt.Unit(t.g),new qt.Unit(t.b),e):new qt.Unit(t.a,"")}function basename(e,n){return _export_assertString_(e,"path"),t.basename(e.val,n&&n.val)}function blend(t,e){return _export_assertColor_(t),t=t.rgba,e=e||new qt.RGBA(255,255,255,1),_export_assertColor_(e),e=e.rgba,new qt.RGBA(t.r*t.a+e.r*(1-t.a),t.g*t.a+e.g*(1-t.a),t.b*t.a+e.b*(1-t.a),t.a+e.a-t.a*e.a)}function blue(t,e){return t=t.rgba,e?rgba(new qt.Unit(t.r),new qt.Unit(t.g),e,new qt.Unit(t.a)):new qt.Unit(t.b,"")}(v=function addProperty(t,e){_export_assertType_(t,"expression","name"),t=_export_unwrap_(t).first,_export_assertString_(t,"name"),_export_assertType_(e,"expression","expr");var n=new qt.Property([t],e),i=this.closestBlock,r=i.nodes.length,o=i.nodes.slice(0,i.index),a=i.nodes.slice(i.index++,r);return o.push(n),i.nodes=o.concat(a),n}).raw=!0,adjust$1.params=["color","prop","amount"],rgba.params=["red","green","blue","alpha"],alpha.params=["color","value"],(y=function(t,e,n){_export_assertPresent_(t,"number"),_export_assertPresent_(e,"base"),t=_export_unwrap_(t).nodes[0].val,e=_export_unwrap_(e).nodes[0].val,n=n&&_export_unwrap_(n).nodes[0].val||2;for(var i=Number(t).toString(e);i.length<n;)i="0"+i;return new qt.Literal(i)}).raw=!0,basename.params=["p","ext"],blend.params=["top","bottom"],blue.params=["color","value"],(g=function clone(t){return _export_assertPresent_(t,"expr"),t.clone()}).raw=!0;var k={red:"r",green:"g",blue:"b",alpha:"a",hue:"h",saturation:"s",lightness:"l"},w={hue:"deg",saturation:"%",lightness:"%"},b={red:"rgba",blue:"rgba",green:"rgba",alpha:"rgba",hue:"hsla",saturation:"hsla",lightness:"hsla"};function component(t,e){_export_assertColor_(t,"color"),_export_assertString_(e,"name"),e=e.string;var n=w[e],i=b[e];if(!(e=k[e]))throw new Error('invalid color component "'+e+'"');return new qt.Unit(t[i][e],n)}function luminosity(t){function processChannel(t){return.03928>(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}return _export_assertColor_(t),t=t.rgba,new qt.Unit(.2126*processChannel(t.r)+.7152*processChannel(t.g)+.0722*processChannel(t.b))}function contrast(t,e){if("rgba"!=t.nodeName&&"hsla"!=t.nodeName)return new qt.Literal("contrast("+(t.isNull?"":t.toString())+")");var n=new qt.Object;function contrast(t,e){1>t.a&&(t=blend(t,e));var n=luminosity(e).val+.05,i=luminosity(t).val+.05,r=n/i;return i>n&&(r=1/r),Math.round(10*r)/10}if(t=t.rgba,e=e||new qt.RGBA(255,255,255,1),_export_assertColor_(e),1<=(e=e.rgba).a){var i=new qt.Unit(contrast(t,e));n.set("ratio",i),n.set("error",new qt.Unit(0)),n.set("min",i),n.set("max",i)}else{var r=contrast(t,blend(e,new qt.RGBA(0,0,0,1))),o=contrast(t,blend(e,new qt.RGBA(255,255,255,1))),a=Math.max(r,o);function processChannel(t,n){return Math.min(Math.max(0,(t-n*e.a)/(1-e.a)),255)}var h=new qt.RGBA(processChannel(t.r,e.r),processChannel(t.g,e.g),processChannel(t.b,e.b),1),l=contrast(t,blend(e,h));n.set("ratio",new qt.Unit(Math.round(50*(l+a))/100)),n.set("error",new qt.Unit(Math.round(50*(a-l))/100)),n.set("min",new qt.Unit(l)),n.set("max",new qt.Unit(a))}return n}function convert$1(t){return _export_assertString_(t,"str"),_export_parseString_(t.string)}function define(t,e,n){_export_assertType_(t,"string","name"),e=_export_unwrap_(e);var i=this.currentScope;n&&n.toBoolean().isTrue&&(i=this.global.scope);var r=new qt.Ident(t.val,e);return i.add(r),qt.null}function dirname$2(e){return _export_assertString_(e,"path"),t.dirname(e.val).replace(/\\/g,"/")}function error(t){_export_assertType_(t,"string","msg");var e=new Error(t.val);throw e.fromStylus=!0,e}function extname$1(e){return _export_assertString_(e,"path"),t.extname(e.val)}function green(t,e){return t=t.rgba,e?rgba(new qt.Unit(t.r),e,new qt.Unit(t.b),new qt.Unit(t.a)):new qt.Unit(t.g,"")}function hsla(t,e,n,i){switch(arguments.length){case 1:return _export_assertColor_(t),t.hsla;case 2:_export_assertColor_(t);var r=t.hsla;return _export_assertType_(e,"unit","alpha"),"%"==(i=e.clone()).type&&(i.val/=100),new qt.HSLA(r.h,r.s,r.l,i.val);default:return _export_assertType_(t,"unit","hue"),_export_assertType_(e,"unit","saturation"),_export_assertType_(n,"unit","lightness"),_export_assertType_(i,"unit","alpha"),(i=i.clone())&&"%"==i.type&&(i.val/=100),new qt.HSLA(t.val,e.val,n.val,i.val)}}function hsl(t,e,n){return 1==arguments.length?(_export_assertColor_(t,"color"),t.hsla):hsla(t,e,n,new qt.Unit(1))}function hue(t,e){if(e){var n=t.hsla;return hsla(e,new qt.Unit(n.s),new qt.Unit(n.l),new qt.Unit(n.a))}return component(t,new qt.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(t,e,n){_export_assertString_(t,"path"),t=t.string;var i=_export_lookup_(t,this.options.paths,this.options.filename),r=e&&"object"==e.nodeName&&e;if(!i){if(r&&r.get("optional").toBoolean().isTrue)return qt.null;throw new Error("failed to locate .json file "+t)}var o=JSON.parse(_export_readFileSync_(i));if(r)return function convert(t,e){var n=new qt.Object,i=e.get("leave-strings").toBoolean();for(var r in t){var o=t[r];"object"==typeof o?n.set(r,convert(o,e)):("string"==(o=_export_coerce_(o)).nodeName&&i.isFalse&&(o=_export_parseString_(o.string)),n.set(r,o))}return n}(o,r);oldJson.call(this,o,e,n)}function oldJson(t,e,n){n?(_export_assertString_(n,"namePrefix"),n=n.val):n="";var i=(e=e?e.toBoolean():new qt.Boolean(e)).isTrue?this.currentScope:this.global.scope;!function convert(t,e){for(var r in e=e?e+"-":"",t){var o=t[r],a=e+r;"object"==typeof o?convert(o,a):("string"==(o=_export_coerce_(o)).nodeName&&(o=_export_parseString_(o.string)),i.add({name:n+a,val:o}))}}(t)}let x,_,S,E,N,A,O,L;function lightness(t,e){if(e){var n=t.hsla;return hsla(new qt.Unit(n.h),new qt.Unit(n.s),e,new qt.Unit(n.a))}return component(t,new qt.String("lightness"))}function lookup(t){_export_assertType_(t,"string","name");var e=this.lookup(t.val);return e?this.visit(e):qt.null}function match(t,e,n){_export_assertType_(t,"string","pattern"),_export_assertString_(e,"val");var i=new RegExp(t.val,function validateFlags(t){return!!(t=t&&t.string)&&t.split("").every((function(t){return~"igm".indexOf(t)}))}(n)?n.string:"");return e.string.match(i)}function math$1(t,e){return _export_assertType_(t,"unit","n"),_export_assertString_(e,"fn"),new qt.Unit(Math[e.string](t.val),t.type)}function operate(t,e,n){return _export_assertType_(t,"string","op"),_export_assertPresent_(e,"left"),_export_assertPresent_(n,"right"),e.operate(t.val,n)}function range(t,e,n){if(_export_assertType_(t,"unit","start"),_export_assertType_(e,"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 qt.Unit(1);for(var i=new qt.Expression,r=t.val;r<=e.val;r+=n.val)i.push(new qt.Unit(r,t.type));return i}function red(t,e){return t=t.rgba,e?rgba(e,new qt.Unit(t.g),new qt.Unit(t.b),new qt.Unit(t.a)):new qt.Unit(t.r,"")}function remove(t,e){return _export_assertType_(t,"object","object"),_export_assertString_(e,"key"),delete t.vals[e.string],t}function replace(t,e,n){_export_assertString_(t,"pattern"),_export_assertString_(e,"replacement"),_export_assertString_(n,"val"),t=new RegExp(t.string,"g");var i=n.string.replace(t,e.string);return n instanceof qt.Ident?new qt.Ident(i):new qt.String(i)}function rgb(t,e,n){if(1===arguments.length){_export_assertColor_(t);var i=t.rgba;return new qt.RGBA(i.r,i.g,i.b,1)}return rgba(t,e,n,new qt.Unit(1))}json.params=["path","local","namePrefix"],(x=function length(t){if(t){if(t.nodes){var e=_export_unwrap_(t).nodes;return 1==e.length&&"object"==e[0].nodeName?e[0].length:1==e.length&&"string"==e[0].nodeName?e[0].val.length:e.length}return 1}return 0}).raw=!0,lightness.params=["color","value"],(_=function listSeparator(t){return t=_export_unwrap_(t),new qt.String(t.isList?",":" ")}).raw=!0,lookup.params=["name"],match.params=["pattern","val","flags"],math$1.params=["n","fn"],(S=function merge(t){_export_assertPresent_(t,"dest"),t=_export_unwrap_(t).first,_export_assertType_(t,"object","dest");for(var e=_export_unwrap_(arguments[arguments.length-1]).first,n=!0===e.val,i=1,r=arguments.length-n;i<r;++i)_export_merge_(t.vals,_export_unwrap_(arguments[i]).first.vals,n);return t}).raw=!0,operate.params=["op","left","right"],(E=function oppositePosition(t){var e=[];return _export_unwrap_(t).nodes.forEach((function(t,n){_export_assertString_(t,"position "+n),t=function(){switch(t.string){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";case"center":return"center";default:throw new Error("invalid position "+t)}}(),e.push(new qt.Literal(t))})),e}).raw=!0,(N=function p(){return[].slice.call(arguments).forEach((function(t){(t=_export_unwrap_(t)).nodes.length&&console.log("[90minspect:[0m %s",t.toString().replace(/^\(|\)$/g,""))})),qt.null}).raw=!0,(A=function pathjoin(){var e=[].slice.call(arguments).map((function(t){return t.first.string}));return t.join.apply(null,e).replace(/\\/g,"/")}).raw=!0,(O=function pop(t){return(t=_export_unwrap_(t)).nodes.pop()}).raw=!0,(L=function(t){t=_export_unwrap_(t);for(var e=1,n=arguments.length;e<n;++e)t.nodes.push(_export_unwrap_(arguments[e]).clone());return t.nodes.length}).raw=!0,range.params=["start","stop","step"],red.params=["color","value"],remove.params=["object","key"],replace.params=["pattern","replacement","val"],rgb.params=["red","green","blue"];var B=function convertAngle(t,e){return t*{rad:1,deg:180/Math.PI,turn:.5/Math.PI,grad:200/Math.PI}[e]},C=function atan(t,e){e=void 0!==e?e:"deg";var n=Math.pow(10,9),i=Math.asin(t),r=B(i,e);return r=Math.round(r*n)/n,new qt.Unit(r,e)},j=function Compiler(t,e){e=e||{},this.compress=e.compress,this.firebug=e.firebug,this.linenos=e.linenos,this.spaces=e["indent spaces"]||2,this.indents=1,i.call(this,t),this.stack=[]};let P;function saturation(t,e){if(e){var n=t.hsla;return hsla(new qt.Unit(n.h),e,new qt.Unit(n.l),new qt.Unit(n.a))}return component(t,new qt.String("saturation"))}j.prototype.__proto__=i.prototype,j.prototype.compile=function(){return this.visit(this.root)},j.prototype.out=function(t,e){return t},j.prototype.__defineGetter__("indent",(function(){return this.compress?"":new Array(this.indents).join(Array(this.spaces+1).join(" "))})),j.prototype.needBrackets=function(t){return 1==this.indents||"atrule"!=t.nodeName||t.hasOnlyProperties},j.prototype.visitRoot=function(t){this.buf="";for(var e=0,n=t.nodes.length;e<n;++e){var i=t.nodes[e];(this.linenos||this.firebug)&&this.debugInfo(i);var r=this.visit(i);r&&(this.buf+=this.out(r+"\n",i))}return this.buf},j.prototype.visitBlock=function(t){var e,n,i,r=this.compress?"":"\n";if(t.hasProperties&&!t.lacksRenderedSelectors){if(n=this.needBrackets(t.node),this.compress)for(var o=t.nodes.length-1;o>=0;--o)if("property"===t.nodes[o].nodeName){i=o;break}n&&(this.buf+=this.out(this.compress?"{":" {\n"),++this.indents),o=0;for(var a=t.nodes.length;o<a;++o)switch(this.last=i===o,(e=t.nodes[o]).nodeName){case"null":case"expression":case"function":case"group":case"block":case"unit":case"media":case"keyframes":case"atrule":case"supports":continue;case!this.compress&&e.inline&&"comment":this.buf=this.buf.slice(0,-1),this.buf+=this.out(" "+this.visit(e)+"\n",e);break;case"property":var h=this.visit(e)+r;this.buf+=this.compress?h:this.out(h,e);break;default:this.buf+=this.out(this.visit(e)+r,e)}n&&(--this.indents,this.buf+=this.out(this.indent+"}"+r))}for(o=0,a=t.nodes.length;o<a;++o)switch((e=t.nodes[o]).nodeName){case"group":case"block":case"keyframes":(this.linenos||this.firebug)&&this.debugInfo(e),this.visit(e);break;case"media":case"import":case"atrule":case"supports":this.visit(e);break;case"comment":e.suppress||(this.buf+=this.out(this.indent+this.visit(e)+"\n",e));break;case"charset":case"literal":case"namespace":this.buf+=this.out(this.visit(e)+"\n",e)}},j.prototype.visitKeyframes=function(t){if(t.frames){var e="official"==t.prefix?"":"-"+t.prefix+"-";this.buf+=this.out("@"+e+"keyframes "+this.visit(t.val)+(this.compress?"{":" {\n"),t),this.keyframe=!0,++this.indents,this.visit(t.block),--this.indents,this.keyframe=!1,this.buf+=this.out("}"+(this.compress?"":"\n"))}},j.prototype.visitMedia=function(t){var e=t.val;t.hasOutput&&e.nodes.length&&(this.buf+=this.out("@media ",t),this.visit(e),this.buf+=this.out(this.compress?"{":" {\n"),++this.indents,this.visit(t.block),--this.indents,this.buf+=this.out("}"+(this.compress?"":"\n")))},j.prototype.visitQueryList=function(t){for(var e=0,n=t.nodes.length;e<n;++e)this.visit(t.nodes[e]),n-1!=e&&(this.buf+=this.out(","+(this.compress?"":" ")))},j.prototype.visitQuery=function(t){var e=t.nodes.length;t.predicate&&(this.buf+=this.out(t.predicate+" ")),t.type&&(this.buf+=this.out(t.type+(e?" and ":"")));for(var n=0;n<e;++n)this.buf+=this.out(this.visit(t.nodes[n])),e-1!=n&&(this.buf+=this.out(" and "))},j.prototype.visitFeature=function(t){return t.expr?t.expr.isEmpty?"("+t.name+")":"("+t.name+":"+(this.compress?"":" ")+this.visit(t.expr)+")":t.name},j.prototype.visitImport=function(t){this.buf+=this.out("@import "+this.visit(t.path)+";\n",t)},j.prototype.visitAtrule=function(t){var e=this.compress?"":"\n";this.buf+=this.out(this.indent+"@"+t.type,t),t.val&&(this.buf+=this.out(" "+t.val.trim())),t.block?t.block.isEmpty?this.buf+=this.out((this.compress?"":" ")+"{}"+e):t.hasOnlyProperties?this.visit(t.block):(this.buf+=this.out(this.compress?"{":" {\n"),++this.indents,this.visit(t.block),--this.indents,this.buf+=this.out(this.indent+"}"+e)):this.buf+=this.out(";"+e)},j.prototype.visitSupports=function(t){t.hasOutput&&(this.buf+=this.out(this.indent+"@supports ",t),this.isCondition=!0,this.buf+=this.out(this.visit(t.condition)),this.isCondition=!1,this.buf+=this.out(this.compress?"{":" {\n"),++this.indents,this.visit(t.block),--this.indents,this.buf+=this.out(this.indent+"}"+(this.compress?"":"\n")))},j.prototype.visitComment=function(t){return this.compress&&t.suppress?"":t.str},j.prototype.visitFunction=function(t){return t.name},j.prototype.visitCharset=function(t){return"@charset "+this.visit(t.val)+";"},j.prototype.visitNamespace=function(t){return"@namespace "+(t.prefix?this.visit(t.prefix)+" ":"")+this.visit(t.val)+";"},j.prototype.visitLiteral=function(t){var e=t.val;return t.css&&(e=e.replace(/^ /gm,"")),e},j.prototype.visitBoolean=function(t){return t.toString()},j.prototype.visitRGBA=function(t){return t.toString()},j.prototype.visitHSLA=function(t){return t.rgba.toString()},j.prototype.visitUnit=function(t){var e=t.type||"",n=t.val,i=n!=(0|n);if(this.compress){if(!["%","s","ms","deg","fr"].includes(e)&&0==n)return"0";if(i&&n<1&&n>-1)return n.toString().replace("0.",".")+e}return(i?parseFloat(n.toFixed(15)):n).toString()+e},j.prototype.visitGroup=function(t){var e=this.keyframe?[]:this.stack,n=this.compress?",":",\n";if(e.push(t.nodes),t.block.hasProperties){var i=_export_compileSelectors_.call(this,e),r=i.length;if(r){this.keyframe&&(n=this.compress?",":", ");for(var o=0;o<r;++o){var a=i[o],h=o==r-1;this.keyframe&&(a=o?a.trim():a),this.buf+=this.out(a+(h?"":n),t.nodes[o])}}else t.block.lacksRenderedSelectors=!0}this.visit(t.block),e.pop()},j.prototype.visitIdent=function(t){return t.name},j.prototype.visitString=function(t){return this.isURL?t.val:t.toString()},j.prototype.visitNull=function(t){return""},j.prototype.visitCall=function(t){this.isURL="url"==t.name;var e=t.args.nodes.map((function(t){return this.visit(t)}),this).join(this.compress?",":", ");return this.isURL&&(e='"'+e+'"'),this.isURL=!1,t.name+"("+e+")"},j.prototype.visitExpression=function(t){var e=[],n=this,i=t.nodes.length,r=t.nodes.map((function(t){return n.visit(t)}));return r.forEach((function(o,a){var h=a==i-1;if(e.push(o),"/"!=r[a+1]&&"/"!=o&&!h){var l=n.isURL||n.isCondition&&(")"==r[a+1]||"("==o)?"":" ";e.push(t.isList?n.compress?",":", ":l)}})),e.join("")},j.prototype.visitArguments=j.prototype.visitExpression,j.prototype.visitProperty=function(t){var e=this.visit(t.expr).trim(),n=t.name||t.segments.join(""),i=[];return"@apply"===n?(i.push(this.out(this.indent),this.out(n+" ",t),this.out(e,t.expr),this.out(this.compress&&this.last?"":";")),i.join("")):(i.push(this.out(this.indent),this.out(n+(this.compress?":":": "),t),this.out(e,t.expr),this.out(this.compress&&this.last?"":";")),i.join(""))},j.prototype.debugInfo=function(t){var e="stdin"==t.filename?"stdin":notImplemented(t.filename),n=(t.nodes&&t.nodes.length?t.nodes[0].lineno:t.lineno)||1;this.linenos&&(this.buf+="\n/* line "+n+" : "+e+" */\n"),this.firebug&&(e="file\\:\\/\\/"+e.replace(/([.:/\\])/g,(function(t){return"\\"+("\\"===t?"/":t)})),n="\\00003"+n,this.buf+="\n@media -stylus-debug-info{filename{font-family:"+e+"}line{font-family:"+n+"}}\n")},(P=function s(t){t=_export_unwrap_(t).nodes[0],_export_assertString_(t);var e=this,n=t.string,i=arguments,r=1;return n=n.replace(/%(s|d)/g,(function(t,n){var o=i[r++]||qt.null;switch(n){case"s":return new j(o,e&&e.options).compile();case"d":if("unit"!=(o=_export_unwrap_(o).first).nodeName)throw new Error("%d requires a unit");return o.val}})),new qt.Literal(n)}).raw=!0,saturation.params=["color","value"];var I=function Normalizer(t,e){e=e||{},i.call(this,t),this.hoist=e["hoist atrules"],this.stack=[],this.map={},this.imports=[]};function selectorExists(t){if(_export_assertString_(t,"selector"),!this.__selectorsMap__){var e=new I(this.root.clone());e.visit(e.root),this.__selectorsMap__=e.map}return t.string in this.__selectorsMap__}let U,R,G,M;function pushToStack(t,e){t.forEach((function(t){t=t.first,_export_assertString_(t,"selector"),e.push(parse$1(t.string))}))}function parse$1(t){var e,n=new Dt(t);return n.state.push("selector-parts"),(e=n.selector()).forEach((function(t){t.val=t.segments.map((function(t){return t.toString()})).join("")})),e}function split(t,e){_export_assertString_(t,"delimiter"),_export_assertString_(e,"val");for(var n=e.string.split(t.string),i=new qt.Expression,r=e instanceof qt.Ident?qt.Ident:qt.String,o=0,a=n.length;o<a;++o)i.nodes.push(new r(n[o]));return i}function substr(t,e,n){_export_assertString_(t,"val"),_export_assertType_(e,"unit","start"),n=n&&n.val;var i=t.string.substr(e.val,n);return t instanceof qt.Ident?new qt.Ident(i):new qt.String(i)}function tan(t){_export_assertType_(t,"unit","angle");var e=t.val;"deg"===t.type&&(e*=Math.PI/180);var n=Math.pow(10,9),i=Math.round(Math.sin(e)*n)/n,r=Math.round(Math.cos(e)*n)/n,o=Math.round(n*i/r)/n;return new qt.Unit(o,"")}function transparentify(t,e,n){_export_assertColor_(t),t=t.rgba,e=e||new qt.RGBA(255,255,255,1),n||!e||e.rgba||(n=e,e=new qt.RGBA(255,255,255,1)),_export_assertColor_(e),e=e.rgba;var i=["r","g","b"].map((function(n){return(t[n]-e[n])/((0<t[n]-e[n]?255:0)-e[n])})).sort((function(t,e){return e-t}))[0];function processChannel(n){return 0==i?e[n]:e[n]+(t[n]-e[n])/i}return n&&(_export_assertType_(n,"unit","alpha"),"%"==n.type?i=n.val/100:n.type||(i=n=n.val)),i=Math.max(Math.min(i,1),0),new qt.RGBA(processChannel("r"),processChannel("g"),processChannel("b"),Math.round(100*i)/100)}function type(t){return _export_assertPresent_(t,"expression"),t.nodeName}function unit(t,e){return _export_assertType_(t,"unit","unit"),e?(_export_assertString_(e,"type"),new qt.Unit(t.val,e.string)):t.type||""}function unquote(t){return _export_assertString_(t,"string"),new qt.Literal(t.string)}function use(e,n){_export_assertString_(e,"plugin"),n&&(_export_assertType_(n,"object","options"),n=parseObject(n)),e=e.string;var i=_export_lookup_(e,this.options.paths,this.options.filename);if(!i)throw new Error('failed to locate plugin file "'+e+'"');var r=require(t.resolve(i));if("function"!=typeof r)throw new Error('plugin "'+e+'" does not export a function');this.renderer.use(r(n||this.options))}function parseObject(t){for(var e in t=t.vals){var n=t[e].nodes[0].nodes;if(n&&n.length){t[e]=[];for(var i=0,r=n.length;i<r;++i)t[e].push(convert(n[i]))}else t[e]=convert(t[e].first)}return t;function convert(t){switch(t.nodeName){case"object":return parseObject(t);case"boolean":return t.isTrue;case"unit":return t.type?t.toString():+t.val;case"string":case"literal":return t.val;default:return t.toString()}}}function warn(t){return _export_assertType_(t,"string","msg"),console.warn("Warning: %s",t.val),qt.null}function math(t){return new qt.Unit(Math[t.string])}function prefixClasses(t,e){_export_assertString_(t,"prefix"),_export_assertType_(e,"block","block");var n=this.prefix;return this.options.prefix=this.prefix=t.string,e=this.visit(e),this.options.prefix=this.prefix=n,e}I.prototype.__proto__=i.prototype,I.prototype.normalize=function(){var t=this.visit(this.root);return this.hoist&&(this.imports.length&&(t.nodes=this.imports.concat(t.nodes)),this.charset&&(t.nodes=[this.charset].concat(t.nodes))),t},I.prototype.bubble=function(t){var e=[],n=[],i=this;if(function filterProps(t){t.nodes.forEach((function(t){switch((t=i.visit(t)).nodeName){case"property":e.push(t);break;case"block":filterProps(t);break;default:n.push(t)}}))}(t.block),e.length){var r=new qt.Selector([new qt.Literal("&")]);r.lineno=t.lineno,r.column=t.column,r.filename=t.filename,r.val="&",(o=new qt.Group).lineno=t.lineno,o.column=t.column,o.filename=t.filename;var o,a=new qt.Block(t.block,o);a.lineno=t.lineno,a.column=t.column,a.filename=t.filename,e.forEach((function(t){a.push(t)})),o.push(r),o.block=a,t.block.nodes=[],t.block.push(o),n.forEach((function(e){t.block.push(e)})),(o=this.closestGroup(t.block))&&(t.group=o.clone()),t.bubbled=!0}},I.prototype.closestGroup=function(t){for(var e,n=t.parent;n&&(e=n.node);){if("group"==e.nodeName)return e;n=e.block&&e.block.parent}},I.prototype.visitRoot=function(t){for(var e,n=new qt.Root,i=0;i<t.nodes.length;++i)switch((e=t.nodes[i]).nodeName){case"null":case"expression":case"function":case"unit":case"atblock":continue;default:this.rootIndex=i,n.push(this.visit(e))}return n},I.prototype.visitProperty=function(t){return this.visit(t.expr),t},I.prototype.visitExpression=function(t){return t.nodes=t.nodes.map((function(e){if("block"==e.nodeName){var n=new qt.Literal("block");return n.lineno=t.lineno,n.column=t.column,n}return e})),t},I.prototype.visitBlock=function(t){var e;if(t.hasProperties)for(var n=0,i=t.nodes.length;n<i;++n)switch((e=t.nodes[n]).nodeName){case"null":case"expression":case"function":case"group":case"unit":case"atblock":continue;default:t.nodes[n]=this.visit(e)}for(n=0,i=t.nodes.length;n<i;++n)e=t.nodes[n],t.nodes[n]=this.visit(e);return t},I.prototype.visitGroup=function(t){var e,n=this.stack,i=this.map;t.nodes.forEach((function(n,i){if(~n.val.indexOf(","))if(~n.val.indexOf("\\,"))n.val=n.val.replace(/\\,/g,",");else{e=n.val.split(",");for(var r,o,a="/"==n.val.charAt(0),h=0,l=e.length;h<l;++h)r=e[h].trim(),a&&h>0&&!~r.indexOf("&")&&(r="/"+r),(o=new qt.Selector([new qt.Literal(r)])).val=r,o.block=t.block,t.nodes[i++]=o}})),n.push(t.nodes);var r=_export_compileSelectors_(n,!0);return r.forEach((function(e){i[e]=i[e]||[],i[e].push(t)})),this.extend(t,r),n.pop(),t},I.prototype.visitFunction=function(){return qt.null},I.prototype.visitMedia=function(t){var e,n=[],i=this.closestGroup(t.block);return function mergeQueries(e){e.nodes.forEach((function(i,r){switch(i.nodeName){case"media":i.val=t.val.merge(i.val),n.push(i),e.nodes[r]=qt.null;break;case"block":mergeQueries(i);break;default:i.block&&i.block.nodes&&mergeQueries(i.block)}}))}(t.block),this.bubble(t),n.length&&n.forEach((function(t){i?i.block.push(t):this.root.nodes.splice(++this.rootIndex,0,t),t=this.visit(t),e=t.block.parent,!t.bubbled||i&&"group"!=e.node.nodeName||(t.group.block=t.block.nodes[0].block,t.block.nodes[0]=t.group)}),this),t},I.prototype.visitSupports=function(t){return this.bubble(t),t},I.prototype.visitAtrule=function(t){return t.block&&(t.block=this.visit(t.block)),t},I.prototype.visitKeyframes=function(t){var e=t.block.nodes.filter((function(t){return t.block&&t.block.hasProperties}));return t.frames=e.length,t},I.prototype.visitImport=function(t){return this.imports.push(t),this.hoist?qt.null:t},I.prototype.visitCharset=function(t){return this.charset=t,this.hoist?qt.null:t},I.prototype.extend=function(t,e){var n=this.map,i=this,r=this.closestGroup(t.block);t.extends.forEach((function(t){var o=n[t.selector];if(!o){if(t.optional)return;if(!(o=i._checkForPrefixedGroups(t.selector))){var a=new Error('Failed to @extend "'+t.selector+'"');throw a.lineno=t.lineno,a.column=t.column,a}}e.forEach((function(t){var n=new qt.Selector;n.val=t,n.inherits=!1,o.forEach((function(t){r&&r==t||i.extend(t,e),t.push(n)}))}))})),t.block=this.visit(t.block)},I.prototype._checkForPrefixedGroups=function(t){for(var e=[],n=this.map,i=null,r=0;r<this.stack.length;r++){var o=this.stack[r][0];if(e.push(o.val),i=n[e.join(" ")+" "+t])break}return i},selectorExists.params=["sel"],(U=function selector(){var t=this.selectorStack,e=[].slice.call(arguments);if(1==e.length){var n=_export_unwrap_(e[0]),i=n.nodes.length;if(1==i){_export_assertString_(n.first,"selector");var r=c,o=n.first.string,a=new r(o).parse().val;if(a==o)return o;t.push(parse$1(o))}else i>1&&(n.isList?pushToStack(n.nodes,t):t.push(parse$1(n.nodes.map((function(t){return _export_assertString_(t,"selector"),t.string})).join(" "))))}else e.length>1&&pushToStack(e,t);return t.length?_export_compileSelectors_(t).join(","):"&"}).raw=!0,(R=function(t){return(t=_export_unwrap_(t)).nodes.shift()}).raw=!0,split.params=["delim","val"],substr.params=["val","start","length"],(G=function slice(t,e,n){if(e=e&&e.nodes[0].val,n=n&&n.nodes[0].val,(t=_export_unwrap_(t).nodes).length>1)return _export_coerce_(t.slice(e,n),!0);var i=t[0].string.slice(e,n);return t[0]instanceof qt.Ident?new qt.Ident(i):new qt.String(i)}).raw=!0,tan.params=["angle"],transparentify.params=["top","bottom","alpha"],type.params=["node"],unit.params=["unit","type"],unquote.params=["string"],(M=function(t){t=_export_unwrap_(t);for(var e=1,n=arguments.length;e<n;++e)t.nodes.unshift(_export_unwrap_(arguments[e]));return t.nodes.length}).raw=!0,use.params=["plugin","options"],warn.params=["msg"],math.params=["prop"],prefixClasses.params=["prefix","block"];const F={};F["add-property"]=v,F.adjust=adjust$1,F.alpha=alpha,F["base-convert"]=y,F.basename=basename,F.blend=blend,F.blue=blue,F.clone=g,F.component=component,F.contrast=contrast,F.convert=convert$1,F["current-media"]=function currentMedia(){var t=this;return new qt.String(function lookForMedia(e){return"media"==e.nodeName?(e.val=t.visit(e.val),e.toString()):e.block.parent.node?lookForMedia(e.block.parent.node):void 0}(this.closestBlock.node)||"")},F.define=define,F.dirname=dirname$2,F.error=error,F.extname=extname$1,F.green=green,F.hsl=hsl,F.hsla=hsla,F.hue=hue,F["image-size"]=noop$1,F.json=json,F.length=x,F.lightness=lightness,F["list-separator"]=_,F.lookup=lookup,F.luminosity=luminosity,F.match=match,F.math=math$1,F.merge=F.extend=S,F.operate=operate,F["opposite-position"]=E,F.p=N,F.pathjoin=A,F.pop=O,F.push=F.append=L,F.range=range,F.red=red,F.remove=remove,F.replace=replace,F.rgb=rgb,F.atan=function atan(t,e){e=void 0!==e?e:"deg";var n=Math.atan(t),i=Math.pow(10,9),r=B(n,e);return r=Math.round(r*i)/i,new qt.Unit(r,e)},F.asin=C,F.acos=function acos(t,e){e=void 0!==e?e:"deg";var n=B(Math.PI/2,e)-C(t,e).val,i=Math.pow(10,9);return n=Math.round(n*i)/i,new qt.Unit(n,e)},F.rgba=rgba,F.s=P,F.saturation=saturation,F["selector-exists"]=selectorExists,F.selector=U,F.selectors=function selectors(){var t=this.selectorStack,e=new qt.Expression(!0);if(t.length)for(var n=0;n<t.length;n++){var i,r=t[n];if(r.length>1)e.push(new qt.String(r.map((function(t){return((i=new c(t.val).parse().nested)&&n?"& ":"")+t.val})).join(",")));else{var o=r[0].val;i=new c(o).parse().nested,e.push(new qt.String((i&&n?"& ":"")+o))}}else e.push(new qt.String("&"));return e},F.shift=R,F.split=split,F.substr=substr,F.slice=G,F.tan=tan,F.trace=function trace(){return console.log(this.stack),qt.null},F.transparentify=transparentify,F.type=F.typeof=F["type-of"]=type,F.unit=unit,F.unquote=unquote,F.unshift=F.prepend=M,F.use=use,F.warn=warn,F["-math-prop"]=math,F["-prefix-classes"]=prefixClasses;
|
||
/*!
|
||
* Stylus - colors
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var q={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]},T=t.extname,$={".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(t){var e=(t=t||{}).paths||[],n=null!=t.limit?t.limit:3e4,i=t.mimes||$;function fn(t,r){var o=new j(t),a="base64";o.isURL=!0,t=function parse(t){return new URL(t)}(t=t.nodes.map((function(t){return o.visit(t)})).join(""));var h,l,c=T(t.pathname||""),u=i[c],f=t.hash||"",d=new qt.Literal('url("'+t.href+'")'),m=e.concat(this.paths);if(!u)return d;if(t.protocol)return d;var v=_export_lookup_(t.pathname,m);return v?(h=_export_readFileSync_(v),!1!==n&&h.length>n?d:(r&&"utf8"==r.first.val.toLowerCase()?(a="charset=utf-8",l=h.toString().replace(/\s+/g," ").replace(/[{}\|\\\^~\[\]`"<>#%]/g,(function(t){return"%"+t[0].charCodeAt(0).toString(16).toUpperCase()})).trim()):l=h.toString(a)+f,new qt.Literal('url("data:'+u+";"+a+","+l+'")'))):(ee.emit("file not found","File "+d+" could not be found, literal url retained!"),d)}return fn.raw=!0,fn};_module_exports_$4.mimes=$;var J=t.dirname,z=noop$2();function importFile(t,e,n){var i,r=this.importStack,o=Dt;if(t.once){if(this.requireHistory[e])return qt.null;if(this.requireHistory[e]=!0,n&&!this.includeCSS)return t}if(~r.indexOf(e))throw new Error("import loop has been found");var a=_export_readFileSync_(e);if(!a.trim())return qt.null;if(t.path=e,t.dirname=J(e),i=_export_statSync_(e),t.mtime=i.mtime,this.paths.push(t.dirname),this.options._imports&&this.options._imports.push(t.clone()),r.push(e),qt.filename=e,n&&((n=new qt.Literal(a.replace(/\r\n?/g,"\n"))).lineno=n.column=1,!this.resolveURL))return n;var h=new qt.Block,l=new o(a,_export_merge_({root:h},this.options));try{h=l.parse()}catch(t){var c=l.lexer.lineno,u=l.lexer.column;if(n&&this.includeCSS&&this.resolveURL)return this.warn("ParseError: "+e+":"+c+":"+u+". This file included as-is"),n;throw t.filename=e,t.lineno=c,t.column=u,t.input=a,t}(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 H=function Evaluator(t,e){e=e||{},i.call(this,t);var n=this.functions=e.functions||{};this.stack=new o,this.imports=e.imports||[],this.globals=e.globals||{},this.paths=e.paths||[],this.prefix=e.prefix||"",this.filename=e.filename,this.includeCSS=e["include css"],this.resolveURL=n.url&&"resolver"==n.url.name&&n.url.options,this.paths.push(J(e.filename||".")),this.stack.push(this.global=new h(t)),this.warnings=e.warn,this.options=e,this.calling=[],this.importStack=[],this.requireHistory={},this.return=0};H.prototype.__proto__=i.prototype;var Q=i.prototype.visit;function CoercionError(t){this.name="CoercionError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,CoercionError)}H.prototype.visit=function(t){try{return Q.call(this,t)}catch(e){if(e.filename)throw e;e.lineno=t.lineno,e.column=t.column,e.filename=t.filename,e.stylusStack=this.stack.toString();try{e.input=_export_readFileSync_(e.filename)}catch(t){}throw e}},H.prototype.setup=function(){var t=this.root,e=[];this.populateGlobalScope(),this.imports.forEach((function(t){var n=new qt.Expression;n.push(new qt.String(t)),e.push(new qt.Import(n))}),this),t.nodes=e.concat(t.nodes)},H.prototype.populateGlobalScope=function(){var t=this.global.scope;Object.keys(q).forEach((function(e){var n=q[e],i=new qt.RGBA(n[0],n[1],n[2],n[3]),r=new qt.Ident(e,i);i.name=e,t.add(r)})),t.add(new qt.Ident("embedurl",new qt.Function("embedurl",_module_exports_$4({limit:!1}))));var e=this.globals;Object.keys(e).forEach((function(n){var i=e[n];i.nodeName||(i=new qt.Literal(i)),t.add(new qt.Ident(n,i))}))},H.prototype.evaluate=function(){return z("eval %s",this.filename),this.setup(),this.visit(this.root)},H.prototype.visitGroup=function(t){return t.nodes=t.nodes.map((function(t){return t.val=this.interpolate(t),z("ruleset %s",t.val),t}),this),t.block=this.visit(t.block),t},H.prototype.visitReturn=function(t){throw t.expr=this.visit(t.expr),t},H.prototype.visitMedia=function(t){return t.block=this.visit(t.block),t.val=this.visit(t.val),t},H.prototype.visitQueryList=function(t){var e,n;if(t.nodes.forEach(this.visit,this),1==t.nodes.length&&(n=t.nodes[0],e=this.lookup(n.type))){if(!(e=e.first.string))return t;var i=new Dt(e,this.options);t=this.visit(i.queries())}return t},H.prototype.visitQuery=function(t){return t.predicate=this.visit(t.predicate),t.type=this.visit(t.type),t.nodes.forEach(this.visit,this),t},H.prototype.visitFeature=function(t){return t.name=this.interpolate(t),t.expr&&(this.return++,t.expr=this.visit(t.expr),this.return--),t},H.prototype.visitObject=function(t){for(var e in t.vals)t.vals[e]=this.visit(t.vals[e]);return t},H.prototype.visitMember=function(t){var e=t.left,n=t.right,i=this.visit(e).first;if("object"!=i.nodeName)throw new Error(e.toString()+" has no property ."+n);return t.val&&(this.return++,i.set(n.name,this.visit(t.val)),this.return--),i.get(n.name)},H.prototype.visitKeyframes=function(t){var e;return t.fabricated?t:(t.val=this.interpolate(t).trim(),(e=this.lookup(t.val))&&(t.val=e.first.string||e.first.name),t.block=this.visit(t.block),"official"!=t.prefix?t:(this.vendors.forEach((function(e){if("ms"!=e){var n=t.clone();n.val=t.val,n.prefix=e,n.block=t.block,n.fabricated=!0,this.currentBlock.push(n)}}),this),qt.null))},H.prototype.visitFunction=function(t){var e=this.stack.currentFrame.scope.lookup(t.name);return e&&this.warn("local "+e.nodeName+' "'+t.name+'" previously defined in this scope'),this.functions[t.name]&&this.warn('user-defined function "'+t.name+'" is already defined'),F[t.name]&&this.warn('built-in function "'+t.name+'" is already defined'),t},H.prototype.visitEach=function(t){this.return++;var e,n,i=_export_unwrap_(this.visit(t.expr)),r=i.nodes.length,o=new qt.Ident(t.val),a=new qt.Ident(t.key||"__index__"),h=this.currentScope,l=this.currentBlock,c=[],u=this;function visitBody(n,i){h.add(i),h.add(n),e=u.visit(t.block.clone()),c=c.concat(e.nodes)}if(this.return--,t.block.scope=!1,1==r&&"object"==i.nodes[0].nodeName)for(var f in(n=i.nodes[0]).vals)o.val=new qt.String(f),a.val=n.get(f),visitBody(a,o);else for(var d=0;d<r;++d)o.val=i.nodes[d],a.val=new qt.Unit(d),visitBody(a,o);return this.mixin(c,l),c[c.length-1]||qt.null},H.prototype.visitCall=function(t){var e,n,i=this.lookup(t.name);if(this.ignoreColors="url"==t.name,i&&"expression"==i.nodeName&&(i=i.nodes[0]),i&&"function"!=i.nodeName&&(i=this.lookupFunction(t.name)),!i||"function"!=i.nodeName)return"calc"==this.unvendorize(t.name)?(e=t.args.nodes&&t.args.nodes[0])&&(n=new qt.Literal(t.name+e)):n=this.literalCall(t),this.ignoreColors=!1,n;if(this.calling.push(t.name),this.calling.length>200)throw new RangeError("Maximum stylus call stack size exceeded");"expression"==i.nodeName&&(i=i.first),this.return++;var r=this.visit(t.args);for(var o in r.map)r.map[o]=this.visit(r.map[o].clone());return this.return--,i.fn?n=this.invokeBuiltin(i.fn,r):"function"==i.nodeName&&(t.block&&(t.block=this.visit(t.block)),n=this.invokeFunction(i,r,t.block)),this.calling.pop(),this.ignoreColors=!1,n},H.prototype.visitIdent=function(t){var e;if(t.property)return(e=this.lookupProperty(t.name))?this.visit(e.expr.clone()):qt.null;if(t.val.isNull){var n=this.lookup(t.name);return n&&t.mixin&&this.mixinNode(n),n?this.visit(n):t}return this.return++,t.val=this.visit(t.val),this.return--,this.currentScope.add(t),t.val},H.prototype.visitBinOp=function(t){if("is defined"==t.op)return this.isDefined(t.left);this.return++;var e=t.op,n=this.visit(t.left),i="||"==e||"&&"==e?t.right:this.visit(t.right),r=t.val?this.visit(t.val):null;this.return--;try{return this.visit(n.operate(e,i,r))}catch(t){if("CoercionError"==t.name)switch(e){case"==":return qt.false;case"!=":return qt.true}throw t}},H.prototype.visitUnaryOp=function(t){var e=t.op,n=this.visit(t.expr);switch("!"!=e&&(n=n.first.clone(),_export_assertType_(n,"unit")),e){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},H.prototype.visitTernary=function(t){return this.visit(t.cond).toBoolean().isTrue?this.visit(t.trueExpr):this.visit(t.falseExpr)},H.prototype.visitExpression=function(t){for(var e=0,n=t.nodes.length;e<n;++e)t.nodes[e]=this.visit(t.nodes[e]);return this.castable(t)&&(t=this.cast(t)),t},H.prototype.visitArguments=H.prototype.visitExpression,H.prototype.visitProperty=function(t){var e=this.interpolate(t),n=this.lookup(e),i=n&&"function"==n.first.nodeName,r=~this.calling.indexOf(e),o=this.property;if(!i||r||t.literal)return this.return++,t.name=e,t.literal=!0,this.property=t,t.expr=this.visit(t.expr),this.property=o,this.return--,t;var a=qt.Arguments.fromExpression(_export_unwrap_(t.expr.clone()));t.name=e,this.property=t,this.return++,this.property.expr=this.visit(t.expr),this.return--;var h=this.visit(new qt.Call(e,a));return this.property=o,h},H.prototype.visitRoot=function(t){if(t!=this.root)return t.constructor=qt.Block,this.visit(t);for(var e=0;e<t.nodes.length;++e)t.index=e,t.nodes[e]=this.visit(t.nodes[e]);return t},H.prototype.visitBlock=function(t){for(this.stack.push(new h(t)),t.index=0;t.index<t.nodes.length;++t.index)try{t.nodes[t.index]=this.visit(t.nodes[t.index])}catch(e){if("return"==e.nodeName){if(this.return)throw this.stack.pop(),e;t.nodes[t.index]=e;break}throw e}return this.stack.pop(),t},H.prototype.visitAtblock=function(t){return t.block=this.visit(t.block),t},H.prototype.visitAtrule=function(t){return t.val=this.interpolate(t),t.block&&(t.block=this.visit(t.block)),t},H.prototype.visitSupports=function(t){var e,n=t.condition;return this.return++,t.condition=this.visit(n),this.return--,e=n.first,1==n.nodes.length&&"string"==e.nodeName&&(t.condition=e.string),t.block=this.visit(t.block),t},H.prototype.visitIf=function(t){var e,n=this.currentBlock,i=t.negate;this.return++;var r=this.visit(t.cond).first.toBoolean();if(this.return--,t.block.scope=t.block.hasMedia,i)r.isFalse&&(e=this.visit(t.block));else if(r.isTrue)e=this.visit(t.block);else if(t.elses.length)for(var o,a=t.elses,h=a.length,l=0;l<h;++l)if(a[l].cond){if(a[l].block.scope=a[l].block.hasMedia,this.return++,o=this.visit(a[l].cond).first.toBoolean(),this.return--,o.isTrue){e=this.visit(a[l].block);break}}else a[l].scope=a[l].hasMedia,e=this.visit(a[l]);return e&&!t.postfix&&n.node&&~["group","atrule","media","supports","keyframes"].indexOf(n.node.nodeName)?(this.mixin(e.nodes,n),qt.null):e||qt.null},H.prototype.visitExtend=function(t){var e=this.currentBlock;return"group"!=e.node.nodeName&&(e=this.closestGroup),t.selectors.forEach((function(t){e.node.extends.push({selector:this.interpolate(t.clone()).trim(),optional:t.optional,lineno:t.lineno,column:t.column})}),this),qt.null},H.prototype.visitImport=function(t){this.return++;var e,n,i=this.visit(t.path).first,r=t.once?"require":"import";if(this.return--,"url"==i.name){if(t.once)throw new Error("You cannot @require a url");return t}if(!i.string)throw new Error("@"+r+" string expected");var o=i=i.string;if(/(?:url\s*\(\s*)?['"]?(?:#|(?:https?:)?\/\/)/i.test(i)){if(t.once)throw new Error("You cannot @require a url");return t}if(/\.css(?:"|$)/.test(i)&&(n=!0,!t.once&&!this.includeCSS))return t;if(n||/\.styl$/i.test(i)||(i+=".styl"),(e=_export_find_(i,this.paths,this.filename))||(e=_export_lookupIndex_(o,this.paths,this.filename)),!e)throw new Error("failed to locate @"+r+" file "+i);for(var a=new qt.Block,h=0,l=e.length;h<l;++h)a.push(importFile.call(this,t,e[h],n));return a},H.prototype.invokeFunction=function(t,e,n){var i=new qt.Block(t.block.parent),r=t.block.clone(i),o=this.stack.currentFrame.block;this.stack.push(new h(i));var a=this.currentScope;if("arguments"!=e.nodeName&&((c=new qt.Expression).push(e),e=qt.Arguments.fromExpression(c)),a.add(new qt.Ident("arguments",e)),a.add(new qt.Ident("mixin",this.return?qt.false:new qt.String(o.nodeName))),this.property){var l=this.propertyExpression(this.property,t.name);a.add(new qt.Ident("current-property",l))}else a.add(new qt.Ident("current-property",qt.null));for(var c=new qt.Expression,u=this.calling.length-1;u--;)c.push(new qt.Literal(this.calling[u]));a.add(new qt.Ident("called-from",c)),u=0;var f=e.nodes.length;return t.params.nodes.forEach((function(n){if(n.rest){for(n.val=new qt.Expression;u<f;++u)n.val.push(e.nodes[u]);n.val.preserve=!0,n.val.isList=e.isList}else{var i=e.map[n.name]||e.nodes[u++];if(n=n.clone(),i?i.isEmpty?e.nodes[u-1]=this.visit(n):n.val=i:e.push(n.val),n.val.isNull)throw new Error('argument "'+n+'" required for '+t)}a.add(n)}),this),n&&a.add(new qt.Ident("block",n,!0)),this.invoke(r,!0,t.filename)},H.prototype.invokeBuiltin=function(t,e){t.raw?e=e.nodes:(t.params||(t.params=function(t){return t.toString().match(/\(([^)]*)\)/)[1].split(/ *, */)}(t)),e=t.params.reduce((function(t,n){var i=e.map[n]||e.nodes.shift();if(i){var r=(i=_export_unwrap_(i)).nodes.length;if(r>1)for(var o=0;o<r;++o)t.push(_export_unwrap_(i.nodes[o].first));else t.push(i.first)}return t}),[]));var n=_export_coerce_(t.apply(this,e)),i=new qt.Expression;return i.push(n),n=i,this.invoke(n)},H.prototype.invoke=function(t,e,n){var i;return n&&this.paths.push(J(n)),this.return?(i=this.eval(t.nodes),e&&this.stack.pop()):(t=this.visit(t),e&&this.stack.pop(),this.mixin(t.nodes,this.currentBlock),i=qt.null),n&&this.paths.pop(),i},H.prototype.mixin=function(t,e){if(t.length){var n=e.nodes.length,i=e.nodes.slice(0,e.index),r=e.nodes.slice(e.index+1,n);this._mixin(t,i,e),e.index=0,e.nodes=i.concat(r)}},H.prototype._mixin=function(t,e,n){for(var i,r=t.length,o=0;o<r;++o)switch((i=t[o]).nodeName){case"return":return;case"block":this._mixin(i.nodes,e,n);break;case"media":var a=i.block.parent.node;a&&"call"!=a.nodeName&&(i.block.parent=n);case"property":var h=i.expr;i.literal&&"block"==h.first.name&&((h=_export_unwrap_(h)).nodes[0]=new qt.Literal("block"));default:e.push(i)}},H.prototype.mixinNode=function(t){switch((t=this.visit(t.first)).nodeName){case"object":return this.mixinObject(t),qt.null;case"block":case"atblock":return this.mixin(t.nodes,this.currentBlock),qt.null}},H.prototype.mixinObject=function(t){var e,n=Dt,i=this.root,r="$block "+t.toBlock(),o=new n(r,_export_merge_({root:e},this.options));try{e=o.parse()}catch(t){throw t.filename=this.filename,t.lineno=o.lexer.lineno,t.column=o.lexer.column,t.input=r,t}e.parent=i,e.scope=!1;for(var a=this.visit(e).first.nodes,h=0,l=a.length;h<l;++h)if(a[h].block){this.mixin(a[h].block.nodes,this.currentBlock);break}},H.prototype.eval=function(t){if(!t)return qt.null;var e=t.length,n=qt.null;try{for(var i=0;i<e;++i)switch((n=t[i]).nodeName){case"if":if("block"!=n.block.nodeName){n=this.visit(n);break}case"each":case"block":(n=this.visit(n)).nodes&&(n=this.eval(n.nodes));break;default:n=this.visit(n)}}catch(t){if("return"==t.nodeName)return t.expr;throw t}return n},H.prototype.literalCall=function(t){return t.args=this.visit(t.args),t},H.prototype.lookupProperty=function(t){for(var e,n,i,r=this.stack.length,o=this.currentBlock.index,a=r;r--;)if((n=this.stack[r].block).node)switch(n.node.nodeName){case"group":case"function":case"if":case"each":case"atrule":case"media":case"atblock":case"call":if(e=n.nodes,r+1==a){for(;o--;)if(this.property!=e[o]&&t==this.interpolate(e[o]))return e[o].clone()}else for(i=e.length;i--;)if("property"==e[i].nodeName&&this.property!=e[i]&&t==this.interpolate(e[i]))return e[i].clone()}return e.null},H.prototype.__defineGetter__("closestBlock",(function(){for(var t,e=this.stack.length;e--;)if((t=this.stack[e].block).node)switch(t.node.nodeName){case"group":case"keyframes":case"atrule":case"atblock":case"media":case"call":return t}})),H.prototype.__defineGetter__("closestGroup",(function(){for(var t,e=this.stack.length;e--;)if((t=this.stack[e].block).node&&"group"==t.node.nodeName)return t})),H.prototype.__defineGetter__("selectorStack",(function(){for(var t,e=[],n=0,i=this.stack.length;n<i;++n)(t=this.stack[n].block).node&&"group"==t.node.nodeName&&(t.node.nodes.forEach((function(t){t.val||(t.val=this.interpolate(t))}),this),e.push(t.node.nodes));return e})),H.prototype.lookup=function(t){var e;if(!this.ignoreColors||!(t in q))return(e=this.stack.lookup(t))?_export_unwrap_(e):this.lookupFunction(t)},H.prototype.interpolate=function(t){var e=this,n="selector"==t.nodeName;function toString(t){switch(t.nodeName){case"function":case"ident":return t.name;case"literal":case"string":return!e.prefix||t.prefixed||t.val.nodeName||(t.val=t.val.replace(/\.(?=[\w-])|^\.$/g,"."+e.prefix),t.prefixed=!0),t.val;case"unit":return"%"==t.type?t.val+"%":t.val;case"member":return toString(e.visit(t));case"expression":if(e.calling&&~e.calling.indexOf("selector")&&e._selector)return e._selector;e.return++;var i=toString(e.visit(t).first);return e.return--,n&&(e._selector=i),i}}return t.segments?t.segments.map(toString).join(""):toString(t)},H.prototype.lookupFunction=function(t){var e=this.functions[t]||F[t];if(e)return new qt.Function(t,e)},H.prototype.isDefined=function(t){if("ident"==t.nodeName)return qt.Boolean(this.lookup(t.name));throw new Error('invalid "is defined" check on non-variable '+t)},H.prototype.propertyExpression=function(t,e){var n=new qt.Expression,i=t.expr.clone();return n.push(new qt.String(t.name)),function replace(t){return"call"==t.nodeName&&e==t.name?new qt.Literal("__CALL__"):(t.nodes&&(t.nodes=t.nodes.map(replace)),t)}(i),n.push(i),n},H.prototype.cast=function(t){return new qt.Unit(t.first.val,t.nodes[1].name)},H.prototype.castable=function(t){return 2==t.nodes.length&&"unit"==t.first.nodeName&&~r.indexOf(t.nodes[1].name)},H.prototype.warn=function(t){this.warnings&&console.warn("[33mWarning:[0m "+t)},H.prototype.__defineGetter__("currentBlock",(function(){return this.stack.currentFrame.block})),H.prototype.__defineGetter__("vendors",(function(){return this.lookup("vendors").nodes.map((function(t){return t.string}))})),H.prototype.unvendorize=function(t){for(var e=0,n=this.vendors.length;e<n;e++)if("official"!=this.vendors[e]){var i="-"+this.vendors[e]+"-";if(~t.indexOf(i))return t.replace(i,"")}return t},H.prototype.__defineGetter__("currentScope",(function(){return this.stack.currentFrame.scope})),H.prototype.__defineGetter__("currentFrame",(function(){return this.stack.currentFrame})),CoercionError.prototype.__proto__=Error.prototype;var W=function Node(){this.lineno=qt.lineno||1,this.column=qt.column||1,this.filename=qt.filename};W.prototype={constructor:W,get first(){return this},get hash(){return this.val},get nodeName(){return this.constructor.name.toLowerCase()},clone:function(){return this},toJSON:function(){return{lineno:this.lineno,column:this.column,filename:this.filename}},eval:function(){return new H(this).evaluate()},toBoolean:function(){return qt.true},toExpression:function(){if("expression"==this.nodeName)return this;var t=new qt.Expression;return t.push(this),t},shouldCoerce:function(t){switch(t){case"is a":case"in":case"||":case"&&":return!1;default:return!0}},operate:function(t,e){switch(t){case"is a":if("string"==e.first.nodeName)return qt.Boolean(this.nodeName==e.val);throw new Error('"is a" expects a string, got '+e.toString());case"==":return qt.Boolean(this.hash==e.hash);case"!=":return qt.Boolean(this.hash!=e.hash);case">=":return qt.Boolean(this.hash>=e.hash);case"<=":return qt.Boolean(this.hash<=e.hash);case">":return qt.Boolean(this.hash>e.hash);case"<":return qt.Boolean(this.hash<e.hash);case"||":return this.toBoolean().isTrue?this:e;case"in":var n=_export_unwrap_(e).nodes,i=n&&n.length,r=this.hash;if(!n)throw new Error('"in" given invalid right-hand operand, expecting an expression');if(1==i&&"object"==n[0].nodeName)return qt.Boolean(n[0].has(this.hash));for(var o=0;o<i;++o)if(r==n[o].hash)return qt.true;return qt.false;case"&&":var a=this.toBoolean(),h=e.toBoolean();return a.isTrue&&h.isTrue?e:a.isFalse?this:e;default:if("[]"==t)var l="cannot perform "+this+"["+e+"]";else l="cannot perform "+this+" "+t+" "+e;throw new Error(l)}},coerce:function(t){if(t.nodeName==this.nodeName)return t;throw new CoercionError("cannot coerce "+t+" to "+this.nodeName)}};var D=function Root(){this.nodes=[]};D.prototype.__proto__=W.prototype,D.prototype.push=function(t){this.nodes.push(t)},D.prototype.unshift=function(t){this.nodes.unshift(t)},D.prototype.clone=function(){var t=new D;return t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,this.nodes.forEach((function(e){t.push(e.clone(t,t))})),t},D.prototype.toString=function(){return"[Root]"},D.prototype.toJSON=function(){return{__type:"Root",nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}};var K=function Null(){};K.prototype.__proto__=W.prototype,K.prototype.inspect=K.prototype.toString=function(){return"null"},K.prototype.toBoolean=function(){return qt.false},K.prototype.__defineGetter__("isNull",(function(){return!0})),K.prototype.__defineGetter__("hash",(function(){return null})),K.prototype.toJSON=function(){return{__type:"Null",lineno:this.lineno,column:this.column,filename:this.filename}};var V=function Each(t,e,n,i){W.call(this),this.val=t,this.key=e,this.expr=n,this.block=i};V.prototype.__proto__=W.prototype,V.prototype.clone=function(t){var e=new V(this.val,this.key);return e.expr=this.expr.clone(t,e),e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},V.prototype.toJSON=function(){return{__type:"Each",val:this.val,key:this.key,expr:this.expr,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}};var Z=function If(t,e){W.call(this),this.cond=t,this.elses=[],e&&e.nodeName?this.block=e:this.negate=e};Z.prototype.__proto__=W.prototype,Z.prototype.clone=function(t){var e=new Z;return e.cond=this.cond.clone(t,e),e.block=this.block.clone(t,e),e.elses=this.elses.map((function(n){return n.clone(t,e)})),e.negate=this.negate,e.postfix=this.postfix,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Z.prototype.toJSON=function(){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}};var Y=function Call(t,e){W.call(this),this.name=t,this.args=e};Y.prototype.__proto__=W.prototype,Y.prototype.clone=function(t){var e=new Y(this.name);return e.args=this.args.clone(t,e),this.block&&(e.block=this.block.clone(t,e)),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Y.prototype.toString=function(){var t=this.args.nodes.map((function(t){var e=t.toString();return e.slice(1,e.length-1)})).join(", ");return this.name+"("+t+")"},Y.prototype.toJSON=function(){var t={__type:"Call",name:this.name,args:this.args,lineno:this.lineno,column:this.column,filename:this.filename};return this.block&&(t.block=this.block),t};var X=function UnaryOp(t,e){W.call(this),this.op=t,this.expr=e};X.prototype.__proto__=W.prototype,X.prototype.clone=function(t){var e=new X(this.op);return e.expr=this.expr.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},X.prototype.toJSON=function(){return{__type:"UnaryOp",op:this.op,expr:this.expr,lineno:this.lineno,column:this.column,filename:this.filename}};var tt=function BinOp(t,e,n){W.call(this),this.op=t,this.left=e,this.right=n};tt.prototype.__proto__=W.prototype,tt.prototype.clone=function(t){var e=new tt(this.op);return e.left=this.left.clone(t,e),e.right=this.right&&this.right.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,this.val&&(e.val=this.val.clone(t,e)),e},tt.prototype.toString=function(){return this.left.toString()+" "+this.op+" "+this.right.toString()},tt.prototype.toJSON=function(){var t={__type:"BinOp",left:this.left,right:this.right,op:this.op,lineno:this.lineno,column:this.column,filename:this.filename};return this.val&&(t.val=this.val),t};var et=function Ternary(t,e,n){W.call(this),this.cond=t,this.trueExpr=e,this.falseExpr=n};et.prototype.__proto__=W.prototype,et.prototype.clone=function(t){var e=new et;return e.cond=this.cond.clone(t,e),e.trueExpr=this.trueExpr.clone(t,e),e.falseExpr=this.falseExpr.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},et.prototype.toJSON=function(){return{__type:"Ternary",cond:this.cond,trueExpr:this.trueExpr,falseExpr:this.falseExpr,lineno:this.lineno,column:this.column,filename:this.filename}};var nt=function Block(t,e){W.call(this),this.nodes=[],this.parent=t,this.node=e,this.scope=!0};nt.prototype.__proto__=W.prototype,nt.prototype.__defineGetter__("hasProperties",(function(){for(var t=0,e=this.nodes.length;t<e;++t)if("property"==this.nodes[t].nodeName)return!0})),nt.prototype.__defineGetter__("hasMedia",(function(){for(var t=0,e=this.nodes.length;t<e;++t)if("media"==this.nodes[t].nodeName)return!0;return!1})),nt.prototype.__defineGetter__("isEmpty",(function(){return!this.nodes.length||this.nodes.every((function(t){return"comment"==t.nodeName}))})),nt.prototype.clone=function(t,e){t=t||this.parent;var n=new nt(t,e||this.node);return n.lineno=this.lineno,n.column=this.column,n.filename=this.filename,n.scope=this.scope,this.nodes.forEach((function(t){n.push(t.clone(n,n))})),n},nt.prototype.push=function(t){this.nodes.push(t)},nt.prototype.toJSON=function(){return{__type:"Block",scope:this.scope,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}};var it={mm:{val:1,label:"mm"},cm:{val:10,label:"mm"},in:{val:25.4,label:"mm"},pt:{val:25.4/72,label:"mm"},ms:{val:1,label:"ms"},s:{val:1e3,label:"ms"},Hz:{val:1,label:"Hz"},kHz:{val:1e3,label:"Hz"}},rt=function Unit(t,e){W.call(this),this.val=t,this.type=e};rt.prototype.__proto__=W.prototype,rt.prototype.toBoolean=function(){return qt.Boolean(!!this.type||this.val)},rt.prototype.toString=function(){return this.val+(this.type||"")},rt.prototype.clone=function(){var t=new rt(this.val,this.type);return t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},rt.prototype.toJSON=function(){return{__type:"Unit",val:this.val,type:this.type,lineno:this.lineno,column:this.column,filename:this.filename}},rt.prototype.operate=function(t,e){var n=this.type||e.first.type;if("rgba"==e.nodeName||"hsla"==e.nodeName)return e.operate(t,this);if(this.shouldCoerce(t))switch(e=e.first,e="%"==this.type||"-"!=t&&"+"!=t||"%"!=e.type?this.coerce(e):new rt(this.val*(e.val/100),"%"),t){case"-":return new rt(this.val-e.val,n);case"+":return n=n||"%"==e.type&&e.type,new rt(this.val+e.val,n);case"/":return new rt(this.val/e.val,n);case"*":return new rt(this.val*e.val,n);case"%":return new rt(this.val%e.val,n);case"**":return new rt(Math.pow(this.val,e.val),n);case"..":case"...":var i=this.val,r=e.val,o=new qt.Expression,a=".."==t;if(i<r)do{o.push(new qt.Unit(i))}while(a?++i<=r:++i<r);else do{o.push(new qt.Unit(i))}while(a?--i>=r:--i>r);return o}return W.prototype.operate.call(this,t,e)},rt.prototype.coerce=function(t){if("unit"==t.nodeName){var e=this,n=t,i=it[e.type],r=it[n.type];if(i&&r&&i.label==r.label){var o=n.val*(r.val/i.val);return new qt.Unit(o,e.type)}return new qt.Unit(n.val,e.type)}if("string"==t.nodeName){if("%"==t.val)return new qt.Unit(0,"%");var a=parseFloat(t.val);return isNaN(a)&&W.prototype.coerce.call(this,t),new qt.Unit(a)}return W.prototype.coerce.call(this,t)};
|
||
/*!
|
||
* Stylus - String
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var st=F.s,ot=function String(t,e){W.call(this),this.val=t,this.string=t,this.prefixed=!1,this.quote="string"!=typeof e?"'":e};let at;ot.prototype.__proto__=W.prototype,ot.prototype.toString=function(){return this.quote+this.val+this.quote},ot.prototype.clone=function(){var t=new ot(this.val,this.quote);return t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},ot.prototype.toJSON=function(){return{__type:"String",val:this.val,quote:this.quote,lineno:this.lineno,column:this.column,filename:this.filename}},ot.prototype.toBoolean=function(){return qt.Boolean(this.val.length)},ot.prototype.coerce=function(t){switch(t.nodeName){case"string":return t;case"expression":return new ot(t.nodes.map((function(t){return this.coerce(t).val}),this).join(" "));default:return new ot(t.toString())}},ot.prototype.operate=function(t,e){switch(t){case"%":(i=new qt.Expression).push(this);var n="expression"==e.nodeName?_export_unwrap_(e).nodes:[e];return st.apply(null,[i].concat(n));case"+":var i;return(i=new qt.Expression).push(new ot(this.val+this.coerce(e).val)),i;default:return W.prototype.operate.call(this,t,e)}};var ht=at=at=function HSLA(t,e,n,i){W.call(this),this.h=clampDegrees(t),this.s=clampPercentage(e),this.l=clampPercentage(n),this.a=function clampAlpha$1(t){return Math.max(0,Math.min(t,1))}(i),this.hsla=this};function clampDegrees(t){return(t%=360)>=0?t:360+t}function clampPercentage(t){return Math.max(0,Math.min(t,100))}ht.prototype.__proto__=W.prototype,ht.prototype.toString=function(){return"hsla("+this.h+","+this.s.toFixed(0)+"%,"+this.l.toFixed(0)+"%,"+this.a+")"},ht.prototype.clone=function(t){var e=new ht(this.h,this.s,this.l,this.a);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},ht.prototype.toJSON=function(){return{__type:"HSLA",h:this.h,s:this.s,l:this.l,a:this.a,lineno:this.lineno,column:this.column,filename:this.filename}},ht.prototype.__defineGetter__("rgba",(function(){return qt.RGBA.fromHSLA(this)})),ht.prototype.__defineGetter__("hash",(function(){return this.rgba.toString()})),ht.prototype.add=function(t,e,n){return new ht(this.h+t,this.s+e,this.l+n,this.a)},ht.prototype.sub=function(t,e,n){return this.add(-t,-e,-n)},ht.prototype.operate=function(t,e){switch(t){case"==":case"!=":case"<=":case">=":case"<":case">":case"is a":case"||":case"&&":return this.rgba.operate(t,e);default:return this.rgba.operate(t,e).hsla}},at.fromRGBA=function(t){var e,n,i=t.r/255,r=t.g/255,o=t.b/255,a=t.a,h=Math.min(i,r,o),l=Math.max(i,r,o),c=(l+h)/2,u=l-h;switch(l){case h:e=0;break;case i:e=60*(r-o)/u;break;case r:e=60*(o-i)/u+120;break;case o:e=60*(i-r)/u+240}return n=l==h?0:c<.5?u/(2*c):u/(2-2*c),new ht(e%=360,n*=100,c*=100,a)},ht.prototype.adjustLightness=function(t){return this.l=clampPercentage(this.l+this.l*(t/100)),this},ht.prototype.adjustHue=function(t){return this.h=clampDegrees(this.h+t),this};var lt=F.adjust;let ct;var pt=ct=ct=function RGBA(t,e,n,i){W.call(this),this.r=clamp(t),this.g=clamp(e),this.b=clamp(n),this.a=function clampAlpha(t){return Math.max(0,Math.min(t,1))}(i),this.name="",this.rgba=this};function clamp(t){return Math.max(0,Math.min(t.toFixed(0),255))}pt.prototype.__proto__=W.prototype,pt.withoutClamping=function(t,e,n,i){var r=new pt(0,0,0,0);return r.r=t,r.g=e,r.b=n,r.a=i,r},pt.prototype.clone=function(){var t=new pt(this.r,this.g,this.b,this.a);return t.raw=this.raw,t.name=this.name,t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},pt.prototype.toJSON=function(){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}},pt.prototype.toBoolean=function(){return qt.true},pt.prototype.__defineGetter__("hsla",(function(){return at.fromRGBA(this)})),pt.prototype.__defineGetter__("hash",(function(){return this.toString()})),pt.prototype.add=function(t,e,n,i){return new pt(this.r+t,this.g+e,this.b+n,this.a+i)},pt.prototype.sub=function(t,e,n,i){return new pt(this.r-t,this.g-e,this.b-n,1==i?this.a:this.a-i)},pt.prototype.multiply=function(t){return new pt(this.r*t,this.g*t,this.b*t,this.a)},pt.prototype.divide=function(t){return new pt(this.r/t,this.g/t,this.b/t,this.a)},pt.prototype.operate=function(t,e){switch("in"!=t&&(e=e.first),t){case"is a":if("string"==e.nodeName&&"color"==e.string)return qt.true;break;case"+":switch(e.nodeName){case"unit":var n=e.val;switch(e.type){case"%":return lt(this,new qt.String("lightness"),e);case"deg":return this.hsla.adjustHue(n).rgba;default:return this.add(n,n,n,0)}case"rgba":return this.add(e.r,e.g,e.b,e.a);case"hsla":return this.hsla.add(e.h,e.s,e.l)}break;case"-":switch(e.nodeName){case"unit":switch(n=e.val,e.type){case"%":return lt(this,new qt.String("lightness"),new qt.Unit(-n,"%"));case"deg":return this.hsla.adjustHue(-n).rgba;default:return this.sub(n,n,n,0)}case"rgba":return this.sub(e.r,e.g,e.b,e.a);case"hsla":return this.hsla.sub(e.h,e.s,e.l)}break;case"*":if("unit"===e.nodeName)return this.multiply(e.val);break;case"/":if("unit"===e.nodeName)return this.divide(e.val)}return W.prototype.operate.call(this,t,e)},pt.prototype.toString=function(){function pad(t){return t<16?"0"+t.toString(16):t.toString(16)}if("transparent"==this.name)return this.name;if(1==this.a){var t=pad(this.r),e=pad(this.g),n=pad(this.b);return t[0]==t[1]&&e[0]==e[1]&&n[0]==n[1]?"#"+t[0]+e[0]+n[0]:"#"+t+e+n}return"rgba("+this.r+","+this.g+","+this.b+","+ +this.a.toFixed(3)+")"},ct.fromHSLA=function(t){var e=t.h/360,n=t.s/100,i=t.l/100,r=t.a,o=i<=.5?i*(n+1):i+n-i*n,a=2*i-o,h=255*hue(e+1/3),l=255*hue(e),c=255*hue(e-1/3);function hue(t){return t<0&&++t,t>1&&--t,6*t<1?a+(o-a)*t*6:2*t<1?o:3*t<2?a+(o-a)*(2/3-t)*6:a}return new pt(h,l,c,r)};var ut=function Ident(t,e,n){W.call(this),this.name=t,this.string=t,this.val=e||qt.null,this.mixin=!!n};ut.prototype.__defineGetter__("isEmpty",(function(){return null==this.val})),ut.prototype.__defineGetter__("hash",(function(){return this.name})),ut.prototype.__proto__=W.prototype,ut.prototype.clone=function(t){var e=new ut(this.name);return e.val=this.val.clone(t,e),e.mixin=this.mixin,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.property=this.property,e.rest=this.rest,e},ut.prototype.toJSON=function(){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}},ut.prototype.toString=function(){return this.name},ut.prototype.coerce=function(t){switch(t.nodeName){case"ident":case"string":case"literal":return new ut(t.string);case"unit":return new ut(t.toString());default:return W.prototype.coerce.call(this,t)}},ut.prototype.operate=function(t,e){var n=e.first;switch(t){case"-":if("unit"==n.nodeName){var i=new qt.Expression;return(n=n.clone()).val=-n.val,i.push(this),i.push(n),i}case"+":return new qt.Ident(this.string+this.coerce(n).string)}return W.prototype.operate.call(this,t,e)};var ft=function Group(){W.call(this),this.nodes=[],this.extends=[]};ft.prototype.__proto__=W.prototype,ft.prototype.push=function(t){this.nodes.push(t)},ft.prototype.__defineGetter__("block",(function(){return this.nodes[0].block})),ft.prototype.__defineSetter__("block",(function(t){for(var e=0,n=this.nodes.length;e<n;++e)this.nodes[e].block=t})),ft.prototype.__defineGetter__("hasOnlyPlaceholders",(function(){return this.nodes.every((function(t){return t.isPlaceholder}))})),ft.prototype.clone=function(t){var e=new ft;return e.lineno=this.lineno,e.column=this.column,this.nodes.forEach((function(n){e.push(n.clone(t,e))})),e.filename=this.filename,e.block=this.block.clone(t,e),e},ft.prototype.toJSON=function(){return{__type:"Group",nodes:this.nodes,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}};var dt=function Literal(t){W.call(this),this.val=t,this.string=t,this.prefixed=!1};dt.prototype.__proto__=W.prototype,dt.prototype.__defineGetter__("hash",(function(){return this.val})),dt.prototype.toString=function(){return this.val.toString()},dt.prototype.coerce=function(t){switch(t.nodeName){case"ident":case"string":case"literal":return new dt(t.string);default:return W.prototype.coerce.call(this,t)}},dt.prototype.operate=function(t,e){var n=e.first;return"+"===t?new qt.Literal(this.string+this.coerce(n).string):W.prototype.operate.call(this,t,e)},dt.prototype.toJSON=function(){return{__type:"Literal",val:this.val,string:this.string,prefixed:this.prefixed,lineno:this.lineno,column:this.column,filename:this.filename}};var mt=function Boolean(t){if(W.call(this),!this.nodeName)return new Boolean(t);this.val=!!t};mt.prototype.__proto__=W.prototype,mt.prototype.toBoolean=function(){return this},mt.prototype.__defineGetter__("isTrue",(function(){return this.val})),mt.prototype.__defineGetter__("isFalse",(function(){return!this.val})),mt.prototype.negate=function(){return new mt(!this.val)},mt.prototype.inspect=function(){return"[Boolean "+this.val+"]"},mt.prototype.toString=function(){return this.val?"true":"false"},mt.prototype.toJSON=function(){return{__type:"Boolean",val:this.val}};var vt=function Return(t){this.expr=t||qt.null};vt.prototype.__proto__=W.prototype,vt.prototype.clone=function(t){var e=new vt;return e.expr=this.expr.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},vt.prototype.toJSON=function(){return{__type:"Return",expr:this.expr,lineno:this.lineno,column:this.column,filename:this.filename}};
|
||
/*!
|
||
* Stylus - at-rule
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var yt=function Atrule(t){W.call(this),this.type=t};function hasOutput(t){var e=t.nodes;return!e.every((function(t){return"group"==t.nodeName&&t.hasOnlyPlaceholders}))&&e.some((function(t){switch(t.nodeName){case"property":case"literal":case"import":return!0;case"block":return hasOutput(t);default:if(t.block)return hasOutput(t.block)}}))}yt.prototype.__proto__=W.prototype,yt.prototype.__defineGetter__("hasOnlyProperties",(function(){if(!this.block)return!1;for(var t=this.block.nodes,e=0,n=t.length;e<n;++e)switch(t[e].nodeName,t[e].nodeName){case"property":case"expression":case"comment":continue;default:return!1}return!0})),yt.prototype.clone=function(t){var e=new yt(this.type);return this.block&&(e.block=this.block.clone(t,e)),e.segments=this.segments.map((function(n){return n.clone(t,e)})),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},yt.prototype.toJSON=function(){var t={__type:"Atrule",type:this.type,segments:this.segments,lineno:this.lineno,column:this.column,filename:this.filename};return this.block&&(t.block=this.block),t},yt.prototype.toString=function(){return"@"+this.type},yt.prototype.__defineGetter__("hasOutput",(function(){return!!this.block&&hasOutput(this.block)}));var gt=function Media(t){yt.call(this,"media"),this.val=t};gt.prototype.__proto__=yt.prototype,gt.prototype.clone=function(t){var e=new gt;return e.val=this.val.clone(t,e),e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},gt.prototype.toJSON=function(){return{__type:"Media",val:this.val,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}},gt.prototype.toString=function(){return"@media "+this.val};var kt=function QueryList(){W.call(this),this.nodes=[]};kt.prototype.__proto__=W.prototype,kt.prototype.clone=function(t){var e=new kt;e.lineno=this.lineno,e.column=this.column,e.filename=this.filename;for(var n=0;n<this.nodes.length;++n)e.push(this.nodes[n].clone(t,e));return e},kt.prototype.push=function(t){this.nodes.push(t)},kt.prototype.merge=function(t){var e,n=new kt;return this.nodes.forEach((function(i){for(var r=0,o=t.nodes.length;r<o;++r)(e=i.merge(t.nodes[r]))&&n.push(e)})),n},kt.prototype.toString=function(){return"("+this.nodes.map((function(t){return t.toString()})).join(", ")+")"},kt.prototype.toJSON=function(){return{__type:"QueryList",nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}};var wt=function Query(){W.call(this),this.nodes=[],this.type="",this.predicate=""};wt.prototype.__proto__=W.prototype,wt.prototype.clone=function(t){var e=new wt;e.predicate=this.predicate,e.type=this.type;for(var n=0,i=this.nodes.length;n<i;++n)e.push(this.nodes[n].clone(t,e));return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},wt.prototype.push=function(t){this.nodes.push(t)},wt.prototype.__defineGetter__("resolvedType",(function(){if(this.type)return this.type.nodeName?this.type.string:this.type})),wt.prototype.__defineGetter__("resolvedPredicate",(function(){if(this.predicate)return this.predicate.nodeName?this.predicate.string:this.predicate})),wt.prototype.merge=function(t){var e,n,i=new wt,r=this.resolvedPredicate,o=t.resolvedPredicate,a=this.resolvedType,h=t.resolvedType;if(a=a||h,h=h||a,"not"==r^"not"==o){if(a==h)return;e="not"==r?h:a,n="not"==r?o:r}else if("not"==r&&"not"==o){if(a!=h)return;e=a,n="not"}else{if(a!=h)return;e=a,n=r||o}return i.predicate=n,i.type=e,i.nodes=this.nodes.concat(t.nodes),i},wt.prototype.toString=function(){var t=this.predicate?this.predicate+" ":"",e=this.type||"",n=t+e;return this.nodes.length&&(n+=(e&&" and ")+this.nodes.map((function(t){return t.toString()})).join(" and ")),n},wt.prototype.toJSON=function(){return{__type:"Query",predicate:this.predicate,type:this.type,nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}};var bt=function Feature(t){W.call(this),this.segments=t,this.expr=null};bt.prototype.__proto__=W.prototype,bt.prototype.clone=function(t){var e=new bt;return e.segments=this.segments.map((function(n){return n.clone(t,e)})),this.expr&&(e.expr=this.expr.clone(t,e)),this.name&&(e.name=this.name),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},bt.prototype.toString=function(){return this.expr?"("+this.segments.join("")+": "+this.expr.toString()+")":this.segments.join("")},bt.prototype.toJSON=function(){var t={__type:"Feature",segments:this.segments,lineno:this.lineno,column:this.column,filename:this.filename};return this.expr&&(t.expr=this.expr),this.name&&(t.name=this.name),t};var xt=function Params(){W.call(this),this.nodes=[]};xt.prototype.__defineGetter__("length",(function(){return this.nodes.length})),xt.prototype.__proto__=W.prototype,xt.prototype.push=function(t){this.nodes.push(t)},xt.prototype.clone=function(t){var e=new xt;return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,this.nodes.forEach((function(n){e.push(n.clone(t,e))})),e},xt.prototype.toJSON=function(){return{__type:"Params",nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}};var _t=function Comment(t,e,n){W.call(this),this.str=t,this.suppress=e,this.inline=n};_t.prototype.__proto__=W.prototype,_t.prototype.toJSON=function(){return{__type:"Comment",str:this.str,suppress:this.suppress,inline:this.inline,lineno:this.lineno,column:this.column,filename:this.filename}},_t.prototype.toString=function(){return this.str};var St=function Keyframes(t,e){yt.call(this,"keyframes"),this.segments=t,this.prefix=e||"official"};St.prototype.__proto__=yt.prototype,St.prototype.clone=function(t){var e=new St;return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.segments=this.segments.map((function(n){return n.clone(t,e)})),e.prefix=this.prefix,e.block=this.block.clone(t,e),e},St.prototype.toJSON=function(){return{__type:"Keyframes",segments:this.segments,prefix:this.prefix,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}},St.prototype.toString=function(){return"@keyframes "+this.segments.join("")};var Et=function Member(t,e){W.call(this),this.left=t,this.right=e};Et.prototype.__proto__=W.prototype,Et.prototype.clone=function(t){var e=new Et;return e.left=this.left.clone(t,e),e.right=this.right.clone(t,e),this.val&&(e.val=this.val.clone(t,e)),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Et.prototype.toJSON=function(){var t={__type:"Member",left:this.left,right:this.right,lineno:this.lineno,column:this.column,filename:this.filename};return this.val&&(t.val=this.val),t},Et.prototype.toString=function(){return this.left.toString()+"."+this.right.toString()};var Nt=function Charset(t){W.call(this),this.val=t};Nt.prototype.__proto__=W.prototype,Nt.prototype.toString=function(){return"@charset "+this.val},Nt.prototype.toJSON=function(){return{__type:"Charset",val:this.val,lineno:this.lineno,column:this.column,filename:this.filename}};
|
||
/*!
|
||
* Stylus - Namespace
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var At=function Namespace(t,e){W.call(this),this.val=t,this.prefix=e};At.prototype.__proto__=W.prototype,At.prototype.toString=function(){return"@namespace "+(this.prefix?this.prefix+" ":"")+this.val},At.prototype.toJSON=function(){return{__type:"Namespace",val:this.val,prefix:this.prefix,lineno:this.lineno,column:this.column,filename:this.filename}};var Ot=function Import(t,e){W.call(this),this.path=t,this.once=e||!1};Ot.prototype.__proto__=W.prototype,Ot.prototype.clone=function(t){var e=new Ot;return e.path=this.path.nodeName?this.path.clone(t,e):this.path,e.once=this.once,e.mtime=this.mtime,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Ot.prototype.toJSON=function(){return{__type:"Import",path:this.path,once:this.once,mtime:this.mtime,lineno:this.lineno,column:this.column,filename:this.filename}};var Lt=function Extend(t){W.call(this),this.selectors=t};Lt.prototype.__proto__=W.prototype,Lt.prototype.clone=function(){return new Lt(this.selectors)},Lt.prototype.toString=function(){return"@extend "+this.selectors.join(", ")},Lt.prototype.toJSON=function(){return{__type:"Extend",selectors:this.selectors,lineno:this.lineno,column:this.column,filename:this.filename}};var Bt={}.constructor,Ct=function Object(){W.call(this),this.vals={},this.keys={}};Ct.prototype.__proto__=W.prototype,Ct.prototype.setValue=function(t,e){return this.vals[t]=e,this},Ct.prototype.set=Ct.prototype.setValue,Ct.prototype.setKey=function(t,e){return this.keys[t]=e,this},Ct.prototype.__defineGetter__("length",(function(){return Bt.keys(this.vals).length})),Ct.prototype.get=function(t){return this.vals[t]||qt.null},Ct.prototype.has=function(t){return t in this.vals},Ct.prototype.operate=function(t,e){switch(t){case".":case"[]":return this.get(e.hash);case"==":var n,i,r=this.vals;if("object"!=e.nodeName||this.length!=e.length)return qt.false;for(var o in r)if(n=r[o],i=e.vals[o],n.operate(t,i).isFalse)return qt.false;return qt.true;case"!=":return this.operate("==",e).negate();default:return W.prototype.operate.call(this,t,e)}},Ct.prototype.toBoolean=function(){return qt.Boolean(this.length)},Ct.prototype.toBlock=function(){var t,e,n="{";for(t in this.vals)"object"==(e=this.get(t)).first.nodeName?n+=t+" "+e.first.toBlock():n+="@charset"===t?t+" "+e.first.toString()+";":t+":"+toString(e)+";";return n+"}";function toString(t){return t.nodes?t.nodes.map(toString).join(t.isList?",":" "):"literal"==t.nodeName&&","==t.val?"\\,":t.toString()}},Ct.prototype.clone=function(t){var e,n=new Ct;for(e in n.lineno=this.lineno,n.column=this.column,n.filename=this.filename,this.vals)n.vals[e]=this.vals[e].clone(t,n);for(e in this.keys)n.keys[e]=this.keys[e].clone(t,n);return n},Ct.prototype.toJSON=function(){return{__type:"Object",vals:this.vals,keys:this.keys,lineno:this.lineno,column:this.column,filename:this.filename}},Ct.prototype.toString=function(){var t={};for(var e in this.vals)t[e]=this.vals[e].toString();return JSON.stringify(t)};var jt=function Function(t,e,n){W.call(this),this.name=t,this.params=e,this.block=n,"function"==typeof e&&(this.fn=e)};jt.prototype.__defineGetter__("arity",(function(){return this.params.length})),jt.prototype.__proto__=W.prototype,jt.prototype.__defineGetter__("hash",(function(){return"function "+this.name})),jt.prototype.clone=function(t){if(this.fn)var e=new jt(this.name,this.fn);else(e=new jt(this.name)).params=this.params.clone(t,e),e.block=this.block.clone(t,e);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},jt.prototype.toString=function(){return this.fn?this.name+"("+this.fn.toString().match(/^function *\w*\((.*?)\)/).slice(1).join(", ")+")":this.name+"("+this.params.nodes.join(", ")+")"},jt.prototype.toJSON=function(){var t={__type:"Function",name:this.name,lineno:this.lineno,column:this.column,filename:this.filename};return this.fn?t.fn=this.fn:(t.params=this.params,t.block=this.block),t};var Pt=function Property(t,e){W.call(this),this.segments=t,this.expr=e};Pt.prototype.__proto__=W.prototype,Pt.prototype.clone=function(t){var e=new Pt(this.segments);return e.name=this.name,this.literal&&(e.literal=this.literal),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.segments=this.segments.map((function(n){return n.clone(t,e)})),this.expr&&(e.expr=this.expr.clone(t,e)),e},Pt.prototype.toJSON=function(){var t={__type:"Property",segments:this.segments,name:this.name,lineno:this.lineno,column:this.column,filename:this.filename};return this.expr&&(t.expr=this.expr),this.literal&&(t.literal=this.literal),t},Pt.prototype.toString=function(){return"property("+this.segments.join("")+", "+this.expr+")"},Pt.prototype.operate=function(t,e,n){return this.expr.operate(t,e,n)};var It=function Selector(t){W.call(this),this.inherits=!0,this.segments=t,this.optional=!1};It.prototype.__proto__=W.prototype,It.prototype.toString=function(){return this.segments.join("")+(this.optional?" !optional":"")},It.prototype.__defineGetter__("isPlaceholder",(function(){return this.val&&~this.val.substr(0,2).indexOf("$")})),It.prototype.clone=function(t){var e=new It;return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.inherits=this.inherits,e.val=this.val,e.segments=this.segments.map((function(n){return n.clone(t,e)})),e.optional=this.optional,e},It.prototype.toJSON=function(){return{__type:"Selector",inherits:this.inherits,segments:this.segments,optional:this.optional,val:this.val,lineno:this.lineno,column:this.column,filename:this.filename}};var Ut=function Expression(t){W.call(this),this.nodes=[],this.isList=t};Ut.prototype.__defineGetter__("isEmpty",(function(){return!this.nodes.length})),Ut.prototype.__defineGetter__("first",(function(){return this.nodes[0]?this.nodes[0].first:qt.null})),Ut.prototype.__defineGetter__("hash",(function(){return this.nodes.map((function(t){return t.hash})).join("::")})),Ut.prototype.__proto__=W.prototype,Ut.prototype.clone=function(t){var e=new this.constructor(this.isList);return e.preserve=this.preserve,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.nodes=this.nodes.map((function(n){return n.clone(t,e)})),e},Ut.prototype.push=function(t){this.nodes.push(t)},Ut.prototype.operate=function(t,e,n){switch(t){case"[]=":var i=this,r=_export_unwrap_(e).nodes;return n=_export_unwrap_(n),r.forEach((function(t){if(u=i.nodes.length,"unit"==t.nodeName){for(var e=t.val<0?u+t.val:t.val,r=e;e-- >u;)i.nodes[e]=qt.null;i.nodes[r]=n}else t.string&&(o=i.nodes[0])&&"object"==o.nodeName&&o.set(t.string,n.clone())})),n;case"[]":var o,a=new qt.Expression,h=_export_unwrap_(this).nodes;return(r=_export_unwrap_(e).nodes).forEach((function(t){"unit"==t.nodeName?o=h[t.val<0?h.length+t.val:t.val]:"object"==h[0].nodeName&&(o=h[0].get(t.string)),o&&a.push(o)})),a.isEmpty?qt.null:_export_unwrap_(a);case"||":return this.toBoolean().isTrue?this:e;case"in":return W.prototype.operate.call(this,t,e);case"!=":return this.operate("==",e,n).negate();case"==":var l,c,u=this.nodes.length;if(e=e.toExpression(),u!=e.nodes.length)return qt.false;for(var f=0;f<u;++f)if(l=this.nodes[f],c=e.nodes[f],!l.operate(t,c).isTrue)return qt.false;return qt.true;default:return this.first.operate(t,e,n)}},Ut.prototype.toBoolean=function(){return this.nodes.length>1?qt.true:this.first.toBoolean()},Ut.prototype.toString=function(){return"("+this.nodes.map((function(t){return t.toString()})).join(this.isList?", ":" ")+")"},Ut.prototype.toJSON=function(){return{__type:"Expression",isList:this.isList,preserve:this.preserve,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}};var Rt={Expression:Ut},Gt=function Arguments(){Rt.Expression.call(this),this.map={}};Gt.prototype.__proto__=Rt.Expression.prototype,Gt.fromExpression=function(t){var e=new Gt,n=t.nodes.length;e.lineno=t.lineno,e.column=t.column,e.isList=t.isList;for(var i=0;i<n;++i)e.push(t.nodes[i]);return e},Gt.prototype.clone=function(t){var e=Rt.Expression.prototype.clone.call(this,t);for(var n in e.map={},this.map)e.map[n]=this.map[n].clone(t,e);return e.isList=this.isList,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Gt.prototype.toJSON=function(){return{__type:"Arguments",map:this.map,isList:this.isList,preserve:this.preserve,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}};
|
||
/*!
|
||
* Stylus - @block
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var Mt=function Atblock(){W.call(this)};Mt.prototype.__defineGetter__("nodes",(function(){return this.block.nodes})),Mt.prototype.__proto__=W.prototype,Mt.prototype.clone=function(t){var e=new Mt;return e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Mt.prototype.toString=function(){return"@block"},Mt.prototype.toJSON=function(){return{__type:"Atblock",block:this.block,lineno:this.lineno,column:this.column,fileno:this.fileno}};
|
||
/*!
|
||
* Stylus - supports
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
var Ft=function Supports(t){yt.call(this,"supports"),this.condition=t};Ft.prototype.__proto__=yt.prototype,Ft.prototype.clone=function(t){var e=new Ft;return e.condition=this.condition.clone(t,e),e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Ft.prototype.toJSON=function(){return{__type:"Supports",condition:this.condition,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}},Ft.prototype.toString=function(){return"@supports "+this.condition};
|
||
/*!
|
||
* Stylus - nodes
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/
|
||
const qt={};function ParseError(t){this.name="ParseError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}function SyntaxError(t){this.name="SyntaxError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}qt.lineno=null,qt.column=null,qt.filename=null,qt.Node=W,qt.Root=D,qt.Null=K,qt.Each=V,qt.If=Z,qt.Call=Y,qt.UnaryOp=X,qt.BinOp=tt,qt.Ternary=et,qt.Block=nt,qt.Unit=rt,qt.String=ot,qt.HSLA=at,qt.RGBA=ct,qt.Ident=ut,qt.Group=ft,qt.Literal=dt,qt.Boolean=mt,qt.Return=vt,qt.Media=gt,qt.QueryList=kt,qt.Query=wt,qt.Feature=bt,qt.Params=xt,qt.Comment=_t,qt.Keyframes=St,qt.Member=Et,qt.Charset=Nt,qt.Namespace=At,qt.Import=Ot,qt.Extend=Lt,qt.Object=Ct,qt.Function=jt,qt.Property=Pt,qt.Selector=It,qt.Expression=Ut,qt.Arguments=Gt,qt.Atblock=Mt,qt.Atrule=yt,qt.Supports=Ft,qt.true=new qt.Boolean(!0),qt.false=new qt.Boolean(!1),qt.null=new qt.Null,ParseError.prototype.__proto__=Error.prototype,SyntaxError.prototype.__proto__=Error.prototype;const Tt=Lexer;var $t={and:"&&",or:"||",is:"==",isnt:"!=","is not":"!=",":=":"?="};function Lexer(t,e){function comment(t,e,n,i){var r=i.lastIndexOf("/*",n)>i.lastIndexOf("*/",n),o=i.lastIndexOf("//",n),a=i.lastIndexOf("\n",n),h=0,l=0;if(~o&&o>a)for(;a!=n;){if("'"==i[a]&&(l?l--:l++),'"'==i[a]&&(h?h--:h++),"/"==i[a]&&"/"==i[a+1]){r=!l&&!h;break}++a}return r?t:","===e&&/^[,\t\n]+$/.test(t)?t.replace(/\n/,"\r"):e+"\r"}this.stash=[],this.indentStack=[],this.indentRe=null,this.lineno=1,this.column=1,"\ufeff"==t.charAt(0)&&(t=t.slice(1)),this.str=t.replace(/\s+$/,"\n").replace(/\r\n?/g,"\n").replace(/\\ *\n/g,"\r").replace(/([,(:](?!\/\/[^ ])) *(?:\/\/[^\n]*|\/\*.*?\*\/)?\n\s*/g,comment).replace(/\s*\n[ \t]*([,)])/g,comment)}Lexer.prototype={inspect:function(){for(var t,e=this.str,n=[];"eos"!=(t=this.next()).type;)n.push(t.inspect());return this.str=e,n.concat(t.inspect()).join("\n")},lookahead:function(t){for(var e=t-this.stash.length;e-- >0;)this.stash.push(this.advance());return this.stash[--t]},skip:function(t){var e=t[0];t=e?e.length:t,this.str=this.str.substr(t),e?this.move(e):this.column+=t},move:function(t){var e=t.match(/\n/g),n=t.lastIndexOf("\n");e&&(this.lineno+=e.length),this.column=~n?t.length-n:this.column+t.length},next:function(){var t=this.stashed()||this.advance();return this.prev=t,t},isPartOfSelector:function(){var t=this.stash[this.stash.length-1]||this.prev;switch(t&&t.type){case"color":return 2==t.val.raw.length;case".":case"[":return!0}return!1},advance:function(){var t=this.column,e=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&&(t=n.column,e=n.lineno),n}.call(this)||this.space()||this.selector();return n.lineno=e,n.column=t,n},peek:function(){return this.lookahead(1)},stashed:function(){return this.stash.shift()},eos:function(){if(!this.str.length)return this.indentStack.length?(this.indentStack.shift(),new e("outdent")):new e("eos")},urlchars:function(){var t;if(this.isURL)return(t=/^[\/:@.;?&=*!,<>#%0-9]+/.exec(this.str))?(this.skip(t),new e("literal",new qt.Literal(t[0]))):void 0},sep:function(){var t;if(t=/^;[ \t]*/.exec(this.str))return this.skip(t),new e(";")},eol:function(){if("\r"==this.str[0]){for(++this.lineno,this.skip(1),this.column=1;this.space(););return this.advance()}},space:function(){var t;if(t=/^([ \t]+)/.exec(this.str))return this.skip(t),new e("space")},escaped:function(){var t;if(t=/^\\(.)[ \t]*/.exec(this.str)){var n=t[1];return this.skip(t),new e("ident",new qt.Literal(n))}},literal:function(){var t;if(t=/^@css[ \t]*\{/.exec(this.str)){this.skip(t);for(var n,i,r=1,o="";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(o+=n,!r)break}return o=o.replace(/\s*}$/,""),(i=new qt.Literal(o)).css=!0,new e("literal",i)}},important:function(){var t;if(t=/^!important[ \t]*/.exec(this.str))return this.skip(t),new e("ident",new qt.Literal("!important"))},brace:function(){var t;if(t=/^([{}])/.exec(this.str)){this.skip(1);var n=t[1];return new e(n,n)}},paren:function(){var t;if(t=/^([()])([ \t]*)/.exec(this.str)){var n=t[1];this.skip(t),")"==n&&(this.isURL=!1);var i=new e(n,n);return i.space=t[2],i}},null:function(){var t;if(t=/^(null)\b[ \t]*/.exec(this.str))return this.skip(t),this.isPartOfSelector()?new e("ident",new qt.Ident(t[0])):new e("null",qt.null)},keyword:function(){var t;if(t=/^(return|if|else|unless|for|in)\b(?!-)[ \t]*/.exec(this.str)){var n=t[1];return this.skip(t),this.isPartOfSelector()?new e("ident",new qt.Ident(t[0])):new e(n,n)}},namedop:function(){var t,n;if(t=/^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)){var i=t[1];return this.skip(t),(n=this.isPartOfSelector()?new e("ident",new qt.Ident(t[0])):new e(i=$t[i]||i,i)).space=t[2],n}},op:function(){var t;if(t=/^([.]{1,3}|&&|\|\||[!<>=?:]=|\*\*|[-+*\/%]=?|[,=?:!~<>&\[\]])([ \t]*)/.exec(this.str)){var n=t[1];this.skip(t);var i=new e(n=$t[n]||n,n);return i.space=t[2],this.isURL=!1,i}},anonFunc:function(){var t;if("@"==this.str[0]&&"("==this.str[1])return this.skip(2),(t=new e("function",new qt.Ident("anonymous"))).anonymous=!0,t},atrule:function(){var t;if(t=/^@(?!apply)(?:-(\w+)-)?([a-zA-Z0-9-_]+)[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=t[2];switch(i){case"require":case"import":case"charset":case"namespace":case"media":case"scope":case"supports":return new e(i);case"document":return new e("-moz-document");case"block":return new e("atblock");case"extend":case"extends":return new e("extend");case"keyframes":return new e(i,n);default:return new e("atrule",n?"-"+n+"-"+i:i)}}},comment:function(){if("/"==this.str[0]&&"/"==this.str[1])return-1==(t=this.str.indexOf("\n"))&&(t=this.str.length),this.skip(t),this.advance();if("/"==this.str[0]&&"*"==this.str[1]){var t;-1==(t=this.str.indexOf("*/"))&&(t=this.str.length);var n=this.str.substr(0,t+2),i=n.split(/\n|\r/).length-1,r=!0,o=!1;return this.lineno+=i,this.skip(t+2),"!"==n[2]&&(n=n.replace("*!","*"),r=!1),this.prev&&";"==this.prev.type&&(o=!0),new e("comment",new qt.Comment(n,r,o))}},boolean:function(){var t;if(t=/^(true|false)\b([ \t]*)/.exec(this.str)){var n=qt.Boolean("true"==t[1]);this.skip(t);var i=new e("boolean",n);return i.space=t[2],i}},unicode:function(){var t;if(t=/^u\+[0-9a-f?]{1,6}(?:-[0-9a-f]{1,6})?/i.exec(this.str))return this.skip(t),new e("literal",new qt.Literal(t[0]))},function:function(){var t;if(t=/^(-*[_a-zA-Z$][-\w\d$]*)\(([ \t]*)/.exec(this.str)){var n=t[1];this.skip(t),this.isURL="url"==n;var i=new e("function",new qt.Ident(n));return i.space=t[2],i}},ident:function(){var t;if(t=/^-*([_a-zA-Z$]|@apply)[-\w\d$]*/.exec(this.str))return this.skip(t),new e("ident",new qt.Ident(t[0]))},newline:function(){var t,n;if(this.indentRe?t=this.indentRe.exec(this.str):((t=(n=/^\n([\t]*)[ \t]*/).exec(this.str))&&!t[1].length&&(t=(n=/^\n([ \t]*)/).exec(this.str)),t&&t[1].length&&(this.indentRe=n)),t){var i,r=t[1].length;if(this.skip(t)," "===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&&r<this.indentStack[0]){for(;this.indentStack.length&&this.indentStack[0]>r;)this.stash.push(new e("outdent")),this.indentStack.shift();i=this.stash.pop()}else r&&r!=this.indentStack[0]?(this.indentStack.unshift(r),i=new e("indent")):i=new e("newline");return i}},unit:function(){var t;if(t=/^(-)?(\d+\.\d+|\d+|\.\d+)(%|[a-zA-Z]+)?[ \t]*/.exec(this.str)){this.skip(t);var n=parseFloat(t[2]);"-"==t[1]&&(n=-n);var i=new qt.Unit(n,t[3]);return i.raw=t[0],new e("unit",i)}},string:function(){var t;if(t=/^("[^"]*"|'[^']*')[ \t]*/.exec(this.str)){var n=t[1],i=t[0][0];return this.skip(t),n=n.slice(1,-1).replace(/\\n/g,"\n"),new e("string",new qt.String(n,i))}},color:function(){return this.rrggbbaa()||this.rrggbb()||this.rgba()||this.rgb()||this.nn()||this.n()},n:function(){var t;if(t=/^#([a-fA-F0-9]{1})[ \t]*/.exec(this.str)){this.skip(t);var n=parseInt(t[1]+t[1],16),i=new qt.RGBA(n,n,n,1);return i.raw=t[0],new e("color",i)}},nn:function(){var t;if(t=/^#([a-fA-F0-9]{2})[ \t]*/.exec(this.str)){this.skip(t);var n=parseInt(t[1],16),i=new qt.RGBA(n,n,n,1);return i.raw=t[0],new e("color",i)}},rgb:function(){var t;if(t=/^#([a-fA-F0-9]{3})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),o=parseInt(n[2]+n[2],16),a=new qt.RGBA(i,r,o,1);return a.raw=t[0],new e("color",a)}},rgba:function(){var t;if(t=/^#([a-fA-F0-9]{4})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),o=parseInt(n[2]+n[2],16),a=parseInt(n[3]+n[3],16),h=new qt.RGBA(i,r,o,a/255);return h.raw=t[0],new e("color",h)}},rrggbb:function(){var t;if(t=/^#([a-fA-F0-9]{6})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),o=parseInt(n.substr(4,2),16),a=new qt.RGBA(i,r,o,1);return a.raw=t[0],new e("color",a)}},rrggbbaa:function(){var t;if(t=/^#([a-fA-F0-9]{8})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),o=parseInt(n.substr(4,2),16),a=parseInt(n.substr(6,2),16),h=new qt.RGBA(i,r,o,a/255);return h.raw=t[0],new e("color",h)}},selector:function(){var t;if(t=/^\^|.*?(?=\/\/(?![^\[]*\])|[,\n{])/.exec(this.str)){var n=t[0];return this.skip(t),new e("selector",n)}}};var Jt=65407===new Uint16Array(new Uint8Array([127,255]).buffer)[0];function hexify(t){for(var e="",n=8;n--;)e+=(t>>>(n<<2)&15).toString(16);return e}function parity(t,e,n){return t^e^n}function majority(t,e,n){return t&e^t&n^e&n}function rotateLeft(t,e){return t<<e|t>>>32-e}var zt=new Uint32Array(80),MemoryCache=function(t){t=t||{},this.limit=t["cache limit"]||256,this._cache={},this.length=0,this.head=this.tail=null};MemoryCache.prototype.set=function(t,e){var n,i=e.clone();i.filename=qt.filename,i.lineno=qt.lineno,i.column=qt.column,n={key:t,value:i},this._cache[t]=n,this.tail?(this.tail.next=n,n.prev=this.tail):this.head=n,this.tail=n,this.length++==this.limit&&this.purge()},MemoryCache.prototype.get=function(t){var e=this._cache[t],n=e.value.clone();return e==this.tail||(e.next&&(e==this.head&&(this.head=e.next),e.next.prev=e.prev),e.prev&&(e.prev.next=e.next),e.next=null,e.prev=this.tail,this.tail&&(this.tail.next=e),this.tail=e),n},MemoryCache.prototype.has=function(t){return!!this._cache[t]},MemoryCache.prototype.key=function(t,e){var n=function createHash(){let t="";return{update:function update(e){t+=e},digest:function digest(){return function sha1(t){if(!(t instanceof Uint8Array))throw new TypeError("Input data must be a Uint8Array.");var e,n=new ArrayBuffer(function align(t,e){var n=e-1;return t+n&~n}(t.byteLength+9,64)),i=new Uint32Array(n),r=new Uint8Array(n);if(r.set(t),r[t.byteLength]=128,Jt)for(var o=0,a=i.length;o<a;++o)i[o]=(e=i[o])>>24&255|e>>8&65280|e<<8&16711680|e<<24&4278190080;var h=8*t.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,y=void 0,g=void 0,k=void 0,w=void 0,b=void 0,x=void 0,_=0,S=i.length;_<S;_+=16){for(v=0;v<16;++v)zt[v]=i[_+v];for(v=16;v<80;++v)zt[v]=rotateLeft(zt[v-3]^zt[v-8]^zt[v-14]^zt[v-16],1);for(y=c,g=u,k=f,w=d,b=m,v=0;v<20;++v)x=rotateLeft(y,5)+((l=g)&k^~l&w)+b+1518500249+zt[v]|0,b=w,w=k,k=rotateLeft(g,30),g=y,y=x;for(v=20;v<40;++v)x=rotateLeft(y,5)+parity(g,k,w)+b+1859775393+zt[v]|0,b=w,w=k,k=rotateLeft(g,30),g=y,y=x;for(v=40;v<60;++v)x=rotateLeft(y,5)+majority(g,k,w)+b+2400959708+zt[v]|0,b=w,w=k,k=rotateLeft(g,30),g=y,y=x;for(v=60;v<80;++v)x=rotateLeft(y,5)+parity(g,k,w)+b+3395469782+zt[v]|0,b=w,w=k,k=rotateLeft(g,30),g=y,y=x;c=c+y|0,u=u+g|0,f=f+k|0,d=d+w|0,m=m+b|0}return""+hexify(c)+hexify(u)+hexify(f)+hexify(d)+hexify(m)}((new TextEncoder).encode(t))}}}();return n.update(t+e.prefix),n.digest("hex")},MemoryCache.prototype.purge=function(){var t=this.head;this.head.next&&(this.head=this.head.next,this.head.prev=null),this._cache[t.key]=t.prev=t.next=null,this.length--};var NullCache=function(){};NullCache.prototype.set=function(t,e){},NullCache.prototype.get=function(t){},NullCache.prototype.has=function(t){return!1},NullCache.prototype.key=function(t,e){return""};var getCache=function(t,e){return"function"==typeof t?new t(e):new("memory"===t?MemoryCache:NullCache)(e)},Ht={lexer:noop$2(),selector:noop$2()},Qt=["ident","string","selector","function","comment","boolean","space","color","unit","for","in","[","]","(",")","+","-","*","*=","<",">","=",":","&","&&","~","{","}",".","..","/"],Wt=["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"],Dt=function Parser(t,e){var n=this;e=e||{},Parser.cache=Parser.cache||Parser.getCache(e),this.hash=Parser.cache.key(t,e),this.lexer={},Parser.cache.has(this.hash)||(this.lexer=new Tt(t)),this.prefix=e.prefix||"",this.root=e.root||new qt.Root,this.state=["root"],this.stash=[],this.parens=0,this.css=0,this.state.pop=function(){n.prevState=[].pop.call(this)}};
|
||
/*!
|
||
* Stylus - Parser
|
||
* Copyright (c) Automattic <developer.wordpress.com>
|
||
* MIT Licensed
|
||
*/Dt.getCache=function(t){return!1===t.cache?getCache(!1):getCache(t.cache||"memory",t)},Dt.prototype={constructor:Dt,currentState:function(){return this.state[this.state.length-1]},previousState:function(){return this.state[this.state.length-2]},parse:function(){var t=this.parent=this.root;if(Dt.cache.has(this.hash))"block"==(t=Dt.cache.get(this.hash)).nodeName&&(t.constructor=qt.Root);else{for(;"eos"!=this.peek().type&&(this.skipWhitespace(),"eos"!=this.peek().type);){var e=this.statement();this.accept(";"),e||this.error("unexpected token {peek}, not allowed at the root level"),t.push(e)}Dt.cache.set(this.hash,t)}return t},error:function(t){var e=this.peek().type,n=null==this.peek().val?"":" "+this.peek().toString();throw n.trim()==e.trim()&&(n=""),new ParseError(t.replace("{peek}",'"'+e+n+'"'))},accept:function(t){if(t==this.peek().type)return this.next()},expect:function(t){return t!=this.peek().type&&this.error('expected "'+t+'", got {peek}'),this.next()},next:function(){var t=this.stash.length?this.stash.pop():this.lexer.next(),e=t.lineno,n=t.column||1;return t.val&&t.val.nodeName&&(t.val.lineno=e,t.val.column=n),qt.lineno=e,qt.column=n,Ht.lexer("%s %s",t.type,t.val||""),t},peek:function(){return this.lexer.peek()},lookahead:function(t){return this.lexer.lookahead(t)},isSelectorToken:function(t){var e=this.lookahead(t).type;switch(e){case"for":return this.bracketed;case"[":return this.bracketed=!0,!0;case"]":return this.bracketed=!1,!0;default:return~Qt.indexOf(e)}},isPseudoSelector:function(t){var e=this.lookahead(t).val;return e&&~Wt.indexOf(e.name)},lineContains:function(t){for(var e,n=1;e=this.lookahead(n++);){if(~["indent","outdent","newline","eos"].indexOf(e.type))return;if(t==e.type)return!0}},selectorToken:function(){if(this.isSelectorToken(1)){if("{"==this.peek().type){if(!this.lineContains("}"))return;for(var t,e=0;t=this.lookahead(++e);){if("}"==t.type){if(2==e||3==e&&"space"==this.lookahead(e-1).type)return;break}if(":"==t.type)return}}return this.next()}},skip:function(t){for(;~t.indexOf(this.peek().type);)this.next()},skipWhitespace:function(){this.skip(["space","indent","outdent","newline"])},skipNewlines:function(){for(;"newline"==this.peek().type;)this.next()},skipSpaces:function(){for(;"space"==this.peek().type;)this.next()},skipSpacesAndComments:function(){for(;"space"==this.peek().type||"comment"==this.peek().type;)this.next()},looksLikeFunctionDefinition:function(t){return"indent"==this.lookahead(t).type||"{"==this.lookahead(t).type},looksLikeSelector:function(t){var e,n,i=1;if(t&&":"==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(;e=this.lookahead(i+2);){if(-1!==["indent","outdent","{",";","eos","selector","media","if","atrule",")","}","unit","[","for","function"].indexOf(e.type)){if("["!==e.type){if(this.isPseudoSelector(i+2))return!0;if(")"===e.type&&this.lookahead(i+3)&&"}"===this.lookahead(i+3).type)break;return-1===["outdent",";","eos","media","if","atrule",")","}","unit","for","function"].indexOf(e.type)}for(;(e=this.lookahead(i+3))&&"]"!==e.type;){if(~[".","unit"].indexOf(e.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:function(t){var e=this.lookahead(t).type;return!("="!=e||!this.bracketed)||("ident"==e||"string"==e)&&"]"==this.lookahead(t+1).type&&("newline"==this.lookahead(t+2).type||this.isSelectorToken(t+2))&&!this.lineContains(":")&&!this.lineContains("=")},looksLikeKeyframe:function(){var t,e=2;switch(this.lookahead(e).type){case"{":case"indent":case",":return!0;case"newline":for(;"unit"==this.lookahead(++e).type||"newline"==this.lookahead(e).type;);return"indent"==(t=this.lookahead(e).type)||"{"==t}},stateAllowsSelector:function(){switch(this.currentState()){case"root":case"atblock":case"selector":case"conditional":case"function":case"atrule":case"for":return!0}},assignAtblock:function(t){try{t.push(this.atblock(t))}catch(t){this.error("invalid right-hand side operand in assignment, got {peek}")}},statement:function(){var t,e,n=this.stmt(),i=this.prevState;switch(this.allowPostfix&&(this.allowPostfix=!1,i="expression"),i){case"assignment":case"expression":case"function arguments":for(;e=this.accept("if")||this.accept("unless")||this.accept("for");)switch(e.type){case"if":case"unless":(n=new qt.If(this.expression(),n)).postfix=!0,n.negate="unless"==e.type,this.accept(";");break;case"for":var r,o=this.id().name;this.accept(",")&&(r=this.id().name),this.expect("in");var a=new qt.Each(o,r,this.expression());(t=new qt.Block(this.parent,a)).push(n),a.block=t,n=a}}return n},stmt:function(){var t,e=this.peek();switch(e.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[e.type]();case"return":return this.return();case"{":return this.property();default:if(this.stateAllowsSelector())switch(e.type){case"color":case"~":case">":case"<":case":":case"&":case"&&":case"[":case".":case"/":return(t=this.selector()).column=e.column,t.lineno=e.lineno,t;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(t=this.selector()).column=e.column,t.lineno=e.lineno,t;case"-":if("{"==this.lookahead(2).type)return this.property()}var n=this.expression();return n.isEmpty&&this.error("unexpected {peek}"),n}},block:function(t,e){var n,i,r,o=this.parent=new qt.Block(this.parent,t);for(!1===e&&(o.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 o;i=this.statement(),this.accept(";")}i||this.error("unexpected token {peek} in block"),o.push(i)}return this.css?(this.skipWhitespace(),this.expect("}"),this.skipSpaces(),this.css--):this.expect("outdent"),this.parent=o.parent,o},comment:function(){var t=this.next().val;return this.skipSpaces(),t},for:function(){this.expect("for");var t,e=this.id().name;this.accept(",")&&(t=this.id().name),this.expect("in"),this.state.push("for"),this.cond=!0;var n=new qt.Each(e,t,this.expression());return this.cond=!1,n.block=this.block(n,!1),this.state.pop(),n},return:function(){this.expect("return");var t=this.expression();return t.isEmpty?new qt.Return:new qt.Return(t)},unless:function(){this.expect("unless"),this.state.push("conditional"),this.cond=!0;var t=new qt.If(this.expression(),!0);return this.cond=!1,t.block=this.block(t,!1),this.state.pop(),t},if:function(){var t=this.expect("if");this.state.push("conditional"),this.cond=!0;var e,n,i,r=new qt.If(this.expression());for(r.column=t.column,this.cond=!1,r.block=this.block(r,!1),this.skip(["newline","comment"]);this.accept("else");){if(!(t=this.accept("if"))){r.elses.push(this.block(r,!1));break}this.cond=!0,e=this.expression(),this.cond=!1,n=this.block(r,!1),(i=new qt.If(e,n)).column=t.column,r.elses.push(i),this.skip(["newline","comment"])}return this.state.pop(),r},atblock:function(t){return t||this.expect("atblock"),t=new qt.Atblock,this.state.push("atblock"),t.block=this.block(t,!1),this.state.pop(),t},atrule:function(){var t,e=this.expect("atrule").val,n=new qt.Atrule(e);return this.skipSpacesAndComments(),n.segments=this.selectorParts(),this.skipSpacesAndComments(),("indent"==(t=this.peek().type)||"{"==t||"newline"==t&&"{"==this.lookahead(2).type)&&(this.state.push("atrule"),n.block=this.block(n),this.state.pop()),n},scope:function(){this.expect("scope");var t=this.selectorParts().map((function(t){return t.val})).join("");return this.selectorScope=t.trim(),qt.null},supports:function(){this.expect("supports");var t=new qt.Supports(this.supportsCondition());return this.state.push("atrule"),t.block=this.block(t),this.state.pop(),t},supportsCondition:function(){var t=this.supportsNegation()||this.supportsOp();return t||(this.cond=!0,t=this.expression(),this.cond=!1),t},supportsNegation:function(){if(this.accept("not")){var t=new qt.Expression;return t.push(new qt.Literal("not")),t.push(this.supportsFeature()),t}},supportsOp:function(){var t,e,n=this.supportsFeature();if(n){for((e=new qt.Expression).push(n);t=this.accept("&&")||this.accept("||");)e.push(new qt.Literal("&&"==t.val?"and":"or")),e.push(this.supportsFeature());return e}},supportsFeature:function(){if(this.skipSpacesAndComments(),"("==this.peek().type){var t=this.lookahead(2).type;if("ident"==t||"{"==t)return this.feature();this.expect("(");var e=new qt.Expression;return e.push(new qt.Literal("(")),e.push(this.supportsCondition()),this.expect(")"),e.push(new qt.Literal(")")),this.skipSpacesAndComments(),e}},extend:function(){var t,e,n,i=this.expect("extend"),r=[];do{(n=this.selectorParts()).length&&(t=new qt.Selector(n),r.push(t),"!"===this.peek().type&&"ident"===(i=this.lookahead(2)).type&&"optional"===i.val.name&&(this.skip(["!","ident"]),t.optional=!0))}while(this.accept(","));return(e=new qt.Extend(r)).lineno=i.lineno,e.column=i.column,e},media:function(){this.expect("media"),this.state.push("atrule");var t=new qt.Media(this.queries());return t.block=this.block(t),this.state.pop(),t},queries:function(){var t=new qt.QueryList,e=["comment","newline","space"];do{this.skip(e),t.push(this.query()),this.skip(e)}while(this.accept(","));return t},query:function(){var t,e,n,i=new qt.Query;if("ident"==this.peek().type&&("."==this.lookahead(2).type||"["==this.lookahead(2).type))return this.cond=!0,t=this.expression(),this.cond=!1,i.push(new qt.Feature(t.nodes)),i;if((e=this.accept("ident")||this.accept("not"))&&(e=new qt.Literal(e.val.string||e.val),this.skipSpacesAndComments(),(n=this.accept("ident"))?(i.type=n.val,i.predicate=e):i.type=e,this.skipSpacesAndComments(),!this.accept("&&")))return i;do{i.push(this.feature())}while(this.accept("&&"));return i},feature:function(){this.skipSpacesAndComments(),this.expect("("),this.skipSpacesAndComments();var t=new qt.Feature(this.interpolate());return this.skipSpacesAndComments(),this.accept(":"),this.skipSpacesAndComments(),this.inProperty=!0,t.expr=this.list(),this.inProperty=!1,this.skipSpacesAndComments(),this.expect(")"),this.skipSpacesAndComments(),t},mozdocument:function(){this.expect("-moz-document");var t=new qt.Atrule("-moz-document"),e=[];do{this.skipSpacesAndComments(),e.push(this.functionCall()),this.skipSpacesAndComments()}while(this.accept(","));return t.segments=[new qt.Literal(e.join(", "))],this.state.push("atrule"),t.block=this.block(t,!1),this.state.pop(),t},import:function(){return this.expect("import"),this.allowPostfix=!0,new qt.Import(this.expression(),!1)},require:function(){return this.expect("require"),this.allowPostfix=!0,new qt.Import(this.expression(),!0)},charset:function(){this.expect("charset");var t=this.expect("string").val;return this.allowPostfix=!0,new qt.Charset(t)},namespace:function(){var t,e;return this.expect("namespace"),this.skipSpacesAndComments(),(e=this.accept("ident"))&&(e=e.val),this.skipSpacesAndComments(),t=this.accept("string")||this.url(),this.allowPostfix=!0,new qt.Namespace(t,e)},keyframes:function(){var t,e=this.expect("keyframes");return this.skipSpacesAndComments(),(t=new qt.Keyframes(this.selectorParts(),e.val)).column=e.column,this.skipSpacesAndComments(),this.state.push("atrule"),t.block=this.block(t),this.state.pop(),t},literal:function(){return this.expect("literal").val},id:function(){var t=this.expect("ident");return this.accept("space"),t.val},ident:function(){for(var t=2,e=this.lookahead(t).type;"space"==e;)e=this.lookahead(++t).type;switch(e){case"=":case"?=":case"-=":case"+=":case"*=":case"/=":case"%=":return this.assignment();case".":if("space"==this.lookahead(t-1).type)return this.selector();if(this._ident==this.peek())return this.id();for(;"="!=this.lookahead(++t).type&&!~["[",",","newline","indent","eos"].indexOf(this.lookahead(t).type););if("="==this.lookahead(t).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(t++).type&&"selector"!=this.lookahead(t).type&&"eos"!=this.lookahead(t).type;);if("="==this.lookahead(t).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"["==e?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:function(){var t,e=[];for(this.accept("*")&&e.push(new qt.Literal("*"));;)if(this.accept("{"))this.state.push("interpolation"),e.push(this.expression()),this.expect("}"),this.state.pop();else if(t=this.accept("-"))e.push(new qt.Literal("-"));else{if(!(t=this.accept("ident")))break;e.push(t.val)}return e.length||this.expect("ident"),e},property:function(){if(this.looksLikeSelector(!0))return this.selector();var t=this.interpolate(),e=new qt.Property(t),n=e;return this.accept("space"),this.accept(":")&&this.accept("space"),this.state.push("property"),this.inProperty=!0,e.expr=this.list(),e.expr.isEmpty&&(n=t[0]),this.inProperty=!1,this.allowPostfix=!0,this.state.pop(),this.accept(";"),n},selector:function(){var t,e,n=new qt.Group,i=this.selectorScope,r="root"==this.currentState();do{this.accept("newline"),t=this.selectorParts(),r&&i&&t.unshift(new qt.Literal(i+" ")),t.length&&((e=new qt.Selector(t)).lineno=t[0].lineno,e.column=t[0].column,n.push(e))}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:function(){for(var t,e=[];t=this.selectorToken();)switch(t.type){case"{":this.skipSpaces();var n=this.expression();this.skipSpaces(),this.expect("}"),e.push(n);break;case this.prefix&&".":var i=new qt.Literal(t.val+this.prefix);i.prefixed=!0,e.push(i);break;case"comment":break;case"color":case"unit":e.push(new qt.Literal(t.val.raw));break;case"space":e.push(new qt.Literal(" "));break;case"function":e.push(new qt.Literal(t.val.name+"("));break;case"ident":e.push(new qt.Literal(t.val.name||t.val.string));break;default:e.push(new qt.Literal(t.val)),t.space&&e.push(new qt.Literal(" "))}return e},assignment:function(){var t,e,n=this.id(),i=n.name;if(t=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),(e=new qt.Ident(i,r)).lineno=n.lineno,e.column=n.column,this.state.pop(),t.type){case"?=":var o=new qt.BinOp("is defined",e),a=new qt.Expression;a.push(new qt.Ident(i)),e=new qt.Ternary(o,a,e);break;case"+=":case"-=":case"*=":case"/=":case"%=":e.val=new qt.BinOp(t.type[0],new qt.Ident(i),r)}}return e},function:function(){var t,e=1,n=2;t:for(;t=this.lookahead(n++);)switch(t.type){case"function":case"(":++e;break;case")":if(!--e)break t;break;case"eos":this.error('failed to find closing paren ")"')}return"expression"===this.currentState()?this.functionCall():this.looksLikeFunctionDefinition(n)?this.functionDefinition():this.expression()},url:function(){this.expect("function"),this.state.push("function arguments");var t=this.args();return this.expect(")"),this.state.pop(),new qt.Call("url",t)},functionCall:function(){var t=this.accept("+");if("url"==this.peek().val.name)return this.url();var e=this.expect("function").val,n=e.name;this.state.push("function arguments"),this.parens++;var i=this.args();this.expect(")"),this.parens--,this.state.pop();var r=new qt.Call(n,i);return r.column=e.column,r.lineno=e.lineno,t&&(this.state.push("function"),r.block=this.block(r),this.state.pop()),r},functionDefinition:function(){var t=this.expect("function"),e=t.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 qt.Function(e,n);return i.column=t.column,i.lineno=t.lineno,i.block=this.block(i),this.state.pop(),new qt.Ident(e,i)},params:function(){for(var t,e,n=new qt.Params;t=this.accept("ident");)this.accept("space"),n.push(e=t.val),this.accept("...")?e.rest=!0:this.accept("=")&&(e.val=this.expression()),this.skipWhitespace(),this.accept(","),this.skipWhitespace();return n},args:function(){var t,e=new qt.Arguments;do{"ident"==this.peek().type&&":"==this.lookahead(2).type?(t=this.next().val.string,this.expect(":"),e.map[t]=this.expression()):e.push(this.expression())}while(this.accept(","));return e},list:function(){for(var t=this.expression();this.accept(",");)if(t.isList)e.push(this.expression());else{var e=new qt.Expression(!0);e.push(t),e.push(this.expression()),t=e}return t},expression:function(){var t,e=new qt.Expression;for(this.state.push("expression");t=this.negation();)t||this.error("unexpected token {peek} in expression"),e.push(t);return this.state.pop(),e.nodes.length&&(e.lineno=e.nodes[0].lineno,e.column=e.nodes[0].column),e},negation:function(){return this.accept("not")?new qt.UnaryOp("!",this.negation()):this.ternary()},ternary:function(){var t=this.logical();if(this.accept("?")){var e=this.expression();this.expect(":");var n=this.expression();t=new qt.Ternary(t,e,n)}return t},logical:function(){for(var t,e=this.typecheck();t=this.accept("&&")||this.accept("||");)e=new qt.BinOp(t.type,e,this.typecheck());return e},typecheck:function(){for(var t,e=this.equality();t=this.accept("is a");)this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new qt.BinOp(t.type,e,this.equality()),this.operand=!1;return e},equality:function(){for(var t,e=this.in();t=this.accept("==")||this.accept("!=");)this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new qt.BinOp(t.type,e,this.in()),this.operand=!1;return e},in:function(){for(var t=this.relational();this.accept("in");)this.operand=!0,t||this.error('illegal unary "in", missing left-hand operand'),t=new qt.BinOp("in",t,this.relational()),this.operand=!1;return t},relational:function(){for(var t,e=this.range();t=this.accept(">=")||this.accept("<=")||this.accept("<")||this.accept(">");)this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new qt.BinOp(t.type,e,this.range()),this.operand=!1;return e},range:function(){var t,e=this.additive();return(t=this.accept("...")||this.accept(".."))&&(this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new qt.BinOp(t.val,e,this.additive()),this.operand=!1),e},additive:function(){for(var t,e=this.multiplicative();t=this.accept("+")||this.accept("-");)this.operand=!0,e=new qt.BinOp(t.type,e,this.multiplicative()),this.operand=!1;return e},multiplicative:function(){for(var t,n=this.defined();t=this.accept("**")||this.accept("*")||this.accept("/")||this.accept("%");){if(this.operand=!0,"/"==t&&this.inProperty&&!this.parens)return this.stash.push(new e("literal",new qt.Literal("/"))),this.operand=!1,n;n||this.error('illegal unary "'+t+'", missing left-hand operand'),n=new qt.BinOp(t.type,n,this.defined()),this.operand=!1}return n},defined:function(){var t=this.unary();return this.accept("is defined")&&(t||this.error('illegal unary "is defined", missing left-hand operand'),t=new qt.BinOp("is defined",t)),t},unary:function(){var t,e;return(t=this.accept("!")||this.accept("~")||this.accept("+")||this.accept("-"))?(this.operand=!0,(e=this.unary())||this.error('illegal unary "'+t+'"'),e=new qt.UnaryOp(t.type,e),this.operand=!1,e):this.subscript()},subscript:function(){for(var t=this.member();this.accept("[");)t=new qt.BinOp("[]",t,this.expression()),this.expect("]");return this.accept("=")&&(t.op+="=",t.val=this.list(),t.val.isEmpty&&this.assignAtblock(t.val)),t},member:function(){var t=this.primary();if(t){for(;this.accept(".");){var e=new qt.Ident(this.expect("ident").val.string);t=new qt.Member(t,e)}this.skipSpaces(),this.accept("=")&&(t.val=this.list(),t.val.isEmpty&&this.assignAtblock(t.val))}return t},object:function(){var t,e,n,i,r=new qt.Object;for(this.expect("{"),this.skipWhitespace();!this.accept("}");)this.accept("comment")||this.accept("newline")||(n||this.accept(","),(t=this.accept("ident")||this.accept("string"))||this.error('expected "ident" or "string", got {peek}'),i=t.val.hash,this.skipSpacesAndComments(),this.expect(":"),e=this.expression(),r.setValue(i,e),r.setKey(i,t.val),n=this.accept(","),this.skipWhitespace());return r},primary:function(){var t;if(this.skipSpaces(),this.accept("(")){++this.parens;var e=this.expression(),n=this.expect(")");return--this.parens,this.accept("%")&&e.push(new qt.Ident("%")),t=this.peek(),!n.space&&"ident"==t.type&&~r.indexOf(t.val.string)&&(e.push(new qt.Ident(t.val.string)),this.next()),e}switch((t=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 i=new qt.Ident(this.next().val);return i.property=!0,i;case"ident":return this.ident();case"function":return t.anonymous?this.functionDefinition():this.functionCall()}}};const Kt={exports:{}};!function(t){void 0!==Kt&&(Kt.exports=t);var e={on:function on(t,e){return getListeners(this,t).push(e),this},once:function once(t,e){var n=this;return wrap.originalListener=e,getListeners(n,t).push(wrap),n;function wrap(){off.call(n,t,wrap),e.apply(this,arguments)}},off:off,emit:function emit(t,e){var n=this,i=getListeners(n,t,!0);if(!i)return!1;var r=arguments.length;if(1===r)i.forEach(zeroarg);else if(2===r)i.forEach(onearg);else{var o=Array.prototype.slice.call(arguments,1);i.forEach(moreargs)}return!!i.length;function zeroarg(t){t.call(n)}function onearg(t){t.call(n,e)}function moreargs(t){t.apply(n,o)}}};function mixin(t){for(var n in e)t[n]=e[n];return t}function off(t,e){var n,i=this;if(arguments.length){if(e){if(n=getListeners(i,t,!0)){if(!(n=n.filter(ne)).length)return off.call(i,t);i.listeners[t]=n}}else if((n=i.listeners)&&(delete n[t],!Object.keys(n).length))return off.call(i)}else delete i.listeners;return i;function ne(t){return t!==e&&t.originalListener!==e}}function getListeners(t,e,n){if(!n||t.listeners){var i=t.listeners||(t.listeners={});return i[e]||(i[e]=[])}}mixin(t.prototype),t.mixin=mixin}((
|
||
/**
|
||
* event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
|
||
*
|
||
* @copyright Yusuke Kawasaki
|
||
* @license MIT
|
||
* @constructor
|
||
* @see https://github.com/kawanet/event-lite
|
||
* @see http://kawanet.github.io/event-lite/EventLite.html
|
||
* @example
|
||
* var EventLite = require("event-lite");
|
||
*
|
||
* function MyClass() {...} // your class
|
||
*
|
||
* EventLite.mixin(MyClass.prototype); // import event methods
|
||
*
|
||
* var obj = new MyClass();
|
||
* obj.on("foo", function() {...}); // add event listener
|
||
* obj.once("bar", function() {...}); // add one-time event listener
|
||
* obj.emit("foo"); // dispatch event
|
||
* obj.emit("bar"); // dispatch another event
|
||
* obj.off("foo"); // remove event listener
|
||
*/
|
||
function EventLite(){if(!(this instanceof EventLite))return new EventLite}));var Vt=Kt.exports;const Zt=class{constructor(){this.events=new Vt}on(...t){return this.events.on(...t)}off(...t){return this.events.off(...t)}once(...t){return this.events.once(...t)}emit(...t){return this.events.emit(...t)}listeners(t){return this.events.listeners&&this.events.listeners[t]||[]}},noop=()=>noop;var Yt=t.dirname,Xt=function DepsResolver(t,e){this.root=t,this.filename=e.filename,this.paths=e.paths||[],this.paths.push(Yt(e.filename||".")),this.options=e,this.functions={},this.deps=[]};Xt.prototype.__proto__=i.prototype;var te=Xt.prototype.visit;Xt.prototype.visit=function(t){switch(t.nodeName){case"root":case"block":case"expression":this.visitRoot(t);break;case"group":case"media":case"atblock":case"atrule":case"keyframes":case"each":case"supports":this.visit(t.block);break;default:te.call(this,t)}},Xt.prototype.visitRoot=function(t){for(var e=0,n=t.nodes.length;e<n;++e)this.visit(t.nodes[e])},Xt.prototype.visitIdent=function(t){this.visit(t.val)},Xt.prototype.visitIf=function(t){this.visit(t.block),this.visit(t.cond);for(var e=0,n=t.elses.length;e<n;++e)this.visit(t.elses[e])},Xt.prototype.visitFunction=function(t){this.functions[t.name]=t.block},Xt.prototype.visitCall=function(t){t.name in this.functions&&this.visit(this.functions[t.name]),t.block&&this.visit(t.block)},Xt.prototype.visitImport=function(t){if("url"!==t.path.first.name){var e,n,i,r=!t.path.first.val.isNull&&t.path.first.val||t.path.first.name;if(r&&((e=/\.css(?:"|$)/.test(r))||/\.styl$/i.test(r)||(i=r,r+=".styl"),!(n=_export_find_(r,this.paths,this.filename))&&i&&(n=_export_lookupIndex_(i,this.paths,this.filename)),n&&(this.deps=this.deps.concat(n),!e)))for(var o=0,a=n.length;o<a;++o){var h=n[o],l=Yt(h),c=_export_readFileSync_(h),u=new qt.Block,f=new Dt(c,_export_merge_({root:u},this.options));~this.paths.indexOf(l)||this.paths.push(l);try{u=f.parse()}catch(t){throw t.filename=h,t.lineno=f.lexer.lineno,t.column=f.lexer.column,t.input=c,t}this.visit(u)}}},Xt.prototype.resolve=function(){return this.visit(this.root),_export_uniq_(this.deps)};var ee=new Zt,ie=t.join;function Renderer(t,e){(e=e||{}).globals=e.globals||{},e.functions=e.functions||{},e.use=e.use||[],e.use=Array.isArray(e.use)?e.use:[e.use],e.imports=[ie("/","functions/index.styl")].concat(e.imports||[]),e.paths=e.paths||[],e.filename=e.filename||"stylus",e.Evaluator=e.Evaluator||H,this.options=e,this.str=t,this.events=ee}return Renderer.prototype.__proto__=Zt.prototype,Renderer.prototype.render=function(t){for(var e=this.parser=new Dt(this.str,this.options),n=0,i=this.options.use.length;n<i;n++)this.use(this.options.use[n]);try{qt.filename=this.options.filename;var r=e.parse();this.evaluator=new this.options.Evaluator(r,this.options),this.nodes=qt,this.evaluator.renderer=this,r=this.evaluator.evaluate(),r=new I(r,this.options).normalize();var o=this.options.sourcemap?new noop(r,this.options):new j(r,this.options),a=o.compile();this.options.sourcemap&&(this.sourcemap=o.map.toJSON())}catch(n){var h={};if(h.input=n.input||this.str,h.filename=n.filename||this.options.filename,h.lineno=n.lineno||e.lexer.lineno,h.column=n.column||e.lexer.column,!t)throw _export_formatException_(n,h);return t(_export_formatException_(n,h))}var l=this.listeners("end");for(t&&l.push(t),n=0,i=l.length;n<i;n++){var c=l[n](null,a);c&&(a=c)}if(!t)return a},Renderer.prototype.deps=function(t){var e=_export_merge_({cache:!1},this.options);t&&(e.filename=t);var n=Xt,i=new Dt(this.str,e);try{return qt.filename=e.filename,new n(i.parse(),e).resolve()}catch(t){var r={};throw r.input=t.input||this.str,r.filename=t.filename||e.filename,r.lineno=t.lineno||i.lexer.lineno,r.column=t.column||i.lexer.column,_export_formatException_(t,r)}},Renderer.prototype.set=function(t,e){return this.options[t]=e,this},Renderer.prototype.get=function(t){return this.options[t]},Renderer.prototype.include=function(t){return this.options.paths.push(t),this},Renderer.prototype.use=function(t){return t.call(this,this),this},Renderer.prototype.define=function(t,e,n){return(e=_export_coerce_(e,n)).nodeName?(this.options.globals[t]=e,this):(this.options.functions[t]=e,null!=n&&(e.raw=n),this)},Renderer.prototype.import=function(t){return this.options.imports.push(t),this},Renderer}();
|