@sencha/cmd-linux-64
Version:
Productivity and performance optimization tool for building applications with Sencha Ext JS
11 lines • 323 kB
JavaScript
"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;if(void 0!==getter)return getter.call(receiver)},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};!function(f){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.Fashion=f()}}(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){var Fashion=require("./src/export/Base.js"),CssVariableManager=require("./src/export/css/CssVariableManager.js"),css=new CssVariableManager;Fashion.apply(Fashion,{css:css,CssExport:CssVariableManager,ValueParser:require("./src/export/parse/ValueParser.js"),functions:{Color:require("./src/functions/Color.js"),Gradients:require("./src/functions/Gradients.js"),HSL:require("./src/functions/HSL.js"),Introspection:require("./src/functions/Introspection.js"),List:require("./src/functions/List.js"),Misc:require("./src/functions/Misc.js"),Numeric:require("./src/functions/Numeric.js"),Opacity:require("./src/functions/Opacity.js"),RGB:require("./src/functions/RGB.js"),Selectors:require("./src/functions/Selectors.js"),Text:require("./src/functions/Text.js"),Util:require("./src/functions/Util.js")},parse:{ast:{BaseNode:require("./src/parse/ast/BaseNode.js"),Nodes:require("./src/parse/ast/Nodes.js")},Scanner:require("./src/parse/Scanner.js"),Tokenizer:require("./src/parse/Tokenizer.js"),Parser:require("./src/parse/Parser.js")},processors:{CssVariables:require("./src/processors/CssVariables.js"),NameRegistrations:require("./src/processors/NameRegistrations.js"),DataInline:require("./src/processors/DataInline.js")},BaseSelector:require("./src/type/selectors/BaseSelector.js"),BaseSelectorList:require("./src/type/selectors/BaseSelectorList.js"),CompoundSelector:require("./src/type/selectors/CompoundSelector.js"),MultiPartSelector:require("./src/type/selectors/MultiPartSelector.js"),SelectorList:require("./src/type/selectors/SelectorList.js"),SelectorPart:require("./src/type/selectors/SelectorPart.js"),SelectorProperty:require("./src/type/selectors/SelectorProperty.js"),Type:require("./src/export/type/Type.js"),Bool:require("./src/export/type/Bool.js"),Literal:require("./src/export/type/Literal.js"),ParentheticalExpression:require("./src/export/type/ParentheticalExpression.js"),Text:require("./src/export/type/Text.js"),Numeric:require("./src/export/type/Numeric.js"),List:require("./src/export/type/List.js"),Map:require("./src/export/type/Map.js"),Color:require("./src/export/type/Color.js"),ColorRGBA:require("./src/export/type/ColorRGBA.js"),ColorHSLA:require("./src/export/type/ColorHSLA.js"),ColorStop:require("./src/export/type/ColorStop.js"),FunctionCall:require("./src/export/type/FunctionCall.js"),Declaration:require("./src/type/Declaration.js"),LinearGradient:require("./src/export/type/LinearGradient.js"),RadialGradient:require("./src/export/type/RadialGradient.js"),Ruleset:require("./src/type/Ruleset.js"),Statics:require("./src/export/type/Statics.js"),SourceBuilder:require("./src/type/SourceBuilder.js"),Types:require("./src/type/Types.js"),TypeVisitor:require("./src/type/TypeVisitor.js"),Builder:require("./src/Builder.js"),CompressedOutput:require("./src/CompressedOutput.js"),Context:require("./src/Context.js"),CSS:require("./src/CSS.js"),CssPostprocessor:require("./src/CssPostprocessor.js"),Env:require("./src/Env.js"),ExtendProcessor:require("./src/ExtendProcessor.js"),Output:require("./src/export/Output.js"),PlaceholderProcessor:require("./src/PlaceholderProcessor.js"),Preprocessor:require("./src/Preprocessor.js"),Ready:require("./src/Ready.js"),Runtime:require("./src/Runtime.js"),SassFile:require("./src/SassFile.js"),Transpiler:require("./src/Transpiler.js"),Visitor:require("./src/Visitor.js")}),module.exports=Fashion},{"./src/Builder.js":4,"./src/CSS.js":5,"./src/CompressedOutput.js":6,"./src/Context.js":7,"./src/CssPostprocessor.js":8,"./src/Env.js":9,"./src/ExtendProcessor.js":10,"./src/PlaceholderProcessor.js":12,"./src/Preprocessor.js":13,"./src/Ready.js":14,"./src/Runtime.js":15,"./src/SassFile.js":16,"./src/Transpiler.js":17,"./src/Visitor.js":18,"./src/export/Base.js":19,"./src/export/Output.js":20,"./src/export/css/CssVariableManager.js":22,"./src/export/parse/ValueParser.js":23,"./src/export/type/Bool.js":24,"./src/export/type/Color.js":25,"./src/export/type/ColorHSLA.js":26,"./src/export/type/ColorRGBA.js":27,"./src/export/type/ColorStop.js":28,"./src/export/type/FunctionCall.js":29,"./src/export/type/LinearGradient.js":30,"./src/export/type/List.js":31,"./src/export/type/Literal.js":32,"./src/export/type/Map.js":33,"./src/export/type/Numeric.js":34,"./src/export/type/ParentheticalExpression.js":35,"./src/export/type/RadialGradient.js":36,"./src/export/type/Statics.js":38,"./src/export/type/Text.js":39,"./src/export/type/Type.js":40,"./src/functions/Color.js":43,"./src/functions/Gradients.js":44,"./src/functions/HSL.js":45,"./src/functions/Introspection.js":46,"./src/functions/List.js":47,"./src/functions/Misc.js":48,"./src/functions/Numeric.js":49,"./src/functions/Opacity.js":50,"./src/functions/RGB.js":51,"./src/functions/Selectors.js":52,"./src/functions/Text.js":53,"./src/functions/Util.js":54,"./src/parse/Parser.js":55,"./src/parse/Scanner.js":56,"./src/parse/Tokenizer.js":57,"./src/parse/ast/BaseNode.js":59,"./src/parse/ast/Nodes.js":60,"./src/processors/CssVariables.js":61,"./src/processors/DataInline.js":62,"./src/processors/NameRegistrations.js":64,"./src/type/Declaration.js":65,"./src/type/Ruleset.js":66,"./src/type/SourceBuilder.js":67,"./src/type/TypeVisitor.js":68,"./src/type/Types.js":69,"./src/type/selectors/BaseSelector.js":70,"./src/type/selectors/BaseSelectorList.js":71,"./src/type/selectors/CompoundSelector.js":72,"./src/type/selectors/MultiPartSelector.js":73,"./src/type/selectors/SelectorList.js":74,"./src/type/selectors/SelectorPart.js":75,"./src/type/selectors/SelectorProperty.js":76}],2:[function(require,module,exports){},{}],3:[function(require,module,exports){function defaultSetTimout(){throw Error("setTimeout has not been defined")}function defaultClearTimeout(){throw Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var cachedSetTimeout,cachedClearTimeout,process=module.exports={};!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw Error("process.chdir is not supported")},process.umask=function(){return 0}},{}],4:[function(require,module,exports){var Fashion=require("./export/Base.js"),Base=Fashion.Base,Context=require("./Context.js"),Preprocessor=require("./Preprocessor.js"),Env=(require("./Transpiler.js"),require("./Env.js")),SassFile=require("./SassFile.js"),Parser=require("./parse/Parser.js"),Builder=(require("./parse/Scanner.js"),function(_Base){function Builder(config){_classCallCheck(this,Builder);var _this=_possibleConstructorReturn(this,(Builder.__proto__||Object.getPrototypeOf(Builder)).call(this,config));return _this.scripts={},Fashion.lastBuilder=_this,_this.context=new Context(_this.context),_this.context.libraries=_this.context.libraries||{compass:"../lib/compass/stylesheets/",blueprint:"../lib/blueprint/stylesheets/"},_this}return _inherits(Builder,_Base),_createClass(Builder,[{key:"getContext",value:function(){return this.context}},{key:"compile",value:function(scss,file){var context=this.getContext(),jsCode=context.convert(scss,file),fn=context.compile(jsCode),css=fn(context.runtime,{},context.preprocessor.getDynamicsMap());return css}},{key:"createSetters",value:function(vars){var varName,setters="";if("string"==typeof vars)setters=vars;else for(varName in vars)setters+=varName+": dynamic("+vars[varName]+");\n";return setters}},{key:"createVarsScope",value:function(vars){var setterAst,setterVariables,sortedAst,settersCode,settersFunc,newGlobals,context=this.context,parser=new Parser,preprocessor=new Preprocessor({runtime:context.runtime}),newContext=new Context({runtime:context.runtime,preprocessor:preprocessor}),setters=this.createSetters(vars),allVariables=Fashion.chain(context.getVariables());return setterAst=parser.parse(setters),preprocessor.preprocess(setterAst,!0),preprocessor.loadPreprocessorCache(context.preprocessor),setterVariables=preprocessor.getVariables(),Fashion.apply(allVariables,setterVariables),preprocessor.variables=allVariables,context.dynamicsMap=preprocessor.getDynamicsMap(),sortedAst=preprocessor.getSortedDynamicAstNodes(),settersCode=newContext.convert(sortedAst),newContext.runtime.setCaches(context.transpiler),settersFunc=newContext.compile(settersCode),settersFunc(context.runtime,null,context.dynamicsMap),newGlobals=context.runtime.getGlobalScope()}},{key:"rebuildCss",value:function(vars){var css,context=this.context,func=context.getFunc();return css=func(context.runtime,vars,context.dynamicsMap)}},{key:"build",value:function(file,callback){function onError(error){Fashion.log("Build error for "+file);var message=(error.message||error)+"";callback&&callback(["/* "+message+" */"],error)}var context,sassFile,split,vars,me=this;"string"!=typeof file&&(split=file.split,me.compressed=file.compress,vars=file.variables,file=file.path),this._sassFileUiPath=null,this._sassFileSavePath=null,context=me.getContext();try{sassFile=me.getSassFile(file),sassFile.invalidate(),sassFile.onReady(function(){Fashion.log("Fashion build starting for "+file);try{var ast=sassFile.getExpandedAst(),converted=context.convert(ast),func=context.compile(converted),css=func(),dynamics=context.dynamicsMap||context.preprocessor.getDynamicsMap();if(vars){var scope=me.createVarsScope(vars);context.dynamicsMap=dynamics,css=me.rebuildCss(scope)}css.getText(function(cssContent,exportFn){Fashion.log("Fashion build complete for "+file),callback&&callback(cssContent,null,exportFn)},me.compressed,me.indent,me.skipComments,split)}catch(error){onError(error)}})}catch(error){onError(error)}}},{key:"getSassFile",value:function(path,relPath,origSource,importer){var sassFileSavePath,sassFileUiPath,script,className,scripts=this.scripts,isSaveFile=!1,isUiFile=!1;return path=this.getSassFilePath(path,relPath),script=scripts[path],this.varSavePath&&(sassFileSavePath=this._sassFileSavePath||this.getSassFilePath(this.varSavePath),this._sassFileSavePath=sassFileSavePath,isSaveFile=path===sassFileSavePath),this.srcSavePath&&(sassFileUiPath=this._sassFileUiPath||this.getSassFilePath(this.srcSavePath),this._sassFileUiPath=sassFileUiPath,isUiFile=0===path.indexOf(sassFileUiPath)),isUiFile&&(className=path.replace(sassFileUiPath,"").replace(/^\//g,"").replace(/\//g,".").replace(/\.scss$/g,"")),script||(script=new SassFile({path:path,builder:this,originalSource:origSource,importer:importer,isSaveFile:isSaveFile,isUiFile:isUiFile,jsClassName:className}),scripts[path]=script),script}},{key:"getFsMap",value:function(){var key,k,path,parts,p,plen,part,level,next,map=this.fsMap,scripts=this.scripts,keys=Object.keys(scripts),len=keys.length;for(map||(map={files:{},root:!0},this.fsMap=map),k=0;k<len;k++){for(key=keys[k],path=key.replace(/\\/g,"/"),parts=path.split("/"),plen=parts.length,level=map,p=0;p<plen-1;p++)part=parts[p],next=level.files[part],next||(next={fullName:level.fullName?[level.fullName,part].join("/"):part,files:{},isDir:!0},level.files[part]=next),level=next;part=parts[plen-1],next=level.files[part],next||(next={fullName:level.fullName?[level.fullName,part].join("/"):part,key:key,isFile:!0,sassFile:scripts[key]},level.files[part]=next),level.hasFile=!0}return map}},{key:"getSassFilePath",value:function(path,relPath){return relPath&&(path=this.getPath(path,relPath)),path=path.replace(/\\/g,"/"),path=this.resolveUrl(path)}},{key:"getParser",value:function(){return new Parser}},{key:"getPath",value:function(baseFile,relPath){if(relPath){var root,libpath,separatorIndex=relPath.indexOf("/"),libraryPaths=this.context.libraries;if(0!==separatorIndex&&(root=separatorIndex===-1?relPath:relPath.substring(0,separatorIndex!==-1?separatorIndex:relPath.length),libpath=libraryPaths[root]))return this.calcPath(libpath,relPath)}return this.calcPath(baseFile,relPath)}},{key:"calcPath",value:function(baseFile,relPath){var path,sep=baseFile.lastIndexOf("/");return path=sep>-1?baseFile.substring(0,sep+1)+relPath:baseFile+"/"+relPath,path.indexOf(".scss")===-1&&path.indexOf(".js")===-1&&(path+=".scss"),path}},{key:"getResolverEl",value:function(){return this.resolverEl||(this.resolverEl=document.createElement("a")),this.resolverEl}},{key:"getCanonicalPath",value:function(path){var part,p,parts=path.split("/"),out=[];for(p=0;p<parts.length;p++)part=parts[p],"."!=part&&(".."==part?(0===out.length&&Fashion.raise("bad path for getCanonicalPath : "+path),out.pop()):out.push(part));return out.join("/")}},{key:"resolveUrl",value:function(path){if(path=path.replace(/\\/g,"/"),Env.isBrowser){var resolverEl=this.getResolverEl();return resolverEl.href=path,resolverEl.href}return path=this.getCanonicalPath(path)}},{key:"createStyleEl",value:function(href,content,before){var styleEl,ieMode,head=document.getElementsByTagName("head")[0],base=document.createElement("base");return Fashion.log("Using base href : "+href),base.href=href,head.firstChild?head.insertBefore(base,head.firstChild):head.appendChild(base),base.href=base.href,styleEl=document.createElement("style"),styleEl.type="text/css",ieMode="styleSheet"in styleEl,ieMode?(before?head.insertBefore(styleEl,before):head.appendChild(styleEl),styleEl.styleSheet.cssText=content):(styleEl.textContent=content,before?head.insertBefore(styleEl,before):head.appendChild(styleEl)),head.removeChild(base),styleEl}},{key:"injectCss",value:function(cssPath,cssContent){var _this2=this;this.lastCssPath=cssPath,Array.isArray(cssContent)||(cssContent=[cssContent]),cssPath=this.resolveUrl(cssPath);var me=this,currEls=me.styleEls||[],href=cssPath.substring(0,cssPath.lastIndexOf("/")+1);me.styleEls=[],cssContent.forEach(function(content,idx){content+="\n/*# sourceURL="+cssPath+"_"+idx+" */";var before=currEls.length&&currEls[0]||null,styleEl=_this2.createStyleEl(href,content,before);me.styleEls.push(styleEl)});var head=document.getElementsByTagName("head")[0];currEls.forEach(function(el){head.removeChild(el)})}}]),Builder}(Base));Fashion.apply(Builder.prototype,{context:void 0,varSavePath:void 0,srcSavePath:void 0,sassNamespace:void 0}),module.exports=Builder},{"./Context.js":7,"./Env.js":9,"./Preprocessor.js":13,"./SassFile.js":16,"./Transpiler.js":17,"./export/Base.js":19,"./parse/Parser.js":55,"./parse/Scanner.js":56}],5:[function(require,module,exports){var Fashion=require("./export/Base.js"),Base=Fashion.Base,SourceBuilder=require("./type/SourceBuilder.js"),CssPostprocessor=require("./CssPostprocessor.js"),ExtendProcessor=require("./ExtendProcessor.js"),PlaceholderProcessor=require("./PlaceholderProcessor.js"),Ready=require("./Ready.js"),Output=require("./export/Output.js"),CompressedOutput=require("./CompressedOutput.js"),CSS=function(_Base2){function CSS(config){_classCallCheck(this,CSS);var _this3=_possibleConstructorReturn(this,(CSS.__proto__||Object.getPrototypeOf(CSS)).call(this,config));return Fashion.apply(_this3,{css:[],extenders:[],outputs:[]}),_this3}return _inherits(CSS,_Base2),_createClass(CSS,[{key:"reset",value:function(){this.css=[]}},{key:"resetOutputs",value:function(){this.outputs=[],this.output=null}},{key:"addRuleset",value:function(ruleset){this.css.push(ruleset)}},{key:"createOutput",value:function(compressed,indent,skipComments,split){var output=compressed?new CompressedOutput:new Output;return indent&&(output.indentstr=indent),!compressed&&skipComments&&(output.addComment=function(text){},output.addCommentLn=function(text){this.addln()}),split&&(output.splitThreshold=split),this.output=output,this.outputs.push(output),output}},{key:"getOutputs",value:function(){var out=[];return this.outputs.forEach(function(output){out.push(output.get().trim())}),out}},{key:"getText",value:function(callBack,compressed,indent,skipComments,split){function postProcess(){var ready,proc=processors.shift();if(proc)ready=new Ready,me.ready=ready,proc.execute(css,me),ready.onReady(function(){postProcess()});else{for(var output=me.createOutput(compressed,indent,skipComments,split),c=0;c<css.length;c++){var newCount,newOutput,count=sourceBuilder.selectorCount,len=output.output.length,prevOutput=output.output;sourceBuilder.toSource(css[c],output),newCount=sourceBuilder.selectorCount,split>-1&&newCount>split&&(newOutput=me.createOutput(compressed,indent,skipComments,split),newOutput.output=output.output.substring(len),output.output=prevOutput,sourceBuilder.selectorCount=newCount-count,output=newOutput)}callBack(me.getOutputs(),me.exportFn)}}this.resetOutputs();var proc,extendProc,placeholderProc,css=this.css,sourceBuilder=new SourceBuilder;proc=new CssPostprocessor({context:this.context}),css=proc.process(css),extendProc=new ExtendProcessor,extendProc.context=this.context,extendProc.extendRulesets(css,this.extenders),placeholderProc=new PlaceholderProcessor,css=placeholderProc.processRulesets(css);var hostDirectives={"@charset":!0,"@import":!0};css.forEach(function(r,i){return r.index=i}),css.sort(function(r1,r2){var d1=!!hostDirectives[r1.atDirectiveName],d2=!!hostDirectives[r2.atDirectiveName];return d1&&!d2?-1:d2&&!d1?1:d1&&d2&&r1.atDirectiveName!=r2.atDirectiveName?"@charset"===r1.atDirectiveName?-1:1:r1.index-r2.index});var me=this,processors=this.processors||[];postProcess()}},{key:"getJSON",value:function(){var ans={};return ans}}]),CSS}(Base);Fashion.apply(CSS.prototype,{css:void 0,extenders:void 0,outputs:void 0,output:void 0,processors:void 0,context:void 0,exportJs:void 0}),module.exports=CSS},{"./CompressedOutput.js":6,"./CssPostprocessor.js":8,"./ExtendProcessor.js":10,"./PlaceholderProcessor.js":12,"./Ready.js":14,"./export/Base.js":19,"./export/Output.js":20,"./type/SourceBuilder.js":67}],6:[function(require,module,exports){var Fashion=require("./export/Base.js"),Output=require("./export/Output.js"),CompressedOutput=function(_Output){function CompressedOutput(){return _classCallCheck(this,CompressedOutput),_possibleConstructorReturn(this,(CompressedOutput.__proto__||Object.getPrototypeOf(CompressedOutput)).call(this))}return _inherits(CompressedOutput,_Output),_createClass(CompressedOutput,[{key:"space",value:function(){}},{key:"addComment",value:function(text){}},{key:"indent",value:function(){}},{key:"unindent",value:function(){}},{key:"addln",value:function(ln){_get(CompressedOutput.prototype.__proto__||Object.getPrototypeOf(CompressedOutput.prototype),"add",this).call(this,ln||"")}},{key:"addCommentLn",value:function(ln){}},{key:"indentln",value:function(ln){this.addln(ln)}},{key:"unindentln",value:function(ln){this.addln(ln)}}]),CompressedOutput}(Output);Fashion.apply(CompressedOutput.prototype,{isCompressed:!0}),module.exports=CompressedOutput},{"./export/Base.js":19,"./export/Output.js":20}],7:[function(require,module,exports){var Fashion=require("./export/Base.js"),Base=Fashion.Base,Runtime=require("./Runtime.js"),Preprocessor=require("./Preprocessor.js"),Transpiler=require("./Transpiler.js"),Parser=require("./parse/Parser.js"),Scanner=require("./parse/Scanner.js"),Context=function(_Base3){function Context(config){_classCallCheck(this,Context);var _this5=_possibleConstructorReturn(this,(Context.__proto__||Object.getPrototypeOf(Context)).call(this,config));return _this5._fnMap={},_this5.runtime=_this5.runtime||new Runtime({context:_this5}),_this5.preprocessor=_this5.preprocessor||new Preprocessor({runtime:_this5.runtime}),_this5.transpiler=_this5.transpiler||new Transpiler({preprocessor:_this5.preprocessor,symbols:config&&config.symbols}),_this5}return _inherits(Context,_Base3),_createClass(Context,[{key:"convert",value:function(ast,file){var node,parser,jsCode,transpiler=this.transpiler;return"string"==typeof ast?(parser=new Parser,node=parser.parse(ast,file)):node=ast,this.preprocessor.preprocess(node),jsCode=this.transpiler.transpile(node),this.runtime.setCaches(this.transpiler),this.lastVariables=transpiler.variables,jsCode}},{key:"getVariables",value:function(){return this.lastVariables}},{key:"compile",value:function(jsCode){var me=this,fn=this.runtime.compile(jsCode);return me.func=function(rt,overrides,dyn){return fn(rt||me.runtime,overrides,dyn||me.dynamicsMap||me.preprocessor.getDynamicsMap())}}},{key:"getFunc",value:function(){return this.func}},{key:"run",value:function(code){return this.runtime.run(code)}},{key:"parseSelectors",value:function(selector){var fn=this._fnMap[selector],runtime=this.runtime;if(!fn){var ast,jsCode,parsedSelectors,parser=new Parser,transpiler=new Transpiler;parser.scanner=new Scanner(selector),parser.style=parser.scanner.style,ast=parser.parseSelectors(),jsCode=transpiler.transpile(ast,!0),jsCode="return "+jsCode+";",fn=runtime.createWrappedFn(jsCode),this._fnMap[selector]=fn}return parsedSelectors=runtime.callWrappedFn(fn,{})}},{key:"getConfig",value:function(name){return this[name]}},{key:"setConfig",value:function(name,value){if("string"==typeof name){var prev=this[name];return this[name]=value,prev}return Fashion.apply(this,name),null}}]),Context}(Base);Fashion.apply(Context.prototype,{runtime:void 0,_fn:void 0,preprocessor:void 0,transpiler:void 0,func:void 0}),module.exports=Context},{"./Preprocessor.js":13,"./Runtime.js":15,"./Transpiler.js":17,"./export/Base.js":19,"./parse/Parser.js":55,"./parse/Scanner.js":56}],8:[function(require,module,exports){var Fashion=require("./export/Base.js"),TypeVisitor=require("./type/TypeVisitor.js"),Declaration=require("./type/Declaration.js"),Ruleset=require("./type/Ruleset.js"),SelectorList=require("./type/selectors/SelectorList.js"),MultiPartSelector=require("./type/selectors/MultiPartSelector.js"),Types=require("./type/Types.js"),Literal=Types.Literal,CssPostprocessor=function(_TypeVisitor){function CssPostprocessor(cfg){return _classCallCheck(this,CssPostprocessor),_possibleConstructorReturn(this,(CssPostprocessor.__proto__||Object.getPrototypeOf(CssPostprocessor)).call(this,cfg))}return _inherits(CssPostprocessor,_TypeVisitor),_createClass(CssPostprocessor,[{key:"selector",value:function(obj){"parent"===obj.selectorType&&(this.currentParentSelector?(obj.visitTarget=this.currentParentSelector,this.parentUsed=!0):this.strictParentRef&&Fashion.raise("Base-level rules cannot contain the parent-selector-referencing character '&'."))}},{key:"literal",value:function(obj){"&"===obj.value&&(this.currentParentSelector?obj.visitTarget=this.currentParentSelector:this.strictParentRef&&Fashion.raise("Base-level rules cannot contain the parent-selector-referencing character '&'."))}},{key:"getSelectorArray",value:function(selectors,applyInterpolations){if(selectors instanceof SelectorList)applyInterpolations&&selectors.applyInterpolations(),selectors=selectors.items;else{var str=""+selectors;if(str.indexOf(",")>-1&&applyInterpolations)return this.getSelectorArray(this.context.parseSelectors(str));selectors=[selectors]}return selectors}},{key:"combineSelectors",value:function(parent,child){var p,c,parentSelector,childSelector,parentSelectors=this.getSelectorArray(parent.selectors),childSelectors=this.getSelectorArray(child.selectors),expandedSelectors=[],plen=parentSelectors.length,clen=childSelectors.length;for(p=0;p<plen;p++)for(parentSelector=parentSelectors[p],this.currentParentSelector=parentSelector,c=0;c<clen;c++)childSelector=childSelectors[c].clone(),this.parentUsed=!1,this.visit(childSelector),this.parentUsed||(childSelector=new MultiPartSelector([parentSelector,childSelector])),expandedSelectors.push(childSelector);this.currentParentSelector=null,expandedSelectors=1==expandedSelectors.length?expandedSelectors[0]:new SelectorList(expandedSelectors),child.selectors=expandedSelectors}},{key:"combineMediaSelectors",value:function(parent,child){for(var parentSelector,nestedSelector,expanded=[],selectors=this.getSelectorArray(parent.selectors),items=this.getSelectorArray(child.selectors),s=0;s<selectors.length;s++){parentSelector=selectors[s];for(var n=0;n<items.length;n++){nestedSelector=items[n],0===n&&(nestedSelector.items=nestedSelector.items.slice(1)),this.currentParentSelector=parentSelector,this.parentUsed=!1,this.visit(nestedSelector),this.parentUsed=!1;var newSelector=new MultiPartSelector([parentSelector,new Literal("and"),nestedSelector]);newSelector.skipParentPrepend=child.isAtRoot(),expanded.push(newSelector)}}expanded=1===expanded.length?expanded[0]:new SelectorList(expanded),child.selectors=expanded}},{key:"declaration",value:function(obj){var declWas=this.currDeclaration;this.currDeclaration=obj,obj.descend(this),this.currDeclaration=declWas}},{key:"ruleset",value:function(obj){var parent,ns,d,decl,idx,prevMedia=this.prevMedia,prevAtRoot=this.prevAtRoot,prevAtRule=this.prevAtRule,prevPlain=this.prevPlain,atRoot=!1,declaration=this.currDeclaration;if(obj.isNamespaced){if(this.visit(obj.declarations),declaration){for(ns=declaration.property,parent=declaration.ruleset,idx=parent.getDeclarationIndex(declaration),idx===-1&&(idx=parent.declarations.length),d=0;d<obj.declarations.length;d++)decl=obj.declarations[d],parent.addDeclaration(new Declaration({property:ns+"-"+decl.property,value:decl.value,docs:decl.docs,sourceInfo:decl.sourceInfo,important:decl.important}),d+idx);obj.visitTarget=null,obj.parentNode===declaration&&parent.removeDeclaration(declaration)}return!1}if(obj.selectors=this.getSelectorArray(obj.selectors,!0),1===obj.selectors.length?obj.selectors=obj.selectors[0]:obj.selectors=new SelectorList(obj.selectors),obj.isAtRule()){if(this.prevAtRule=obj,prevPlain&&obj.declarations.length){var newRuleset=new Ruleset({parent:obj,declarations:obj.declarations,selectors:prevPlain.selectors,isMediaRoot:!0});newRuleset.declarations.forEach(function(d){return d.ruleset=newRuleset}),obj.declarations=[],obj.children.unshift(newRuleset)}prevAtRule||(atRoot=!0)}return obj.isMedia()?(prevMedia&&this.combineMediaSelectors(prevMedia,obj),this.prevMedia=obj,atRoot=!0):obj.isAtRoot()?atRoot=!0:obj.isAtRule()||(prevPlain&&!obj.isMediaRoot&&this.combineSelectors(prevPlain,obj),this.prevPlain=obj,prevAtRule||(atRoot=!0)),atRoot&&(obj.parent&&obj.parent.removeChildRuleset(obj),(obj.isAtRule()||obj.declarations.length||obj.isAtDirective)&&this.rootCss.push(obj)),obj.descend(this),this.prevMedia=prevMedia,this.prevAtRoot=prevAtRoot,this.prevPlain=prevPlain,this.prevAtRule=prevAtRule,!1}},{key:"visitItem",value:function(obj){var currParent=this.currParent;obj.parentNode=currParent,this.currParent=obj,_get(CssPostprocessor.prototype.__proto__||Object.getPrototypeOf(CssPostprocessor.prototype),"visitItem",this).call(this,obj),this.currParent=currParent}},{key:"process",value:function(obj){return this.rootCss=[],this.visit(obj),this.rootCss}}]),CssPostprocessor}(TypeVisitor);Fashion.apply(CssPostprocessor.prototype,{currentParentSelector:null,parentUsed:null,rootCss:null,context:null,prevMedia:null,prevAtRule:null,prevAtRoot:null,prevPlain:null,currDeclaration:null,currParent:null,strictParentRef:!1}),module.exports=CssPostprocessor},{"./export/Base.js":19,"./type/Declaration.js":65,"./type/Ruleset.js":66,"./type/TypeVisitor.js":68,"./type/Types.js":69,"./type/selectors/MultiPartSelector.js":73,"./type/selectors/SelectorList.js":74}],9:[function(require,module,exports){(function(global){(function(){var fs,Fashion=require("./export/Base.js"),isNode=function(){try{return"[object process]"===Object.prototype.toString.call(global.process);
}catch(e){return!1}}(),isPhantom="undefined"!=typeof phantom,isRhino="undefined"!=typeof importPackage,isBrowser=!(isNode||isRhino||isPhantom),canSetPrototype=function(){var a={x:42},b={};try{b.__proto__=a}catch(e){}return 42===b.x}();(isNode||isPhantom)&&(fs=require("fs"));var Env=function(){function Env(){_classCallCheck(this,Env),Fashion.apply(this,{isNode:isNode,isPhantom:isPhantom,isRhino:isRhino,isBrowser:isBrowser,canSetPrototype:canSetPrototype,fs:fs})}return _createClass(Env,[{key:"exists",value:function(path){var fs=this.fs;try{return this.isRhino&&!this.isPhantom?new java.io.File(path).exists():this.isPhantom?fs.exists(path):(this.readFile(path),!0)}catch(e){return!1}}},{key:"join",value:function(dir,subpath){return dir+"/"+subpath}},{key:"readFileRhino",value:function(file){Fashion.raise("function 'Fashion.Env.readFileRhino' has no default implementation")}},{key:"readFile",value:function(file){return this.isRhino?this.readFileRhino(file):this.isNode?this.fs.readFileSync(file):this.doRequest({url:file,async:!1,method:"GET"})}},{key:"loadFileRhino",value:function(file,success,error){Fashion.raise("function 'Fashion.Env.readFileRhino' has no default implementation")}},{key:"loadFile",value:function(file,success,error,options,retries){this.isBrowser?(retries=retries||0,this.doRequest(Fashion.merge({url:file,async:!0,params:{_dc:(new Date).getTime()},onComplete:function(options,xhr){success&&success(xhr.responseText,xhr)},onError:function(){retries<3?this.loadFile(file,success,error,options,retries+1):error&&error.apply(error,arguments)}},options))):this.isNode?this.fs.readFile(file,"utf-8",function(err,data){err?error&&error(err):(65279!==data.charCodeAt(0)&&65534!==data.charCodeAt(0)||(data=data.substr(1)),success(data))}):this.isRhino&&this.loadFileRhino(file,success,error)}},{key:"doRequest",value:function(options){var queryParamStr,xhr,content,sep,url=options.url,method=options.method||"GET",data=options.data||null,async=options.async!==!1,onComplete=options.onComplete,onError=options.onError,scope=options.scope||this,params=options.params,queryParams=[],arrayBufferSupported=!1;if(params){for(var name in params)queryParams.push(name+"="+params[name]);queryParamStr=queryParams.join("&"),""!==queryParamStr&&(sep=url.indexOf("?")>-1?"&":"?",url=url+sep+queryParamStr)}if("undefined"!=typeof XMLHttpRequest?(xhr=new XMLHttpRequest,arrayBufferSupported="string"==typeof xhr.responseType):xhr=new ActiveXObject("Microsoft.XMLHTTP"),xhr.open(method,url,async),async&&(xhr.timeout=5e3),options.binary&&(arrayBufferSupported?(xhr.responseType="arraybuffer",xhr.getBinaryData=function(){return new Uint8Array(this.response)}):(xhr.overrideMimeType("text/plain; charset=x-user-defined"),xhr.getBinaryData=function(){return this.responseText})),xhr.onreadystatechange=function(){if(4===xhr.readyState)try{200===xhr.status?onComplete&&onComplete.call(scope,options,xhr):onError&&onError.call(scope,options,xhr)}catch(err){Fashion.error((err.stack||err)+""),onError&&onError.call(scope,options,xhr,err)}finally{}},xhr.onerror=onError,"function"==typeof data&&(data=data()),"string"!=typeof data&&(data=JSON.stringify(data)),xhr.send(data),!async)return content=xhr.responseText}}]),Env}();module.exports=new Env}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export/Base.js":19,fs:2}],10:[function(require,module,exports){function pushApply(array,items){for(var i=0;i<items.length;i++){var item=items[i];item&&array.push(item)}}function joinArrays(){for(var arrays=arguments,out=[],i=0;i<arrays.length;i++){var array=arrays[i];Array.isArray(array)?pushApply(out,arrays[i]):array&&out.push(array)}return out}var Fashion=require("./export/Base.js"),TypeVisitor=require("./type/TypeVisitor.js"),SelectorList=require("./type/selectors/SelectorList.js"),MultiPartSelector=require("./type/selectors/MultiPartSelector.js"),CompoundSelector=require("./type/selectors/CompoundSelector.js"),SourceBuilder=require("./type/SourceBuilder.js"),ExtendProcessor=function(_TypeVisitor2){function ExtendProcessor(cfg){return _classCallCheck(this,ExtendProcessor),_possibleConstructorReturn(this,(ExtendProcessor.__proto__||Object.getPrototypeOf(ExtendProcessor)).call(this,cfg))}return _inherits(ExtendProcessor,_TypeVisitor2),_createClass(ExtendProcessor,[{key:"mergeCompoundSelector",value:function(match,extendSelector,matchKeys,targetKeys){for(var newCompoundSelector,matchIndex,origCompoundSelector=this.currCompoundSelector,compoundSelector=origCompoundSelector,multiPartSelector=this.currMultiPartSelector,items=[],i=0;i<compoundSelector.items.length;i++){for(var item=compoundSelector.items[i];item&&item.visitTarget;)item=item.visitTarget;item&&item.$isFashionBaseSelectorList&&(compoundSelector=this.context.parseSelectors(SourceBuilder.toSource(compoundSelector)),multiPartSelector=null)}for(var i=0;i<compoundSelector.items.length;i++){var item=compoundSelector.items[i],hash=item.getHash();targetKeys?targetKeys.hasOwnProperty(hash)?(matchIndex=i,items.push(null)):items.push(item):hash!=match.getHash()?items.push(item):(matchIndex=i,items.push(null))}if(extendSelector instanceof MultiPartSelector){var newSelector=extendSelector.clone(),last=newSelector.last();last instanceof CompoundSelector?last.setItems(joinArrays(items,last.items)):compoundSelector.$isFashionMultiPartSelector?(last=new MultiPartSelector(joinArrays([last],items)),newSelector.items[newSelector.items.length-1]=last):(last=new CompoundSelector(joinArrays([last],items)),newSelector.items[newSelector.items.length-1]=last),newCompoundSelector=newSelector}else extendSelector instanceof CompoundSelector?items.splice.apply(items,[matchIndex,1].concat(extendSelector.items)):items[matchIndex]=extendSelector;if(newCompoundSelector=newCompoundSelector||new CompoundSelector(items),multiPartSelector){for(var newItems=[],i=0;i<multiPartSelector.items.length;i++){var item=multiPartSelector.items[i];item===origCompoundSelector?newItems.push(newCompoundSelector):newItems.push(item)}this.newSelectors.push(new MultiPartSelector(newItems))}else this.newSelectors.push(newCompoundSelector)}},{key:"mergeMultiPartSelector",value:function(match,extendSelector){var i,item,before,after,multiPartSelector=this.currMultiPartSelector,items=multiPartSelector.items,len=items.length;for(i=0;i<len;i++)if(item=items[i],item.getHash()===match.getHash())if(before=items.slice(0,i),after=items.slice(i+1),extendSelector instanceof MultiPartSelector){var mpExtendSelector=extendSelector,extendItems=mpExtendSelector.items,elen=extendItems.length,first=extendItems.slice(0,elen-1),last=extendItems.slice(elen-1);this.newSelectors.push(new MultiPartSelector(joinArrays(before,first,last,after))),this.newSelectors.push(new MultiPartSelector(joinArrays(first,before,last,after)))}else this.newSelectors.push(new MultiPartSelector(joinArrays(before,extendSelector,after)))}},{key:"checkSelectorPart",value:function(obj){if(obj.getHash()===this.currTargetHash)if(this.currCompoundSelector)for(var e=0;e<this.extendSelectors.length;e++){var extendSelector=this.extendSelectors[e];this.mergeCompoundSelector(obj,extendSelector)}else if(this.currMultiPartSelector)for(var e=0;e<this.extendSelectors.length;e++){var extendSelector=this.extendSelectors[e];this.mergeMultiPartSelector(obj,extendSelector)}else this.appendAllExtendSelectors()}},{key:"appendAllExtendSelectors",value:function(){this.newSelectors.push.apply(this.newSelectors,this.extendSelectors)}},{key:"getCompoundSelectorMap",value:function(compoundSelector){for(var item,map={},i=0;i<compoundSelector.items.length;i++)item=compoundSelector.items[i],map[item.getHash()]=!0;return map}},{key:"literal",value:function(obj){this.checkSelectorPart(obj)}},{key:"selector",value:function(obj){this.checkSelectorPart(obj)}},{key:"compoundselector",value:function(obj){var resetCompoundSelector=this.currCompoundSelector;if(this.currCompoundSelector=obj,obj.getHash()===this.currTargetHash)this.appendAllExtendSelectors();else if(this.currTarget instanceof CompoundSelector){for(var targetKey,objMap=this.getCompoundSelectorMap(obj),targetMap=this.getCompoundSelectorMap(this.currTarget),objKeys=Object.keys(objMap),targetKeys=Object.keys(targetMap),subset=!0,t=0;t<targetKeys.length;t++)if(targetKey=targetKeys[t],!objKeys.hasOwnProperty(targetKey)){subset=!1;break}if(subset)for(var e=0;e<this.extendSelectors.length;e++){var extendSelector=this.extendSelectors[e];this.mergeCompoundSelector(obj,extendSelector,objKeys,targetKeys)}}else obj.descend(this);return this.currCompoundSelector=resetCompoundSelector,!1}},{key:"multipartselector",value:function(obj){var resetMultiPartSelector=this.currMultiPartSelector;return this.currMultiPartSelector=obj,obj.getHash()===this.currTargetHash?this.appendAllExtendSelectors():obj.descend(this),this.currMultiPartSelector=resetMultiPartSelector,!1}},{key:"extend",value:function(ruleset,targetSelector,extendSelectors){var i,j,newSelector,hash;if(this.currTarget=targetSelector,this.currTargetHash=this.currTarget.getHash(),this.newSelectors=[],this.extendSelectors=extendSelectors,ruleset.selectors&&(ruleset.selectors.flatten&&ruleset.selectors.flatten(),this.visit(ruleset.selectors)),this.newSelectors.length){var selectors=ruleset.selectors,map={};for(selectors=selectors instanceof SelectorList?selectors.items:[selectors],i=0;i<selectors.length;i++)map[selectors[i].getHash()]=!0;for(i=0;i<this.newSelectors.length;i++)newSelector=this.newSelectors[i],hash=newSelector.getHash(),map.hasOwnProperty(hash)||(selectors.push(newSelector),map[hash]=!0);for(i=0;i<selectors.length;i++)for(j=0;j<selectors.length;j++)if(i!=j&&selectors[i]&&selectors[j]){var comp=this.compareSelectors(selectors[i],selectors[j]);0!==comp&&(comp>1?selectors[i]=null:selectors[j]=null)}for(var filteredSelectors=[],i=0;i<selectors.length;i++){var selector=selectors[i];selector&&filteredSelectors.push(selector)}ruleset.selectors=new SelectorList(filteredSelectors)}for(var c=0;c<ruleset.children.length;c++)this.extend(ruleset.children[c],targetSelector,extendSelectors)}},{key:"compareSelectors",value:function(sel1,sel2){if(sel1 instanceof MultiPartSelector)return sel2 instanceof MultiPartSelector||(sel2=new MultiPartSelector([sel2])),this.isSuperSelector(sel1,sel2);if(sel2 instanceof MultiPartSelector)return sel1=new MultiPartSelector([sel1]),this.isSuperSelector(sel1,sel2);if(sel1 instanceof CompoundSelector)return sel2 instanceof CompoundSelector||(sel2=new CompoundSelector([sel2])),this.isSubset(sel1,sel2);if(sel2 instanceof CompoundSelector)return sel1=new CompoundSelector([sel1]),this.isSubset(sel1,sel2);var h1=sel1.getHash(),h2=sel2.getHash();return h1==h2?1:0}},{key:"isSuperSelector",value:function(sel1,sel2){var tmpRes,items=sel1.items,sItems=sel2.items,shortList=items,longList=sItems,res=1;items.length>sItems.length&&(shortList=sItems,longList=items,res=-1);for(var i=0;i<shortList.length;i++){tmpRes=this.compareSelectors(shortList[i],longList[i]);var tmpRes;if(0===tmpRes)return 0;if(tmpRes!==res)return 0}return res}},{key:"isSubset",value:function(sel1,sel2){var item,items=sel1.items,sItems=sel2.items,longItemMap={},shortList=items,longList=sItems,res=1;items.length>sItems.length&&(shortList=sItems,longList=items,res=-1);for(var i=0;i<longList.length;i++)item=longList[i],longItemMap[item.getHash()]=item;for(var i=0;i<shortList.length;i++)if(item=shortList[i],!longItemMap[item.getHash()])return 0;return res}},{key:"extendRulesets",value:function(rulesets,extenders){var i,j,k,e,iLen,jLen,kLen,eLen,extender,extend,ruleset,token,hash,extendMap={},extenderArray=[];for(iLen=extenders.length,kLen=rulesets.length,i=0;i<iLen;i++)for(extender=extenders[i],jLen=extender.extend.length,j=0;j<jLen;j++){extend=extender.extend[j];var extendSelectors=extender.selectors;extendSelectors instanceof SelectorList?(extendSelectors.flatten(),extendSelectors=extendSelectors.items):((extendSelectors.$isFashionMultiPartSelector||extendSelectors.$isFashionCompoundSelector)&&extendSelectors.flatten(),extendSelectors=[extendSelectors]),hash=extend.getHash(),token=extendMap[hash],token||(token={selector:extend,extenders:[]},extendMap[hash]=token,extenderArray.push(token)),token.extenders.push.apply(token.extenders,extendSelectors)}for(eLen=extenderArray.length,k=0;k<kLen;k++)for(ruleset=rulesets[k],e=0;e<eLen;e++)token=extenderArray[e],this.extend(ruleset,token.selector,token.extenders)}}]),ExtendProcessor}(TypeVisitor);Fashion.apply(ExtendProcessor.prototype,{currTarget:null,currTargetHash:null,newSelectors:null,extendSelectors:null,currCompoundSelector:null,currMultiPartSelector:null}),module.exports=ExtendProcessor},{"./export/Base.js":19,"./type/SourceBuilder.js":67,"./type/TypeVisitor.js":68,"./type/selectors/CompoundSelector.js":72,"./type/selectors/MultiPartSelector.js":73,"./type/selectors/SelectorList.js":74}],11:[function(require,module,exports){function getJsName(name){return name.replace(/\-/g,"_").replace(/\//g,"_fs_").replace(/\\/g,"_bs_")}var NameConverter=function(){function NameConverter(){_classCallCheck(this,NameConverter),this.variableNameMap={}}return _createClass(NameConverter,[{key:"convertName",value:function(name){var map=this.variableNameMap,converted=map[name];return void 0===converted&&(converted=map[name]=getJsName(name)),converted}}]),NameConverter}(),converter=new NameConverter;module.exports={NameConverter:NameConverter,getJsName:function(name){return converter.convertName(name)}}},{}],12:[function(require,module,exports){var Fashion=require("./export/Base.js"),TypeVisitor=require("./type/TypeVisitor.js"),PlaceholderProcessor=function(_TypeVisitor3){function PlaceholderProcessor(cfg){return _classCallCheck(this,PlaceholderProcessor),_possibleConstructorReturn(this,(PlaceholderProcessor.__proto__||Object.getPrototypeOf(PlaceholderProcessor)).call(this,cfg))}return _inherits(PlaceholderProcessor,_TypeVisitor3),_createClass(PlaceholderProcessor,[{key:"literal",value:function(obj){"%"===obj.getHash()&&(this.hasPlaceholder=!0)}},{key:"selector",value:function(obj){"placeholder"===obj.selectorType&&(this.hasPlaceholder=!0)}},{key:"selectorlist",value:function(obj){var i,item,items=obj.items,len=items.length,newItems=[];for(i=0;i<len;i++)item=items[i],this.hasPlaceholder=!1,this.visit(item),this.hasPlaceholder||newItems.push(item);return obj.items=newItems,!1}},{key:"ruleset",value:function(obj){return this.hasPlaceholder=!1,this.visit(obj.selectors),this.hasPlaceholder&&(obj.selectors=null),this.visit(obj.children),!1}},{key:"process",value:function(css){this.visit(css),css.selectors&&0!==css.selectors.length&&this.outCss.push(css)}},{key:"processRulesets",value:function(css){this.outCss=[];for(var i=0;i<css.length;i++)this.process(css[i]);return this.outCss}}]),PlaceholderProcessor}(TypeVisitor);Fashion.apply(PlaceholderProcessor.prototype,{hasPlaceholder:!1,outCss:null}),module.exports=PlaceholderProcessor},{"./export/Base.js":19,"./type/TypeVisitor.js":68}],13:[function(require,module,exports){var Fashion=require("./export/Base.js"),Base=Fashion.Base,Visitor=require("./Visitor.js"),regexes={replaces:/^\s*?\/\/# fashion replaces\s+?(.*?)$/},SassVariableAttributes=function SassVariableAttributes(){_classCallCheck(this,SassVariableAttributes)};Fashion.apply(SassVariableAttributes.prototype,{global:!1,"default":!1,dynamic:!1});var SassVariable=function(_Base4){function SassVariable(cfg){_classCallCheck(this,SassVariable);var _this9=_possibleConstructorReturn(this,(SassVariable.__proto__||Object.getPrototypeOf(SassVariable)).call(this,cfg));return _this9.references=_this9.references||[],_this9}return _inherits(SassVariable,_Base4),_createClass(SassVariable,[{key:"elevateDynamics",value:function(variables,elevator){var me=this,dynamicWas=me.dynamic;me.dynamic=!0,dynamicWas||(this.enableElevationWarning&&(Fashion.warn("Elevating variable '"+me.name+"' to dynamic",me.node),Fashion.warn("\tcaused by",elevator.node)),me.elevationCause=elevator,variables.push(me)),me.references.forEach(function(ref){var variable=me.map[ref];variable&&!variable.dynamic&&variable.elevateDynamics(variables,me)})}},{key:"verify",value:function(){return!(this.dynamic&&this.previous&&!this.previous.dynamic)||(Fashion.error("Cannot redefine "+this.name+" as dynamic"),Fashion.error("\tfrom ",this.previous.getNode()),Fashion.error("\t at ",this.getNode()),this.preprocessor.errors+=1,!1)}},{key:"elevated",value:function(){return this.dynamic&&!this.attributes.dynamic}},{key:"getNode",value:function(){var node=this.node;return node}}]),SassVariable}(Base);Fashion.apply(SassVariable.prototype,{name:null,previous:null,node:null,dynamic:!1,references:null,attributes:null,isGlobal:!1,map:null,elevationCause:null,processed:!1,preprocessor:null,enableElevationWarning:!1,scope:void 0});var Preprocessor=function(_Visitor){function Preprocessor(cfg){_classCallCheck(this,Preprocessor);var _this10=_possibleConstructorReturn(this,(Preprocessor.__proto__||Object.getPrototypeOf(Preprocessor)).call(this,cfg));return _this10.reset(),_this10}return _inherits(Preprocessor,_Visitor),_createClass(Preprocessor,[{key:"reset",value:function(){this.replacedVariable=null,this.variables={},this.functions=[],this.currentVariable=null,this.functionDeclarations={},this.mixinDeclarations={},this.registeredDeclarations=null,this.replacesMap={},this.currentScope={variables:{},isGlobal:!0}}},{key:"handleFunc",value:function(node,collection){var func=node.func||node.name,name=Fashion.getJsName(func.id||func.value),parameters=Preprocessor.getFunctionCallArgs(func);collection[name]={parameters:parameters,ast:node,scope:this.currentScope};for(var i=0;i<parameters.length;i++){var param=parameters[i];name=Fashion.getJsName(param.name),this.currentScope.variables[name]=new SassVariable({name:name,node:param.arg,isGlobal:!1,dynamic:!1,map:this.currentScope.variables,preprocessor:this,enableElevationWarning:this.enableElevationWarning,scope:this.currentScope})}}},{key:"Mixin",value:function(node){var scopeWas=this.currentScope;this.currentScope={prev:scopeWas,variables:{}},this.handleFunc(node,this.mixinDeclarations),node.descend(this),this.currentScope=scopeWas}},{key:"Function",value:function(node){var isGlobal=1==this.nodeStack.length,scopeWas=this.currentScope;isGlobal&&this.functions.push(node),this.currentScope={prev:scopeWas,variables:{}},this.handleFunc(node,this.functionDeclarations),node.descend(this),this.currentScope=scopeWas}},{key:"getVariable",value:function(name){for(var variable,scope=this.currentScope;scope&&!(variable=scope.variables[name]);)scope=scope.prev;return variable}},{key:"Variable",value:function(node){if(this.currentVariable){var refName=Fashion.getJsName(node.name),variable=this.getVariable(refName);variable&&!variable.scope.isGlobal||this.currentVariable.references.push(refName)}}},{key:"FunctionCall",value:function(node){if(this.currentVariable){node.descend(this);var id=Fashion.getJsName(node.id),entry=this.functionDeclarations[id];if(entry){var scopeWas=this.currentScope;this.currentScope=entry.scope,this.visit(entry.ast.statements),this.currentScope=scopeWas}}}},{key:"Comment",value:function(comment){var replaces=regexes.replaces,match=replaces.exec(comment);"//# fashion warn -elevation"===comment?this.enableElevationWarning=!1:"//# fashion warn +elevation"===comment?this.enableElevationWarning=!0:match&&(this.replacedVariable=match[1])}},{key:"VariableAssignment",value:function(node){var variable,value,funcName,replaces=this.replacedVariable,replacesEntry=this.replacesMap[Fashion.getJsName(node.name)],origName=node.name,nodeName=replacesEntry&&replacesEntry.name||origName,name=Fashion.getJsName(nodeName),currVariable=this.variables[name],varWas=this.currentVariable,bangGlobal=!!node.global,bangDynamic=!!node.dynamic,bangDefault=!!node["default"],isGlobalVar=1===this.nodeStack.length;if(replacesEntry&&Fashion.warn("Using new variable "+replacesEntry.name+" for deprecated variable "+node.name,node),node.name=nodeName,value=node.value,"FunctionCall"===value.type&&(funcName=value.id||value.value,"dynamic"===funcName&&(bangDynamic=!0,value.visitTarget=value.args,value.args.items&&1===value.args.items.length&&(value.visitTarget=value.args.items[0]))),variable=new SassVariable({name:name,nodeName:origName,node:node,previous:currVariable,attributes:{global:bangGlobal,"default":bangDefault,dynamic:bangDynamic},isGlobal:isGlobalVar,dynamic:currVariable&&currVariable.dynamic||bangDynamic,map:this.variables,preprocessor:this,enableElevationWarning:this.enableElevationWarning,scope:this.currentScope,replaces:replaces||currVariable&&currVariable.replaces}),variable.replaces){var replacesName=Fashion.getJsName(variable.replaces),current=this.replacesMap[replacesName];current&&variable.name!=current.name&&Fashion.warn("Variable "+current.name+" already replaces variable "+variable.replaces,node),this.replacesMap[replacesName]=variable}return this.replacedVariable=null,this.currentScope.variables[name]=variable,isGlobalVar||bangGlobal?(node.dynamic&&(Fashion.warn("Use of !dynamic has been deprecated",node),Fashion.warn("Use dynamic() function instead.")),variable.verify(),this.variables[name]=variable,this.currentVariable=variable,node.descend(this),void(this.currentVariable=varWas)):(node.descend(this),!1)}},{key:"getRuntime",value:function(){return this.runtime}},{key:"getRegisteredFunctions",value:function(){return this.registeredFunctions||(this.registeredFunctions=this.runtime&&this.runtime.getRegisteredFunctions()||{}),this.registeredFunctions}},{key:"loadRegisteredFunctionArgs",value:function(){if(!this.registeredDeclarations){var name,func,src,params,match,args,i,argName,registered=this.getRegisteredFunctions(),funcArgsRx=this.funcArgsRx,paramsMap={};for(name in registered)if(func=registered[name],Fashion.isFunction(func)){if(src=func+"",params=[],match=funcArgsRx.exec(src),match&&match[2])for(args=match[2]&&match[2].split(/,/g)||[],i=0;i<args.length;i++)argName=args[i].trim(),params.push({name:argName,position:i});paramsMap[name]=params}this.registeredDeclarations=paramsMap}}},{key:"preprocess",value:function(node,skipRegistrations){this.reset(),this.visit(node),skipRegistrations||this.loadRegisteredFunctionArgs(),this.errors&&Fashion.raise("Encountered "+this.errors+" error(s) during preprocessing.")}},{key:"getVariables",value:function(){return this.variables}},{key:"generateCycleError",value:function(stack,variables){var r,trace,referenceTrace=[];for(r=0;r<stack.length;r++)trace=stack[r]+" => "+variables[stack[r]].node.file+":"+variables[stack[r]].node.lineNumber,referenceTrace.push(trace);var msg=["Variable Cycle detected in variable : ",referenceTrace.join("\n")].join("\n");Fashion.error(msg),Fashion.raise(msg)}},{key:"topoSort",value:function(variable,variables,sorted,processed,stack){function processRef(ref){var refVariable=variables[ref];return!(!refVariable||!refVariable.dynamic&&!me.sortAllVariables)&&(me.topoSort(refVariable,variables,sorted,processed,stack),!0)}processed=processed||{},sorted=sorted||[],stack=stack||[];var refs,ref,r,me=this,name=variable.name;if(processed[name]!==!0){for(stack.push(name),"processing"===processed[name]&&this.generateCycleError(stack,variables),processed[name]="processing",refs=variable.references,r=0;r<refs.length;r++)if(ref=refs[r],!processRef(ref)&&this.replacesMap[ref]){var entry=this.replacesMap[ref],ref=Fashion.getJsName(entry.name);processRef(ref)}sorted.push(variable),processed[name]=!0,stack.pop()}}},{key:"getDynamics",value:function(){var variable,name,dynamic,d,n,variables=this.sortAllVariables?this.currentScope.variables:this.variables,variableNames=Object.keys(variables),dynamics=[],sorted=[];for(n=0;n<variableNames.length;n++)name=variableNames[n],variable=variables[name],variable.dynamic&&(variable.elevateDynamics(dynamics),dynamics.push(variable));for(d=0;d<dynamics.length;d++)dynamic=dynamics[d],this.topoSort(dynamic,variables,sorted);return sorted}},{key:"getDynamicsMap",value:function(){var i,variable,dynamicVariables=this.getDynamics(),map={};for(i=0;i<dynamicVariables.length;i++)variable=dynamicVariables[i],map[variable.name]=variable;return map}},{key:"getSortedDynamicAstNodes",value:function(){var i,sortedVariables=this.getDynamics(),sortedAst=[];for(i=0;i<sortedVariables.length;i++)sortedAst.push(sortedVariables[i].getNode());return sortedAst}},{key:"loadPreprocessorCache",value:function(preprocessor){this.functionDeclarations=preprocessor.functionDeclarations,this.mixinDeclarations=preprocessor.mixinDeclarations,this.registeredDeclarations=preprocessor.registeredDeclarations,this.registeredFunctions=preprocessor.registeredFunctions,this.currentScope=preprocessor.currentScope}}],[{key:"loadArgsArray",value:function(args){return!args||"SelectorList"!==args.type&&"List"!==args.type||(args=args.items),Array.isArray(args)||(args=[args]),args}},{key:"getFunctionCallArgs",value:function(func){var arg,a,param,args=this.loadArgsArray(func.args),parameters=[];for(a=0;a<args.length;a++)if(arg=args[a],arg&&(param={name:arg.variable||arg.name,value:arg,position:a,varArgs:arg.varArgs},parameters.push(param),arg.variable))if(arg.token){var scanner=arg.token.scanner,style=scanner&&scanner.style,start=arg.token.startIdx,end=arg.token.idx;param["default"]=style.substring(start,end).trim()}else if("List"==arg.type){var first=arg.items[0],last=arg.items[arg.items.length-1],startTok=first&&first.token,endTok=last&&last.token;if(startTok&&endTok){var style=startTok.scanner.style,start=startTok.startIdx,end=endTok.idx;param["default"]=style.substring(start,end).trim()}}return parameters}}]),Preprocessor}(Visitor);Fashion.apply(Preprocessor.prototype,{functionDeclarations:null,mixinDeclarations:null,registeredDeclarations:null,registeredFunctions:null,runtime:null,currentVariable:null,functions:null,variables:null,errors:0,enableElevationWarning:!0,funcArgsRx:/function\s*?(.*?)\((.*?)\)\s*?\{/,sortAllVariables:!1}),module.exports=Preprocessor},{"./Visitor.js":18,"./export/Base.js":19}],14:[function(require,module,exports){var Ready=function(){function Ready(){_classCallCheck(this,Ready),this.blocks=0,this.listeners=[]}return _createClass(Ready,[{key:"block",value:function(){this.blocks++}},{key:"unblock",value:function(){this.blocks&&!--this.blocks&&this.fireReady()}},{key:"fireReady",value:function(){for(var i=0;i<this.listeners.length;i++){var listener=this.listeners[i];listener(),this.listeners[i]=null}this.listeners=Fashion.filter(this.listeners,function(l){return!!l})}},{key:"onReady",value:function(callback){this.blocks?this.listeners.push(callback):callback()}}]),Ready}();module.exports=Ready},{}],15:[function(require,module,exports){var Fashion=require("./export/Base.js"),BaseRuntime=(Fashion.Base,require("./export/Runtime.js")),Literal=(require("./export/type/Type.js"),require("./export/type/List.js"),require("./export/type/Bool.js"),require("./export/type/Literal.js")),Null=Literal.Null,Declaration=require("./type/Declaration.js"),Ruleset=require("./type/Ruleset.js"),CSS=require("./CSS.js"),TypeVisitor=require("./type/TypeVisitor.js"),Types=require("./type/Types.js"),SelectorList=require("./type/selectors/SelectorList.js"),ColorFunctions=require("./functions/Color.js"),Gradients=require("./functions/Gradients.js"),HSL=require("./functions/HSL.js"),Introspection=require("./functions/Introspection.js"),ListFunctions=require("./functions/List.js"),Misc=require("./functions/Misc.js"),Numeric=require("./functions/Numeric.js"),Opacity=require("./functions/Opacity.js"),RGB=require("./functions/RGB.js"),Selectors=require("./functions/Selectors.js"),Text=require("./functions/Text.js"),Util=require("./functions/Util.js"),NameRegistrations=require("./processors/NameRegistrations.js"),DataInline=require("./processors/DataInline.js"),CssVariables=require("./processors/CssVariables.js"),Runtime=function(_BaseRuntime){function Runtime(config){_classCallCheck(this,Runtime);var _this11=_possibleConstructorReturn(this,(Runtime.__proto__||Object.getPrototypeOf(Runtime)).call(this,config)),me=_this11;return me.deferredContent=[],ColorFunctions.init(me),Gradients.init(me),HSL.init(me),Introspection.init(me),ListFunctions.init(me),Misc.init(me),Numeric.init(me),Opacity.init(me),RGB.init(me),Selectors.init(me),Text.init(me),Util.init(me),NameRegistrations.init(me),DataInline.init(me),CssVariables.init(me),_this11}return _inherits(Runtime,_BaseRuntime),_createClass(Runtime,[{key:"ruleset",value:function ruleset(selectors,sourceInfo,docs,blockDocs,hasBlock){var ruleset=this.openRuleset(selectors);return ruleset.sourceInfo=sourceInfo,ruleset.docs=docs,ruleset.blockDocs=blockDocs,ruleset.hasBlock=hasBlock,ruleset}},{key:"rulesetDone",value:function(){var current=this.closeRuleset();return this.printRuleset(current),current}},{key:"namespacedRuleset",value:function(ns){var ruleset=this.openRuleset(new SelectorList([]));ruleset.isNamespaced=!0,ruleset.parent.removeChildRuleset(ruleset),ruleset.parent=null,ns=""+ns,this.rulesets.pop(),this.declare(ns,ruleset),this.rulesets.push(ruleset)}},{key:"declare",value:function(property,value,important,sourceInfo,docs){var isNull=!1;value.$isFashionList&&1===value.items.length&&(value=value.items[0]),void 0!==value&&null!==value&&value!==Null||(isNull=!0),isNull&&!important||this.getCurrentRuleset().addDeclaration(new Declaration({property:property,value:value,important:important,sourceInfo:sourceInfo,docs:docs}))}},{key:"extendSelector",value:function(selector){var current=this.getCurrentRuleset();current.extend||(this.extenders.push(current),current.extend=[]),current.extend.push(selector)}},{key:"openRuleset",value:function(selectors){var current=this.getCurrentRuleset(),ruleset=new Ruleset({selectors:selectors,parent:current});return current&¤t.addChildRuleset(ruleset),this.rulesets.push(ruleset),ruleset}},{key:"closeRuleset",value:function(){return this.rulesets.pop()}},{key:"getCurrentRuleset",value:function(){var rulesets=this.rulesets;return rulesets[rulesets.length-1]}},{key:"getCurrentRulesets",value:function(){return this.rulesets}},{key:"addDirectiveRuleset",value:function(name,value){this.printRuleset(new Ruleset({isAtDirective:!0,atDirectiveName:name,atDirectiveValue:value}))}},{key:"printRuleset",value:function(ruleset){ruleset.parent||ruleset.isNamespaced||this.css.addRuleset(ruleset)}},{key:"reset",value:function(){_get(Runtime.prototype.__proto__||Object.getPrototypeOf(Runtime.prototype),"reset",this).call(this),this.css=new CSS({context:this.context}),this.css.processors=this.processors.slice(),this.rulesets=[],this.extenders=[]}},{key:"registerProcessor",value:function(proc){this.processors.push(new TypeVisitor(proc))}},{key:"compile",value:function(code){var me=this,theFn=_get(Runtime.prototype.__proto__||Object.getPrototypeOf(Runtime.prototype),"compile",this).call(this,code);return this.fn=function(rt,overrides,dyn){var runtime=rt||me;return theFn(runtime,overrides,dyn),runtime.runDeferred(),runtime.css.extenders=runtime.extenders,runtime.css},this.fn}},{key:"defer",value:function(name,fn){this.deferredContent.push({name:name,fn:fn})}},{key:"runDeferred",value:function(name){for(var d,deferred=this.deferredContent,newDeferred=[];deferred.length;)d=deferred.shift(),name&&d.name!==name?newDeferred.push(d):d.fn();this.deferredContent=newDeferred}}]),Runtime}(BaseRuntime);Fashion.apply(Runtime,{uniqueScopesForGlobalRulesets:!0,uniqueScopesForAllRulesets:!0,allowSetScopedVariables:!0,allowMultipleImports:!0,allowNullDefaults:!0,allowEmptyRulesets:!1,fullExtendWeave:!1,compactSuperSelectors:!1}),Fashion.apply(Runtime.prototype,{extenders:null,mixins:null,rulesets:null,css:null,types:Types,mediaTest:/@media/,keyframesTest:/@.*?keyframes/}),module.exports=Runtime},{"./CSS.js":5,"./export/Base.js":19,"./export/Runtime.js":21,"./export/type/Bool.js":24,"./export/type/List.js":31,"./export/type/Literal.js":32,"./export/type/Type.js":40,"./functions/Color.js":43,"./functions/Gradients.js":44,
"./functions/HSL.js":45,"./functions/Introspection.js":46,"./functions/List.js":47,"./functions/Misc.js":48,"./functions/Numeric.js":49,"./functions/Opacity.js":50,"./functions/RGB.js":51,"./functions/Selectors.js":52,"./functions/Text.js":53,"./functions/Util.js":54,"./processors/CssVariables.js":61,"./processors/DataInline.js":62,"./processors/NameRegistrations.js":64,"./type/Declaration.js":65,"./type/Ruleset.js":66,"./type/TypeVisitor.js":68,"./type/Types.js":69,"./type/selectors/SelectorList.js":74}],16:[function(require,module,exports){(function(process){(function(){var Fashion=require("./export/Base.js"),Base=Fashion.Base,Env=require("./Env.js"),Visitor=require("./Visitor.js"),Runtime=require("./Runtime.js");Fashion.currentFile=void 0;var SassFile=function(_Base5){function SassFile(cfg){_classCallCheck(this,SassFile);var _this12=_possibleConstructorReturn(this,(SassFile.__proto__||Object.getPrototypeOf(SassFile)).call(this,cfg));return _this12.readyListeners=[],_this12.state=0,_this12.imports={},_this12.importedBy={},_this12.isJsExtension()?_this12.loadExtension():_this12.loadSass(),_this12}return _inherits(SassFile,_Base5),_createClass(SassFile,[{key:"getLoadPath",value:function(){var loadPath=this.loadPath;return loadPath||(loadPath=this.loadPath=this.path),loadPath}},{key:"loadExtension",value:function(){var me=this,loadPath=me.getLoadPath();if(me.state<5&&(me.state=5,me.state<9))if(me.state=9,"undefined"!=typeof System)try{me.info("importing "+loadPath),System["import"](loadPath).then(function(extension){extension.init(me.builder.context.runtime),me.state=10,me.content="",me.info("file "+loadPath+" is loaded"),me.checkImports()},function(err){me.error("file "+loadPath+" failed to load"),me.error((err.stack||err)+""),me.checkImports()})}catch(err){me.error("file "+loadPath+" failed to load"),me.error(err),me.error((err.stack||err)+""),me.checkImports()}else try{/\.js$/.test(loadPath)||(loadPath+=".js"),Env.isNode&&0!==loadPath.indexOf("/")&&1!==loadPath.indexOf(":")&&(loadPath=process.cwd()+"/"+loadPath),me.info("requiring "+loadPath),delete require.cache[require.resolve(loadPath)];var extension=require(loadPath);extension.init(me.builder.context.runtime),me.state=10,me.content="",me.info("file "+loadPath+" is loaded"),me.checkImports()}catch(err){me.error("file "+loadPath+" failed to load"),me.error((err.stack||err)+""),me.checkImports()}}},{key:"loadSass",value:function(){var loadPath,me=this;if(me.state<5&&(me.state=5,me.state<10)){if(loadPath=me.getLoadPath(),me.info("loading file "+loadPath),me.isSaveFile)return me.state=10,me.content="",void me.checkImports();Env.loadFile(loadPath,function(content){me.state=10,me.info("file "+loadPath+" is loaded"),me.content=content,me.checkImports()},function(){var idx=loadPath.lastIndexOf("/"),attempt=loadPath;idx>-1&&(attempt=attempt.substring(0,idx+1)+"_"+attempt.substring(idx+1)),loadPath=me.loadPath=attempt,me.info("retrying with "+loadPath),Env.loadFile(loadPath,function(content){me.state=10,me.info("file "+loadPath+" is loaded"),me.content=content,me.checkImports()},function(){Fashion.error("failed to download path : "+loadPath),me.content="",me.checkImports()})})}}},{key:"getAst",value:function(){var parser,me=this,ast=me.ast,content=me.content,loadPath=me.getLoadPath();if(!me.isJsExtension()){if(!ast&&content){parser=me.builder.getParser(),me.debug("parsing file "+loadPath);try{ast=me.ast=parser.parse(content,loadPath)}catch(err){throw Fashion.error("Error parsing file : "+loadPath+" => "),err}}return ast}}},{key:"getSassFile",value:function(basePath,targetPath,origSource,importer){return this.builder.getSassFile(basePath,targetPath,origSource,importer)}},{key:"isJsExtension",value:function(){var loadPath=this.getLoadPath();return loadPath.indexOf(".js")>0}},{key:"getImportSource",value:function(source){var imports=[];return"List"!==source.type&&"SelectorList"!==source.type||!source.separator||0!==source.separator.indexOf(",")?imports.push(source):imports=source.items,imports=Fashion.convert(imports,function(source){return source&&"MultiPartSelector"===source.type&&1===source.items.length&&(source=source.items[0]),source&&"CompoundSelector"===source.type&&1===source.items.length&&(source=source.items[0]),source&&source.value?source.value:source}),imports=Fashion.filter(imports,function(source){if(!source)return!1;if(!source.indexOf)return!1;var idx=source.indexOf(".css");return!(idx>-1&&idx===source.length-4)&&(idx=source.indexOf("http://"),0!==idx&&(idx=source.indexOf("//"),0!==idx))})}},{key:"trimComment",value:function(comment){return 0===comment.indexOf("//#")&&(comment=comment.substring(3)),0===comment.indexOf("//")&&(comment=comment.substring(2)),0===comment.indexOf("/*")&&(comment=comment.substring(2,comment.length-3)),comment.trim()}},{key:"dependsOn",value:function(path){var me=this;if(me.imports[path])return!0;for(var loadPath in me.imports){var dep=me.imports[loadPath];if(dep.dependsOn(path))return!0}return!1}},{key:"checkImports",value:function checkImports(){var me=this,loadPath=me.getLoadPath(),sassFiles=[],missing,i;if(me.state<15){if(me.info("checking Imports for file "+loadPath),me.state=15,me.isJsExtension()){if(Fashion&&Env&&Env.isRhino){var content=me.content+"\n//# sourceURL="+loadPath;eval(content)}}else{me.isUiFile&&(me.mixinCalls=[]);var vis=new Visitor({skipBranching:!0,loadJsExtension:function(source){source=source.replace(/;$/,"").replace(/^'/,"").replace(/'$/,"").replace(/\.js$/,"").replace(/^js:\s*/,""),0!==source.indexOf(".")&&(source="./"+source);var sassFile=me.getSassFile(me.path,source+".js",source,me);sassFile===me&&Fashion.raise("file "+loadPath+" should not import itself"),me.imports[sassFile.getLoadPath()]=sassFile,sassFile.importedBy[loadPath]=me,sassFile.state<20&&sassFiles.push(sassFile)},FunctionCall:function(node){var funcName=node.id||node.value,handlers=this;if("require"===funcName){var sources=me.getImportSource(node.args);Fashion.warn("Use of 'require()' will be deprecated",node),Fashion.warn("Use @import instead"),sources.forEach(function(source){handlers.loadJsExtension(source)}),node.visitTarget=null}},Require:function(node){var source=me.getImportSource(node.source)[0],isGlobal=1==this.nodeStack.length;source.indexOf&&(isGlobal||Fashion.raise('Cannot use require() "'+source+'" from non-file-scope location',node),Fashion.warn("Use of '@require' has been deprecated",node),Fashion.warn("Use @import instead"),delete node.visitTarget,this.loadJsExtension(source))},Import:function(node){delete node.visitTarget,delete node.nodeFiles;var handlers=this,source=me.getImportSource(node.source);source.forEach(function(source){if(/(^js[:])|(\.js$)/.test(source))handlers.loadJsExtension(source);else{var sassFile=me.getSassFile(me.path,source,source);sassFile===me&&Fashion.raise("file "+loadPath+" should not import itself"),sassFile.dependsOn(loadPath)?me.importError=Error("Import cycle detected between "+me.getLoadPath()+" and "+sassFile.getLoadPath()):(me.imports[sassFile.getLoadPath()]=sassFile,sassFile.importedBy[loadPath]=me,sassFile.state<20&&sassFiles.push(sassFile))}})},Include:function(node){me.isUiFile&&me.mixinCalls.push(node)}});vis.visit(me.getAst())}if(16==me.state,missing=sassFiles.length,!missing)return void me.fireReady();for(i=0;i<sassFiles.length;i++)sassFiles[i].onReady(function(){missing--,0===missing?me.fireReady():me.debug("file "+loadPath+" still waiting for "+missing+" other files")})}}},{key:"onReady",value:function(listener){var me=this;me.state>=20?listener(me):(me.readyListeners.push(listener),10==me.state&&me.checkImports())}},{key:"fireReady",value:function(){var me=this;if(me.state<20){me.info("file "+me.getLoadPath()+" is ready"),me.state=20;for(var listener;null!=(listener=me.readyListeners.shift());)listener(me)}}},{key:"getExpandedAst",value:function(stamp){function addSourceInfo(vis){vis.addSourceInfo&&vis.addSourceInfo(this.node)}function createCallStackScope(vis){vis.createCallStackScope&&vis.createCallStackScope()}function popCallStackScope(vis){vis.popCallStackScope&&vis.popCallStackScope()}stamp=stamp||(new Date).getTime();var me=this,ast=me.getAst();if(me.importError){var err=me.importError;throw delete me.importError,err}if(me.imported!=stamp&&(me.imported=stamp,!me.isJsExtension())){me.debug("expanding ast for file "+me.getLoadPath());var vis=new Visitor({skipBranching:!0,Import:function(node){delete node.visitTarget;var source=me.getImportSource(node.source),visitTarget=[];source.forEach(function(source){if(source&&source.indexOf&&!/(^js[:])|(\.js$)/.test(source)&&!node.skipSassImport){var sassFile=me.getSassFile(me.path,source);sassFile.importing=!0;var importAst=sassFile.getExpandedAst(stamp);me.builder.context.enableSymbols&&(visitTarget.push({node:node,doVisit:addSourceInfo}),visitTarget.push({doVisit:createCallStackScope})),visitTarget.push(importAst),me.builder.context.enableSymbols&&visitTarget.push({doVisit:popCallStackScope}),sassFile.importing=!1}}),visitTarget.length&&(node.visitTarget=visitTarget)}});return me.expanding=!0,vis.visit(ast),me.expanding=!1,ast}return Runtime.allowMultipleImports?ast:void 0}},{key:"invalidate",value:function(){var me=this;if(me.state>=10){me.info("invalidating file "+me.getLoadPath()),me.state=0,delete me.ast,delete me.content,delete me.imported;for(var name in me.importedBy)me.importedBy[name].unready();var loadPath=me.getLoadPath();for(name in me.imports)delete me.imports[name].importedBy[loadPath];me.imports={},me.isJsExtension()?me.loadExtension():me.loadSass()}}},{key:"unready",value:function(){this.state=10,delete this.ast;for(var name in this.importedBy)this.importedBy[name].unready()}},{key:"debug",value:function(message){}},{key:"info",value:function(message){}},{key:"error",value:function(message){Fashion.error(message)}},{key:"getCustomUIs",value:function(){var node,mixinName,include,args,arg,argName,argMap,uiMap,me=this,mixinMap={},allUIs={},calls=me.mixinCalls,separator=", ";allUIs[me.jsClassName]=mixinMap;for(var i=0;i<calls.length;i++){node=calls[i],include=node.include,mixinName=include.id||include.value,uiMap=mixinMap[mixinName]||{},args=include.args,args.isFashionListAst&&(args=args.items,separator=args.separator),Array.isArray(args)||(args=[args]),argMap={};for(var a=0;a<args.length;a++){arg=args[a],argName=a;var value=arg.name||arg.value;if(arg.variable&&(argName=arg.variable),!value){for(;arg&&arg.expr;)arg=arg.expr;var converter=function converter(item){if(item=item&&item.expr||item,item.isFashionListAst){var sep=item.separator||separator,items=Fashion.convert(item.items,converter),value=items.join(sep);return items.length>1&&(value="("+value+")"),value}return item.name||item.value};arg.isFashionListAst?(separator=arg.separator||separator,value=converter(arg)):value=arg.name||arg.value}argMap[argName]=value}if(argMap.$ui){var tmp={};tmp[argMap.$ui]=argMap,delete argMap.$ui,argMap=tmp}Fashion.apply(uiMap,argMap),mixinMap[mixinName]=uiMap}return allUIs}}]),SassFile}(Base);Fashion.apply(SassFile.prototype,{$isSassFile:!0,expanding:!1,readyListeners:null,state:null,imports:null,importedBy:null,loadPath:null,path:null,content:null,originalSource:null,ast:null,imported:null,importer:null,builder:null,isSaveFile:null,isUiFile:null,jsClassName:null,mixinCalls:null}),module.exports=SassFile}).call(this)}).call(this,require("_process"))},{"./Env.js":9,"./Runtime.js":15,"./Visitor.js":18,"./export/Base.js":19,_process:3}],17:[function(require,module,exports){var Fashion=require("./export/Base.js"),Visitor=require("./Visitor.js"),Preprocessor=require("./Preprocessor.js"),Output=require("./export/Output.js"),Parser=require("./parse/Parser.js"),Scanner=require("./parse/Scanner.js"),Color=require("./export/type/Color.js"),Runtime=require("./Runtime.js"),Nodes=require("./parse/ast/Nodes.js"),List=Nodes.List,SelectorList=Nodes.SelectorList,Constant=Nodes.Constant,FunctionCall=Nodes.FunctionCall,Variable=Nodes.Variable,_VariableAssignment=Nodes.VariableAssignment,StringCache=function(){function StringCache(){_classCallCheck(this,StringCache),this.array=[],this.map={}}return _createClass(StringCache,[{key:"addString",value:function(string){var idx=this.map[string];return void 0===idx&&(idx=this.array.length,this.array.push(string),this.map[string]=idx),idx}},{key:"get",value:function(id){return this.array[id]}}]),StringCache}(),ObjCache=function(){function ObjCache(){_classCallCheck(this,ObjCache),this.array=[]}return _createClass(ObjCache,[{key:"addObj",value:function(obj){var idx=this.array.length;return this.array.push(obj),idx}},{key:"get",value:function(id){return this.array[id]}}]),ObjCache}(),Transpiler=function(_Visitor2){function Transpiler(){return _classCallCheck(this,Transpiler),_possibleConstructorReturn(this,(Transpiler.__proto__||Object.getPrototypeOf(Transpiler)).apply(this,arguments))}return _inherits(Transpiler,_Visitor2),_createClass(Transpiler,[{key:"reset",value:function(){this.output=new Output,this.currentScope={__suffix:"",__isGlobal:!0},this.globalScope=this.currentScope,this.globalVars={},this.errors=0,this.warnings=0,this.stringCache=new StringCache,this.docCache=new ObjCache,this.nodeCache=new ObjCache}},{key:"createScope",value:function(parent){parent=parent||this.currentScope;var scope=Fashion.chain(parent);return scope.__suffix=scope.__suffix+"$",scope}},{key:"getScopeName",value:function(name,scope){return Fashion.getJsName(name)}},{key:"getVariableName",value:function(node){return node.variable||node.name||node.value||node}},{key:"handleInlineExpression",value:function(expr){try{var tree,outwas=this.output,output=new Output,parser=this.inlineParser||(this.inlineParser=new Parser);return this.isSelector?(parser.scanner=new Scanner(expr),tree=parser.parseSequence()):(tree=parser.parse("$foobar: "+expr+";"),tree=tree[0].value),this.output=output,this.handleStatement(tree),this.output=outwas,output.get().trim()}catch(error){throw Fashion.log("failed to evaluate inline expression : "+expr),error}}},{key:"handleInlineExpressions",value:function(text,start,skipEscape){text+="",start=start||0;var outwas,i,ch,ch2,out=[],level=0;for(i=start;i<text.length;i++)switch(ch=text.charAt(i),ch2=i<text.length-1?text.charAt(i+1):void 0,ch){case"\\":outwas||skipEscape?out.push(ch):out.push("\\\\");break;case'"':outwas||skipEscape?out.push(ch):out.push('\\"');break;case"#":"{"===ch2?(level++,level<2?(outwas=out,out=[],i++):out.push(ch)):out.push(ch);break;case"}":level--,level?out.push(ch):(outwas.push('" + __rt_unquote('),outwas.push(this.handleInlineExpression(out.join(""))),outwas.push(') + "'),out=outwas,outwas=void 0);break;default:out.push(ch)}return out.join("")}},{key:"addSourceInfo",value:function(item){this.symbols&&(item=item||this.nodeStack[this.nodeStack.length-1],item&&(item.lineNumber||item.file)&&(this.output.add("__rt_pushSourceInfo(["+item.lineNumber+", '"+(item.file||"source-code")+"'])"),this.output.add(";")))}},{key:"createCallStackScope",value:function(){this.symbols&&this.output.addln("__rt_createCallStackScope();")}},{key:"popCallStackScope",value:function(){this.symbols&&this.output.addln("__rt_popCallStackScope();")}},{key:"handleStatements",value:function(statements){this.symbols&&this.addSourceInfo(),this.visit(statements)}},{key:"handleStatement",value:function(statement){statement&&statement.hasOwnProperty("visitTarget")&&(statement=statement.visitTarget,statement&&Array.isArray(statement)&&this.handleStatements(statement)),statement&&(statement instanceof Array&&(statement=new List(null,statement,",")),this.visit(statement))}},{key:"createDefaultScopeMap",value:function(args,isMixin){args=this.loadArgsArray(args);var arg,a,varName,jsName,name,output=this.output,defaulted=0;for(this.isSignatureDeclaration=!0,this.generateGets=!0,a=0;a<args.length;a++)arg=args[a],arg&&(varName=arg.variable||arg.name,name=varName,jsName=this.getScopeName(varName),this.currentScope[jsName]={name:jsName,param:!0},varName=jsName,arg.varArgs?(output.addln(varName+" = __rt_sliceArgs(arguments, "+(isMixin?a+1:a)+");"),defaulted++):"Variable"!==arg.type||void 0!==arg.variable?(output.addln("var "+varName+" = "+varName+" || "),this.handleStatement(arg),output.add(";"),defaulted++):output.addln("var "+varName+" = "+varName+" || __Null;"),output.addln('__rt_set("'+jsName+'", '+varName+", true);"));return this.generateGets=!1,this.isSignatureDeclaration=!1,defaulted}},{key:"getRegisteredDeclarationsMap",value:function(declaredParameters){for(var param,map={},d=0;d<declaredParameters.length;d++)param=declaredParameters[d],map[param.name]=param;return map}},{key:"createCallArray",value:function(args,defaults,id,convertName,addComma){args=this.loadArgsArray(args),defaults.parameters&&(defaults=defaults.parameters);for(var arg,a,position,me=this,output=me.output,len=args.length>defaults.length?args.length:defaults.length,declaredMap=me.getRegisteredDeclarationsMap(defaults),actual=Array(len),a=0;a<args.length;a++){if(arg=args[a],position=a,arg&&arg.variable){var argName=arg.variable;if(convertName&&(0==argName.indexOf("$")&&(argName=argName.substr(1)),argName=argName.replace(/\-/g,"_")),!declaredMap[argName]){var params=[];for(var pName in declaredMap)params.push(pName);Fashion.warn("function or mixin '"+id+"' had no parameter named "+argName+" : params were : "+params.join(", "));continue}position=declaredMap[argName].position}actual[position]=arg}for(a=0;a<actual.length;a++)arg=actual[a],(addComma||a>0)&&(output.add(","),output.space()),arg?(output.addln(),arg.varArgs?(output.add("__rt_applySpread("),me.handleStatement(arg),output.add(")")):me.handleStatement(arg)):output.addln("__udf");return actual.length}},{key:"escapeString",value:function(str){return str&&str.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}},{key:"Each",value:function(statement){var _this14=this;if(statement.isMap){var me=this,output=me.output,arg=statement.variable,names=statement.variable.items;me.eachCount=me.eachCount||1;var jsNames=Fashion.convert(names,function(name){return me.getScopeName(name)}),jsItrName="__each_itr_"+me.eachCount,jsListName="__each__list";names.forEach(function(name,i){return _this14.currentScope[jsNames[i]]=jsNames[i]}),output.addln("var "+jsListName+" = "),me.handleStatement(statement.list),output.add(";"),output.addln("for(var "+jsItrName+" = 0; "+jsItrName+" < "+jsListName+".items.length - 1; "+jsItrName+"+=2) {"),output.indent(),output.addln('__rt_set("'+jsNames[0]+'", '+jsListName+".items["+jsItrName+"]);"),output.addln('__rt_set("'+jsNames[1]+'", '+jsListName+".items["+jsItrName+" + 1]);"),me.handleStatements(statement.statements),output.unindentln("}")}else{var me=this,output=me.output,arg=statement.variable,name=me.getVariableName(arg),jsName=me.getScopeName(name),jsListName=jsName+"__list",jsItrName=jsName+"__itr";this.currentScope[jsItrName]=jsItrName,this.currentScope[jsListName]=jsListName,this.currentScope[jsName]=jsName,output.addln("var "+jsListName+" = "),me.handleStatement(statement.list),output.add(";"),output.addln("for(var "+jsItrName+" = 0; "+jsItrName+" < "+jsListName+".items.length; "+jsItrName+"++) {"),output.indent(),output.addln('__rt_set("'+jsName+'", '+jsListName+".items["+jsItrName+"]);"),me.handleStatements(statement.statements),output.unindentln("}")}return!1}},{key:"For",value:function(statement){var me=this,output=me.output,arg=statement.variable,name=me.getVariableName(arg),jsName=me.getScopeName(name),jsItrName=jsName+"__itr";return this.currentScope[jsName]=jsName,output.addln("for(var "+jsItrName+" = __rt_unbox("),me.handleStatement(statement.start),output.add("), end = (__rt_unbox("),me.handleStatement(statement.end),output.add(")"),statement.inclusive&&output.add(" + 1"),output.add("); "+jsItrName+" < end; "+jsItrName+"++){"),output.indent(),output.addln("var "+jsName+" = "+jsItrName),output.addln('__rt_set("'+jsName+'", '+jsItrName+", true);"),me.handleStatements(statement.statements),output.unindentln("};"),!1}},{key:"While",value:function(statement){var output=this.output;return output.addln("while(__rt_unbox("),this.handleStatement(statement.condition),output.add(")) {"),output.indent(),this.handleStatements(statement.statements),output.unindentln("};"),!1}},{key:"Function",value:function(statement){var me=this,output=me.output,func=statement.func,jsName=Fashion.getJsName(func.id||func.value);"dynamic"===jsName&&me.error("Cannot define function named 'dynamic'",statement),"require"===jsName&&me.error("Cannot define function named 'require'",statement),me.nestedDocs=!0;var scopeWas=me.currentScope;me.currentScope=me.createScope(),output.addln("function "+jsName+"__fn(");for(var args=me.loadArgsArray(func.args||[]),i=0;i<args.length;i++){var arg=args[i],varName=arg.variable||arg.name;varName=me.getScopeName(varName),i>0&&(output.add(","),output.space()),output.add(varName)}return output.add(") {"),output.indent(),output.addln("__rt_createScope(__rt_functions."+jsName+" && __rt_functions."+jsName+".createdScope);"),this.symbols&&me.createCallStackScope(),this.symbols&&this.addSourceInfo(),me.createDefaultScopeMap(func.args),this.popScope=!0,statement.statements.length&&me.handleStatements(statement.statements),me.currentScope=scopeWas,this.popScope&&(this.symbols&&me.popCallStackScope(),output.addln("__rt_popScope();"),this.popScope=!1),output.unindentln("};"),output.addln("__rt_functions."+jsName+" = "+jsName+"__fn;"),output.addln("__rt_functions."+jsName+".createdScope = __rt_getCurrentScope();"),me.nestedDocs=!1,!1}},{key:"Ruleset",value:function(statement,fnName){fnName=fnName||"__rt_ruleset";var me=this,output=me.output,isGlobal=1===me.nodeStack.length,newScope=!1,docIdx=-1,blockDocIdx=-1,hasBlock=!!statement.statements;if(output.addln(fnName+"("),this.isSelector=statement.selectors,this.handleStatement(statement.selectors),this.isSelector=null,statement.file){var fileIdx=this.stringCache.addString(statement.file);output.add(",__rt_getString("+fileIdx+') + ":'+statement.lineNumber+'"')}else output.add(", null");if(statement.docs&&statement.docs.length?(docIdx=this.docCache.addObj(statement.docs),output.add(",__rt_getDocs("+docIdx+")")):output.add(", null"),statement.blockDocs&&statement.blockDocs.length?(blockDocIdx=this.docCache.addObj(statement.blockDocs),output.add(",__rt_getDocs("+blockDocIdx+")")):output.add(", null"),output.add(", "+hasBlock),output.add(");"),isGlobal&&Runtime.uniqueScopesForGlobalRulesets&&(newScope=!0),Runtime.uniqueScopesForAllRulesets&&(newScope=!0),newScope){var scopeWas=me.currentScope;me.currentScope=me.createScope(),output.addln("__rt_createScope();"),me.handleStatements(statement.statements),output.addln("__rt_popScope();"),me.currentScope=scopeWas}else me.handleStatements(statement.statements);output.addln("__rt_rulesetDone();"),me.nestedDocs=!1}},{key:"Mixin",value:function(statement){var args,arg,varName,scopeWas,i,me=this,output=me.output,name=statement.name,jsName=Fashion.getJsName(name.id||name.value);for(me.nestedDocs=!0,me.processingMixin=!0,scopeWas=me.currentScope,me.currentScope=me.createScope(),output.addln("__rt.mixins."+jsName+"= function("),args=me.loadArgsArray(name.args||[]),output.add("$$content"),i=0;i<args.length;i++)arg=args[i],varName=arg.variable||arg.name,varName=me.getScopeName(varName),output.add(","),output.space(),output.add(varName);return output.add(") {"),output.indent(),output.addln("__rt_createScope(__rt.mixins."+jsName+" && __rt.mixins."+jsName+".createdScope);"),this.symbols&&me.createCallStackScope(),this.symbols&&this.addSourceInfo(),me.createDefaultScopeMap(name.args,!0),me.handleStatements(statement.statements),me.currentScope=scopeWas,this.symbols&&me.popCallStackScope(),output.addln("__rt_popScope();"),output.unindentln("};"),output.addln("__rt.mixins."+jsName+".createdScope = __rt_getCurrentScope();"),me.nestedDocs=!1,me.processingMixin=!1,!1}},{key:"Content",value:function(statement){return this.processingMixin||this.error("@content may only be used within a mixin declaration"),this.output.addln("$$content && $$content();"),!1}},{key:"Include",value:function(statement){var me=this,output=me.output,include=statement.include,id=include.id||include.value,jsId=Fashion.getJsName(id),args=me.loadArgsArray(include.args||[]);return this.symbols&&(me.addSourceInfo(),output.add(";"),output.addln()),"fashion_defer_content"==jsId?(output.addln("__rt.defer("),args[0]?(output.add("__rt.unbox("),me.handleStatement(args[0]),output.add(")")):output.add("null"),output.add(", "),output.addln("(function(scope) { return function(){"),output.indent(),output.addln("__rt_createScope(scope);"),this.symbols&&me.createCallStackScope(),me.handleStatements(statement.content.statements),this.symbols&&me.popCallStackScope(),output.addln("__rt_popScope();"),output.unindent(),output.addln("}})(__rt_getCurrentScope())"),output.add(");")):"fashion_inject_content"==jsId?(output.addln("__rt.runDeferred("),args[0]&&(output.add("__rt.unbox("),me.handleStatement(args[0]),output.add(")")),output.add(");")):me.mixinDeclarations[jsId]?(output.addln("(__rt.mixins."+jsId+" || "+jsId+"__mix).apply(__rt.mixins, __rt_applySpreadArgs(["),output.indent(),statement.content?(output.addln("(function(scope) { return function(){"),output.indent(),output.addln("__rt_createScope(scope);"),this.symbols&&me.createCallStackScope(),this.symbols&&this.addSourceInfo(),me.handleStatements(statement.content.statements),this.symbols&&me.popCallStackScope(),output.addln("__rt_popScope();"),output.unindent(),output.addln("}})(__rt_getCurrentScope())")):output.add("__udf"),me.createCallArray(args,me.mixinDeclarations[jsId],id,!1,!0),output.unindent(),output.add('], "'+jsId+'"));')):me.error("unknown definition for mixin named "+id+" : "+statement.file+":"+statement.lineNumber),!1}},{key:"Declaration",value:function(statement){var i,nsRuleset,me=this,output=me.output,namespacedRulesets=[],props=[],separator=" ",docIdx=-1,val=statement.value;for("List"===val.type?(separator=val.separator,val=val.items):Array.isArray(val)||(val=[val]),i=0;i<val.length;i++){var prop=val[i];"Ruleset"!==prop.type?props.push(prop):namespacedRulesets.push(prop)}if(props.length){if(this.symbols&&this.addSourceInfo(),output.addln('__rt_declare("'+me.handleInlineExpressions(statement.property)+'", '),"font"===statement.property&&(me.isFontDecl=statement),me.handleStatement(new List(null,props,separator)),output.add(","),output.space(),output.add(!!statement.important+""),statement.file){var fileIdx=this.stringCache.addString(statement.file);output.add(",__rt_getString("+fileIdx+') + ":'+statement.lineNumber+'"')}else output.add(", null");statement.docs&&statement.docs.length?(docIdx=this.docCache.addObj(statement.docs),output.add(",__rt_getDocs("+docIdx+")")):output.add(", null"),output.add(");")}if(namespacedRulesets.length)for(i=0;i<namespacedRulesets.length;i++)nsRuleset=namespacedRulesets[i],nsRuleset.selectors=new SelectorList({items:[new Constant({dataType:"Literal",value:statement.property})],separator:", "}),me.Ruleset(nsRuleset,"__rt_namespacedRuleset"),delete nsRuleset.selectors;return me.isFontDecl=void 0,!1}},{key:"VariableAssignment",value:function(statement){var me=this,output=me.output,name=statement.name,bangGlobal=statement.global?1:0,bangDynamic=statement.dynamic?1:0,bangDefault=statement["default"]?1:0,isGlobalVar=1===me.nodeStack.length?1:0,jsName=me.getScopeName(name),exists=me.currentScope[jsName],createLocal=isGlobalVar||exists&&exists.param?0:1,variable=me.dynamicVariables[jsName],failDynamicAssignment=!1,processed=me.processedVariables,isDynamic=!1;this.preprocessor.replacesMap;if(this.symbols&&this.addSourceInfo(),bangDynamic&&!isGlobalVar&&(failDynamicAssignment=!0),bangDynamic||!variable||isGlobalVar||me.currentScope!==me.globalScope||(failDynamicAssignment=!0),bangGlobal&&!bangDynamic&&!isGlobalVar&&variable&&(failDynamicAssignment=!0),failDynamicAssignment){this.error("Dynamic variable "+name+" can only be assigned at file scope "),Fashion.error(" at ",statement);for(var v=variable;v&&v.elevationCause;)Fashion.error("\t"+v.name+" elevated by "+v.elevationCause.name+" at ",v.elevationCause.getNode()),v=v.elevationCause}if(isGlobalVar&&variable&&processed[jsName])return!1;variable&&(!exists||!exists.param&&bangGlobal)&&(isDynamic=!0),exists?bangGlobal?createLocal=0:!variable&&Runtime.allowSetScopedVariables&&(createLocal=0):bangGlobal&&(createLocal=0),createLocal?me.currentScope[jsName]={name:jsName}:bangGlobal&&(jsName=me.getScopeName(name,me.globalScope)),isGlobalVar&&(me.globalScope[jsName]=jsName);var setArgs=[];if(isDynamic){output.addln('__rt_setDynamic("'+name+'", '),output.add('__rt_getGlobalDefault("'+jsName+'") || ');var idx=this.nodeCache.addObj(statement.value);setArgs.push(idx)}else if(bangGlobal){output.addln('__rt_setGlobal("'+jsName+'", '),bangDefault&&output.add('__rt_getGlobalDefault("'+jsName+'") || ');var idx=this.nodeCache.addObj(statement.value);setArgs.push(idx)}else createLocal?(output.addln('__rt_set("'+jsName+'", '),bangDefault&&output.add('__rt_getLocalDefault("'+jsName+'") || ')):(output.addln('__rt_setScoped("'+jsName+'", '),bangDefault&&output.add('__rt_getLocalDefault("'+jsName+'") || '));if(me.handleStatement(statement.value),setArgs.length&&output.add(", "+setArgs.join(", ")),output.add(");"),variable&&(processed[jsName]=!0),variable&&variable.replaces){var assignment=new _VariableAssignment(null,variable.replaces,new Variable(null,name));assignment.deprecatedAssignment=!0,me.nodeStack.pop(),me.handleStatement(assignment),me.nodeStack.push(statement)}return!1}},{key:"If",value:function(statement){var output=this.output;return output.addln("if(__rt_unbox("),this.handleStatement(statement.condition),output.add(")) {"),output.indent(),this.handleStatements(statement.statements),output.unindentln("}"),!1}},{key:"Else",value:function(statement){var output=this.output;return statement.condition?(output.addln("else if(__rt_unbox("),this.handleStatement(statement.condition),output.add(")) {"),output.indent()):output.indentln("else {"),this.handleStatements(statement.statements),output.unindentln("}"),!1}},{key:"Return",value:function(statement){for(var isFunc=!1,stack=this.nodeStack,i=stack.length-1;i>=0;i--)if("Function"==stack[i].type){isFunc=!0;break}return isFunc?(this.popScope=!1,this.output.addln("var $$$r = "),this.handleStatement(statement.expr),this.output.add(";"),this.symbols&&this.popCallStackScope(),this.output.addln("__rt_popScope();"),this.output.addln("return $$$r;")):Fashion.warn("Ingnored @return => ",statement),!1}},{key:"BinaryExpression",value:function(statement){var me=this,output=me.output,suffix="";"-"!=statement.operator&&"+"!=statement.operator||void 0!==statement.left||(statement.left=new Constant({dataType:"Number",value:0}));var divider=", ",prefix="__rt";switch(statement.operator){case"+":case"-":case"*":case"%":case"**":case"==":case"!=":case">":case"<":case">=":case"<=":divider='.operate("'+statement.operator+'",';break;case"and":output.add("__rt_and("),divider="",prefix="";break;case"or":output.add("__rt_or("),divider="",prefix="";break;case"/":for(var parent,doOperator=!0,isDeclaration=!1,isParenthetical=!1,isFunctionCall=!1,stack=this.nodeStack,p=stack.length-1;p>=0;p--)switch(parent=stack[p],parent.type){case"Declaration":isDeclaration=!0;break;case"ParentheticalExpression":isParenthetical=!0;break;case"FunctionCall":isFunctionCall=!0}if(doOperator=!isDeclaration||!me.isFontDecl||isParenthetical||isFunctionCall,!doOperator)return output.add("new __Literal("),me.handleStatement(statement.left),output.add(' + "/" + '),me.handleStatement(statement.right),output.add(")"),!1;divider='.operate("'+statement.operator+'",';break;default:Fashion.log("Unrecognized binary expression operator: "+statement.operator)}return output.add(prefix),output.add(divider),me.handleStatement(statement.left),output.add(", "),me.handleStatement(statement.right),output.add(")"),output.add(suffix),!1}},{key:"UnaryExpression",value:function(statement){var output=this.output;switch(statement.operator){case"not":output.add("__rt_not("),
this.handleStatement(statement.expr),output.add(")");break;default:Fashion.log("Unrecognized unary expression operator "+statement.operator)}return!1}},{key:"Variable",value:function(statement){var name=statement.name,jsName=this.getScopeName(name);if("$__filename"==name)return void this.output.add('new __Text("'+statement.file+'")');if("$__dirname"==name){var fileName=statement.file.replace("\\","/"),dirName=fileName.indexOf("/")>-1?statement.file.substring(0,fileName.lastIndexOf("/")):statement.file;return void this.output.add('new __Text("'+dirName+'")')}return this.skipWarning||jsName in this.currentScope||jsName in this.variables||this.warn("Reference to undeclared variable "+name+" => "+statement.file+":"+statement.lineNumber),this.output.add('__rt_get("'+jsName+'")'),!1}},{key:"Constant",value:function(statement){var regex,me=this,output=me.output,value=statement.value;if(statement.jsonEncoded){var tmp=JSON.parse(value);value=tmp.value,value=me.handleInlineExpressions(JSON.stringify(value),null,!0)}else value=me.handleInlineExpressions(value);switch(statement.dataType){case"Length":case"Time":case"Angle":regex=/([0-9\.\-]+)([\w]+)$/i,value=value.match(regex),output.add("new __Numeric("+value[1]+', "'+value[2]+'")');break;case"Number":var s=value+"";0===s.indexOf(".")&&(s="0"+s),value=s,output.add("new __Numeric("+value+")");break;case"Percentage":var s=value+"";0===s.indexOf(".")&&(s="0"+s),value=s,output.add("new __Numeric("+value.replace("%","").replace(/\\/g,"")+', "%")');break;case"String":output.add('new __Text("'+value+'", "'+me.escapeString(statement.quoteChar)+'")');break;case"Literal":me.booleans.hasOwnProperty(value.toLowerCase())?"true"===value.toLowerCase()?output.add("__True"):output.add("__False"):me.colors.hasOwnProperty(value.toLowerCase())?output.add('__rt_color("'+value+'")'):"null"==value?output.add("__Null"):"none"==value?output.add("__None"):statement.jsonEncoded?output.add("new __Literal("+value+")"):output.add('new __Literal("'+value+'")');break;case"Color":output.add('__ColorRGBA.fromHex("'+value+'")');break;default:output.add('"'+value+'"')}return!1}},{key:"FunctionCall",value:function(statement){var jsId,me=this,output=me.output,args=statement.args,id=statement.id||statement.value,reserved={"if":!0,"else":!0};if(id=reserved[id]?"__"+id:id,jsId=Fashion.getJsName(id),"__if"===jsId){var args=me.loadArgsArray(statement.args),skipWarning=this.skipWarning;output.add("(__rt_test("),me.handleStatement(args[0]),output.add(") ? "),this.skipWarning=!0,me.handleStatement(args[1]),output.add(" : "),me.handleStatement(args[2]),output.add(")"),this.skipWarning=skipWarning}else if(me.functionDeclarations[jsId])output.add("__rt_box((__rt.functions."+jsId+" || "+jsId+"__fn).apply(__rt.functions, __rt_applySpreadArgs(["),output.indent(),me.createCallArray(statement.args,me.functionDeclarations[jsId],id),output.unindent(),output.add("])))");else if(me.registeredDeclarations[jsId])output.add("__rt_box(__rt.registered."+jsId+".apply(__rt.registered, __rt_applySpreadArgs(["),output.indent(),me.createCallArray(statement.args,me.registeredDeclarations[jsId],id,!0),output.unindent(),output.add("])))");else{args=this.loadArgsArray(args),output.add('new __FunctionCall("'),output.add(me.handleInlineExpressions(id)),output.add('", new __List(['),output.indent(),output.addln();for(var a=0;a<args.length;a++){var arg=args[a];me.handleStatement(arg),a<args.length-1&&(output.add(","),output.space())}output.unindentln('], ","))')}return!1}},{key:"Extend",value:function(statement){return this.output.addln("__rt_extendSelector("),this.handleStatement(statement.selector),this.output.add(");"),!1}},{key:"ParentheticalExpression",value:function(statement){return this.isSelector?(this.output.addln("new __ParentheticalExpression("),this.handleStatement(statement.expr),this.output.add(")")):statement.expr?this.handleStatement(statement.expr):this.output.add("new __List([], ', ')"),!1}},{key:"List",value:function(statement){var output=this.output,isMap=!1;if(statement.items.length&&statement.items[0].isKVP&&(isMap=!0),isMap){output.add("new __Map([");for(var i=0;i<statement.items.length;i++){var item=statement.items[i];this.handleStatement(item.variable),output.add(","),output.space(),this.handleStatement(item),i<statement.items.length-1&&(output.add(","),output.space())}output.add("])")}else{output.add("new __List([");for(var i=0;i<statement.items.length;i++){var item=statement.items[i];this.handleStatement(item),i<statement.items.length-1&&(output.add(","),output.space())}output.add('], "'+statement.separator+'")')}return!1}},{key:"Warn",value:function(statement){return this.addSourceInfo(),this.output.addln("__rt_warn(__rt_unbox("),this.handleStatement(statement.expr),this.output.add("));"),!1}},{key:"Error",value:function(statement){return this.addSourceInfo(),this.output.addln("__rt_error(__rt_unbox("),this.handleStatement(statement.expr),this.output.add("));"),!1}},{key:"Debugger",value:function(statement){return this.output.addln("debugger;"),!1}},{key:"Import",value:function(statement){var _this15=this,me=this,output=me.output,source=statement.source;return source="List"!==source.type&&"SelectorList"!==source.type||!source.separator||0!==source.separator.indexOf(",")?[source]:source.items,this.isSelector=statement.source,source.forEach(function(source){source&&!/(^js[:])|(\.js$)/.test(source.value)&&(output.addln('__rt_addDirectiveRuleset("@import", '),"MultiPartSelector"===source.type&&1===source.items.length&&(source=source.items[0]),source&&"CompoundSelector"===source.type&&1===source.items.length&&(source=source.items[0]),source.type&&"String"!==source.dataType&&"Literal"!==source.dataType?_this15.handleStatement(source):(source.type||(source=new Constant({value:source,dataType:"String",quoteChar:'"'})),0!==source.value.indexOf("http://")&&0!==source.value.indexOf("//")&&(source=new FunctionCall(null,"url",[new FunctionCall(null,"unquote",[source])])),_this15.handleStatement(source)),output.add(");"))}),this.isSelector=null,!1}},{key:"Require",value:function(statement){return!1}},{key:"Assignment",value:function(statement){return this.output.addln('new __Literal(["'),this.output.add(this.handleInlineExpressions(statement.id)),this.output.add(statement.operator+'", '),this.handleStatement(statement.expr),this.output.add('].join(""))'),!1}},{key:"Debug",value:function(statement){this.output.addln("__rt_debug(__rt_unbox("),this.handleStatement(statement.expr),this.output.add("));")}},{key:"Charset",value:function(statement){return!1}},{key:"SelectorPart",value:function(statement){var output=this.output;return output.add("new __SelectorPart("),this.handleStatement(statement.value),output.add(', "'+statement.selectorType+'")'),!1}},{key:"CompoundSelector",value:function(statement){var output=this.output;output.add("new __CompoundSelector([");for(var i=0;i<statement.items.length;i++){var item=statement.items[i];this.handleStatement(item),i<statement.items.length-1&&(output.add(","),output.space())}return output.add("], true)"),!1}},{key:"MultiPartSelector",value:function(statement){var output=this.output;output.add("new __MultiPartSelector([");for(var i=0;i<statement.items.length;i++){var item=statement.items[i];this.handleStatement(item),i<statement.items.length-1&&(output.add(","),output.space())}return output.add("])"),!1}},{key:"SelectorList",value:function(statement){var output=this.output;output.add("new __SelectorList([");for(var i=0;i<statement.items.length;i++){var item=statement.items[i];this.handleStatement(item),i<statement.items.length-1&&(output.add(","),output.space())}return output.add("])"),!1}},{key:"SelectorProperty",value:function(statement){var output=this.output;return output.add("new __SelectorProperty("),this.handleStatement(statement.property),output.add(", "),this.handleStatement(statement.value),output.add(")"),!1}},{key:"Default",value:function(statement){this.warn("Unrecognized statement type: "+statement.type+" , "+JSON.stringify(statement,null,4))}},{key:"error",value:function(message,data){Fashion.error(message,data),this.errors++}},{key:"warn",value:function(message,data){Fashion.warn(message,data),this.warnings++}},{key:"transpile",value:function(ast,disableGetter){var sortedAst,me=this,preprocessor=this.preprocessor;return me.reset(),preprocessor||(preprocessor=new Preprocessor,preprocessor.preprocess(ast)),this.preprocessor=preprocessor,me.functionDeclarations=preprocessor.functionDeclarations,me.mixinDeclarations=preprocessor.mixinDeclarations,me.registeredDeclarations=preprocessor.registeredDeclarations,me.variables=preprocessor.getVariables(),me.dynamicVariables=preprocessor.getDynamicsMap(),me.processedVariables={},sortedAst=preprocessor.getSortedDynamicAstNodes(),Array.isArray(ast)?sortedAst.push.apply(sortedAst,ast):sortedAst.push(ast),me.nestedDocs=!1,me.handleStatements(sortedAst),me.warnings&&Fashion.warn("Sass compilation encountered "+me.warnings+" warning(s)"),me.errors&&Fashion.raise("Sass compilation encountered "+me.errors+" error(s)"),me.output.get().trim()}}]),Transpiler}(Visitor);Fashion.apply(Transpiler.prototype,{errors:0,warnings:0,preprocessor:void 0,output:void 0,currentScope:void 0,globalScope:void 0,globalVars:void 0,isSignatureDeclaration:void 0,nestedDocs:void 0,processingMixin:void 0,functionDeclarations:void 0,mixinDeclarations:void 0,registeredDeclarations:void 0,isFontDecl:void 0,isSelector:void 0,variables:void 0,dynamicVariables:void 0,stringCache:void 0,docCache:void 0,nodeCache:void 0,eachCount:void 0,popScope:void 0,generateGets:void 0,processedVariables:void 0,skipWarning:void 0,loadArgsArray:Preprocessor.loadArgsArray,colors:Color.map,booleans:{"true":!0,"false":!0},nativeCssMethods:{url:!0,translate3d:!0,rotate:!0,scale:!0,"-webkit-gradient":!0,from:!0,skew:!0,"color-stop":!0,rect:!0,calc:!0}}),module.exports=Transpiler},{"./Preprocessor.js":13,"./Runtime.js":15,"./Visitor.js":18,"./export/Base.js":19,"./export/Output.js":20,"./export/type/Color.js":25,"./parse/Parser.js":55,"./parse/Scanner.js":56,"./parse/ast/Nodes.js":60}],18:[function(require,module,exports){var Fashion=require("./export/Base.js"),Base=Fashion.Base,Visitor=function(_Base6){function Visitor(config){_classCallCheck(this,Visitor);var _this16=_possibleConstructorReturn(this,(Visitor.__proto__||Object.getPrototypeOf(Visitor)).call(this,config));return _this16.nodeStack=[],_this16}return _inherits(Visitor,_Base6),_createClass(Visitor,[{key:"visitComments",value:function(docs){for(var d=0;d<docs.length;d++)this.Comment(docs[d])}},{key:"visitItem",value:function(obj){obj.docs&&obj.docs.length&&this.visitComments(obj.docs),obj.doVisit(this)}},{key:"visit",value:function(obj){for(;obj&&void 0!==obj.visitTarget;)obj=obj.visitTarget;if(obj){if(Array.isArray(obj)){for(var i=0;i<obj.length;i++)this.visit(obj[i]);return}this.nodeStack.push(obj),this.visitItem(obj),this.nodeStack.pop()}}},{key:"Comment",value:function(comment){}},{key:"Each",value:function(obj){obj.descend(this)}},{key:"For",value:function(obj){obj.descend(this)}},{key:"While",value:function(obj){obj.descend(this)}},{key:"Charset",value:function(obj){obj.descend(this)}},{key:"Function",value:function(obj){obj.descend(this)}},{key:"Ruleset",value:function(obj){obj.descend(this)}},{key:"Mixin",value:function(obj){obj.descend(this)}},{key:"Block",value:function(obj){obj.descend(this)}},{key:"Include",value:function(obj){obj.descend(this)}},{key:"Declaration",value:function(obj){obj.descend(this)}},{key:"VariableAssignment",value:function(obj){obj.descend(this)}},{key:"Assignment",value:function(obj){obj.descend(this)}},{key:"If",value:function(obj){obj.descend(this)}},{key:"Else",value:function(obj){obj.descend(this)}},{key:"Return",value:function(obj){obj.descend(this)}},{key:"ParentheticalExpression",value:function(obj){obj.descend(this)}},{key:"SelectorPart",value:function(obj){obj.descend(this)}},{key:"SelectorProperty",value:function(obj){obj.descend(this)}},{key:"CompoundSelector",value:function(obj){obj.descend(this)}},{key:"MultiPartSelector",value:function(obj){obj.descend(this)}},{key:"SelectorList",value:function(obj){obj.descend(this)}},{key:"BinaryExpression",value:function(obj){obj.descend(this)}},{key:"UnaryExpression",value:function(obj){obj.descend(this)}},{key:"Variable",value:function(obj){obj.descend(this)}},{key:"Constant",value:function(obj){obj.descend(this)}},{key:"FunctionCall",value:function(obj){obj.descend(this)}},{key:"Extend",value:function(obj){obj.descend(this)}},{key:"List",value:function(obj){obj.descend(this)}},{key:"Warn",value:function(obj){obj.descend(this)}},{key:"Error",value:function(obj){obj.descend(this)}},{key:"Import",value:function(obj){obj.descend(this)}},{key:"Require",value:function(obj){obj.descend(this)}},{key:"Content",value:function(obj){obj.descend(this)}},{key:"Debugger",value:function(obj){obj.descend(this)}},{key:"Debug",value:function(obj){obj.descend(this)}}]),Visitor}(Base);Fashion.apply(Visitor.prototype,{nodeStack:null,skipBranching:!1}),module.exports=Visitor},{"./export/Base.js":19}],19:[function(require,module,exports){function _chainFunc(){}function apply(target,source){if(target=target||{},source)for(var name in source)target[name]=source[name];return target}function merge(destination,object){destination=destination||{};var key,value,sourceKey;if(object)for(key in object)value=object[key],value&&value.constructor===Object?(sourceKey=destination[key],sourceKey&&sourceKey.constructor===Object?merge(sourceKey,value):destination[key]=value):destination[key]=value;return destination}function createMessage(message,source){return source&&source.isFashionScanner?message+=": "+source.currentFile+":"+source.lineNumber:source&&(message+=": "+source.file+":"+source.lineNumber),message}function isFunction(obj){return obj&&"function"==typeof obj}function trace(message,source){debugging.trace&&console.log(createMessage("[DBG] "+message,source))}function debug(message,source){console.log(createMessage("[DBG] "+message,source))}function log(message,source){console.log(createMessage("[LOG] "+message,source))}function info(message,source){console.log(createMessage("[INF] "+message,source))}function warn(message,source){console.log(createMessage("[WRN] "+message,source))}function error(message,source){console.log(createMessage("[ERR] "+message,source))}function raise(message,extra){Fashion.inspect,"string"!=typeof message&&(extra=message,message=extra.message,delete extra.message);var error=Error(message);throw error.$isFashionError=!0,apply(error,extra)}function raiseAt(message,source,stack){var extra;source&&(message=createMessage(message,source),extra=source.isFashionScanner?{file:source.currentFile,lineNumber:source.lineNumber}:{node:source,lineNumber:source.lineNumber,file:source.file}),stack&&(extra||(extra={}),extra.fashionStack=stack),raise(message,extra)}function filter(array,func){for(var result=[],i=0;i<array.length;i++){var item=array[i];func(item,i)&&result.push(item)}return result}function convert(array,func){for(var converted=[],i=0;i<array.length;i++)converted.push(func(array[i]));return converted}function _first(array){return array.length&&array[0]}function _last(array){return array.length&&array[array.length-1]}function _tail(array){return array.length>2?array.slice(1):[]}function getAllKeys(obj,stop){for(var i,key,n,names,keys=[],map={};obj&&obj!==stop;obj=Object.getPrototypeOf(obj))for(names=Object.getOwnPropertyNames(obj),i=0,n=names.length;i<n;++i)key=names[i],map[key]||(map[key]=!0,keys.push(key));return keys}function mixin(target,bases){Array.isArray(bases)||(bases=Array.prototype.slice.call(arguments,1));for(var proto=target.prototype,b=0;b<bases.length;b++){var base=bases[b],baseProto=base.prototype;getAllKeys(baseProto,Base.prototype).forEach(function(name){name in baseProto&&(name in proto||(proto[name]=baseProto[name]))})}}function flatten(array,level,output){output=output||[],level=void 0===level?1e3:level;for(var i=0;i<array.length;i++){var item=array[i];Array.isArray(item)&&level?flatten(item,level-1,output):output.push(item)}return output}var NameConverter=require("./../NameConverter.js"),debugging={trace:!1},Base=function Base(config){_classCallCheck(this,Base),config&&merge(this,config)},BaseSet=function(){function BaseSet(){_classCallCheck(this,BaseSet)}return _createClass(BaseSet,[{key:"first",value:function(){return _first(this.items)}},{key:"last",value:function(){return _last(this.items)}},{key:"tail",value:function(){return _tail(this.items)}}]),BaseSet}();BaseSet.prototype.items=null;var chain=Object.create||function(Parent){return _chainFunc.prototype=Parent,new _chainFunc};module.exports={EmptyArray:[],getJsName:NameConverter.getJsName,chain:chain,Base:Base,BaseSet:BaseSet,apply:apply,merge:merge,createMessage:createMessage,isFunction:isFunction,debugging:debugging,trace:trace,debug:debug,log:log,info:info,warn:warn,error:error,raise:raise,raiseAt:raiseAt,filter:filter,convert:convert,first:_first,last:_last,tail:_tail,mixin:mixin,flatten:flatten}},{"./../NameConverter.js":11}],20:[function(require,module,exports){var Fashion=require("./Base.js"),Base=Fashion.Base,Output=function(_Base7){function Output(){_classCallCheck(this,Output);var _this17=_possibleConstructorReturn(this,(Output.__proto__||Object.getPrototypeOf(Output)).call(this));return _this17.output="",_this17}return _inherits(Output,_Base7),_createClass(Output,[{key:"space",value:function(){this.add(" ")}},{key:"add",value:function(text){this.output+=text}},{key:"addComment",value:function(text){this.output+=text}},{key:"indent",value:function(){this.indentation+=this.indentstr}},{key:"unindent",value:function(){this.indentation=this.indentation.substr(this.indentstr.length)}},{key:"addln",value:function(ln){this.output+="\n"+this.indentation+(ln||"")}},{key:"addCommentLn",value:function(ln){ln&&0===ln.indexOf("//")||this.addln(ln)}},{key:"get",value:function(){return this.output}},{key:"indentln",value:function(ln){this.addln(ln),this.indent()}},{key:"unindentln",value:function(ln){this.unindent(),this.addln(ln)}},{key:"reset",value:function(){this.indentation="",this.output=""}}]),Output}(Base);Fashion.apply(Output.prototype,{indentation:"",output:"",isCompressed:!1,indentstr:" ",splitThreshold:1e6,selectorCount:0}),module.exports=Output},{"./Base.js":19}],21:[function(require,module,exports){var Fashion=require("./Base.js"),Base=Fashion.Base,Type=require("./type/Type.js"),List=require("./type/List.js"),Bool=require("./type/Bool.js"),Color=require("./type/Color.js"),ColorRGBA=require("./type/ColorRGBA.js"),Text=require("./type/Text.js"),Literal=require("./type/Literal.js"),Statics=require("./type/Statics.js"),TypeVisitor=require("./type/TypeVisitor.js"),Types=require("./type/Types.js"),Scope=function(){function Scope(prev){_classCallCheck(this,Scope),this.prev=prev,this.map={},this.sourceInfo=null}return _createClass(Scope,[{key:"get",value:function(name){for(var value,map=this.map,prev=this;map;){if(value=map[name])return value;prev=prev.prev,map=prev&&prev.map}return value}},{key:"has",value:function(name){for(var map=this.map,prev=this;map;){if(name in map)return!0;prev=prev.prev,map=prev&&prev.map}return!1}},{key:"put",value:function(name,value){return this.map[name]=value,value}},{key:"addEntries",value:function(names){this.prev&&this.prev.addEntries(names);for(var name in this.map)names[name]=this.map[name]}},{key:"getEntries",value:function(entries){return entries=entries||{},this.addEntries(entries),entries}},{key:"getSourceInfo",value:function(){return this.sourceInfo}},{key:"getCallStack",value:function(stack){return stack=stack||[],this.sourceInfo&&stack.push(this.sourceInfo),this.prev&&this.prev.getCallStack(stack),stack}}]),Scope}();Fashion.apply(Scope.prototype,{$isScope:!0,map:void 0,prev:void 0,resetScope:void 0});var Runtime=function(_Base8){function Runtime(config){_classCallCheck(this,Runtime);var _this18=_possibleConstructorReturn(this,(Runtime.__proto__||Object.getPrototypeOf(Runtime)).call(this,config)),me=_this18;return me.mixins={},me.functions={},me.processors=[],me.registered={runtime:me,box:Statics.boxType,unbox:Statics.unboxType,isArray:function(array){return Array.isArray(array)},getRuntime:function(){return this.runtime},handleArgs:function(args,keys){for(var key,scope={},index=0,a=0;a<args.length;a++){var arg=args[a];if(void 0!==arg)if(arg===!0||arg===!1)scope[keys[index]]=arg,index++;else if(void 0===arg.type)for(key in arg)scope[key.replace(/^\$/,"")]=arg[key];else key=keys[index],key instanceof Array?(key=key[0],scope[key]=scope[key]||new List,scope[key].add(arg)):(scope[key]=arg,index++)}return scope},sliceArgs:function(args,start,end){return this.getRuntime().sliceArgs(args,start,end).items},tailArgs:function(start,args){var tail=Array.prototype.slice.call(args,start);return 1==tail.length&&this.isArray(tail)&&(tail=tail[0]),tail}},_this18}return _inherits(Runtime,_Base8),_createClass(Runtime,[{key:"bool",value:function(value){return new Bool(value)}},{key:"color",value:function color(name){var rgb=Color.map[name],color=new ColorRGBA(rgb[0],rgb[1],rgb[2],rgb[3]);return color.stringified=name,color}},{key:"quote",value:function(value){return"string"===value.type?value:new Text(""+value)}},{key:"unquote",value:function(value){return value.$isFashionType?value.unquote():new Literal(""+value)}},{key:"not",value:function(expression){return this.box(0==this.unbox(expression))}},{key:"operate",value:function(operation,left,right){return(null!=left&&!left.$isFashionNull||"=="==operation||"!="==operation)&&(null!=right&&!right.$isFashionNull||"=="==operation||"!="==operation)?left.operate(operation,right):Literal.Null}},{key:"reset",value:function(){this._currentScope=null,this._currentCallStackScope=this.createCallStackScope(),this._globalScope=this.createScope(),this._dynamics={}}},{key:"run",value:function(code,metadata){return this.load(code),this.compile(code),this.execute(metadata)}},{key:"createTypesBlock",value:function(types){types=types||this.types;for(var name,keys=Object.getOwnPropertyNames(types),buff=[],i=0;i<keys.length;i++)name=keys[i],buff.push(name+" = Types."+name),buff.push("__"+name+" = "+name);return 0===buff.length?"":"var "+buff.join(",\n ")+";\n"}},{key:"createMethodBlock",value:function(proto){proto=proto||this.constructor.prototype;for(var keys,name,buff=[];proto;){keys=Object.getOwnPropertyNames(proto);for(var i=0;i<keys.length;i++)name=keys[i],"function"==typeof proto[name]&&buff.push("__rt_"+name+" = __rt."+name+".bind(__rt)");proto=Object.getPrototypeOf(proto)}return 0===buff.length?"":"var "+buff.join(",\n ")+";\n"}},{key:"createPropertyBlock",value:function(){for(var name,keys=Object.getOwnPropertyNames(this),buff=[],i=0;i<keys.length;i++)name=keys[i],buff.push("__rt_"+name+" = __rt."+name);return 0===buff.length?"":"var "+buff.join(",\n ")+";\n"}},{key:"createPrefixedFunctionBody",value:function(code){return code=this.createTypesBlock()+this.createMethodBlock()+this.createPropertyBlock()+code}},{key:"createWrappedFn",value:function(code){return Function("Types","__rt","__gs","__udf","__dyn",this.createPrefixedFunctionBody(code))}},{key:"callWrappedFn",value:function(fn,dynamics){return fn(Fashion,this,this._globalScope,void 0,dynamics||{})}},{key:"compile",value:function(code){var theFn,me=this;return this.code=code,theFn=this.createWrappedFn(code),this.fn=function(rt,overrides,dyn){var runtime=rt||me,dynamics=dyn||{};runtime.reset(),overrides&&(overrides.$isScope?runtime._globalScope=overrides:runtime._globalScope.map=overrides),dyn&&(runtime._dynamics=dyn),runtime._currentScope=runtime._globalScope,runtime._scopeStack=[runtime._currentScope];try{theFn(me.types,runtime,runtime._globalScope,void 0,dynamics)}catch(err){Fashion.raiseAt(err.message||err,null,runtime.getCallStack())}return runtime._globalScope},this.fn}},{key:"execute",value:function(metadata){return this.fn(this,metadata)}},{key:"load",value:function(code){return this.code=code,this}},{key:"registerProcessor",value:function(proc){this.processors.push(new TypeVisitor(proc))}},{key:"register",value:function(methods){methods.dynamic&&(Fashion.error('Cannot register javascript function named "dynamic"'),delete methods.dynamic),methods.require&&(Fashion.error('Cannot register javascript function named "require"'),delete methods.require),Fashion.apply(this.registered,methods)}},{key:"isRegistered",value:function(name){return name=this.reserved[name]?"__"+name:name,!!this.registered[name]}},{key:"getGlobalScope",value:function(){return this._globalScope}},{key:"getCurrentScope",value:function(){return this._currentScope}},{key:"getRegisteredFunctions",value:function(){return this.registered}},{key:"getFunctions",value:function(){return this.functions}},{key:"getMixins",value:function(){return this.mixins}},{key:"createScope",value:function(scope){var currScope=scope||this._currentScope,newScope=new Scope(currScope);return this.pushScope(newScope)}},{key:"pushScope",value:function(scope){return scope.resetScope=this._currentScope,this._currentScope=scope,scope}},{key:"popScope",value:function(){return this._currentScope=this._currentScope.resetScope,this._currentScope}},{key:"createCallStackScope",value:function(scope){var currScope=scope||this._currentCallStackScope,newScope=new Scope(currScope);return this.pushCallStackScope(newScope)}},{key:"pushCallStackScope",value:function(scope){return scope.resetScope=this._currentCallStackScope,this._currentCallStackScope=scope,scope}},{key:"popCallStackScope",value:function(){return this._currentCallStackScope=this._currentCallStackScope.resetScope,this._currentCallStackScope}},{key:"getCallStack",value:function(){return this._currentCallStackScope?this._currentCallStackScope.getCallStack():null}},{key:"pushSourceInfo",value:function(info){return this._currentCallStackScope&&(this._currentCallStackScope.sourceInfo=info),!0}},{key:"getSourceInfo",value:function(){var stack=this._currentCallStackScope,info=stack&&stack.sourceInfo;return info&&info.length?{lineNumber:info[0],file:info[1]}:null}},{key:"get",value:function(name){var scope=this.getScopeForName(name),res=scope.map[name];return void 0===res&&(name in scope.map||Fashion.raiseAt("Reference to undeclared variable : "+name,null,this.getCallStack())),this.box(res)}},{key:"getScopeForName",value:function(jsName){for(var scope=this._currentScope;scope;){if(jsName in scope.map)return scope;scope=scope.prev}return this._currentScope}},{key:"getDefault",value:function(val){if(null!=val&&void 0!==val){if(!val.$isFashionNull)return this.box(val);if(this.constructor.allowNullDefaults)return val}}},{key:"getGlobalDefault",value:function(jsName){var obj=this._globalScope.get(jsName);return this.getDefault(obj)}},{key:"getLocalDefault",value:function(jsName){var obj=this._currentScope.get(jsName);return this.getDefault(obj)}},{key:"setGlobal",value:function(jsName,value,astNodeId){var currScope=this._globalScope;return value&&value.$isFashionLiteral||(value=this.box(value)),value.ast=value.ast||this.getAstNode(astNodeId),currScope.map[jsName]=value,value}},{key:"setDynamic",value:function(name,value,astNodeId){var newValue,jsName=Fashion.getJsName(name),currScope=this._globalScope;return value&&value.$isFashionLiteral||(value=this.box(value)),value.ast=value.ast||this.getAstNode(astNodeId),value.$referenceName||value.$constant?(newValue=value.clone(),newValue.$previousReference=value,value=newValue,value.ast=this.getAstNode(astNodeId)):value.$referenceName=name,currScope.map[jsName]=value,value}},{key:"setScoped",value:function(jsName,value){var currScope=this.getScopeForName(jsName);return value&&value.$isFashionLiteral||(value=this.box(value)),currScope.map[jsName]=value,value}},{key:"set",value:function(jsName,value){var currScope=this._currentScope;return value&&value.$isFashionLiteral||(value=this.box(value)),currScope.map[jsName]=value,value}},{key:"getDocs",value:function(id){if(this.docCache)return this.docCache.get(id)}},{key:"getString",value:function(id){if(this.stringCache)return this.stringCache.get(id)}},{key:"getAstNode",value:function(id){if(this.nodeCache)return this.nodeCache.get(id)}},{key:"applySpread",value:function(arg){return arg.spread=!0,arg}},{key:"sliceArgs",value:function(args,start,end){start=start||0,end=end||args.length;var spread,a,arg,filtered=[],newArgs=[],separator=", ";for(a=start;a<end;a++)arg=args[a],arg?arg.spread&&arg.$isFashionList?(spread&&filtered.push(spread),spread=arg,separator=spread.separator||separator):filtered.push(arg):spread||filtered.push(arg);for(a=0;a<filtered.length;a++)arg=filtered[a],separator=arg&&arg.splatSeparator||separator,newArgs.push(filtered[a]);return spread&&newArgs.push.apply(newArgs,spread.items),new List(newArgs,separator)}},{key:"applySpreadArgs",value:function(args,name){var arg,a,item,i,items,key,map,defaults,proc,param,paramName,newArgs=[],hadSpread=!1,offset=0;for(proc=this.context&&this.context.preprocessor,proc&&(defaults=proc.mixinDeclarations[name],defaults?offset=1:defaults=proc.functionDeclarations[name],defaults=defaults&&defaults.parameters),a=0;a<args.length;a++){if(arg=args[a],arg&&arg.spread&&arg.$isFashionMap&&defaults){items=arg.items,map={};for(key in arg.map)map["$"+Fashion.getJsName(key)]=arg.map[key];for(var p=0;p<defaults.length;p++)param=defaults[p],paramName=Fashion.getJsName(param.name),paramName in map?(newArgs.push(items[map[paramName]]),delete map[paramName]):param.varArgs||newArgs.push(void 0);for(key in map)item=items[map[key]],newArgs.push(item);hadSpread=!0}else if(arg&&arg.spread&&arg.$isFashionList){for(items=arg.getItems(),i=0;i<items.length;i++)item=items[i],item&&(item.splatSeparator=arg.separator),newArgs.push(item);hadSpread=!0}else!arg&&hadSpread||newArgs.push(arg);arg&&(arg.spread=void 0)}var misisngParams=this.context&&this.context.missingParameters;if(misisngParams&&"error"==misisngParams&&defaults)for(var d=0;d<defaults.length;d++)defaults[d].hasOwnProperty("default")||defaults[d].varArgs||void 0===newArgs[d+offset]&&Fashion.raiseAt("No value supplied for argument : "+defaults[d].name,null,this.getCallStack());return newArgs}},{key:"warn",value:function(arg){Fashion.warn(arg,this.getSourceInfo())}},{key:"error",value:function(arg){Fashion.raiseAt(arg,null,this.getCallStack())}},{key:"debug",value:function(){Fashion.debug.apply(Fashion,arguments)}},{key:"setCaches",value:function(transpiler){this.docCache=transpiler.docCache,this.stringCache=transpiler.stringCache,this.nodeCache=transpiler.nodeCache}},{key:"copyRuntimeState",value:function(runtime){this._dynamics=runtime._dynamics,this.registered=runtime.registered,this.functions=runtime.functions,this.mixins=runtime.mixins}},{key:"test",value:function(val){return val=this.unbox(val),null!=val&&val!==!1}},{key:"and",value:function(a,b){return this.test(a)?b:a}},{key:"or",value:function(a,b){return this.test(a)?a:b}}]),Runtime}(Base);Fashion.apply(Runtime.prototype,{box:Type.box,unbox:Type.unbox,Scope:Scope,isFashionRuntime:!0,functions:null,code:null,fn:null,stringCache:null,docCache:null,types:Types,_globalScope:null,_currentScope:null,_dynamics:null,context:null,reserved:{"if":!0,"else":!0}}),module.exports=Runtime},{"./Base.js":19,"./type/Bool.js":24,"./type/Color.js":25,"./type/ColorRGBA.js":27,"./type/List.js":31,"./type/Literal.js":32,"./type/Statics.js":38,"./type/Text.js":39,"./type/Type.js":40,"./type/TypeVisitor.js":41,"./type/Types.js":42}],22:[function(require,module,exports){var Fashion=require("../Base.js"),Runtime=require("../Runtime.js"),ValueParser=require("../parse/ValueParser.js"),SourceBuilder=require("../type/SourceBuilder.js"),CssVariableManager=function(){function CssVariableManager(){_classCallCheck(this,CssVariableManager),this.reset()}return _createClass(CssVariableManager,[{key:"reset",value:function(){this.initFns=[],this.calcFns=[],this.variableMap={},this.runtime=null}},{key:"createRuntime",value:function(){return new Runtime}},{key:"getRuntime",
value:function(){var me=this,rt=me.runtime;if(!rt){rt=me.createRuntime();for(var i=0;i<me.initFns.length;i++)me.initFns[i](rt);me.runtime=rt}return rt}},{key:"calculate",value:function(vars){var key,scope,sb,name,names,jsName,value,me=this,rt=me.getRuntime(),parser=new ValueParser,map=me.variableMap;scope=new rt.Scope;for(name in vars)key=Fashion.getJsName(name.replace(me.nameRe,"")),0!==key.indexOf("$")&&(key="$"+key),scope.put(key,parser.parse(vars[name]));rt._globalScope=scope,rt._currentScope=scope;for(var i=0;i<me.calcFns.length;i++)me.calcFns[i](rt);sb=new SourceBuilder,vars={};for(name in map){names=map[name];for(var i=0;i<names.length;i++)key=names[i],jsName="$"+Fashion.getJsName(key),value=scope.get(jsName),value&&(value.$isWrapper&&(value=value.value),vars[key]=sb.toSource(value))}return vars}},{key:"applyVariables",value:function(vars){var me=this,map=me.variableMap;for(var selector in map){var variables=map[selector],els=document.querySelectorAll(selector);if(els)for(var i=0;i<els.length;i++)for(var j=0;j<variables.length;j++){var varName=variables[j];els[i].style.setProperty("--"+varName,vars[varName])}}}},{key:"setVariables",value:function(vars){this.applyVariables(this.calculate(vars))}},{key:"register",value:function(init,calc,map){if(init&&this.initFns.push(init),calc&&this.calcFns.push(calc),map){var vars=this.variableMap;for(var name in map){var curr=vars[name];curr?curr.push.apply(curr,map[name]):vars[name]=map[name]}}}},{key:"buildName",value:function(name){return name.replace(/^--/,"").replace(/^\$/,"")}},{key:"buildJsName",value:function(name){return Fashion.getJsName(name)}},{key:"buildNames",value:function(names){var name,out={};for(name in names)out[name]=this.buildName(names[name]);return out}},{key:"buildJsNames",value:function(names){var name,out={};for(name in names)out[name]=this.buildJsName(names[name]);return out}},{key:"getVariables",value:function(){var me=this,map=me.variableMap,out={};for(var selector in map){var variables=map[selector],els=document.querySelectorAll(selector);if(els)for(var i=0;i<els.length;i++)for(var j=0;j<variables.length;j++){var varName=variables[j];out[varName]=els[i].style.getPropertyValue("--"+varName)}}return out}}]),CssVariableManager}();Fashion.apply(CssVariableManager.prototype,{$isExport:!0,nameRe:/^--/}),module.exports=CssVariableManager},{"../Base.js":19,"../Runtime.js":21,"../parse/ValueParser.js":23,"../type/SourceBuilder.js":37}],23:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("../type/Type.js"),Types=(require("../type/Statics.js"),require("../type/Types.js")),Color=Types.Color,Text=Types.Text,Numeric=Types.Numeric,List=Types.List,Bool=Types.Bool,Literal=Types.Literal,ColorRGBA=Types.ColorRGBA,ColorHSLA=Types.ColorHSLA,FunctionCall=Types.FunctionCall,Parser=function(){function Parser(){_classCallCheck(this,Parser),this.index=0}return _createClass(Parser,[{key:"_advance",value:function(){for(var ch,me=this,buff="",str=me.str,len=str.length,isString=!1,escaped=!1,isParen=0;me.index<len;)if(ch=str[me.index],me.index++,ch<=" "&&!isString&&!isParen){if(buff.length)break}else{if(";"===ch&&!isString&&!escaped)break;if("("===ch&&isParen++,")"===ch&&isParen&&isParen--,","===ch&&!isString&&!escaped&&!isParen){if(buff.length){me.index--;break}return ch}"\\"===ch&&isString?(escaped=1,me.index++):('"'!==ch&&"'"!==ch||(isString?isString===ch&&(isString=!1):isString=ch),escaped=!1,buff+=ch)}return buff}},{key:"parseValue",value:function(token){var match,value,rx={number:/^(\d+)(px|pt|pc|cm|mm|in|em|rem|ex)?$/g,shortHexColor:/^#([A-Fa-f0-9]{3})$/,longHexColor:/^#([A-Fa-f0-9]{6})$/,functionCall:/^([A-Za-z0-9_]+)\((.*)\)$/,parenList:/^\((.*?)\)$/};if('"'===token[0]||"'"===token[0])return value=token=token.substring(1,token.length-1),new Text(value,token[0]);if("true"===token)return new Bool((!0));if("false"===token)return new Bool((!1));if("null"===token)return Literal.Null;if("none"===token)return Literal.None;if(Fashion.Color.map[token]){var rgb=Color.map[token],color=new ColorRGBA(rgb[0],rgb[1],rgb[2],rgb[3]);return color.stringified=token,color}if(match=rx.number.exec(token))return new Numeric(parseFloat(match[1]),match[2]);if(match=rx.shortHexColor.exec(token))return ColorRGBA.fromHex(match[1]);if(match=rx.longHexColor.exec(token))return ColorRGBA.fromHex(match[1]);if(match=rx.functionCall.exec(token)){var name=match[1],args=this.parse(match[2]).items;return"hsla"===name||"hsl"===name?new ColorHSLA(Type.unbox(args[0]),Type.unbox(args[1]),Type.unbox(args[2]),Type.unbox(args[3])||1):"rgba"===name||"rgb"===name?new ColorRGBA(Type.unbox(args[0]),Type.unbox(args[1]),Type.unbox(args[2]),Type.unbox(args[3])||1):new FunctionCall(name,args)}return(match=rx.parenList.exec(token))?new FunctionCall(this.parse(match[1])):new Fashion.Literal(token)}},{key:"parse",value:function(str){var token,me=this,tokens=[],values=[],csv=null;for(me.str=str,me.index=0;token=me._advance();)tokens.push(token);for(var i=0;i<tokens.length;i++)token=tokens[i].trim(),","===tokens[i+1]?(csv=csv||[],csv.push(me.parseValue(token)),i++):csv?(csv.push(me.parseValue(token)),values.push(new List(csv,", ")),csv=null):values.push(me.parseValue(token));return 1===values.length?values[0]:new List(values," ")}}]),Parser}();module.exports=Parser},{"../Base.js":19,"../type/Statics.js":38,"../type/Type.js":40,"../type/Types.js":42}],24:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),Bool=function(_Type){function Bool(value){_classCallCheck(this,Bool);var _this19=_possibleConstructorReturn(this,(Bool.__proto__||Object.getPrototypeOf(Bool)).call(this));return _this19.value=!!value,_this19}return _inherits(Bool,_Type),_createClass(Bool,[{key:"doVisit",value:function(visitor){visitor.bool(this)}},{key:"toString",value:function(){return this.value?"true":"false"}},{key:"copy",value:function(){return new Bool(this.value)}}]),Bool}(Type);Fashion.apply(Bool.prototype,{type:"bool",$isFashionBool:!0,value:null}),Bool.True=new Bool((!0)),Bool.True.$constant=!0,Bool.False=new Bool((!1)),Bool.False.$constant=!0,module.exports=Bool},{"../Base.js":19,"./Type.js":40}],25:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),Bool=require("./Bool.js"),Numeric=require("./Numeric.js"),Color=function(_Type2){function Color(){return _classCallCheck(this,Color),_possibleConstructorReturn(this,(Color.__proto__||Object.getPrototypeOf(Color)).call(this))}return _inherits(Color,_Type2),_createClass(Color,[{key:"toBoolean",value:function(){return Bool.True}},{key:"getRGBA",value:function(){return this}},{key:"getHSLA",value:function(){return this}}],[{key:"component",value:function(color,_component){var targetColor,unit=Color.units[_component],type=Color.types[_component],prop=Color.comps[_component];return targetColor="hsla"==type?color.getHSLA():color.getRGBA(),new Numeric(targetColor[prop],unit)}},{key:"adjust",value:function(color,component,amount){var hsl=color.getHSLA().copy(),prop=Color.comps[component],value=amount.value;return hsl[prop]+=value,hsl.h=Color.constrainDegrees(hsl.h),hsl.s=Color.constrainPercentage(hsl.s),hsl.l=Color.constrainPercentage(hsl.l),hsl.getRGBA()}},{key:"constrainChannel",value:function(channel){return Math.max(0,Math.min(channel,255))}},{key:"constrainPercentage",value:function(per){return Math.max(0,Math.min(per,100))}},{key:"constrainDegrees",value:function(deg){return deg%=360,deg<0?360+deg:deg}},{key:"constrainAlpha",value:function(alpha){return void 0===alpha?1:Math.max(0,Math.min(alpha,1))}}]),Color}(Type);Fashion.apply(Color,{units:{lightness:"%",saturation:"%",hue:"deg"},types:{red:"rgba",blue:"rgba",green:"rgba",alpha:"rgba",hue:"hsla",saturation:"hsla",lightness:"hsla"},comps:{red:"r",green:"g",blue:"b",alpha:"a",hue:"h",saturation:"s",lightness:"l"},map:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5],transparent:[0,0,0,0]}}),Fashion.apply(Color.prototype,{type:"color",$isFashionColor:!0,$isFashionRGBA:!1,$isFashionHSLA:!1,$canUnbox:!1}),module.exports=Color},{"../Base.js":19,"./Bool.js":24,"./Numeric.js":34,"./Type.js":40}],26:[function(require,module,exports){var Fashion=require("../Base.js"),Color=require("./Color.js"),ColorRGBA=require("./ColorRGBA.js"),ColorHSLA=function(_Color){function ColorHSLA(h,s,l,a){_classCallCheck(this,ColorHSLA);var _this21=_possibleConstructorReturn(this,(ColorHSLA.__proto__||Object.getPrototypeOf(ColorHSLA)).call(this));return _this21.h=Color.constrainDegrees(h),_this21.s=s,_this21.l=l,void 0!==a&&(_this21.a=a),_this21}return _inherits(ColorHSLA,_Color),_createClass(ColorHSLA,[{key:"doVisit",value:function(visitor){visitor.hsla(this)}},{key:"operate",value:function(operation,right){return this.getRGBA().operate(operation,right)}},{key:"copy",value:function(){return new ColorHSLA(this.h,this.s,this.l,this.a)}},{key:"getRGBA",value:function(){return ColorRGBA.fromHSLA(this)}},{key:"toString",value:function(){return""+this.getRGBA()}},{key:"add",value:function(h,s,l,a){return new ColorHSLA(Color.constrainDegrees(this.h+h),Color.constrainPercentage(this.s+s),Color.constrainPercentage(this.l+l),Color.constrainAlpha(this.a*a))}},{key:"subtract",value:function(h,s,l){return this.add(-h,-s,-l)}},{key:"adjustLightness",value:function(percent){return this.l=Color.constrainPercentage(this.l+percent),this}},{key:"adjustHue",value:function(deg){return this.h=Color.constrainDegrees(this.h+deg),this}}],[{key:"fromRGBA",value:function(rgba){if(rgba.$isFashionHSLA)return rgba.clone();var r=rgba.r/255,g=rgba.g/255,b=rgba.b/255,a=rgba.a,max=Math.max(r,g,b),min=Math.min(r,g,b),delta=max-min,h=0,s=0,l=.5*(max+min);return min!=max&&(s=l<.5?delta/(max+min):delta/(2-max-min),h=r==max?60*(g-b)/delta:g==max?120+60*(b-r)/delta:240+60*(r-g)/delta,h<0&&(h+=360),h>=360&&(h-=360)),new ColorHSLA(Color.constrainDegrees(h),Color.constrainPercentage(100*s),Color.constrainPercentage(100*l),a)}}]),ColorHSLA}(Color);ColorRGBA.prototype.getHSLA=function(){return ColorHSLA.fromRGBA(this)},Fashion.apply(ColorHSLA.prototype,{type:"hsla",$isFashionHSLA:!0,h:null,s:null,l:null,a:1}),module.exports=ColorHSLA},{"../Base.js":19,"./Color.js":25,"./ColorRGBA.js":27}],27:[function(require,module,exports){function hex2(v){var s=v.toString(16);return s.length<2&&(s="0"+s),s}var Fashion=require("../Base.js"),Color=require("./Color.js"),ColorRGBA=function(_Color2){function ColorRGBA(r,g,b,a){_classCallCheck(this,ColorRGBA);var _this22=_possibleConstructorReturn(this,(ColorRGBA.__proto__||Object.getPrototypeOf(ColorRGBA)).call(this));return _this22.r=Math.min(255,Math.max(0,r)),_this22.g=Math.min(255,Math.max(0,g)),_this22.b=Math.min(255,Math.max(0,b)),void 0!==a&&(_this22.a=Math.min(1,Math.max(0,a))),_this22}return _inherits(ColorRGBA,_Color2),_createClass(ColorRGBA,[{key:"doVisit",value:function(visitor){visitor.rgba(this)}},{key:"copy",value:function(){return new ColorRGBA(this.r,this.g,this.b,this.a)}},{key:"getHSLA",value:function(){return null}},{key:"stringify",value:function(){var me=this,round=Math.round,r=round(me.r),g=round(me.g),b=round(me.b),a=me.a,stringified="";return stringified=1===a?"#"+hex2(r)+hex2(g)+hex2(b):"rgba("+r+", "+g+", "+b+", "+a+")",stringified=stringified.toLowerCase()}},{key:"getCompressedValue",value:function(lowerVal){var name=ColorRGBA.stringifiedMap[lowerVal],shortName=ColorRGBA.shortFormMap[lowerVal];return name&&(lowerVal=lowerVal.length>name.length?name:lowerVal),ColorRGBA.useShortValues&&shortName&&(lowerVal=lowerVal.length>shortName.length?shortName:lowerVal),lowerVal}},{key:"toString",value:function(){return this.stringified||(this.stringified=this.getCompressedValue(this.stringify())),this.stringified}},{key:"toIeHexStr",value:function(){var me=this,round=Math.round,r=round(me.r),g=round(me.g),b=round(me.b),a=round(255*me.a);return"#"+hex2(a)+hex2(r)+hex2(g)+hex2(b)}},{key:"add",value:function(r,g,b,a){return new ColorRGBA(this.r+r,this.g+g,this.b+b,this.a*a)}},{key:"subtract",value:function(r,g,b){return new ColorRGBA(this.r-r,this.g-g,this.b-b,this.a)}},{key:"multiply",value:function(number){return new ColorRGBA(this.r*number,this.g*number,this.b*number,this.a)}},{key:"divide",value:function(number){return new ColorRGBA(this.r/number,this.g/number,this.b/number,this.a)}}],[{key:"fromHex",value:function(value){"#"==value.charAt(0)&&(value=value.substr(1));var r,g,b;3===value.length?(r=parseInt(value.charAt(0),16),g=parseInt(value.charAt(1),16),b=parseInt(value.charAt(2),16),r=(r<<4)+r,g=(g<<4)+g,b=(b<<4)+b):(r=parseInt(value.substring(0,2),16),g=parseInt(value.substring(2,4),16),b=parseInt(value.substring(4,6),16));var result=new ColorRGBA(r,g,b);return ColorRGBA.preserveInputStrings&&(result.stringified="#"+value),result}},{key:"fromHSLA",value:function(color){function hue(h){return h<0&&++h,h>1&&--h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(2/3-h)*6:m1}if(color.$isFashionRGBA)return color.clone();var hsla=color,h=hsla.h/360,s=hsla.s/100,l=hsla.l/100,a=hsla.a,m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,r=Color.constrainChannel(255*hue(h+1/3)),g=Color.constrainChannel(255*hue(h)),b=Color.constrainChannel(255*hue(h-1/3));return new ColorRGBA(r,g,b,a)}}]),ColorRGBA}(Color);Fashion.apply(ColorRGBA,{stringifiedMap:{"rgba(0, 0, 0, 0)":"transparent"},shortFormMap:{},useShortValues:!0,preserveInputStrings:!1}),Fashion.apply(ColorRGBA.prototype,{type:"rgba",$isFashionRGBA:!0,r:null,g:null,b:null,a:1,stringified:null,"+.number":function(right){var value=right.value,unit=right.unit;switch(unit){case"%":return this.getHSLA().adjustLightness(value).getRGBA();case"deg":return this.getHSLA().adjustHue(value).getRGBA();default:return this.add(value,value,value,1)}},"+.rgba":function(right){return this.add(right.r,right.g,right.b,right.a)},"+.hsla":function(right){return this.getHSLA().add(right.h,right.s,right.l)},"-.number":function(right){var value=right.value,unit=right.unit;switch(unit){case"%":return this.getHSLA().adjustLightness(-value).getRGBA();case"deg":return this.getHSLA().adjustHue(-value).getRGBA();default:return this.subtract(value,value,value)}},"-.rgba":function(right){return this.subtract(right.r,right.g,right.b)},"-.hsla":function(right){return this.getHSLA().subtract(right.h,right.s,right.l)},"*.number":function(right){return this.multiply(right.value)},"/.number":function(right){return this.divide(right.value)},"*.rgba":function(right){return new ColorRGBA(this.r*right.r,this.g*right.g,this.b*right.b,this.a*right.a)},"/.rgba":function(right){return new ColorRGBA(Math.floor(this.r/right.r),Math.floor(this.g/right.g),Math.floor(this.b/right.b),Math.floor(this.a/right.a))}}),module.exports=ColorRGBA,function(ColorRGBA,stringifiedMap,colorMap,shortMap){var i,colorChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],names=Object.keys(colorMap);for(names.sort(),i=0;i<names.length;i++){var name=names[i],val=colorMap[name],color=new ColorRGBA(val[0],val[1],val[2],val[3]),str=color.stringify();stringifiedMap[str]=name}colorChars.forEach(function(short1){var long1=short1+short1;colorChars.forEach(function(short2){var long2=short2+short2;colorChars.forEach(function(short3){var long3=short3+short3,shortName="#"+short1+short2+short3,longName="#"+long1+long2+long3;if(shortMap[longName]){var curr=shortMap[longName];shortName=curr.length>shortName.length?shortName:curr}shortMap[longName]=shortName})})})}(ColorRGBA,ColorRGBA.stringifiedMap,Color.map,ColorRGBA.shortFormMap)},{"../Base.js":19,"./Color.js":25}],28:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),Numeric=require("./Numeric.js"),ColorStop=function(_Type3){function ColorStop(color,stop){_classCallCheck(this,ColorStop);var _this23=_possibleConstructorReturn(this,(ColorStop.__proto__||Object.getPrototypeOf(ColorStop)).call(this));return _this23.color=color,_this23.stop=stop,_this23}return _inherits(ColorStop,_Type3),_createClass(ColorStop,[{key:"doVisit",value:function(visitor){visitor.colorstop(this)}},{key:"descend",value:function(visitor){visitor.visit(this.color),visitor.visit(this.stop)}},{key:"toString",value:function(){var string=""+this.color,stop=this.stop;return stop&&(stop=stop.copy(),string+=" ",stop.unit||(stop.value*=100,stop.unit="%"),string+=""+stop),string}},{key:"toOriginalWebkitString",value:function(){var stop=this.stop;return stop||(stop=new Numeric(0,"%")),stop=stop.copy(),stop.unit||(stop.value*=100,stop.unit="%"),"color-stop("+stop+", "+this.color+")"}},{key:"copy",value:function(){return new ColorStop(this.color&&this.color.clone(),this.stop&&this.stop.clone())}}]),ColorStop}(Type);Fashion.apply(ColorStop.prototype,{type:"colorstop",$isFashionColorStop:!0,$canUnbox:!1,color:null,stop:null}),module.exports=ColorStop},{"../Base.js":19,"./Numeric.js":34,"./Type.js":40}],29:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),List=require("./List.js"),FunctionCall=function(_Type4){function FunctionCall(name,args){_classCallCheck(this,FunctionCall);var _this24=_possibleConstructorReturn(this,(FunctionCall.__proto__||Object.getPrototypeOf(FunctionCall)).call(this));return _this24.name=name,Array.isArray(args)&&(args=new List(args)),_this24.args=args,_this24}return _inherits(FunctionCall,_Type4),_createClass(FunctionCall,[{key:"toString",value:function(){var argsStr,args=this.args;return argsStr=Array.isArray(args)?args.join(", "):""+args,this.name+"("+argsStr+")"}},{key:"doVisit",value:function(visitor){visitor.functioncall(this)}},{key:"descend",value:function(visitor){this.args&&visitor.visit(this.args)}},{key:"copy",value:function(){return new FunctionCall(this.name,this.args&&this.args.copy())}}]),FunctionCall}(Type);Fashion.apply(FunctionCall.prototype,{type:"functioncall",$isFashionFunctionCall:!0,$canUnbox:!1,name:null,args:null}),module.exports=FunctionCall},{"../Base.js":19,"./List.js":31,"./Type.js":40}],30:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),LinearGradient=function(_Type5){function LinearGradient(position,stops){_classCallCheck(this,LinearGradient);var _this25=_possibleConstructorReturn(this,(LinearGradient.__proto__||Object.getPrototypeOf(LinearGradient)).call(this));return _this25.position=position,_this25.stops=stops,_this25}return _inherits(LinearGradient,_Type5),_createClass(LinearGradient,[{key:"doVisit",value:function(visitor){visitor.lineargradient(this)}},{key:"descend",value:function(visitor){visitor.visit(this.position),visitor.visit(this.stops)}},{key:"copy",value:function(){return new LinearGradient(this.position&&this.position.clone(),this.stops&&this.stops.clone())}},{key:"gradientPoints",value:function(position){}},{key:"operate",value:function(operation,right){switch(operation){case"!=":if("literal"==right.type&&("null"==right.value||"none"==right.value))return!0;case"==":if("literal"==right.type&&("null"==right.value||"none"==right.value))return!1}return _get(LinearGradient.prototype.__proto__||Object.getPrototypeOf(LinearGradient.prototype),"operate",this).call(this,operation,right)}},{key:"supports",value:function(prefix){return!!this.vendorPrefixes[prefix.toLowerCase()]}},{key:"toString",value:function(){var string="linear-gradient(";return this.position&&(string+=this.position+", "),string+this.stops+")"}},{key:"toOriginalWebkitString",value:function(){var i,args=[],stops=this.stops.items,ln=stops.length;for(args.push("top"),args.push("bottom"),i=0;i<ln;i++)args.push(stops[i].toOriginalWebkitString());return"-webkit-gradient(linear, "+args.join(", ")+")"}},{key:"toPrefixedString",value:function(prefix){return"owg"===prefix?this.toOriginalWebkitString():prefix+(""+this)}}]),LinearGradient}(Type);Fashion.apply(LinearGradient.prototype,{type:"lineargradient",$isFashionLinearGradient:!0,$canUnbox:!1,position:null,stops:null,vendorPrefixes:{webkit:!0,moz:!0,svg:!0,pie:!0,css2:!0,o:!0,owg:!0}}),module.exports=LinearGradient},{"../Base.js":19,"./Type.js":40}],31:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),List=function(_Type6){function List(items,separator){_classCallCheck(this,List);var _this26=_possibleConstructorReturn(this,(List.__proto__||Object.getPrototypeOf(List)).call(this));return _this26.items=items||[],_this26.separator=void 0===separator?" ":separator,_this26}return _inherits(List,_Type6),_createClass(List,[{key:"doVisit",value:function(visitor){visitor.list(this)}},{key:"descend",value:function(visitor){for(var i=0;i<this.items.length;i++)visitor.visit(this.items[i])}},{key:"copy",value:function(){for(var items=this.items,len=items.length,newItems=[],i=0;i<len;i++)newItems.push(items[i].clone());return new List(newItems,this.separator)}},{key:"clone",value:function(match,replace){if(replace&&this.matches(match))return replace.clone();for(var items=this.items,len=items.length,newItems=[],i=0;i<len;i++){var item=items[i];item?newItems.push(item.clone(match,replace)):newItems.push(item)}var copy=new List(newItems,this.separator);return copy.$referenceName=this.$referenceName,copy.$referenceBase=this.$referenceBase,copy.$previousReference=this.$previousReference,copy}},{key:"add",value:function(item){return this.items.push(item)}},{key:"get",value:function(index){return this.items[index-1]||null}},{key:"operate",value:function(operation,right){switch(operation){case"!=":if(right.$isFashionLiteral&&("null"===right.value||"none"===right.value))return!0;break;case"==":if(right.$isFashionLiteral&&("null"===right.value||"none"===right.value))return!1}return _get(List.prototype.__proto__||Object.getPrototypeOf(List.prototype),"operate",this).call(this,operation,right)}},{key:"supports",value:function(prefix){for(var i=0;i<this.items.length;i++){var item=this.items[i];if(item.supports(prefix))return!0}return!1}},{key:"toBoolean",value:function(){return!!this.items.length}},{key:"getItems",value:function(){return this.items}},{key:"toString",value:function(){return this.items.join(this.separator)}},{key:"unquote",value:function(){for(var item,items=[],i=0;i<this.items.length;i++)item=this.items[i],item?items.push(item.unquote()):items.push(item);return new List(items,this.separator)}},{key:"toPrefixedString",value:function(prefix){for(var items=[],i=0;i<this.items.length;i++){var item=this.items[i];item&&items.push(item.toPrefixedString(prefix))}return items.join(this.separator)}},{key:"==.list",value:function(right){for(var equals=this.separator==right.separator&&this.items.length==right.items.length,i=0;equals&&i<this.items.length;++i)equals=this.items[i].operate("==",right.items[i]);return equals}}]),List}(Type);Fashion.apply(List.prototype,{type:"list",$isFashionList:!0,items:null,separator:null}),module.exports=List},{"../Base.js":19,"./Type.js":40}],32:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),Numeric=require("./Numeric.js"),Literal=function(_Type7){function Literal(value){_classCallCheck(this,Literal);var _this27=_possibleConstructorReturn(this,(Literal.__proto__||Object.getPrototypeOf(Literal)).call(this));return _this27.value=value,_this27}return _inherits(Literal,_Type7),_createClass(Literal,[{key:"doVisit",value:function(visitor){visitor.literal(this)}},{key:"_getHash",value:function(){return this.value}},{key:"toString",value:function(){return this.value||""}},{key:"toBoolean",value:function(){return this.value.length}},{key:"copy",value:function(){return new Literal(this.value)}},{key:"+",value:function(right){return new Literal(this.value+right.getHash())}},{key:"+.number",value:function(right){return null===this.value?right:new Literal(this.value+(""+right))}},{key:"/",value:function(right){return new Literal(this.value+"/"+right.getHash())}},{key:"-",value:function(right){return new Literal(this.value+"-"+right.getHash())}},{key:"%",value:function(right){return new Literal(this.value+"%"+right.getHash())}},{key:"normalizeStart",value:function(startVal){var start=Type.unbox(startVal)||0;return start>0&&(start-=1),start<0&&(start=this.value.length+start),start<0&&(start=0),start}},{key:"normalizeEnd",value:function(endVal){var end=Type.unbox(endVal)||-1;return end>0&&(end-=1),end<0&&(end=this.value.length+end),end<0&&(end=0),end>0&&(end+=1),end}},{key:"slice",value:function(start,end){return start=this.normalizeStart(start),end=this.normalizeEnd(end),new Literal(this.value.slice(start,end))}},{key:"toUpperCase",value:function(){return new Literal(this.value.toUpperCase())}},{key:"toLowerCase",value:function(){return new Literal(this.value.toLowerCase())}},{key:"indexOf",value:function(str){var idx=this.value.indexOf(str.value);if(idx!==-1)return new Numeric(idx+1)}},{key:"insert",value:function(str,startVal){var start=Type.unbox(startVal)||0,inserted=this.value;return start>0&&(start=Math.min(start-1,inserted.length)),start<0&&(start=inserted.length+start+1,start=Math.max(start,0)),inserted=inserted.substring(0,start)+str.value+inserted.substring(start),new Literal(Literal.deEscape(inserted))}},{key:"toDisplayString",value:function(){var val=this.value;return null===val?"null":""+this}}],[{key:"tryCoerce",value:function(obj){if(!obj.$isFashionNumber)return obj.$isFashionString?new Literal(obj.value):obj.$isFashionLiteral?obj:new Literal(obj.getHash())}},{key:"deEscape",value:function(str){var i,ch,buff="";for(i=0;i<str.length;i++)ch=str.charAt(i),"\\"===ch&&(i++,ch=str.charAt(i)),buff+=ch;return buff}}]),Literal}(Type);Fashion.apply(Literal.prototype,{type:"literal",$isFashionLiteral:!0,value:null});var FashionNull=function(_Literal){function FashionNull(value){return _classCallCheck(this,FashionNull),_possibleConstructorReturn(this,(FashionNull.__proto__||Object.getPrototypeOf(FashionNull)).call(this,value||null))}return _inherits(FashionNull,_Literal),_createClass(FashionNull,[{key:"copy",value:function(){return new FashionNull(this.value)}}]),FashionNull}(Literal);Fashion.apply(FashionNull.prototype,{$isFashionNull:!0,$constant:!0}),FashionNull.prototype.$isFashionNull=!0,Literal.Null=new FashionNull(null),Literal.None=new Literal("none"),module.exports=Literal},{"../Base.js":19,"./Numeric.js":34,"./Type.js":40}],33:[function(require,module,exports){var Fashion=require("../Base.js"),List=require("./List.js"),Type=require("./Type.js"),Literal=require("./Literal.js"),Null=Literal.Null,Numeric=require("./Numeric.js"),Map=function(_List){function Map(pairs){_classCallCheck(this,Map);var _this29=_possibleConstructorReturn(this,(Map.__proto__||Object.getPrototypeOf(Map)).call(this,pairs));if(_this29.map={},pairs)for(var i=0;i<pairs.length-1;i+=2){var key=_this29.toKey(pairs[i]);pairs[i+1];_this29.map[key]=i+1}return _this29}return _inherits(Map,_List),_createClass(Map,[{key:"doVisit",value:function(visitor){visitor.map(this)}},{key:"descend",value:function(visitor){for(var i=0;i<this.items.length;i++)visitor.visit(this.items[i])}},{key:"get",value:function(key){return key instanceof Numeric&&(key=Type.unbox(key)),"number"==typeof key?new List([this.items[2*key-2],this.items[2*key-1]]," "):(key=this.toKey(key),this.items[this.map[key]]||Null)}},{key:"getItems",value:function(){for(var values=[],i=0;i<this.items.length-1;i+=2){var key=this.toKey(this.items[i]);values.push(this.map[key])}return values}},{key:"put",value:function(key,value){var keyStr=this.toKey(key);this.map.hasOwnProperty(keyStr)?this.items[this.map[keyStr]]=value:(this.items.push(key,value),this.map[keyStr]=this.items.length-1)}},{key:"toString",value:function(){for(var str="",count=0,i=0;i<this.items.length-1;i+=2){var key=this.toKey(this.items[i]),value=this.map[key];value&&(count>0&&(str+=", "),str+=key+": "+value,count++)}return str}},{key:"toKey",value:function(key){return""+this.unquoteKey(key)}},{key:"unquoteKey",value:function(string){return string.$isFashionType?string.unquote():string}},{key:"remove",value:function(key){if(key=this.toKey(key),this.map[key]){var idx=this.map[key];delete this.items[idx-1],delete this.items[idx],delete this.map[key]}}},{key:"getKeys",value:function(){for(var keys=[],i=0;i<this.items.length;i+=2){var k=this.items[i];k&&keys.push(k)}return keys}},{key:"getValues",value:function(){for(var values=[],i=1;i<this.items.length;i+=2){var v=this.items[i];v&&values.push(v)}return values}},{key:"hasKey",value:function(key){return key=this.toKey(key),!!this.map.hasOwnProperty(key)}}]),Map}(List);Fashion.apply(Map.prototype,{type:"map",$isFashionMap:!0,$canUnbox:!1,map:null}),module.exports=Map},{"../Base.js":19,"./List.js":31,"./Literal.js":32,"./Numeric.js":34,"./Type.js":40}],34:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),Bool=require("./Bool.js"),Literal=require("./Literal.js"),Numeric=function(_Type8){
function Numeric(value,unit,numeratorUnits,denominatorUnits){_classCallCheck(this,Numeric);var _this30=_possibleConstructorReturn(this,(Numeric.__proto__||Object.getPrototypeOf(Numeric)).call(this));return _this30.value=value,_this30.unit=unit,unit&&!numeratorUnits?_this30.numeratorUnits=[unit]:_this30.numeratorUnits=numeratorUnits||[],_this30.denominatorUnits=denominatorUnits||[],_this30}return _inherits(Numeric,_Type8),_createClass(Numeric,[{key:"doVisit",value:function(visitor){visitor.number(this)}},{key:"unitless",value:function(){return(!this.numeratorUnits||!this.numeratorUnits.length)&&(!this.denominatorUnits||!this.denominatorUnits.length)}},{key:"getUnitStr",value:function(){this.normalizeUnits();var unitStr=this.numeratorUnits.join("*");return this.denominatorUnits.length&&(unitStr+="/"+this.denominatorUnits.join("*")),unitStr}},{key:"_getHash",value:function(){return this.value}},{key:"stringify",value:function(){this.normalizeUnits();var valStr,value=this.value;return valStr=Math.round(1e5*value)/1e5+"",valStr+this.getUnitStr()}},{key:"toString",value:function(){return this.stringify()}},{key:"toBoolean",value:function(){return!!this.unit||!!this.value}},{key:"copy",value:function(){return new Numeric(this.value,this.unit)}},{key:"-.literal",value:function(right){return new Literal(0===this.value&&this.unitless()?"-"+right:""+this+"-"+right)}},{key:"-.string",value:function(right){return new Literal(0===this.value&&this.unitless()?"-"+right:""+this+"-"+right)}},{key:"-.number",value:function(right){var value=right.value;return"%"==right.unit&&right.unit!==this.unit&&(value=this.value*(right.value/100)),new Numeric(this.value-value,this.unit||right.unit)}},{key:"+.literal",value:function(right){return new Literal(right.$isFashionString?""+this+right.value:""+this+(""+right))}},{key:"+.number",value:function(right){var value=right.value;return"%"==right.unit&&right.unit!==this.unit&&(value=this.value*(right.value/100)),new Numeric(this.value+value,this.unit||right.unit)}},{key:"/",value:function(right){return new Numeric(this.value/right.value,this.unit==right.unit?null:this.unit||right.unit)}},{key:"*",value:function(right){return new Numeric(this.value*right.value,this.unit||right.unit)}},{key:"%",value:function(right){return new Numeric(this.value%right.value,this.unit||right.unit)}},{key:"**",value:function(right){return new Numeric(Math.pow(this.value,right.value),this.unit||right.unit)}},{key:"operate",value:function(operation,right){var normalized;this.unit||right.unit;return right.$isFashionRGBA||right.$isFashionHSLA?new Literal(this+operation+right):right.$isFashionNumber?this.numericOperate(operation,right):right.$isFashionLiteral&&(normalized=this.tryCoerce(right))?this.performOperation(operation,normalized):_get(Numeric.prototype.__proto__||Object.getPrototypeOf(Numeric.prototype),"operate",this).call(this,operation,right)}},{key:"tryNormalize",value:function(other){var value=other.value,unit=other.unit;if(other.$isFashionNumber)switch(this.unit){case"mm":switch(unit){case"in":return new Numeric(25.4*value,"mm");case"cm":return new Numeric(2.54*value,"mm")}break;case"cm":switch(unit){case"in":return new Numeric(2.54*value,"cm");case"mm":return new Numeric(value/10,"cm")}break;case"in":switch(unit){case"mm":return new Numeric(value/25.4,"in");case"cm":return new Numeric(value/2.54,"in")}break;case"ms":switch(unit){case"s":return new Numeric(1e3*value,"ms")}break;case"s":switch(unit){case"ms":return new Numeric(value/1e3,"s")}break;case"Hz":switch(unit){case"kHz":return new Numeric(1e3*value,"Hz")}break;case"kHz":switch(unit){case"Hz":return new Numeric(value/1e3,"kHz")}break;case"%":switch(unit){default:return new Numeric(value)}}}},{key:"normalize",value:function(other){var norm=this.tryNormalize(other);return void 0===norm&&raise("Could not normalize "+this+" with "+other),norm}},{key:"comparable",value:function(other){var unit1=this.unit,unit2=other.unit;return!!other.$isFashionNumber&&(unit1===unit2||"mm"===unit1&&("in"===unit2||"cm"===unit2)||"cm"===unit1&&("in"===unit2||"mm"===unit2)||"in"===unit1&&("mm"===unit2||"cm"===unit2)||"ms"===unit1&&"s"===unit2||"s"===unit1&&"ms"===unit2||"Hz"===unit1&&"kHz"===unit2||"kHz"===unit1&&"Hz"===unit2)}},{key:"normalizeUnits",value:function(){if(!this.normalized&&(this.normalized=!0,!this.unitless())){var clean=this.removeCommonUnits(this.numeratorUnits,this.denominatorUnits);clean.num=Fashion.filter(clean.num,function(val){return!!val}),clean.den=Fashion.filter(clean.den,function(val){return!!val}),this.numeratorUnits=clean.num,this.denominatorUnits=clean.den}}},{key:"numericOperate",value:function(operation,right){this.normalizeUnits(),right.normalizeUnits();var result,me=this,other=right,ops=Numeric.OPERATIONS,moreOps=Numeric.NON_COERCE_OPERATIONS,op=ops[operation];if(op)try{me.unitless()?me=me.coerceUnits(other.numeratorUnits,other.denominatorUnits):other=other.coerceUnits(me.numeratorUnits,me.denominatorUnits)}catch(e){if("=="==operation)return Bool.False;if("!="==operation)return Bool.True;throw e}else op=moreOps[operation];if(op&&(result=op(me.value,other.value)),"number"==typeof result){var units=this.computeUnits(me,other,operation);return new Numeric(result,units.num.length?units.num[0]:null,units.num,units.den)}return new Bool(result)}},{key:"computeUnits",value:function(left,right,op){switch(op){case"*":return{num:left.numeratorUnits.slice().concat(right.numeratorUnits),den:left.denominatorUnits.slice().concat(right.denominatorUnits)};case"/":return{num:left.numeratorUnits.slice().concat(right.denominatorUnits),den:left.denominatorUnits.slice().concat(right.numeratorUnits)};default:return{num:left.numeratorUnits,den:left.denominatorUnits}}}},{key:"coerceUnits",value:function(units,denominatorUnits){var value=this.value;return this.unitless()||(value=value*this.coercionFactor(this.numeratorUnits,units)/this.coercionFactor(this.denominatorUnits,denominatorUnits)),new Numeric(value,units&&units[0],units,denominatorUnits)}},{key:"coercionFactor",value:function(units,otherUnits){var res=this.removeCommonUnits(units,otherUnits),fromUnits=res.num,toUnits=res.den;fromUnits.length===toUnits.length&&this.convertable(fromUnits||toUnits)||Fashion.raise("Incompatible units: "+fromUnits.join("*")+" and "+toUnits.join("*"));for(var i=0;i<fromUnits.length;i++)for(var fromUnit=fromUnits[i],j=0;j<toUnits.length;j++){var toUnit=toUnits[j],factor=this.conversionFactor(fromUnit,toUnit);if(null!==factor)return factor}return 1}},{key:"conversionFactor",value:function(fromUnit,toUnit){var cUnits=Numeric.CONVERTABLE_UNITS,cTable=Numeric.CONVERSION_TABLE,factor=null;return cUnits[fromUnit]&&cUnits[toUnit]&&(factor=cTable[cUnits[fromUnit]][cUnits[toUnit]]),null===factor&&cUnits[toUnit]&&cUnits[fromUnit]&&(factor=1/cTable[cUnits[toUnit]][cUnits[fromUnit]]),factor}},{key:"convertable",value:function(units){if(units&&!Array.isArray(units)&&(units=[units]),units&&units.length)for(var convertableUnits=Numeric.CONVERTABLE_UNITS,i=0;i<units.length;i++)if(void 0===convertableUnits[units[i]])return!1;return!0}},{key:"removeCommonUnits",value:function(numUnits,denUnits){var i,unit,unit,map={},num=[],den=[];for(i=0;i<numUnits.length;i++)unit=numUnits[i],map[unit]=(map[unit]||0)+1;for(i=0;i<denUnits.length;i++)unit=denUnits[i],map[unit]=(map[unit]||0)-1;for(i=0;i<numUnits.length;i++)unit=numUnits[i],map[unit]>0&&(num.push(unit),map[unit]--);for(i=0;i<denUnits.length;i++)unit=denUnits[i],map[unit]<0&&(den.push(unit),map[unit]++);return{num:num,den:den}}}],[{key:"tryGetNumber",value:function(value){if(/^\d*$/.test(value)&&(value=parseFloat(value)),!isNaN(value))return new Numeric(value)}},{key:"tryCoerce",value:function(obj){return obj.$isFashionNumber?obj:obj.$isFashionLiteral?this.tryGetNumber(obj.value):void 0}}]),Numeric}(Type);Fashion.apply(Numeric,{OPERATIONS:{"!=":function(l,r){return l!=r},"+":function(l,r){return l+r},"-":function(l,r){return l-r},"<=":function(l,r){return l<=r},"<":function(l,r){return l<r},">":function(l,r){return l>r},">=":function(l,r){return l>=r},"==":function(l,r){return l==r},"%":function(l,r){return Math.abs(l%r)}},NON_COERCE_OPERATIONS:{"*":function(l,r){return l*r},"**":function(l,r){return Math.pow(l,r)},"/":function(l,r){return l/r}},CONVERTABLE_UNITS:{"in":0,cm:1,pc:2,mm:3,pt:4,px:5},CONVERSION_TABLE:[[1,2.54,6,25.4,72,96],[null,1,2.36220473,10,28.3464567,37.795276],[null,null,1,4.23333333,12,16],[null,null,null,1,2.83464567,3.7795276],[null,null,null,null,1,1.3333333],[null,null,null,null,null,1]]}),Fashion.apply(Numeric.prototype,{type:"number",$isFashionNumber:!0,value:void 0,unit:void 0,numeratorUnits:void 0,denominatorUnits:void 0,normalized:!1}),module.exports=Numeric},{"../Base.js":19,"./Bool.js":24,"./Literal.js":32,"./Type.js":40}],35:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),ParentheticalExpression=function(_Type9){function ParentheticalExpression(value){_classCallCheck(this,ParentheticalExpression);var _this31=_possibleConstructorReturn(this,(ParentheticalExpression.__proto__||Object.getPrototypeOf(ParentheticalExpression)).call(this));return _this31.value=value,_this31}return _inherits(ParentheticalExpression,_Type9),_createClass(ParentheticalExpression,[{key:"toString",value:function(){return"("+(this.value&&""+this.value)+")"}},{key:"doVisit",value:function(visitor){visitor.parenthetical(this)}}]),ParentheticalExpression}(Type);Fashion.apply(ParentheticalExpression.prototype,{value:null,type:"parenthetical"}),module.exports=ParentheticalExpression},{"../Base.js":19,"./Type.js":40}],36:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),RadialGradient=function(_Type10){function RadialGradient(position,shape,stops){_classCallCheck(this,RadialGradient);var _this32=_possibleConstructorReturn(this,(RadialGradient.__proto__||Object.getPrototypeOf(RadialGradient)).call(this));return _this32.position=position,_this32.stops=stops,_this32.shape=shape,_this32}return _inherits(RadialGradient,_Type10),_createClass(RadialGradient,[{key:"doVisit",value:function(visitor){visitor.radialgradient(this)}},{key:"descend",value:function(visitor){visitor.visit(this.position),visitor.visit(this.stops),visitor.visit(this.shape)}},{key:"copy",value:function(){return new RadialGradient(this.position,this.shape,this.stops)}},{key:"toString",value:function(){var string="radial-gradient(";return this.position&&(string+=this.position+", "),this.shape&&(string+=this.shape+", "),string+this.stops+")"}},{key:"toOriginalWebkitString",value:function(){var i,args=[],stops=this.stops.items,ln=stops.length;for(args.push("center 0%"),args.push("center 100%"),i=0;i<ln;i++)args.push(stops[i].toOriginalWebkitString());return"-webkit-gradient(radial, "+args.join(", ")+")"}},{key:"supports",value:function(prefix){return["owg","webkit"].indexOf(prefix.toLowerCase())!==-1}},{key:"toPrefixedString",value:function(prefix){return"owg"===prefix?this.toOriginalWebkitString():prefix+(""+this)}},{key:"gradientPoints",value:function(position){}}]),RadialGradient}(Type);Fashion.apply(RadialGradient.prototype,{type:"radialgradient",$isFashionRadialGradient:!0,$canUnbox:!1,position:null,stops:null,shape:null}),module.exports=RadialGradient},{"../Base.js":19,"./Type.js":40}],37:[function(require,module,exports){var Fashion=require("../Base.js"),TypeVisitor=require("./TypeVisitor.js"),Output=require("../Output.js"),SourceBuilder=function(_TypeVisitor4){function SourceBuilder(cfg){_classCallCheck(this,SourceBuilder);var _this33=_possibleConstructorReturn(this,(SourceBuilder.__proto__||Object.getPrototypeOf(SourceBuilder)).call(this,cfg));return _this33.nullFound=!1,_this33}return _inherits(SourceBuilder,_TypeVisitor4),_createClass(SourceBuilder,[{key:"list",value:function(obj){for(var delta,output=this.output,items=obj.items,len=output.output.length,sep=obj.separator,sepLen=sep&&sep.length,hasSpace=sep&&sep.indexOf(" ")>-1,prev=output.output,i=0;i<items.length;i++)items[i]&&!items[i].$isFashionNull?(this.visit(items[i]),delta=output.output.length-len,!delta&&sepLen&&i>0&&(output.output=prev),prev=output.output,i<items.length-1&&sepLen&&(output.add(sep),hasSpace||output.space()),len=output.output.length):this.nullFound=!0}},{key:"map",value:function(obj){var key,value,output=this.output,items=obj.items;this.currDeclaration&&Fashion.raise("("+obj+") isn't a valid CSS value.");for(var i=0;i<items.length-1;i+=2)key=items[i],value=items[i+1],key&&value&&(i>0&&(output.add(","),output.space()),this.visit(key),output.add(": "),this.visit(value))}},{key:"literal",value:function(obj){obj.value&&this.output.add(obj.value)}},{key:"string",value:function(obj){var output=this.output;output.add(obj.quoteChar),output.add(obj.value),output.add(obj.quoteChar)}},{key:"functioncall",value:function(obj){var output=this.output;output.add(obj.name),output.add("("),this.visit(obj.args),output.add(")")}},{key:"parenthetical",value:function(obj){this.output.add("("),this.visit(obj.value),this.output.add(")")}},{key:"number",value:function(obj){var val=obj.stringify();"."!==val.indexOf(".")||this.output.isCompressed||(val="0"+val),this.output.add(val)}},{key:"bool",value:function(obj){this.output.add(obj.value?"true":"false")}},{key:"hsla",value:function(obj){this.output.add(""+obj)}},{key:"rgba",value:function(obj){this.output.add(""+obj)}},{key:"colorstop",value:function(obj){var output=this.output,stop=obj.stop;this.visit(obj.color),stop&&(stop=stop.clone(),output.add(" "),stop.unit||(stop.value*=100,stop.unit="%"),this.visit(stop))}},{key:"lineargradient",value:function(obj){var output=this.output;output.add("linear-gradient("),obj.position&&(this.visit(obj.position),output.add(","),output.space()),this.visit(obj.stops),output.add(")")}},{key:"radialgradient",value:function(obj){var output=this.output;output.add("radial-gradient("),obj.position&&(this.visit(obj.position),output.add(","),output.space()),obj.shape&&(this.visit(obj.shape),output.add(","),output.space()),this.visit(obj.stops),output.add(")")}},{key:"toSource",value:function(obj,output){return this.output=output||new Output,this.visit(obj),this.output.get()}}],[{key:"toSource",value:function(obj,output){var sb=new SourceBuilder;return sb.toSource(obj,output)}}]),SourceBuilder}(TypeVisitor);Fashion.apply(SourceBuilder.prototype,{output:null}),module.exports=SourceBuilder},{"../Base.js":19,"../Output.js":20,"./TypeVisitor.js":41}],38:[function(require,module,exports){var Fashion=require("../Base.js"),Type=require("./Type.js"),Text=require("./Text.js"),Numeric=require("./Numeric.js"),Bool=require("./Bool.js"),True=Bool.True,False=Bool.False,Literal=require("./Literal.js"),Null=Literal.Null;module.exports={unboxType:function(expression){var val=expression;return val&&val.$isFashionType&&val.$canUnbox&&(val=val.value,expression.$isFashionString||expression.$isFashionLiteral?"none"!==val&&"null"!==val||(val=null):expression.$isFashionList&&(val=expression.items)),val},boxType:function(expression){if(expression&&expression.$isFashionType)return expression;if(null==expression)return Null;if(expression===!0)return True;if(expression===!1)return False;var typeOf=void 0===expression?"undefined":_typeof(expression);switch(typeOf){case"string":return new Text(expression);case"number":return new Numeric(expression)}return expression}},Fashion.apply(Type,{box:module.exports.boxType,unbox:module.exports.unboxType})},{"../Base.js":19,"./Bool.js":24,"./Literal.js":32,"./Numeric.js":34,"./Text.js":39,"./Type.js":40}],39:[function(require,module,exports){var Fashion=require("../Base.js"),Literal=require("./Literal.js"),Text=function(_Literal2){function Text(value,quoteChar){_classCallCheck(this,Text);var _this34=_possibleConstructorReturn(this,(Text.__proto__||Object.getPrototypeOf(Text)).call(this,value));return void 0!==quoteChar&&(Text.preferDoubleQuotes&&""===quoteChar?_this34.quoteChar="":_this34.quoteChar=quoteChar),_this34}return _inherits(Text,_Literal2),_createClass(Text,[{key:"doVisit",value:function(visitor){visitor.string(this)}},{key:"toString",value:function(){return this.quoteChar+this.value+this.quoteChar}},{key:"unquote",value:function(){return new Literal(this.value)}},{key:"copy",value:function(){return new Text(this.value,this.quoteChar)}},{key:"slice",value:function(start,end){return new Text(_get(Text.prototype.__proto__||Object.getPrototypeOf(Text.prototype),"slice",this).call(this,start,end).value,this.quoteChar)}},{key:"toUpperCase",value:function(){return new Text(this.value.toUpperCase(),this.quoteChar)}},{key:"toLowerCase",value:function(){return new Text(this.value.toLowerCase(),this.quoteChar)}},{key:"insert",value:function(str,startVal){return new Text(_get(Text.prototype.__proto__||Object.getPrototypeOf(Text.prototype),"insert",this).call(this,str,startVal).value,this.quoteChar)}}],[{key:"tryCoerce",value:function(obj){if(!obj.$isFashionNumber)return new Text(obj.$isFashionLiteral?obj.value:obj.getHash())}}]),Text}(Literal);Text.preferDoubleQuotes=!1,Fashion.apply(Text.prototype,{type:"string",$isFashionString:!0,value:null,quoteChar:'"',"+":function(right){return new Text(this.value+right.getHash())},"+.number":function(right){return new Text(this.value+(""+right))},"/":function(right){return new Text(this.value+"/"+right.getHash())}}),module.exports=Text},{"../Base.js":19,"./Literal.js":32}],40:[function(require,module,exports){var Fashion=require("../Base.js"),Type=function(){function Type(){_classCallCheck(this,Type)}return _createClass(Type,[{key:"coerce",value:function(obj){var converted=this.tryCoerce(obj);return converted||obj}},{key:"_getHash",value:function(){return this.visitTarget?""+this.visitTarget:""+this}},{key:"getHash",value:function(){return null==this._hash&&(this._hash=this._getHash()),this._hash}},{key:"tryCoerce",value:function(obj){var me=this;return me.constructor===obj.constructor?obj:me.constructor.tryCoerce?me.constructor.tryCoerce(obj):void 0}},{key:"supports",value:function(prefix){return!1}},{key:"operate",value:function(operation,right){return this.performOperation(operation,this.coerce(right))}},{key:"performOperation",value:function(operation,right){var method=this[operation+"."+right.type]||this[operation];method||Fashion.raise("Failed to find method for operation "+operation+" on type "+right.type+" with value "+right+".");var res=method.call(this,right);return res&&res.$isFashionType||(res=Type.box(res)),res}},{key:"==",value:function(right){return this.getHash()===right.getHash()}},{key:"!=",value:function(right){return this.getHash()!==right.getHash()}},{key:">=",value:function(right){return this.getHash()>=right.getHash()}},{key:"<=",value:function(right){return this.getHash()<=right.getHash()}},{key:">",value:function(right){return this.getHash()>right.getHash()}},{key:"<",value:function(right){return this.getHash()<right.getHash()}},{key:"+",value:function(right){return this.getHash()+right.getHash()}},{key:"copy",value:function(){return this}},{key:"matches",value:function(match){return!(!match||match!=""+this)}},{key:"clone",value:function(match,replace){if(replace&&this.matches(match))return replace.copy();var copy=this.copy();return copy.ast=this.ast,copy.$referenceName=this.$referenceName,copy.$referenceBase=this.$referenceBase,copy.$previousReference=this.$previousReference,copy}},{key:"unquote",value:function(){return this}},{key:"toPrefixedString",value:function(prefix){return""+this}},{key:"doVisit",value:function(visitor){}},{key:"descend",value:function(visitoir){}},{key:"hasTag",value:function(tag,prefix,enable,disable){prefix=prefix||"fashion",enable=enable||RegExp("^\\s*//#\\s*"+prefix+"\\s*\\+?"+tag+"\\s*$"),disable=disable||RegExp("^\\s*//#\\s*"+prefix+"\\s*\\-"+tag+"\\s*$");var docs=this.docs;if(docs&&docs.length)for(var d=0;d<this.docs.length;d++){var doc=docs[d];if(enable.test(doc))return!0;if(disable.test(doc))return!1}return this.parentNode?this.parentNode.hasTag(tag,prefix,enable,disable):null}},{key:"toDisplayString",value:function(){return"["+this.constructor.name+" : "+this+"]"}}]),Type}();Fashion.apply(Type.prototype,{visitTarget:void 0,$isFashionType:!0,$canUnbox:!0,$isFashionLiteral:!1,$isFashionNumber:!1,$isFashionString:!1,$isFashionBool:!1,$constant:!1,$referenceName:void 0,$referenceBase:void 0,$previousReference:void 0,value:void 0,unit:void 0,parentNode:void 0,docs:void 0,ast:void 0}),module.exports=Type},{"../Base.js":19}],41:[function(require,module,exports){var Fashion=require("../Base.js"),TypeVisitor=function(){function TypeVisitor(cfg){_classCallCheck(this,TypeVisitor),cfg&&Fashion.apply(this,cfg)}return _createClass(TypeVisitor,[{key:"literal",value:function(obj){obj.descend(this)}},{key:"bool",value:function(obj){obj.descend(this)}},{key:"string",value:function(obj){obj.descend(this)}},{key:"number",value:function(obj){obj.descend(this)}},{key:"map",value:function(obj){obj.descend(this)}},{key:"functioncall",value:function(obj){obj.descend(this)}},{key:"parenthetical",value:function(obj){obj.descend(this)}},{key:"list",value:function(obj){obj.descend(this)}},{key:"hsla",value:function(obj){obj.descend(this)}},{key:"rgba",value:function(obj){obj.descend(this)}},{key:"colorstop",value:function(obj){obj.descend(this)}},{key:"lineargradient",value:function(obj){obj.descend(this)}},{key:"radialgradient",value:function(obj){obj.descend(this)}},{key:"visitItem",value:function(obj){obj.doVisit(this)}},{key:"visit",value:function(obj){for(;obj&&void 0!==obj.visitTarget;)obj=obj.visitTarget;if(obj)if(Array.isArray(obj))for(var i=0;i<obj.length;i++)this.visit(obj[i]);else this.visitItem(obj)}},{key:"execute",value:function(obj,context){this.visit(obj)}}]),TypeVisitor}();TypeVisitor.prototype.context=null,module.exports=TypeVisitor},{"../Base.js":19}],42:[function(require,module,exports){var Bool=require("./Bool.js"),Literal=require("./Literal.js"),Types={Bool:Bool,Literal:Literal,Text:require("./Text.js"),Numeric:require("./Numeric.js"),Color:require("./Color.js"),ColorRGBA:require("./ColorRGBA.js"),ColorHSLA:require("./ColorHSLA.js"),ColorStop:require("./ColorStop.js"),LinearGradient:require("./LinearGradient.js"),RadialGradient:require("./RadialGradient.js"),List:require("./List.js"),Map:require("./Map.js"),ParentheticalExpression:require("./ParentheticalExpression.js"),FunctionCall:require("./FunctionCall.js"),Null:Literal.Null,None:Literal.None,True:Bool.True,False:Bool.False};module.exports=Types},{"./Bool.js":24,"./Color.js":25,"./ColorHSLA.js":26,"./ColorRGBA.js":27,"./ColorStop.js":28,"./FunctionCall.js":29,"./LinearGradient.js":30,"./List.js":31,"./Literal.js":32,"./Map.js":33,"./Numeric.js":34,"./ParentheticalExpression.js":35,"./RadialGradient.js":36,"./Text.js":39}],43:[function(require,module,exports){var Color=require("../export/type/Color.js");module.exports={init:function(runtime){runtime.register({adjust_color:function(color,red,green,blue,hue,saturation,lightness,alpha){var adjusted=color.getRGBA().copy(),adjust=Color.adjust,comps=Color.comps;return red&&(adjusted[comps.red]+=red.value),blue&&(adjusted[comps.blue]+=blue.value),green&&(adjusted[comps.green]+=green.value),adjusted[comps.red]=Math.max(0,Math.min(adjusted[comps.red],255)),adjusted[comps.blue]=Math.max(0,Math.min(adjusted[comps.blue],255)),adjusted[comps.green]=Math.max(0,Math.min(adjusted[comps.green],255)),alpha&&(adjusted[comps.alpha]=Math.max(0,Math.min(1,adjusted[comps.alpha]+alpha.value))),hue&&(adjusted=adjust(adjusted,"hue",hue)),lightness&&(adjusted=adjust(adjusted,"lightness",lightness)),saturation&&(adjusted=adjust(adjusted,"saturation",saturation)),adjusted},scale_color:function(){},change_color:function(color,red,green,blue,hue,saturation,lightness,alpha){var adjusted=color.getRGBA().clone(),comps=(Color.adjust,Color.comps);return red&&(adjusted[comps.red]=red.value),blue&&(adjusted[comps.blue]=blue.value),green&&(adjusted[comps.green]=green.value),adjusted[comps.red]=Math.max(0,Math.min(adjusted[comps.red],255)),adjusted[comps.blue]=Math.max(0,Math.min(adjusted[comps.blue],255)),adjusted[comps.green]=Math.max(0,Math.min(adjusted[comps.green],255)),alpha&&(adjusted[comps.alpha]=Math.max(0,Math.min(1,alpha.value))),hue&&(adjusted=adjusted.getHSLA())&&(adjusted.h=hue.value),lightness&&(adjusted=adjusted.getHSLA())&&(adjusted.l=lightness.value),saturation&&(adjusted=adjusted.getHSLA())&&(adjusted.s=saturation.value),adjusted},ie_hex_str:function(color){if("hsla"!==color.type&&"rgba"!==color.type)throw color+" is not a color for 'ie-hex-str'";return color.toIeHexStr()}})}}},{"../export/type/Color.js":25}],44:[function(require,module,exports){var LinearGradient=require("../export/type/LinearGradient.js"),RadialGradient=require("../export/type/RadialGradient.js"),List=require("../export/type/List.js"),ColorStop=require("../export/type/ColorStop.js");module.exports={init:function(runtime){runtime.register({linear_gradient:function(position,stops){return stops=this.tailArgs(1,arguments),stops&&1===stops.length&&(stops=stops[0]),"list"===position.type&&("rgba"===position.get(1).type||"hsla"===position.get(1).type)||"hsla"===position.type||"rgba"===position.type?(stops=this.color_stops.apply(this,arguments),position=null):"list"==position.type&&"colorstop"==position.get(1).type?(stops=position,position=null):stops="hsla"===stops.type||"rgba"===stops.type?this.color_stops.call(this,new List([stops])):this.color_stops.call(this,stops),new LinearGradient(position,stops)},radial_gradient:function(position,shape,stops){return stops=this.tailArgs(2,arguments),stops&&1===stops.length&&(stops=stops[0]),"list"===position.type&&("rgba"===position.get(1).type||"hsla"===position.get(1).type)||"hsla"===position.type||"rgba"===position.type?(stops=this.color_stops.apply(this,arguments),position=null):"list"==position.type&&"colorstop"==position.get(1).type?(stops=position,position=null):"list"===shape.type&&("rgba"===shape.get(1).type||"hsla"===shape.get(1).type)||"hsla"===shape.type||"rgba"===shape.type?(stops=this.color_stops.apply(this,arguments),shape=null):"list"==shape.type&&"colorstop"==shape.get(1).type?(stops=shape,shape=null):stops="hsla"===stops.type||"rgba"===stops.type?this.color_stops.call(this,new List([stops])):this.color_stops.call(this,stops),new RadialGradient(position,shape,stops)},color_stops:function(){var i,arg,args=this.tailArgs(0,arguments),mapped=this.handleArgs(args&&args.items||args,[["stops"]]),stops=mapped.stops.items,ln=stops.length,list=new List(null,", ");for(i=0;i<ln;i++)arg=stops[i],"list"===arg.type?2===arg.items.length?list.add(new ColorStop(arg.get(1),arg.get(2))):list.items.push.apply(list.items,arg.items):"rgba"===arg.type||"hsla"===arg.type?list.add(new ColorStop(arg)):Array.isArray(arg)?list.items.push.apply(list.items,arg):list.add(arg);return list}})}}},{"../export/type/ColorStop.js":28,"../export/type/LinearGradient.js":30,"../export/type/List.js":31,"../export/type/RadialGradient.js":36}],45:[function(require,module,exports){var Fashion=require("../export/Base.js"),Color=require("../export/type/Color.js"),ColorRGBA=require("../export/type/ColorRGBA.js"),ColorHSLA=require("../export/type/ColorHSLA.js"),Numeric=require("../export/type/Numeric.js"),Literal=require("../export/type/Literal.js");module.exports={init:function(runtime){runtime.register({hsla:function(hue,saturation,lightness,alpha){return 4!=arguments.length&&Fashion.raise("Wrong number of arguments ("+arguments.length+" for 4) for 'hsla'"),hue.$isFashionNumber||Fashion.raise(hue+" is not a number for 'hsla'"),saturation.$isFashionNumber||Fashion.raise(saturation+" is not a number for 'hsla'"),lightness.$isFashionNumber||Fashion.raise(lightness+" is not a number for 'hsla'"),alpha.$isFashionNumber||Fashion.raise(alpha+" is not a number for 'hsla'"),saturation.value!==Color.constrainPercentage(saturation.value)&&Fashion.raise("Saturation "+saturation+" must be between 0% and 100% for 'hsla'"),lightness.value!==Color.constrainPercentage(lightness.value)&&Fashion.raise("Lightness "+lightness+" must be between 0% and 100% for 'hsla'"),alpha.value!==Color.constrainAlpha(alpha.value)&&Fashion.raise("Alpha channel "+alpha+" must be between 0 and 1 for 'hsla'"),new ColorHSLA(hue.value,saturation.value,lightness.value,alpha.value)},hsl:function(hue,saturation,lightness){var len=arguments.length;return 3!=len&&Fashion.raise("Wrong number of arguments ("+len+" for 3) for 'hsl'"),this.hsla(hue,saturation,lightness,new Numeric(1))},hue:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'hue'"),Color.component(color,"hue"))},saturation:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'saturation'"),Color.component(color,"saturation"))},lightness:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'lightness'"),Color.component(color,"lightness"))},adjust_hue:function(color,degrees){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'adjust-hue'"),"number"!==degrees.type&&Fashion.raise(degrees+" is not a number for 'adjust-hue'"),Color.adjust(color,"hue",degrees))},lighten:function(color,amount){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'lighten'"),"number"!==amount.type&&Fashion.raise(amount+" is not a number for 'lighten'"),amount.value!==Color.constrainPercentage(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0% and 100% for 'lighten'"),Color.adjust(color,"lightness",amount))},darken:function(color,amount){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'darken'"),"number"!==amount.type&&Fashion.raise(amount+" is not a number for 'darken'"),amount.value!==Color.constrainPercentage(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0% and 100% for 'darken'"),amount=amount.clone(),amount.value*=-1,Color.adjust(color,"lightness",amount))},saturate:function(color,amount){return null==color||color.$isFashionNull?Literal.Null:amount?("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'saturate'"),"number"!==amount.type&&Fashion.raise(amount+" is not a number for 'saturate'"),amount.value!==Color.constrainPercentage(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0% and 100% for 'saturate'"),Color.adjust(color,"saturation",amount)):new Literal("saturate("+color+")")},desaturate:function(color,amount){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'desaturate'"),"number"!==amount.type&&Fashion.raise(amount+" is not a number for 'desaturate'"),amount.value!==Color.constrainPercentage(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0% and 100% for 'desaturate'"),amount.value*=-1,Color.adjust(color,"saturation",amount))},grayscale:function(color){return null==color||color.$isFashionNull?Literal.Null:color.$isFashionNumber?new Literal("grayscale("+color+")"):("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'grayscale'"),this.desaturate(color,new Numeric(100,"%")))},complement:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'complement'"),this.adjust_hue(color,new Numeric(180,"deg")))},invert:function(color){return null==color||color.$isFashionNull?Literal.Null:color.$isFashionNumber?new Literal("invert("+color+")"):("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'invert'"),
color=color.getRGBA(),new ColorRGBA(255-color.r,255-color.g,255-color.b,color.a))}})}}},{"../export/Base.js":19,"../export/type/Color.js":25,"../export/type/ColorHSLA.js":26,"../export/type/ColorRGBA.js":27,"../export/type/Literal.js":32,"../export/type/Numeric.js":34}],46:[function(require,module,exports){var Fashion=require("../export/Base.js"),Literal=require("../export/type/Literal.js"),Text=require("../export/type/Text.js"),Bool=require("../export/type/Bool.js");module.exports={init:function(runtime){runtime.register({type_of:function(value){return new Literal(value===!0||value===!1?"bool":value===Literal.Null?"null":"hsla"==value.type||"rgba"==value.type?"color":"literal"==value.type||"string"==value.type?"string":value.type)},unit:function(number){return number.$isFashionNumber||Fashion.raise(number+" is not a number for 'unit'"),new Text(number.getUnitStr()||"")},unitless:function(number){return"number"!=number.type&&Fashion.raise(number+" is not a number for 'unitless'"),new Bool((!number.unit))},strip_unit:function(a){if(!a||!a.$isFashionNumber){var val=a?a.toDisplayString():"[null]";Fashion.raise(val+" is not a number for 'strip-unit'")}return new Fashion.Numeric(a.value)},comparable:function(number_1,number_2){return"number"!=number_1.type&&Fashion.raise(number_1+" is not a number for 'comparable'"),"number"!=number_2.type&&Fashion.raise(number_2+" is not a number for 'comparable'"),new Bool((!!number_1.comparable(number_2)))},variable_exists:function(name){var nameStr=name;(name.$isFashionString||name.$isFashionLiteral)&&(nameStr=name.value),nameStr=Fashion.getJsName(nameStr),0!==nameStr.indexOf("$")&&(nameStr="$"+nameStr);var scope=this.getRuntime().getCurrentScope();return!!scope.get(nameStr)},global_variable_exists:function(name){var nameStr=name;(name.$isFashionString||name.$isFashionLiteral)&&(nameStr=name.value),nameStr=Fashion.getJsName(nameStr),0!==nameStr.indexOf("$")&&(nameStr="$"+nameStr);var scope=this.getRuntime().getGlobalScope();return!!scope.get(nameStr)},function_exists:function(name){var nameStr=name;(name.$isFashionString||name.$isFashionLiteral)&&(nameStr=name.value),nameStr=Fashion.getJsName(nameStr);var extensions=this.getRuntime().getRegisteredFunctions(),functions=this.getRuntime().getFunctions();return nameStr in extensions||nameStr in functions},mixin_exists:function(name){var nameStr=name;(name.$isFashionString||name.$isFashionLiteral)&&(nameStr=name.value),nameStr=Fashion.getJsName(nameStr);var mixins=this.getRuntime().getMixins();return nameStr in mixins},call:function(name){name&&name.$isFashionLiteral||Fashion.raise(name+" is not a string or literal for 'call'");var args=this.sliceArgs(arguments,1),runtime=this.getRuntime(),functions=runtime.getFunctions(),extensions=runtime.getRegisteredFunctions(),funcName=getJsName(name.value);return functions[funcName]?functions[funcName].apply(functions,args):extensions[funcName]?extensions[funcName].apply(this,args):Literal.Null}})}}},{"../export/Base.js":19,"../export/type/Bool.js":24,"../export/type/Literal.js":32,"../export/type/Text.js":39}],47:[function(require,module,exports){var Fashion=require("../export/Base.js"),Numeric=require("../export/type/Numeric.js"),List=require("../export/type/List.js");module.exports={init:function(runtime){runtime.register({length:function(list){return new Numeric("list"!==list.type?arguments.length:list.items.length)},nth:function(list,index){"list"!==list.type&&(list=new List([list])),"number"==index.type&&index.value.toFixed(0)==index.value||Fashion.raise("List index "+index+" must be an integer for 'nth'");var value=index.value;return value<0&&(value=Math.max(1,list.items.length+value+1)),0===value&&Fashion.raise("List index "+value+" must be greater than or equal to 1 for 'nth'"),value-1>=list.items.length&&Fashion.raise("List index is "+value+" but list is only "+list.items.length+" item"+(1===list.items.length?"":"s")+" long for 'nth'"),list.get(value)},first_value_of:function(list){return"list"!==list.type&&(list=new List([list])),this.nth(list,new Numeric(1))},last_value_of:function(list){return"list"!==list.type&&(list=new List(list)),this.nth(list,new Numeric(list.items.length))},compact:function(){var items,list=arguments,sep=", ";"list"!==list.type&&(list=new List(list)),items=list.items,1==items.length&&"list"==items[0].type&&(list=items[0],items=list.items,sep=list.separator),list=new List(null,sep);for(var i=0;i<items.length;i++){var item=items[i];this.unbox(item)&&list.add(item)}return list},_compass_list_size:function(){var list=arguments;return"list"!==list.type&&(list=new List(list)),new Numeric(list.items.length)},join:function(list1,list2,separator){if("list"!==list1.type&&(list1=new List([list1]),list1.separator=null),"list"!==list2.type&&(list2=new List([list2]),list2.separator=null),separator||(separator=list1.items.length&&list1.separator||list2.items.length&&list2.separator||" "),"literal"===separator.type)switch(separator.value){case"comma":separator=", ";break;case"space":separator=" ";break;case"auto":separator=list1.separator||list2.separator||" ";break;default:Fashion.raise("Separator name must be space, comma, or auto for 'join'")}return"string"===separator.type&&(separator=separator.value),new List(list1.items.concat(list2.items),separator)},append:function(){return this.join.apply(this,arguments)},box:function(list,index){if(list instanceof List||(list=new List([list])),list=list.items.slice(),index>=list.length)switch(list.length){case 1:list[1]=list[2]=list[3]=list[0];break;case 2:list[2]=list[0],list[3]=list[1];break;case 3:list[3]=list[1]}return list[index-1]},zip:function(){for(var list,lists=this.sliceArgs(arguments),output=[],minLen=-1,i=0;i<lists.length;i++)list=lists[i].items,minLen===-1?minLen=list.length:list.length<minLen&&(minLen=list.length);for(var i=0;i<minLen;i++){for(var newList=[],j=0;j<lists.length;j++)newList.push(lists[j].items[i]);output.push(new List(newList," "))}return new List(output,", ")}})}}},{"../export/Base.js":19,"../export/type/List.js":31,"../export/type/Numeric.js":34}],48:[function(require,module,exports){var Literal=require("../export/type/Literal.js"),Bool=require("../export/type/Bool.js");module.exports={init:function(runtime){runtime.register({__if:function(condition,if_true,if_false){return this.unbox(condition)?if_true:if_false},theme_image:function(theme,file){return new Literal('url("resources/images/'+theme.value+"/"+file.value+'")')},prefixed:function(prefix,items){if(arguments.length>2&&(items=Array.prototype.slice.call(arguments,1)),prefix=this.unbox(prefix),0===prefix.indexOf("-")&&(prefix=prefix.substring(1)),Array.isArray(items)){var i,arg,ln=items.length;for(i=0;i<ln;i++)if(arg=items[i],arg.supports&&arg.supports(prefix))return Bool.True}else if(items.supports&&items.supports(prefix))return Bool.True;return Bool.False},_owg:function(value){return new Literal(value.toPrefixedString("owg"))},_webkit:function(value){return new Literal(value.toPrefixedString("-webkit-"))},_o:function(value){return new Literal(value.toPrefixedString("-o-"))},_moz:function(value){return new Literal(value.toPrefixedString("-moz-"))}})}}},{"../export/type/Bool.js":24,"../export/type/Literal.js":32}],49:[function(require,module,exports){var Fashion=require("../export/Base.js"),Numeric=require("../export/type/Numeric.js"),Literal=require("../export/type/Literal.js");module.exports={init:function(runtime){runtime.register({percentage:function(value){return null==value||value.$isFashionNull?Literal.Null:(("number"!=value.type||value.getUnitStr())&&Fashion.raise(value+" is not a unitless number for 'percentage'"),new Numeric(100*value.value,"%"))},round:function(value){return null==value||value.$isFashionNull?Literal.Null:("number"!==value.type&&Fashion.raise(value+" is not a number for 'round'"),new Numeric(Math.round(value.value),value.unit))},ceil:function(value){return null==value||value.$isFashionNull?Literal.Null:("number"!==value.type&&Fashion.raise(value+" is not a number for 'ceil'"),new Numeric(Math.ceil(value.value),value.unit))},floor:function(value){return null==value||value.$isFashionNull?Literal.Null:("number"!==value.type&&Fashion.raise(value+" is not a number for 'floor'"),new Numeric(Math.floor(value.value),value.unit))},abs:function(value){return null==value||value.$isFashionNull?Literal.Null:("number"!==value.type&&Fashion.raise(value+" is not a number for 'abs'"),new Numeric(Math.abs(value.value),value.unit))},min:function min(){var arg,i,min,args=this.sliceArgs(arguments);for(i=0;i<args.length;i++){if(arg=args[i],null==arg||arg.$isFashionNull)return Literal.Null;arg&&arg.$isFashionNumber||Fashion.raise(arg+" is not a number for 'min'"),min&&!this.unbox(arg.operate("<",min))||(min=arg)}return min&&min.copy()},max:function max(a,b){var arg,i,max,args=this.sliceArgs(arguments);for(i=0;i<args.length;i++){if(arg=args[i],null==arg||arg.$isFashionNull)return Literal.Null;arg&&arg.$isFashionNumber||Fashion.raise(arg+" is not a number for 'max'"),max&&!this.unbox(arg.operate(">",max))||(max=arg)}return max&&max.copy()}})}}},{"../export/Base.js":19,"../export/type/Literal.js":32,"../export/type/Numeric.js":34}],50:[function(require,module,exports){var Fashion=require("../export/Base.js"),Literal=require("../export/type/Literal.js"),Color=require("../export/type/Color.js"),Numeric=require("../export/type/Numeric.js");module.exports={init:function(runtime){runtime.register({alpha:function(color){return color&&color.$isFashionNumber?new Literal("alpha("+color+")"):(color=Array.isArray(color)?color[0]:color,color&&color.$isFashionLiteral?color:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'alpha'"),Color.component(color,"alpha")))},opacity:function(color){return color&&color.$isFashionNumber?new Literal("opacity("+color+")"):(color=Array.isArray(color)?color[0]:color,color&&color.$isFashionLiteral?color:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'opacity'"),Color.component(color,"alpha")))},opacify:function(color,amount){"hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'opacify'"),"number"!==amount.type&&Fashion.raise(amount+" is not a number for 'opacify'"),"%"==amount.unit?(amount.value!==Color.constrainPercentage(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0% and 100% for 'opacify'"),amount=new Numeric(amount.value/100)):amount.value!==Color.constrainAlpha(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0 and 1 for 'opacify'");var rgba=color.getRGBA().clone();return rgba.a=Math.min((100*rgba.a+100*amount.value)/100,1),rgba},transparentize:function(color,amount){"hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'transparentize'"),"number"!==amount.type&&Fashion.raise(amount+" is not a number for 'transparentize'"),"%"==amount.unit?(amount.value!==Color.constrainPercentage(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0% and 100% for 'transparentize'"),amount=new Numeric(amount.value/100)):amount.value!==Color.constrainAlpha(amount.value)&&Fashion.raise("Amount "+amount+" must be between 0 and 1 for 'transparentize'");var rgba=color.getRGBA().clone();return rgba.a=Math.max((100*rgba.a-100*amount.value)/100,0),rgba},fade_in:function(color,amount){return this.opacify(color,amount)},fade_out:function(color,amount){return this.transparentize(color,amount)}})}}},{"../export/Base.js":19,"../export/type/Color.js":25,"../export/type/Literal.js":32,"../export/type/Numeric.js":34}],51:[function(require,module,exports){var Fashion=require("../export/Base.js"),Literal=require("../export/type/Literal.js"),Color=require("../export/type/Color.js"),ColorRGBA=require("../export/type/ColorRGBA.js"),Numeric=require("../export/type/Numeric.js");module.exports={init:function(runtime){runtime.register({rgba:function(red,green,blue,alpha,color){var colorInst;if(red&&color&&Fashion.raise("Unsupported arguments to RGBA"),color&&!red?color.$isFashionColor?colorInst=color:Fashion.raise("Unsupported arguments to RGBA"):red&&red.$isFashionColor&&(colorInst=red),colorInst&&(alpha=green||alpha,colorInst=colorInst.getRGBA(),red=new Numeric(colorInst.r),green=new Numeric(colorInst.g),blue=new Numeric(colorInst.b)),!red||!red.$isFashionNumber){if(null==red||red.$isFashionNull)return Literal.Null;Fashion.raise(red+" is not a number for 'rgba' red")}if(!green||!green.$isFashionNumber){if(null==green||green.$isFashionNull)return Literal.Null;Fashion.raise(green+" is not a number for 'rgba' green")}if(!blue||!blue.$isFashionNumber){if(null==blue||blue.$isFashionNull)return Literal.Null;Fashion.raise(blue+" is not a number for 'rgba' blue")}if(!alpha||!alpha.$isFashionNumber){if(null==alpha||alpha.$isFashionNull)return Literal.Null;Fashion.raise(alpha+" is not a number for 'rgba' alpha")}return"%"==red.unit?red=new Numeric(Color.constrainPercentage(red.value)/100*255):red.value!==Color.constrainChannel(red.value)&&Fashion.raise("Color value "+red+" must be between 0 and 255 inclusive for 'rgba'"),"%"==green.unit?green=new Numeric(Color.constrainPercentage(green.value)/100*255):green.value!==Color.constrainChannel(green.value)&&Fashion.raise("Color value "+green+" must be between 0 and 255 inclusive for 'rgba'"),"%"==blue.unit?blue=new Numeric(Color.constrainPercentage(blue.value)/100*255):blue.value!==Color.constrainChannel(blue.value)&&Fashion.raise("Color value "+blue+" must be between 0 and 255 inclusive for 'rgba'"),"%"==alpha.unit?alpha=new Numeric(Color.constrainPercentage(alpha.value)/100):alpha.value!==Color.constrainAlpha(alpha.value)&&Fashion.raise("Alpha channel "+alpha+" must be between 0 and 1 inclusive for 'rgba'"),new ColorRGBA(red.value,green.value,blue.value,alpha.value)},rgb:function(red,green,blue,color){return this.rgba(red,green,blue,new Numeric(1),color)},red:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'red'"),Color.component(color,"red"))},green:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'green'"),Color.component(color,"green"))},blue:function(color){return null==color||color.$isFashionNull?Literal.Null:("hsla"!==color.type&&"rgba"!==color.type&&Fashion.raise(color+" is not a color for 'blue'"),Color.component(color,"blue"))},mix:function(color_1,color_2,weight){if(null==color_1||color_1.$isFashionNull)return Literal.Null;if(null==color_2||color_2.$isFashionNull)return Literal.Null;weight=void 0!==weight?weight:new Numeric(50,"%"),"hsla"!==color_1.type&&"rgba"!==color_1.type&&Fashion.raise("arg 1 "+color_1+" is not a color for 'mix'"),"hsla"!==color_2.type&&"rgba"!==color_2.type&&Fashion.raise("arg 2 "+color_2+" is not a color for 'mix'"),"number"!==weight.type&&Fashion.raise("arg 3 "+weight+" is not a number for 'mix'"),weight.value!==Color.constrainPercentage(weight.value)&&Fashion.raise("Weight "+weight+" must be between 0% and 100% for 'mix'"),color_1=color_1.getRGBA(),color_2=color_2.getRGBA(),weight=weight.value/100;var factor=2*weight-1,alpha=color_1.a-color_2.a,weight1=((factor*alpha==-1?factor:(factor+alpha)/(1+factor*alpha))+1)/2,weight2=1-weight1;return new ColorRGBA(weight1*color_1.r+weight2*color_2.r,weight1*color_1.g+weight2*color_2.g,weight1*color_1.b+weight2*color_2.b,weight*color_1.a+(1-weight)*color_2.a)}})}}},{"../export/Base.js":19,"../export/type/Color.js":25,"../export/type/ColorRGBA.js":27,"../export/type/Literal.js":32,"../export/type/Numeric.js":34}],52:[function(require,module,exports){var Text=require("../export/type/Text.js");module.exports={init:function(runtime){runtime.register({headers:function headers(from,to){var fromVal,toVal,h,headers=[];for(from.$isFashionLiteral&&"all"==from.value?(fromVal=1,toVal=6):(fromVal=this.unbox(from),toVal=this.unbox(to)),h=fromVal;h<toVal+1;h++)headers.push("h"+h);return new Text(headers.join(", "))},headings:function(from,to){return this.headers(from,to)}})}}},{"../export/type/Text.js":39}],53:[function(require,module,exports){var Fashion=require("../export/Base.js"),Text=require("../export/type/Text.js"),Literal=require("../export/type/Literal.js"),Numeric=require("../export/type/Numeric.js");module.exports={init:function(runtime){runtime.register({quote:function(string){return string.$isFashionString||string.$isFashionLiteral||Fashion.raise(string+" is not a string or literal for 'quote'"),new Text(string.value)},unquote:function(string){return string.$isFashionString?new Literal(Literal.deEscape(string.value)):string},str_slice:function(string,start_at,end_at){return string.$isFashionLiteral||string.$isFashionString||Fashion.raise(string+" is not a string or literal for 'str-slice'"),string.slice(start_at,end_at)},str_length:function(string){return string.$isFashionLiteral||string.$isFashionString||Fashion.raise(string+" is not a string or literal for 'str-slice'"),new Numeric(string.value.length)},to_upper_case:function(string){return string.$isFashionLiteral||string.$isFashionString||Fashion.raise(string+" is not a string or literal for 'to-lower-case'"),string.toUpperCase()},to_lower_case:function(string){return string.$isFashionLiteral||string.$isFashionString||Fashion.raise(string+" is not a string or literal for 'to-lower-case'"),string.toLowerCase()},str_index:function(string,substring){return string.$isFashionLiteral||string.$isFashionString||Fashion.raise(string+" is not a string or literal for 'str-insert'"),substring.$isFashionLiteral||substring.$isFashionString||Fashion.raise(substring+" is not a string or literal for 'str-insert'"),string.indexOf(substring)},str_insert:function(string,insert,index){return string.$isFashionLiteral||string.$isFashionString||Fashion.raise(string+" is not a string or literal for 'str-insert'"),insert.$isFashionLiteral||insert.$isFashionString||Fashion.raise(insert+" is not a string or literal for 'str-insert'"),string.insert(insert,index)}})}}},{"../export/Base.js":19,"../export/type/Literal.js":32,"../export/type/Numeric.js":34,"../export/type/Text.js":39}],54:[function(require,module,exports){var Map=require("../export/type/Map.js"),Literal=require("../export/type/Literal.js"),Text=require("../export/type/Text.js"),List=require("../export/type/List.js"),Bool=require("../export/type/Bool.js"),Env=require("../Env.js");module.exports={init:function(runtime){runtime.register({parsebox:function(list,num){if(null==list||list.$isFashionNull)return Literal.Null;var ret,size,i,actual=[];for(num=this.unbox(num),"list"===list.type&&(list=list.items),this.isArray(list)||(list=[list]),size=list.length,i=0;i<size;i++)actual.push(list[i]);return num>=size&&(1===size?(actual.push(list[0]),actual.push(list[0]),actual.push(list[0])):2===size?(actual.push(list[0]),actual.push(list[1])):3===size&&actual.push(list[1])),ret=actual[num-1]},is_null:function(value){if(value===Literal.Null)return!0;switch(value.type){case"string":case"literal":return value=value.value,"null"==value||"none"==value||null===value;default:return!1}},file_join:function(value1,value2){value1=this.unbox(value1),value2=this.unbox(value2);var joined=value1?value1+"/"+value2:value2;return new Text(joined,"")},theme_image_exists:function(directory,path){directory=directory.value,path=path.value;var fullPath=Env.join(directory,path);return!!Env.isBrowser||Env.exists(fullPath)},map_create:function(){return new Map},map_put:function(map,key,value){map.put(key,value)},map_get:function(map,key){return map.get(key)},map_merge:function(map1,map2){var ret=new Fashion.Map(map1&&map1.items&&[].concat(map1.items));if(map2)for(var items=map2.items,i=0;i<items.length;i+=2){var key=items[i],value=items[i+1];key&&value&&ret.put(items[i],items[i+1])}return ret},map_remove:function(map,key){map&&map.$isFashionMap&&map.remove(key)},map_keys:function(map){if(map&&map.$isFashionMap)return new List(map.getKeys(),", ")},map_values:function(map){if(map&&map.$isFashionMap)return new List(map.getValues(),", ")},map_has_key:function(map,key){return map&&map.$isFashionMap&&map.hasKey(key)?Bool.True:Bool.False}})}}},{"../Env.js":9,"../export/type/Bool.js":24,"../export/type/List.js":31,"../export/type/Literal.js":32,"../export/type/Map.js":33,"../export/type/Text.js":39}],55:[function(require,module,exports){function debug(message){}var Fashion=require("../export/Base.js"),Base=Fashion.Base,Scanner=require("./Scanner.js"),EOF=Scanner.EOF,Nodes=require("../parse/ast/Nodes.js"),Each=Nodes.Each,For=Nodes.For,While=Nodes.While,Charset=Nodes.Charset,FunctionNode=Nodes.Function,Ruleset=Nodes.Ruleset,Mixin=Nodes.Mixin,Block=Nodes.Block,Include=Nodes.Include,Assignment=Nodes.Assignment,Declaration=Nodes.Declaration,VariableAssignment=Nodes.VariableAssignment,If=Nodes.If,Else=Nodes.Else,Return=Nodes.Return,Parenthetical=Nodes.Parenthetical,SelectorPart=Nodes.SelectorPart,SelectorProperty=Nodes.SelectorProperty,CompoundSelector=Nodes.CompoundSelector,MultiPartSelector=Nodes.MultiPartSelector,SelectorList=Nodes.SelectorList,BinaryExpression=Nodes.BinaryExpression,UnaryExpression=Nodes.UnaryExpression,Variable=Nodes.Variable,Literal=Nodes.Literal,Number=Nodes.Number,String=Nodes.String,Length=Nodes.Length,Time=Nodes.Time,Angle=Nodes.Angle,Percentage=Nodes.Percentage,Color=Nodes.Color,FunctionCall=Nodes.FunctionCall,Extend=Nodes.Extend,List=Nodes.List,Warn=Nodes.Warn,Error=Nodes.Error,Debug=Nodes.Debug,Import=Nodes.Import,Require=Nodes.Require,Content=Nodes.Content,Debugger=Nodes.Debugger,Parser=function(_Base9){function Parser(lax){_classCallCheck(this,Parser);var _this35=_possibleConstructorReturn(this,(Parser.__proto__||Object.getPrototypeOf(Parser)).call(this));return _this35.lax=lax,Fashion.apply(_this35,{isSelector:!1,isParenthetical:!1,isSelectorPart:!1}),_this35}return _inherits(Parser,_Base9),_createClass(Parser,[{key:"nextValueIs",value:function(val,offset){var next=this.scanner.peek(offset);return next&&next.value===val}},{key:"parseConstant",value:function(){var scanner=this.scanner,t=scanner.peek();if(t===EOF||!t.isOperator){if(t.isNumber){if(t=scanner.next(),t.value.indexOf("\\")>-1){var t2=scanner.peek();if(t2.isNumber)return scanner.next(),new Literal(t,t1.value+t2.value)}return new Number(t)}return t.isString?(t=scanner.next(),new String(t)):t.isLength?(t=scanner.next(),new Length(t)):t.isTime?(t=scanner.next(),new Time(t)):t.isAngle?(t=scanner.next(),new Angle(t)):t.isPercentage?(t=scanner.next(),new Percentage(t)):t.isHash?(t=scanner.next(),new Color(t)):void 0}}},{key:"parseStylesheet",value:function(){for(var stat,statements=[];;){if(stat=this.parseStatement(),!stat)break;statements.push(stat)}return statements}},{key:"parseStatement",value:function(){var stat,me=this,scanner=me.scanner,t=scanner.peek();if(t!==EOF){if(t.isVariable)return me.parseVariableAssignment();if(t.isDirective&&"-"!==t.value[1])return stat=me.parseDirective(),t=scanner.peek(),t!==EOF&&t.isOperator&&";"===t.value&&scanner.next(),stat;if(t.isIdent){var start=t.startIdx,line=t.startLine,fn=me.parseFunctionCall();if(t=scanner.peek(),fn&&";"===t.value)return scanner.next(),fn;scanner.lineNumber=line,scanner.setIndex(start)}return me.parseRuleset()}}},{key:"parseDirective",value:function(){var me=this,scanner=me.scanner,t=scanner.peek();return"@charset"===t.value?me.parseCharset():"@debug"===t.value?me.parseDebug():"@each"===t.value?me.parseEach():"@for"===t.value?me.parseFor():"@function"===t.value?me.parseFunction():"@if"===t.value?me.parseIf():"@elseif"===t.value?me.parseElse():"@else"===t.value?me.parseElse():"@extend"===t.value?me.parseExtend():"@import"===t.value?me.parseImport():"@require"===t.value?me.parseRequire():"@debugger"===t.value?me.parseDebugger():"@content"===t.value?me.parseContent():"@mixin"===t.value?me.parseMixin():"@include"===t.value?me.parseInclude():"@return"===t.value?me.parseReturn():"@while"===t.value?me.parseWhile():"@warn"===t.value?me.parseWarn():"@error"===t.value?me.parseError():void Fashion.raiseAt("Unknown directive "+t.value,scanner)}},{key:"parseFunction",value:function(){var t,func,statements,me=this,scanner=me.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@function"===t.value)return func=me.parseFunctionCall(!0),statements=me.parseBlock().statements,new FunctionNode({func:func,statements:statements,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}},{key:"parseCharset",value:function(){var t,charset,me=this,scanner=me.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@charset"===t.value){if(t=scanner.next(),t!==EOF&&t.isString)return charset=t.value,new Charset({charset:charset,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile});Fashion.raiseAt("Expected a string after @charset",scanner)}}},{key:"parseDebug",value:function(){var t,expr,me=this,scanner=me.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@debug"===t.value){if(expr=me.parseExpression())return new Debug({expr:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile});Fashion.raiseAt("Expected an expression after @debug",scanner)}}},{key:"parseWarn",value:function(){var t,expr,me=this,scanner=me.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@warn"===t.value){if(expr=me.parseExpression())return new Warn({expr:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile});Fashion.raiseAt("Expected an expression after @debug",scanner)}}},{key:"parseError",value:function(){var t,expr,me=this,scanner=me.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@error"===t.value){if(expr=me.parseExpression())return new Error({expr:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile});Fashion.raiseAt("Expected an expression after @debug",scanner)}}},{key:"parseEach",value:function(){var t,id,seq,stat,isMap,me=this,scanner=me.scanner,statements=[];if(t=scanner.next(),t!==EOF&&t.isDirective&&"@each"===t.value){for(t=scanner.next(),t!==EOF&&t.isVariable||Fashion.raiseAt("Expected variable name after @each",scanner),id=t.value,t=scanner.next(),t!==EOF&&","===t.value&&(t=scanner.next(),t!==EOF&&t.isVariable||Fashion.raiseAt('Expected variable name after "," in @each',scanner),id=new List(null,[id,t.value],", "),isMap=!0,t=scanner.next()),t!==EOF&&t.isIdent&&"in"===t.value||Fashion.raiseAt('Expected "in" after variable in @each',scanner),seq=me.parseSequence(),seq.items&&(seq=seq.items),seq||Fashion.raiseAt('Expected value sequence after "in" in @each',scanner),scanner.expect("{");;){if(debug("parsing each"),t=scanner.peek(),t!==EOF&&t.isOperator&&"}"===t.value)break;if(stat=me.parseScopedStatement(),!stat)break;statements.push(stat)}return scanner.expect("}"),new Each({variable:id,list:seq,statements:statements,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile,isMap:isMap})}}},{key:"parseFor",value:function(){var t,id,start,end,inclusive,stat,me=this,scanner=me.scanner,statements=[];if(t=scanner.next(),t!==EOF&&t.isDirective&&"@for"===t.value){for(t=scanner.next(),t!==EOF&&t.isVariable||Fashion.raiseAt("Expected variable name after @for",scanner),id=t.value,t=scanner.next(),t!==EOF&&t.isIdent&&"from"===t.value||Fashion.raiseAt('Expected "from" after variable in @for',scanner),start=me.parseExpression(),start||Fashion.raiseAt('Expected an expression after "from" in @for',scanner),t=scanner.next(),(t===EOF||!t.isIdent||"to"!==t.value&&"through"!==t.value)&&Fashion.raiseAt('Expected "to" or "through" in @for',scanner),inclusive="through"===t.value,end=me.parseExpression(),end||Fashion.raiseAt("Expected a terminating expression in @for",scanner),scanner.expect("{");;){if(debug("parse for"),t=scanner.peek(),t!==EOF&&t.isOperator&&"}"===t.value)break;if(stat=me.parseScopedStatement(),!stat)break;statements.push(stat)}return scanner.expect("}"),new For({variable:id,start:start,end:end,inclusive:inclusive,statements:statements,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}}},{key:"parseWhile",value:function(){var t,condition,stat,me=this,scanner=me.scanner,statements=[];if(t=scanner.next(),t!==EOF&&t.isDirective&&"@while"===t.value){for(condition=me.parseExpression(),scanner.expect("{");;){if(debug("parse while"),t=scanner.peek(),t!==EOF&&t.isOperator&&"}"===t.value)break;if(stat=me.parseScopedStatement(),!stat)break;statements.push(stat)}return scanner.expect("}"),new While({condition:condition,statements:statements,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}}},{key:"parseIf",value:function(){var t,condition,stat,me=this,scanner=me.scanner,statements=[];if(t=scanner.next(),t!==EOF&&t.isDirective&&"@if"===t.value){for(condition=me.parseSequence(),scanner.expect("{");;){if(debug("parse if"),t=scanner.peek(),t!==EOF&&t.isOperator&&"}"===t.value)break;if(stat=me.parseScopedStatement(),!stat)break;statements.push(stat)}return scanner.expect("}"),new If({condition:condition,statements:statements,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}}},{key:"parseElse",value:function(){var t,condition,stat,isElseIf,me=this,scanner=me.scanner,statements=[];if(t=scanner.next(),t!==EOF&&t.isDirective&&("@else"===t.value||"@elseif"==t.value)){for(isElseIf="@elseif"==t.value,t=scanner.peek(),isElseIf?condition=me.parseExpression():t.isIdent&&"if"===t.value&&(scanner.next(),condition=me.parseExpression()),scanner.expect("{");;){if(debug("parse else"),t=scanner.peek(),t!==EOF&&t.isOperator&&"}"===t.value)break;if(void 0===t||t===EOF)break;if(stat=me.parseScopedStatement(),!stat)break;statements.push(stat)}return scanner.expect("}"),new Else({condition:condition,statements:statements,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}}},{key:"parseExtend",value:function(){var t,selector,me=this,scanner=me.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@extend"===t.value){if(selector=me.parseSelectors())return new Extend({selector:selector,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile});Fashion.raiseAt("Expecting attribute name",scanner)}}},{key:"parseImport",value:function(){var expr,t2,scanner=this.scanner,t=scanner.next();if(t!==EOF&&t.isDirective&&"@import"===t.value)return t=scanner.peek(),t2=scanner.peek(2),t.isString&&";"==t2.value?(scanner.next(),new Import({source:new Literal(t),lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})):(expr=this.parseSelectorSequence(),new Import({source:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile}))}},{key:"parseRequire",value:function(){var expr,t2,scanner=this.scanner,t=scanner.next();if(t!==EOF&&t.isDirective&&"@require"===t.value)return t=scanner.peek(),t2=scanner.peek(2),t.isString&&";"==t2.value?(scanner.next(),new Require({source:new Literal(t),lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})):(expr=this.parseSequence(),new Require({source:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile}))}},{key:"parseDebugger",value:function(){var scanner=this.scanner,t=scanner.next();return new Debugger({lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}},{key:"parseContent",value:function(){var scanner=this.scanner,t=scanner.next();return new Content({type:"Content",lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}},{key:"parseMixin",value:function(){var t,mixin,scanner=this.scanner;return t=scanner.next(),t!==EOF&&t.isDirective&&"@mixin"===t.value&&(mixin=new Mixin({name:this.parseFunctionCall(!0),statements:[],docs:scanner.flushDocs(),token:t,file:scanner.currentFile}),mixin.statements=this.parseBlock().statements,t=scanner.peek(),t!==EOF&&t.isOperator&&";"===t.value&&scanner.next()),mixin}},{key:"parseInclude",value:function(){
var t,inc,block,scanner=this.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@include"===t.value)return inc=this.parseFunctionCall(!0),this.nextValueIs("{")&&(block=this.parseBlock()),new Include({include:inc,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile,content:block})}},{key:"parseBlock",value:function(){var t,stat,scanner=this.scanner,statements=[];if(t=scanner.peek(),t&&t!==EOF){if(";"===t.value)return void scanner.next();for(scanner.expect("{");;){if(debug("parse block"),t=scanner.peek(),null===t||void 0===t)break;if(";"!==t.value){if(null===t||void 0===t)break;if(t!==EOF&&t.isOperator&&"}"===t.value)break;if(stat=this.parseScopedStatement(),!stat)break;statements.push(stat)}else scanner.next()}return debug("done parsing block"),scanner.expect("}"),new Block({statements:statements,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}}},{key:"parseReturn",value:function(){var t,expr,scanner=this.scanner;if(t=scanner.next(),t!==EOF&&t.isDirective&&"@return"===t.value)return expr=this.parseSequence(),new Return({expr:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}},{key:"parseVariableAssignment",value:function(){var t,assignment,start,end,scanner=this.scanner;t=scanner.next(),assignment=new VariableAssignment(t,t.value);try{for(scanner.expect(":"),t=scanner.peek(),start=t?t.startIdx:-1,assignment.value=this.parseValue(),t=scanner.peek(),end=t?t.startIdx:start;t!==EOF&&t.isOperator&&"!"===t.value;)t=scanner.next(),t=scanner.next(),"default"===t.value?assignment["default"]=!0:"global"===t.value?assignment.global=!0:"dynamic"===t.value&&(assignment.dynamic=!0),end=t.startIdx,t=scanner.peek();start>-1&&(assignment.valueText=scanner.style.substring(start,end)),t=scanner.peek(),t!==EOF&&";"===t.value&&scanner.expect(";")}catch(e){if(!this.lax)throw e}return assignment}},{key:"parseRuleset",value:function(){var t,selectors,statements,block,scanner=this.scanner;return t=scanner.peek(),selectors=this.parseSelectors(),block=this.parseBlock(),statements=block&&block.statements,new Ruleset({selectors:selectors,statements:statements,blockDocs:block&&block.docs,lineNumber:t.lineNumber,docs:(selectors&&selectors.docs||[]).concat(scanner.flushDocs()||[]),token:t,file:scanner.currentFile})}},{key:"parseSelectors",value:function(){var selectors=this.parseSelectorSequence();return selectors}},{key:"tryParseSelectors",value:function(){var token,scanner=this.scanner,peek=scanner.peek(),index=peek.startIdx,line=peek.startLine,docs=scanner.docs;try{this.parseSelectors()}catch(e){this.isSelector=!1}return token=scanner.peek(),scanner.lineNumber=line,scanner.setIndex(index),scanner.docs=docs,token}},{key:"parseScopedStatement",value:function(){var stat,me=this,scanner=me.scanner,t=scanner.peek();if(t.isHash||t.isClass)return me.parseRuleset();if(t!==EOF&&t.isOperator&&("&"===t.value||">"===t.value||"~"===t.value||":"===t.value||"%"===t.value))return me.parseRuleset();if(t.isVariable)return me.parseVariableAssignment();if(t.isDirective)return stat=me.parseDirective(),t=scanner.peek(),t!==EOF&&t.isOperator&&";"===t.value&&scanner.next(),stat;if(t!==EOF&&t.isOperator&&"-"===t.value)return me.parseDeclaration();if(t.isIdent||t.isNumber||t.isPercentage||t.isOperator&&"}"!==t.value){for(var idx=1,skipRuleset=!1,directive=!1,tmp=scanner.peek(idx++);tmp&&!tmp.isEOF&&"{"!==tmp.value&&"}"!==tmp.value&&";"!==tmp.value;)0===tmp.value.indexOf("@")&&(directive=!0),":"===tmp.value&&(" "!==scanner.style.charAt(tmp.idx)||directive||(skipRuleset=!0),this.nextValueIs("{",idx)&&(skipRuleset=!0)),tmp=scanner.peek(idx++);return tmp&&"{"===tmp.value&&!skipRuleset?me.parseRuleset():me.parseDeclaration()}}},{key:"parseDeclaration",value:function(){var me=this,scanner=me.scanner,t=scanner.next(),decl=new Declaration({property:"",docs:scanner.flushDocs(),lineNumber:scanner.lineNumber,token:t,file:scanner.currentFile});if(t===EOF||!t.isOperator||"*"!==t.value&&"-"!==t.value||(decl.property=t.value,t=scanner.next(),t!==EOF&&t.isHash&&(t.type="ident")),t!==EOF&&t.isIdent){if(decl.property+=t.value,scanner.expect(":"),t=scanner.peek(),0===decl.property.indexOf("--")){var ch,start=t.startIdx,idx=start,end=start,brace=0,paren=0,bracket=0,quote=null;loop:for(idx=start;idx<scanner.style.length;idx++)switch(ch=scanner.style.charAt(idx)){case'"':case"'":quote?quote===ch&&(quote=null):quote=ch;break;case"{":brace++;break;case"(":paren++;break;case"[":bracket++;break;case"}":brace--;break;case")":paren--;break;case"]":bracket--;break;case";":if(0===bracket&&0===brace&&0===paren&&!quote){end=idx;break loop}}scanner.setIndex(end);var data={value:scanner.style.substring(start,end).trim()};decl.value=new Literal(t,JSON.stringify(data)),decl.value.jsonEncoded=!0}else"filter"===decl.property||"-ms-filter"===decl.property||"_filter"===decl.property?decl.value=me.parseFilterValue():decl.value=me.parseValue();return t=scanner.peek(),t!==EOF&&t.isOperator&&"!"===t.value&&(scanner.next(),t=scanner.next(),t.isIdent&&"important"===t.value&&(decl.important=!0)),t=scanner.peek(),t!==EOF&&t.isOperator&&";"===t.value&&scanner.next(),decl}var message="Property declaration: expected identifier but saw "+JSON.stringify(t)+" instead : "+scanner.lineNumber+":"+(scanner.index-scanner.start);Fashion.error(message),Fashion.raiseAt(message,scanner)}},{key:"parseValue",value:function(){var t,stat,sequence,ruleset,scanner=this.scanner,statements=[];if(sequence=this.parseSequence(),t=scanner.peek(),t!==EOF&&t.isOperator&&"{"==t.value){for(scanner.next();void 0!==(stat=this.parseScopedStatement());)statements.push(stat);scanner.expect("}"),ruleset=new Ruleset({statements:statements,selectors:[],lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}return ruleset&&(sequence.items?sequence.items.push(ruleset):sequence=sequence?new List(null,[sequence,ruleset]," "):ruleset),sequence}},{key:"parseFilterFunctionCall",value:function(){var t,peek,pos,scanner=this.scanner;if(t=scanner.peek(),t!==EOF&&"ident"==t.type&&("progid"==t.value||"chroma"==t.value)){for(pos=t.startIdx;;){if(peek=scanner.peek(),peek&&peek.isOperator&&")"===peek.value){t=scanner.next();break}if(peek&&";"===peek.value)break;t=scanner.next()}return new Literal(t,this.style.substring(pos,t.idx).replace(/\r/g,"").replace(/\n/g,"").replace(/\s+/g," ").trim())}}},{key:"parseFilterValue",value:function(){for(var t,args,scanner=this.scanner,value=[],separator=" ";;)if(debug("parse filter value"),t=scanner.peek(),","!=t.value){if(t===EOF)break;if("ident"!=t.type||"progid"!=t.value&&"chroma"!=t.value){if(t.isOperator&&(";"===t.value||"{"===t.value||"!"===t.value||"}"===t.value))break;if(args=this.parseSequence(),args.items?(separator=args.separator,args=args.items):args=[args],0===args.length)break;1===args.length?value.push(args[0]):value.push.apply(value,args)}else value.push(this.parseFilterFunctionCall())}else separator=",",scanner.next();if(0===value.length)return null;for(;1===value.length;)value=value[0];return value.length&&(value=new List(null,value,separator)),value}},{key:"parseExpression",value:function(){var id,scanner=this.scanner,t=scanner.peek();if(t.isIdent){if(t=scanner.peek(2),t!==EOF&&t.isOperator)switch(t.value){case"=":case"~=":case"|=":case"^=":case"$=":case"*=":return id=scanner.next().value,scanner.expect(t.value),new Assignment({id:id,expr:this.parseRelational(),operator:t.value,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}}else if(t!==EOF&&t.isOperator&&"!"===t.value){var t2=scanner.peek(2);if(t2&&"important"===t2.value)return t=scanner.next(),t=scanner.next(),new Literal(t,"!important")}return this.parseDisjunction()}},{key:"parseDisjunction",value:function(){var factor,or,t,scanner=this.scanner;for(or=this.parseConjunction(),factor=or;;){if(debug("parse disjunction"),t=scanner.peek(),t==EOF||!t.isOperator||"or"!==t.value||this.isSelector)break;if(t=scanner.next(),or=this.parseConjunction(),!or)break;factor=new BinaryExpression({operator:"or",left:factor,right:or,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}return factor}},{key:"parseConjunction",value:function(){var or,and,t,scanner=this.scanner;for(and=this.parseComplement(),or=and;;){if(debug("parse conjunction"),t=scanner.peek(),t===EOF||!t.isOperator||"and"!==t.value||this.isSelector)break;if(t=scanner.next(),and=this.parseComplement(),!and)break;or=new BinaryExpression({operator:"and",left:or,right:and,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}return or}},{key:"parseComplement",value:function(){var t,scanner=this.scanner;if(t=scanner.peek(),t!==EOF&&t.isOperator&&"not"===t.value){if(this.isSelectorParen)return scanner.next(),new Literal(t,"not");if(!this.isSelector)return scanner.next(),new UnaryExpression({operator:"not",expr:this.parseRelational(),lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}return this.parseRelational()}},{key:"parseRelational",value:function(){var cmp,expr,t,scanner=this.scanner;for(cmp=this.parseAdditive(),expr=cmp;;){if(debug("parse relational"),t=scanner.peek(),t===EOF||!t.isOperator||"=="!==t.value&&"!="!==t.value&&"<"!==t.value&&"<="!==t.value&&">="!==t.value&&(">"!==t.value||this.isSelector))break;if(t=scanner.next(),cmp=this.parseAdditive(),!cmp)break;expr=new BinaryExpression({operator:t.value,left:expr,right:cmp,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}return expr}},{key:"parseAdditive",value:function(){var term,cmp,t,scanner=this.scanner;for(term=this.parseMultiplicative(),cmp=term;;){if(debug("parse additive"),t=scanner.peek(),t===EOF||!t.isOperator||"+"!==t.value&&"-"!==t.value||this.isSelector)break;if(t=scanner.next(),term=this.parseMultiplicative(),!term)break;cmp=new BinaryExpression({operator:t.value,left:cmp,right:term,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}return cmp}},{key:"parseMultiplicative",value:function(){var term,factor,t;for(factor=this.parsePrimary(),term=factor;;){if(debug("parse multiplicative"),t=this.scanner.peek(),t===EOF||!t.isOperator||"*"!==t.value&&"/"!==t.value&&("%"!==t.value||this.isSelector))break;if(t=this.scanner.next(),factor=this.parsePrimary(),!factor)break;term=new BinaryExpression({operator:t.value,left:term,right:factor,docs:this.scanner.flushDocs()})}return term}},{key:"parsePrimary",value:function(){var t,t2,scanner=this.scanner;if(t=scanner.peek(),t2=scanner.peek(2),t!==EOF)return t!==EOF&&t.isOperator&&"("===t.value?this.parseParenthetical():t.isIdent?this.keywords[t.value]?(scanner.next(),new Literal(t)):"progid"===t.value&&":"===t2.value?this.parseFilterFunctionCall():this.parseFunctionCall():t.isVariable?(t=scanner.next(),t.negate?new BinaryExpression({operator:"-",right:new Variable(t,t.value),docs:scanner.flushDocs(),token:t,file:scanner.currentFile}):new Variable(t,t.value)):t=this.parseConstant()}},{key:"parseParenthetical",value:function(){var expr,scanner=this.scanner,t=scanner.next(),selWas=this.isSelector,parWas=this.isParenthetical,selParWas=this.isSelectorParen;return parWas&&(this.isSelector=!1),this.isParenthetical=!0,this.isSelectorParen=selWas,expr=this.isSelector?this.parseSelectorSequence(!0):this.parseSequence(),this.isSelector=selWas,this.isParenthetical=parWas,this.isSelectorParen=selParWas,scanner.expect(")"),expr&&expr.isKVP&&(expr=new List(null,[expr],", ")),new Parenthetical({expr:expr,lineNumber:t.lineNumber,docs:scanner.flushDocs(),token:t,file:scanner.currentFile})}},{key:"parseFunctionCall",value:function(allowSpaceBeforeParen){var end,prev,temp,twas,scanner=this.scanner,t=scanner.next(),id=t.value,start=t.idx,ch="",args=[],passThroughNames={expression:1,calc:1,"-moz-calc":1,"-webkit-calc":1,"-ms-calc":1};if(twas=t,t=scanner.peek(),t!==EOF&&(prev=scanner.style.charAt(start),t.isOperator&&"("===t.value&&(" "!==prev||allowSpaceBeforeParen))){if(scanner.next(),t=scanner.peek(),id in passThroughNames){start=t.startIdx,end=start;for(var parenCount=0;;){if(debug("parsing function call"),ch=scanner.style.charAt(end),end+=1,"("===ch&&parenCount++,!ch||!ch){end=start;break}if(")"===ch){if(0===parenCount)break;parenCount--}}if(debug("done parsing function call"),end!=start)return scanner.setIndex(end),args.push(new Literal(null,scanner.style.substring(start,end-1))),new FunctionCall(t,id,args)}else if(!("url"!==id&&"url-prefix"!==id||t===EOF||t.isOperator&&"/"!==t.value||t.isString)){start=t.startIdx,end=start;for(var ch2,tpl=0;;){if(ch=scanner.style.charAt(end),ch2=scanner.style.charAt(end+1),"#"===ch&&"{"===ch2&&tpl++,"}"===ch){if(!tpl){end=start;break}tpl--}if(("("===ch||"$"==ch)&&!tpl){end=start;break}if("+"===ch&&!tpl&&scanner.style.indexOf("data:",start)!=start&&scanner.style.indexOf("http:",start)!=start){end=start;break}if(!ch||")"===ch)break;if(!ch){end=start;break}end+=1}if(end!=start)return scanner.setIndex(end),args.push(new String(null,scanner.style.substring(start,end),"")),scanner.next(),new FunctionCall(t,id,args)}return temp=t===EOF||t.isOperator&&")"===t.value?args:this.isSelector?this.parseSelectorSequence():this.parseArguments(),t=scanner.peek(),scanner.expect(")"),new FunctionCall(t,id,temp)}return new Literal(twas,id)}},{key:"parseSelectorPart",value:function(){var t,scanner=this.scanner;if(t=scanner.peek()){if(t.isClass)return t=scanner.next(),new SelectorPart({selectorType:"class",value:new Literal(t)});if(t.isHash)return t=scanner.next(),new SelectorPart({selectorType:"id",value:new Literal(t)});if(t.isOperator)switch(t.value){case"and":return scanner.next(),new SelectorPart({selectorType:"and",value:new Literal(t)});case"or":return scanner.next(),new SelectorPart({selectorType:"or",value:new Literal(t)});case"*":return scanner.next(),new SelectorPart({selectorType:"wildcard",value:new Literal(t)});case"!":return scanner.next(),new SelectorPart({selectorType:"bang",value:new Literal(t)});case"|":return scanner.next(),new SelectorPart({selectorType:"pipe",value:new Literal(t)});case">":return scanner.next(),new SelectorPart({selectorType:"direct",value:new Literal(t)});case"+":return scanner.next(),new SelectorPart({selectorType:"after",value:new Literal(t)});case"~":return scanner.next(),new SelectorPart({selectorType:"before",value:new Literal(t)});case"&":return scanner.next(),new SelectorPart({selectorType:"parent",value:new Literal(t)});case"-":scanner.next();var expr=this.parseSelectorPart();return new SelectorPart({selectorType:"dash",value:expr});case"%":scanner.next();var expr=this.parseSelectorPart();return new SelectorPart({selectorType:"placeholder",value:expr});case"[":scanner.next();var expr=this.parseSelectorPart();return scanner.expect("]"),new SelectorPart({selectorType:"attribute",value:expr});case":":t=scanner.next();var idx=t.idx;if(t=scanner.peek(),t!==EOF&&"{"===t.value||" "===scanner.style.charAt(idx))return;return new SelectorPart({selectorType:"pseudo",value:this.parseSelectorPart()});case"not":return new SelectorPart({selectorType:"not",value:this.parseFunctionCall()})}}return this.parseExpression()}},{key:"parseSequence",value:function(){for(var arg,t,scanner=this.scanner,args=[];;){if(debug("parse sequence"),arg=this.parseTuple(),!arg)break;if(args.push(arg),t=scanner.peek(),!t||t===EOF)break;if(":"===t.value&&(scanner.next(),arg=this.parseTuple(),arg.variable=args.pop(),arg.isKVP=!0,args.push(arg),t=scanner.peek()),!t.isOperator||","!==t.value)break;scanner.next()}return 1===args.length?(null==args[0],args[0]):new List(t,args,", ")}},{key:"parseSelectorSequence",value:function(isParenthetical){for(var arg,t,t2,scanner=this.scanner,args=[],sequence=new SelectorList({items:args,separator:", "});;){if(debug("parse sequence"),arg=this.parseSelectorTuple(),!arg)break;if(!arg||arg.items&&!arg.items.length||args.push(arg),t=scanner.peek(),t===EOF)break;if(":"===t.value&&isParenthetical&&(t2=scanner.peek(2),t!==EOF&&"{"!==t.value&&";"!==t.value&&(scanner.next(),arg=new SelectorProperty({property:args.pop(),value:this.parseSelectorTuple()}),args.push(arg),t=scanner.peek())),!t.isOperator||","!==t.value)break;scanner.next()}return 1===args.length?args[0]:sequence}},{key:"parseSelectorTuple",value:function(){var expr,t,idx,ch,last,line,scanner=this.scanner,separator=" ",exprs=[],selectorWas=this.isSelector;for(this.isSelector=!0;;){if(debug("parse selector tuple"),t=scanner.peek(),t===EOF)break;if(idx=t.startIdx,line=t.startLine,last=exprs[exprs.length-1],expr=this.parseSelectorPart(),!expr){scanner.lineNumber=line,scanner.setIndex(idx);break}if(ch=scanner.style.charAt(idx)," "!==ch&&"\t"!==ch&&"\r"!==ch&&"\n"!==ch)if(last)if("CompoundSelector"!==last.type)last=new CompoundSelector({separator:"",items:[last,expr]}),exprs[exprs.length-1]=last;else{var items=last.items;items.push(expr)}else exprs.push(expr);else exprs.push(expr)}return this.isSelector=selectorWas,1===exprs.length?exprs[0]:new MultiPartSelector({items:exprs,separator:separator})}},{key:"parseTuple",value:function(){for(var expr,t,idx,ch,last,scanner=this.scanner,separator=" ",exprs=[];;){if(debug("parse tuple"),t=scanner.peek(),t===EOF)break;if(idx=t.startIdx,last=exprs[exprs.length-1],expr=this.parseExpression(),!expr)break;if(ch=scanner.style.charAt(idx)," "!==ch&&"\t"!==ch&&"\r"!==ch&&"\n"!==ch)if(last)if("List"!==last.type)last=new List(null,[exprs.pop(),expr],""),exprs.push(last);else{var items=last.items;items.push(expr)}else exprs.push(new List(null,[expr],""));else exprs.push(expr)}return 1===exprs.length?(exprs=exprs[0],exprs.items&&1===exprs.items.length?exprs.items[0]:exprs):exprs.length?new List(null,exprs,separator):void 0}},{key:"parseArguments",value:function(){for(var arg,t,scanner=this.scanner,args=[];;){if(debug("parse arguments"),arg=this.parseArgument(),!arg)break;if(args.push(arg),t=scanner.peek(),t===EOF)break;if(!t.isOperator||","!==t.value)break;scanner.next()}return new List(t,args,", ")}},{key:"parseVarArgs",value:function(expr){var t,t2,t3,scanner=this.scanner;return t=scanner.peek(),t!==EOF&&"."===t.value&&(t2=scanner.peek(2),t3=scanner.peek(3),t2&&"."===t2.value&&t3&&"."===t3.value&&(expr.varArgs=!0,scanner.next(),scanner.next(),scanner.next())),expr}},{key:"parseArgument",value:function(){for(var expr,t,scanner=this.scanner,arg=[];;){if(debug("parse argument"),t=scanner.peek(),t===EOF)break;if((t.isVariable||t.isIdent)&&(t=scanner.peek(2),t!==EOF&&t.isOperator&&":"===t.value))t=scanner.next(),scanner.next(),expr=this.parseTuple(),expr&&(expr.variable=t.value),arg.push(expr);else{if(expr=this.parseExpression(),!expr)break;this.parseVarArgs(expr),arg.push(expr)}}return 1==arg.length?arg[0]:new List(null,arg," ")}},{key:"parse",value:function(content,file){var scanner,me=this;me.scanner=scanner=new Scanner(content,file),me.style=scanner.style;var result=me.parseStylesheet();return me.scanner=me.style=null,result}}]),Parser}(Base);Fashion.apply(Parser.prototype,{lax:!1,keywords:{"no-repeat":!0},scanner:void 0,style:void 0}),module.exports=Parser},{"../export/Base.js":19,"../parse/ast/Nodes.js":60,"./Scanner.js":56}],56:[function(require,module,exports){function isAlpha(ch){return 1&_chars[ch.charCodeAt(0)]}function isDigit(ch){return 2&_chars[ch.charCodeAt(0)]}function isNameChar(ch){return 4&_chars[ch.charCodeAt(0)]}function isHexDigit(ch){return 8&_chars[ch.charCodeAt(0)]}function isLength(unit){var ch1=unit.charAt(0).toLowerCase(),ch2=unit.charAt(1).toLowerCase(),ch3=unit.charAt(2).toLowerCase(),ch4=unit.charAt(3).toLowerCase();if("p"===ch1)return"x"===ch2||"t"===ch2||"c"===ch2;if("m"===ch2&&("c"===ch1||"m"===ch1||"e"===ch1))return 2;if("x"===ch2)return"e"===ch1;if("m"===ch3&&"r"===ch1&&"e"===ch2)return 3;if("x"===ch1&&isHexDigit(ch2)){for(var len=1;isHexDigit(unit[len]);)len++;return len}if("v"===ch1){if("w"===ch2||"h"===ch2)return 2;if("m"===ch2){if("i"===ch3&&"n"===ch4)return 4;if("a"===ch3&&"x"===ch4)return 4}}return!1}function isTime(unit){return 1===unit.length?"s"===unit:2===unit.length&&"ms"===unit}function isAngle(unit){var ch=unit[0];return"d"===ch||"D"===ch?"deg"===unit.toLowerCase():("r"===ch||"R"===ch)&&"rad"===unit.toLowerCase()}for(var Fashion=require("../export/Base.js"),Base=Fashion.Base,Tokens=require("./Tokens.js"),Operator=Tokens.Operator,Ident=Tokens.Ident,StringLiteral=Tokens.StringLiteral,Percentage=Tokens.Percentage,Length=Tokens.Length,Time=Tokens.Time,Angle=Tokens.Angle,NumberLiteral=Tokens.NumberLiteral,Class=Tokens.Class,Hash=Tokens.Hash,Variable=Tokens.Variable,Directive=Tokens.Directive,_limit=(Tokens.EOF,255),_chars=Array(_limit),_EOF=null,c=0;c<_limit;c++){var ch=String.fromCharCode(c),mask=0;(ch>="a"&&ch<="z"||ch>="A"&&ch<="Z")&&(mask|=1),ch>="0"&&ch<="9"&&(mask|=2),(ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch>="0"&&ch<="9"||"-"===ch||"_"===ch||c>=128&&c<=_limit&&215!==c&&247!==c||"\\"===ch)&&(mask|=4),(ch>="0"&&ch<="9"||ch>="a"&&ch<="f"||ch>="A"&&ch<="F")&&(mask|=8),_chars[c]=mask}var Scanner=function(_Base10){function Scanner(style,file){_classCallCheck(this,Scanner);var _this36=_possibleConstructorReturn(this,(Scanner.__proto__||Object.getPrototypeOf(Scanner)).call(this));return _this36.style=style,_this36.lineNumber=_this36.style.length?1:0,_this36.currentFile=file||Fashion.currentFile,_this36.docs=[],_this36.tokenBuff=[],_this36}return _inherits(Scanner,_Base10),_createClass(Scanner,[{key:"next",value:function(advance){var me=this,start=me.index,startLine=me.lineNumber,token=!advance&&me.tokenBuff.shift();return token||(token=me._advance(),token&&(token.startIdx=start,token.startLine=startLine)),token}},{key:"_advance",value:function(){for(var ch,ch2,ch3,start,str,level,negate,charOffset,value,me=this,style=me.style,length=style.length;;){for(ch=style[me.index];me.index<length&&(ch<=" "||ch>=128);)"\n"===ch&&(me.lineNumber+=1,me.start=me.index),me.index+=1,ch=style[me.index];if(ch2=style[me.index+1],"/"!==ch||"*"!==ch2){if("/"!==ch||"/"!==ch2)break;for(me.index+=1,start=me.index;me.index<length&&(ch=style[me.index],"\r"!==ch&&"\n"!==ch);)me.index+=1;me.docs.push(style.substring(start-1,me.index))}else{for(me.index+=1,start=me.index+1;me.index<length;){if(ch=style[me.index],ch2=style[me.index+1],"\n"===ch&&(me.lineNumber+=1,me.start=me.index),"*"===ch&&"/"===ch2){me.index+=2;break}me.index+=1}me.docs.push(style.substring(start-2,me.index))}}if(start=me.index,start>=length)return _EOF;if(ch=style[me.index],ch2=style[me.index+1],ch3=style[me.index+2],isNameChar(ch)&&!isDigit(ch)&&"-"!==ch||"-"===ch&&isNameChar(ch2)&&!isDigit(ch2)||"#"===ch&&"{"===ch2){for(level=0,me.index+=1,"#"===ch&&"{"===ch2&&(level+=1,me.index+=1),"\\"===ch&&(me.index+=1);me.index<length;)if(ch=style[me.index],ch2=style[me.index+1],isNameChar(ch))me.index+=1;else if("\\"!==ch)if(">"!=ch)if("#"!==ch||"{"!==ch2){if(!(level>0))break;me.index+=1,"}"===ch&&(level-=1)}else level+=1,me.index+=2;else me.index+=1;else me.index+=2;return str=style.substring(start,me.index).toLowerCase(),"or"===str||"and"===str||"not"===str?new Operator(me,str):new Ident(me,style.substring(start,me.index))}if("'"===ch||'"'===ch||"\\"===ch&&("'"===ch2||'"'===ch2)){charOffset="\\"===ch?2:1,me.index+=charOffset,start=me.index;var openCh="\\"===ch?ch2:ch;level=0;for(var buff="";me.index<length;){if(ch=style[me.index],me.index++,"\\"===ch){if(ch2=style[me.index],"\n"===ch2||"\r"===ch2){me.index++;continue}if(buff+=ch,ch=style[me.index],me.index++,!level&&2===charOffset&&openCh===style[me.index])break}else if("#"===ch)"{"===style[me.index]&&level++;else if("}"===ch)level&&level--;else if(!level&&ch===openCh)break;buff+=ch}return new StringLiteral(me,buff,style[start-1])}if(isDigit(ch)||"."===ch&&isDigit(ch2)||"-"===ch&&isDigit(ch2)||"-"===ch&&"."===ch2&&isDigit(ch3)){for("-"===ch&&(me.index+=1),me.index+=1;me.index<length&&(ch=style[me.index],!(ch<"0"||ch>"9"));)me.index+=1;if("\\"===ch&&(me.index+=1,ch=style[me.index]),"."===ch)for(me.index+=1;me.index<length&&(ch=style[me.index],!(ch<"0"||ch>"9"));)me.index+=1;if("%"===ch){me.index+=1;var pcnt=new Percentage(me,style.substring(start,me.index));return pcnt.start=start,pcnt.end=me.index,pcnt}if(" "!==ch){var unitLen=isLength(style.substr(me.index,10));if(unitLen)return me.index+=unitLen===!0?2:unitLen,new Length(me,style.substring(start,me.index));if(isTime(style.substr(me.index,1)))return me.index+=1,new Time(me,style.substring(start,me.index));if(isTime(style.substr(me.index,2)))return me.index+=2,new Time(me,style.substring(start,me.index));if(isAngle(style.substr(me.index,3)))return me.index+=3,new Angle(me,style.substring(start,me.index))}return new NumberLiteral(me,style.substring(start,me.index))}if("."===ch){for(level=0,me.index+=1,ch=style[me.index],"{"===ch&&(level+=1,me.index+=1);me.index<length;)if(ch=style[me.index],ch2=style[me.index+1],isNameChar(ch))me.index+=1;else if("#"!==ch||"{"!==ch2){if(!(level>0))break;me.index+=1,"}"===ch&&(level-=1)}else level+=1,me.index+=2;return new Class(me,style.substring(start,me.index))}if("#"===ch){for(level=0,me.index+=1,ch=style[me.index],"{"===ch&&(level+=1,me.index+=1);me.index<length;)if(ch=style[me.index],ch2=style[me.index+1],isNameChar(ch))me.index+=1;else if("#"!==ch||"{"!==ch2){if(!(level>0))break;me.index+=1,"}"===ch&&(level-=1)}else level+=1,me.index+=2;return new Hash(me,style.substring(start,me.index))}if("$"===ch||"-"===ch&&"$"===ch2){for("-"===ch&&(negate=!0,start+=1,me.index+=1),me.index+=1;me.index<length&&(ch=style[me.index],isNameChar(ch));)me.index+=1;return new Variable(me,style.substring(start,me.index),negate)}if("@"===ch){for(me.index+=1;me.index<length&&(ch=style[me.index],isAlpha(ch)||"-"===ch);)me.index+=1;return value=style.substring(start,me.index),me.directives[value]?new Directive(me,value):new Ident(me,value)}return me.index+=1,str=ch,"="===ch&&"="===ch2&&(str="==",me.index+=1),"~"===ch&&"="===ch2&&(str="~=",me.index+=1),"|"===ch&&"="===ch2&&(str="|=",me.index+=1),"^"===ch&&"="===ch2&&(str="^=",me.index+=1),"$"===ch&&"="===ch2&&(str="$=",me.index+=1),"*"===ch&&"="===ch2&&(str="*=",me.index+=1),"!"===ch&&"="===ch2&&(str="!=",me.index+=1),"<"===ch&&"="===ch2&&(str="<=",me.index+=1),">"===ch&&"="===ch2&&(str=">=",me.index+=1),new Operator(me,str)}},{key:"flushDocs",value:function(){if(this.docs.length>0){var docs=this.docs;return this.docs=[],docs}return null}},{key:"peek",value:function(i){var buff=this.tokenBuff,len=buff.length;i=i||1;for(var x=len;x<i;x++)buff.push(this.next(!0));return buff[i-1]||_EOF}},{key:"setIndex",value:function(index){this.index=index,this.tokenBuff=[]}},{key:"expect",value:function(op){var token=this.next(),lineNo=this.lineNumber-1,fileName=this.currentFile||"sass-content",message="Expected '"+op+"' but saw '"+(token?token.value:"(null token)")+"' => "+fileName+":"+(lineNo+1)+":"+(this.index-this.start+1);token||Fashion.raise(message),token.isOperator&&token.value===op||Fashion.raise(message)}}]),Scanner}(Base);Fashion.apply(Scanner.prototype,{isFashionScanner:!0,directives:{"@charset":!0,"@import":!0,"@extend":!0,"@debug":!0,"@warn":!0,"@error":!0,"@if":!0,"@else":!0,"@for":!0,"@each":!0,"@while":!0,"@mixin":!0,"@include":!0,"@function":!0,"@return":!0,"@debugger":!0,"@elseif":!0,"@content":!0,"@require":!0},index:0,docs:void 0,start:void 0,style:void 0,currentFile:void 0,lineNumber:void 0}),Scanner.EOF=_EOF,module.exports=Scanner},{"../export/Base.js":19,"./Tokens.js":58}],57:[function(require,module,exports){var Fashion=require("../export/Base.js"),Base=Fashion.Base,Scanner=require("./Scanner.js"),Tokenizer=function(_Base11){function Tokenizer(){return _classCallCheck(this,Tokenizer),_possibleConstructorReturn(this,(Tokenizer.__proto__||Object.getPrototypeOf(Tokenizer)).apply(this,arguments))}return _inherits(Tokenizer,_Base11),_createClass(Tokenizer,[{key:"tokenize",value:function(config){var token,scanner=new Scanner(config),tokens=this.tokens;if(!tokens)for(this.tokens=tokens=[];void 0!==(token=scanner.next());)tokens.push(token);return tokens}}]),Tokenizer}(Base);Tokenizer.prototype.tokens=void 0,module.exports=Tokenizer},{"../export/Base.js":19,"./Scanner.js":56}],58:[function(require,module,exports){var Fashion=require("../export/Base.js"),Token=function Token(scanner){_classCallCheck(this,Token),this.scanner=scanner,scanner&&(this.idx=scanner.index,this.lineNumber=scanner.lineNumber,this.file=scanner.currentFile)};Fashion.apply(Token.prototype,{$isToken:!0,lineNumber:void 0,file:void 0,idx:void 0,startIdx:void 0,startLine:void 0,value:void 0,start:void 0,end:void 0});var Operator=function(_Token){function Operator(scanner,value){_classCallCheck(this,Operator);var _this38=_possibleConstructorReturn(this,(Operator.__proto__||Object.getPrototypeOf(Operator)).call(this,scanner));return _this38.value=value,_this38}return _inherits(Operator,_Token),Operator}(Token);Fashion.apply(Operator.prototype,{isOperator:!0,type:"operator"});var Ident=function(_Token2){function Ident(scanner,value){_classCallCheck(this,Ident);var _this39=_possibleConstructorReturn(this,(Ident.__proto__||Object.getPrototypeOf(Ident)).call(this,scanner));return _this39.value=value,_this39}return _inherits(Ident,_Token2),Ident}(Token);Fashion.apply(Ident.prototype,{isIdent:!0,type:"ident"});var StringLiteral=function(_Token3){function StringLiteral(scanner,value,quoteChar){_classCallCheck(this,StringLiteral);var _this40=_possibleConstructorReturn(this,(StringLiteral.__proto__||Object.getPrototypeOf(StringLiteral)).call(this,scanner));return _this40.value=value,_this40.quoteChar=quoteChar,_this40}return _inherits(StringLiteral,_Token3),StringLiteral}(Token);Fashion.apply(StringLiteral.prototype,{isString:!0,type:"string",quoteChar:void 0});var Percentage=function(_Token4){function Percentage(scanner,value){_classCallCheck(this,Percentage);var _this41=_possibleConstructorReturn(this,(Percentage.__proto__||Object.getPrototypeOf(Percentage)).call(this,scanner));return _this41.value=value,_this41}return _inherits(Percentage,_Token4),Percentage}(Token);Fashion.apply(Percentage.prototype,{isPercentage:!0,type:"percentage"});var Length=function(_Token5){function Length(scanner,value){_classCallCheck(this,Length);var _this42=_possibleConstructorReturn(this,(Length.__proto__||Object.getPrototypeOf(Length)).call(this,scanner));return _this42.value=value,_this42}return _inherits(Length,_Token5),Length}(Token);Fashion.apply(Length.prototype,{isLength:!0,type:"length"});var Time=function(_Token6){function Time(scanner,value){_classCallCheck(this,Time);var _this43=_possibleConstructorReturn(this,(Time.__proto__||Object.getPrototypeOf(Time)).call(this,scanner));return _this43.value=value,_this43}return _inherits(Time,_Token6),Time}(Token);Fashion.apply(Time.prototype,{isTime:!0,type:"time"});var Angle=function(_Token7){function Angle(scanner,value){_classCallCheck(this,Angle);var _this44=_possibleConstructorReturn(this,(Angle.__proto__||Object.getPrototypeOf(Angle)).call(this,scanner));return _this44.value=value,_this44}return _inherits(Angle,_Token7),Angle}(Token);Fashion.apply(Angle.prototype,{isAngle:!0,type:"angle"});var NumberLiteral=function(_Token8){function NumberLiteral(scanner,value){_classCallCheck(this,NumberLiteral);var _this45=_possibleConstructorReturn(this,(NumberLiteral.__proto__||Object.getPrototypeOf(NumberLiteral)).call(this,scanner));return _this45.value=value,_this45}return _inherits(NumberLiteral,_Token8),NumberLiteral}(Token);Fashion.apply(NumberLiteral.prototype,{isNumber:!0,type:"number"});var Class=function(_Token9){function Class(scanner,value){_classCallCheck(this,Class);var _this46=_possibleConstructorReturn(this,(Class.__proto__||Object.getPrototypeOf(Class)).call(this,scanner));return _this46.value=value,_this46}return _inherits(Class,_Token9),Class}(Token);Fashion.apply(Class.prototype,{isClass:!0,type:"class"});var Hash=function(_Token10){function Hash(scanner,value){_classCallCheck(this,Hash);var _this47=_possibleConstructorReturn(this,(Hash.__proto__||Object.getPrototypeOf(Hash)).call(this,scanner));return _this47.value=value,_this47}return _inherits(Hash,_Token10),Hash}(Token);Fashion.apply(Hash.prototype,{isHash:!0,type:"hash"
});var Variable=function(_Token11){function Variable(scanner,value,negate){_classCallCheck(this,Variable);var _this48=_possibleConstructorReturn(this,(Variable.__proto__||Object.getPrototypeOf(Variable)).call(this,scanner));return _this48.value=value,_this48.negate=negate,_this48}return _inherits(Variable,_Token11),Variable}(Token);Fashion.apply(Variable.prototype,{isVariable:!0,type:"variable",negate:void 0});var Directive=function(_Token12){function Directive(scanner,value){_classCallCheck(this,Directive);var _this49=_possibleConstructorReturn(this,(Directive.__proto__||Object.getPrototypeOf(Directive)).call(this,scanner));return _this49.value=value,_this49}return _inherits(Directive,_Token12),Directive}(Token);Fashion.apply(Directive.prototype,{isDirective:!0,type:"directive"});var EOF=function(_Token13){function EOF(scanner){_classCallCheck(this,EOF);var _this50=_possibleConstructorReturn(this,(EOF.__proto__||Object.getPrototypeOf(EOF)).call(this,scanner));return _this50.value="",_this50}return _inherits(EOF,_Token13),EOF}(Token);Fashion.apply(EOF.prototype,{isEOF:!0,type:"eof"}),module.exports={Token:Token,Operator:Operator,Ident:Ident,StringLiteral:StringLiteral,Percentage:Percentage,Length:Length,Time:Time,Angle:Angle,NumberLiteral:NumberLiteral,Class:Class,Hash:Hash,Variable:Variable,Directive:Directive,EOF:EOF}},{"../export/Base.js":19}],59:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseNode=function(){function BaseNode(token,file,line,docs){if(_classCallCheck(this,BaseNode),token)if(token.$isToken){this.token=token,this.lineNumber=token.lineNumber,this.file=token.file;var scanner=token.scanner;this.acceptsDocs&&(this.docs=scanner.flushDocs())}else Fashion.apply(this,token)}return _createClass(BaseNode,[{key:"doVisit",value:function(visitor){}},{key:"descend",value:function(visitor){}}]),BaseNode}();Fashion.apply(BaseNode.prototype,{visitTarget:void 0,docs:void 0,file:void 0,token:void 0,lienNumber:void 0,acceptsDocs:!1}),module.exports=BaseNode},{"../../export/Base.js":19}],60:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseNode=require("./BaseNode.js"),Each=function(_BaseNode){function Each(cfg){return _classCallCheck(this,Each),_possibleConstructorReturn(this,(Each.__proto__||Object.getPrototypeOf(Each)).call(this,cfg))}return _inherits(Each,_BaseNode),_createClass(Each,[{key:"doVisit",value:function(visitor){visitor.Each(this)}},{key:"descend",value:function(visitor){visitor.visit(this.list),visitor.visit(this.statements)}}]),Each}(BaseNode);Fashion.apply(Each.prototype,{type:"Each",variable:void 0,list:void 0,statements:void 0});var For=function(_BaseNode2){function For(cfg){return _classCallCheck(this,For),_possibleConstructorReturn(this,(For.__proto__||Object.getPrototypeOf(For)).call(this,cfg))}return _inherits(For,_BaseNode2),_createClass(For,[{key:"doVisit",value:function(visitor){visitor.For(this)}},{key:"descend",value:function(visitor){visitor.visit(this.start),visitor.visit(this.end),visitor.visit(this.statements)}}]),For}(BaseNode);Fashion.apply(For.prototype,{type:"For",variable:void 0,start:void 0,end:void 0,statements:void 0});var While=function(_BaseNode3){function While(cfg){return _classCallCheck(this,While),_possibleConstructorReturn(this,(While.__proto__||Object.getPrototypeOf(While)).call(this,cfg))}return _inherits(While,_BaseNode3),_createClass(While,[{key:"doVisit",value:function(visitor){visitor.While(this)}},{key:"descend",value:function(visitor){visitor.visit(this.condition),visitor.visit(this.statements)}}]),While}(BaseNode);Fashion.apply(While.prototype,{type:"While",condition:void 0,statements:void 0});var Charset=function(_BaseNode4){function Charset(cfg){return _classCallCheck(this,Charset),_possibleConstructorReturn(this,(Charset.__proto__||Object.getPrototypeOf(Charset)).call(this,cfg))}return _inherits(Charset,_BaseNode4),_createClass(Charset,[{key:"doVisit",value:function(visitor){visitor.Charset(this)}}]),Charset}(BaseNode);Fashion.apply(Charset.prototype,{type:"Charset"});var FunctionNode=function(_BaseNode5){function FunctionNode(cfg){return _classCallCheck(this,FunctionNode),_possibleConstructorReturn(this,(FunctionNode.__proto__||Object.getPrototypeOf(FunctionNode)).call(this,cfg))}return _inherits(FunctionNode,_BaseNode5),_createClass(FunctionNode,[{key:"doVisit",value:function(visitor){visitor.Function(this)}},{key:"descend",value:function(visitor){visitor.visit(this.func),visitor.visit(this.statements)}}]),FunctionNode}(BaseNode);Fashion.apply(FunctionNode.prototype,{type:"Function",func:void 0,statements:void 0});var Ruleset=function(_BaseNode6){function Ruleset(cfg){return _classCallCheck(this,Ruleset),_possibleConstructorReturn(this,(Ruleset.__proto__||Object.getPrototypeOf(Ruleset)).call(this,cfg))}return _inherits(Ruleset,_BaseNode6),_createClass(Ruleset,[{key:"doVisit",value:function(visitor){visitor.Ruleset(this)}},{key:"descend",value:function(visitor){visitor.visit(this.selectors),visitor.visit(this.statements)}}]),Ruleset}(BaseNode);Fashion.apply(Ruleset.prototype,{type:"Ruleset",selectors:void 0,statements:void 0,acceptsDocs:!0});var Mixin=function(_BaseNode7){function Mixin(cfg){return _classCallCheck(this,Mixin),_possibleConstructorReturn(this,(Mixin.__proto__||Object.getPrototypeOf(Mixin)).call(this,cfg))}return _inherits(Mixin,_BaseNode7),_createClass(Mixin,[{key:"doVisit",value:function(visitor){visitor.Mixin(this)}},{key:"descend",value:function(visitor){visitor.visit(this.name),visitor.visit(this.statements)}}]),Mixin}(BaseNode);Fashion.apply(Mixin.prototype,{type:"Mixin",name:void 0,statements:void 0});var Block=function(_BaseNode8){function Block(cfg){return _classCallCheck(this,Block),_possibleConstructorReturn(this,(Block.__proto__||Object.getPrototypeOf(Block)).call(this,cfg))}return _inherits(Block,_BaseNode8),_createClass(Block,[{key:"doVisit",value:function(visitor){visitor.Block(this)}},{key:"descend",value:function(visitor){visitor.visit(this.statements)}}]),Block}(BaseNode);Fashion.apply(Block.prototype,{type:"Block",statements:void 0});var Include=function(_BaseNode9){function Include(cfg){return _classCallCheck(this,Include),_possibleConstructorReturn(this,(Include.__proto__||Object.getPrototypeOf(Include)).call(this,cfg))}return _inherits(Include,_BaseNode9),_createClass(Include,[{key:"doVisit",value:function(visitor){visitor.Include(this)}},{key:"descend",value:function(visitor){visitor.visit(this.include),this.content&&visitor.visit(this.content)}}]),Include}(BaseNode);Fashion.apply(Include.prototype,{type:"Include",include:void 0,content:void 0});var Assignment=function(_BaseNode10){function Assignment(cfg){return _classCallCheck(this,Assignment),_possibleConstructorReturn(this,(Assignment.__proto__||Object.getPrototypeOf(Assignment)).call(this,cfg))}return _inherits(Assignment,_BaseNode10),_createClass(Assignment,[{key:"doVisit",value:function(visitor){visitor.Assignment(this)}},{key:"descend",value:function(visitor){visitor.visit(this.expr)}}]),Assignment}(BaseNode);Fashion.apply(Assignment.prototype,{type:"Assignment",expr:void 0});var Declaration=function(_BaseNode11){function Declaration(cfg){return _classCallCheck(this,Declaration),_possibleConstructorReturn(this,(Declaration.__proto__||Object.getPrototypeOf(Declaration)).call(this,cfg))}return _inherits(Declaration,_BaseNode11),_createClass(Declaration,[{key:"doVisit",value:function(visitor){visitor.Declaration(this)}},{key:"descend",value:function(visitor){visitor.visit(this.value)}}]),Declaration}(BaseNode);Fashion.apply(Declaration.prototype,{type:"Declaration",property:void 0,value:void 0,acceptsDocs:!0});var VariableAssignment=function(_BaseNode12){function VariableAssignment(token,name,value){_classCallCheck(this,VariableAssignment);var _this62=_possibleConstructorReturn(this,(VariableAssignment.__proto__||Object.getPrototypeOf(VariableAssignment)).call(this,token));return _this62.name=name,_this62.value=value,_this62}return _inherits(VariableAssignment,_BaseNode12),_createClass(VariableAssignment,[{key:"doVisit",value:function(visitor){visitor.VariableAssignment(this)}},{key:"descend",value:function(visitor){visitor.visit(this.value)}}]),VariableAssignment}(BaseNode);Fashion.apply(VariableAssignment.prototype,{type:"VariableAssignment",name:void 0,value:void 0,valueText:void 0,acceptsDocs:!0});var If=function(_BaseNode13){function If(cfg){return _classCallCheck(this,If),_possibleConstructorReturn(this,(If.__proto__||Object.getPrototypeOf(If)).call(this,cfg))}return _inherits(If,_BaseNode13),_createClass(If,[{key:"doVisit",value:function(visitor){visitor.If(this)}},{key:"descend",value:function(visitor){visitor.visit(this.condition),visitor.visit(this.statements)}}]),If}(BaseNode);Fashion.apply(If.prototype,{type:"If",condition:void 0,statements:void 0});var Else=function(_BaseNode14){function Else(cfg){return _classCallCheck(this,Else),_possibleConstructorReturn(this,(Else.__proto__||Object.getPrototypeOf(Else)).call(this,cfg))}return _inherits(Else,_BaseNode14),_createClass(Else,[{key:"doVisit",value:function(visitor){visitor.Else(this)}},{key:"descend",value:function(visitor){visitor.visit(this.condition),visitor.visit(this.statements)}}]),Else}(BaseNode);Fashion.apply(Else.prototype,{type:"Else",condition:void 0,statements:void 0});var Return=function(_BaseNode15){function Return(cfg){return _classCallCheck(this,Return),_possibleConstructorReturn(this,(Return.__proto__||Object.getPrototypeOf(Return)).call(this,cfg))}return _inherits(Return,_BaseNode15),_createClass(Return,[{key:"doVisit",value:function(visitor){visitor.Return(this)}},{key:"descend",value:function(visitor){visitor.visit(this.expr)}}]),Return}(BaseNode);Fashion.apply(Return.prototype,{type:"Return",expr:void 0});var Parenthetical=function(_BaseNode16){function Parenthetical(cfg){return _classCallCheck(this,Parenthetical),_possibleConstructorReturn(this,(Parenthetical.__proto__||Object.getPrototypeOf(Parenthetical)).call(this,cfg))}return _inherits(Parenthetical,_BaseNode16),_createClass(Parenthetical,[{key:"doVisit",value:function(visitor){visitor.ParentheticalExpression(this)}},{key:"descend",value:function(visitor){visitor.visit(this.expr)}}]),Parenthetical}(BaseNode);Fashion.apply(Parenthetical.prototype,{type:"Parenthetical",expr:void 0});var SelectorPart=function(_BaseNode17){function SelectorPart(cfg){return _classCallCheck(this,SelectorPart),_possibleConstructorReturn(this,(SelectorPart.__proto__||Object.getPrototypeOf(SelectorPart)).call(this,cfg))}return _inherits(SelectorPart,_BaseNode17),_createClass(SelectorPart,[{key:"doVisit",value:function(visitor){visitor.SelectorPart(this)}},{key:"descend",value:function(visitor){visitor.visit(this.value)}}]),SelectorPart}(BaseNode);Fashion.apply(SelectorPart.prototype,{type:"SelectorPart",value:void 0});var SelectorProperty=function(_BaseNode18){function SelectorProperty(cfg){return _classCallCheck(this,SelectorProperty),_possibleConstructorReturn(this,(SelectorProperty.__proto__||Object.getPrototypeOf(SelectorProperty)).call(this,cfg))}return _inherits(SelectorProperty,_BaseNode18),_createClass(SelectorProperty,[{key:"doVisit",value:function(visitor){visitor.SelectorProperty(this)}},{key:"descend",value:function(visitor){visitor.visit(this.property),visitor.visit(this.value)}}]),SelectorProperty}(BaseNode);Fashion.apply(SelectorProperty.prototype,{type:"SelectorProperty",property:void 0,value:void 0});var CompoundSelector=function(_BaseNode19){function CompoundSelector(cfg){return _classCallCheck(this,CompoundSelector),_possibleConstructorReturn(this,(CompoundSelector.__proto__||Object.getPrototypeOf(CompoundSelector)).call(this,cfg))}return _inherits(CompoundSelector,_BaseNode19),_createClass(CompoundSelector,[{key:"doVisit",value:function(visitor){visitor.CompoundSelector(this)}},{key:"descend",value:function(visitor){visitor.visit(this.items)}}]),CompoundSelector}(BaseNode);Fashion.apply(CompoundSelector.prototype,{type:"CompoundSelector",items:void 0});var MultiPartSelector=function(_BaseNode20){function MultiPartSelector(cfg){return _classCallCheck(this,MultiPartSelector),_possibleConstructorReturn(this,(MultiPartSelector.__proto__||Object.getPrototypeOf(MultiPartSelector)).call(this,cfg))}return _inherits(MultiPartSelector,_BaseNode20),_createClass(MultiPartSelector,[{key:"doVisit",value:function(visitor){visitor.MultiPartSelector(this)}},{key:"descend",value:function(visitor){visitor.visit(this.items)}}]),MultiPartSelector}(BaseNode);Fashion.apply(MultiPartSelector.prototype,{type:"MultiPartSelector",items:void 0});var SelectorList=function(_BaseNode21){function SelectorList(cfg){return _classCallCheck(this,SelectorList),_possibleConstructorReturn(this,(SelectorList.__proto__||Object.getPrototypeOf(SelectorList)).call(this,cfg))}return _inherits(SelectorList,_BaseNode21),_createClass(SelectorList,[{key:"doVisit",value:function(visitor){visitor.SelectorList(this)}},{key:"descend",value:function(visitor){visitor.visit(this.items)}}]),SelectorList}(BaseNode);Fashion.apply(SelectorList.prototype,{type:"SelectorList",items:void 0});var BinaryExpression=function(_BaseNode22){function BinaryExpression(cfg){return _classCallCheck(this,BinaryExpression),_possibleConstructorReturn(this,(BinaryExpression.__proto__||Object.getPrototypeOf(BinaryExpression)).call(this,cfg))}return _inherits(BinaryExpression,_BaseNode22),_createClass(BinaryExpression,[{key:"doVisit",value:function(visitor){visitor.BinaryExpression(this)}},{key:"descend",value:function(visitor){visitor.visit(this.left),visitor.visit(this.right)}}]),BinaryExpression}(BaseNode);Fashion.apply(BinaryExpression.prototype,{type:"BinaryExpression",left:void 0,right:void 0});var UnaryExpression=function(_BaseNode23){function UnaryExpression(cfg){return _classCallCheck(this,UnaryExpression),_possibleConstructorReturn(this,(UnaryExpression.__proto__||Object.getPrototypeOf(UnaryExpression)).call(this,cfg))}return _inherits(UnaryExpression,_BaseNode23),_createClass(UnaryExpression,[{key:"doVisit",value:function(visitor){visitor.UnaryExpression(this)}},{key:"descend",value:function(visitor){visitor.visit(this.expr)}}]),UnaryExpression}(BaseNode);Fashion.apply(UnaryExpression.prototype,{type:"UnaryExpression",expr:void 0});var Variable=function(_BaseNode24){function Variable(token,name){_classCallCheck(this,Variable);var _this74=_possibleConstructorReturn(this,(Variable.__proto__||Object.getPrototypeOf(Variable)).call(this,token));return _this74.name=name||token.value,_this74}return _inherits(Variable,_BaseNode24),_createClass(Variable,[{key:"doVisit",value:function(visitor){visitor.Variable(this)}}]),Variable}(BaseNode);Fashion.apply(Variable.prototype,{type:"Variable"});var Constant=function(_BaseNode25){function Constant(token,value){_classCallCheck(this,Constant);var _this75=_possibleConstructorReturn(this,(Constant.__proto__||Object.getPrototypeOf(Constant)).call(this,token));return _this75.value=value||token.value,_this75}return _inherits(Constant,_BaseNode25),_createClass(Constant,[{key:"doVisit",value:function(visitor){visitor.Constant(this)}}]),Constant}(BaseNode);Fashion.apply(Constant.prototype,{type:"Constant",value:void 0});var Literal=function(_Constant){function Literal(token,value){return _classCallCheck(this,Literal),_possibleConstructorReturn(this,(Literal.__proto__||Object.getPrototypeOf(Literal)).call(this,token,value))}return _inherits(Literal,_Constant),Literal}(Constant);Fashion.apply(Literal.prototype,{dataType:"Literal"});var Number=function(_Constant2){function Number(token,value){return _classCallCheck(this,Number),_possibleConstructorReturn(this,(Number.__proto__||Object.getPrototypeOf(Number)).call(this,token,value))}return _inherits(Number,_Constant2),Number}(Constant);Fashion.apply(Number.prototype,{dataType:"Number"});var String=function(_Constant3){function String(token,value,quoteChar){_classCallCheck(this,String);var _this78=_possibleConstructorReturn(this,(String.__proto__||Object.getPrototypeOf(String)).call(this,token,value));return _this78.quoteChar=void 0!==quoteChar?quoteChar:token.quoteChar,_this78}return _inherits(String,_Constant3),String}(Constant);Fashion.apply(String.prototype,{dataType:"String",quoteChar:void 0});var Length=function(_Constant4){function Length(token,value,quoteChar){return _classCallCheck(this,Length),_possibleConstructorReturn(this,(Length.__proto__||Object.getPrototypeOf(Length)).call(this,token,value))}return _inherits(Length,_Constant4),Length}(Constant);Fashion.apply(Length.prototype,{dataType:"Length",quoteChar:void 0});var Time=function(_Constant5){function Time(token,value,quoteChar){return _classCallCheck(this,Time),_possibleConstructorReturn(this,(Time.__proto__||Object.getPrototypeOf(Time)).call(this,token,value))}return _inherits(Time,_Constant5),Time}(Constant);Fashion.apply(Time.prototype,{dataType:"Time",quoteChar:void 0});var Angle=function(_Constant6){function Angle(token,value,quoteChar){return _classCallCheck(this,Angle),_possibleConstructorReturn(this,(Angle.__proto__||Object.getPrototypeOf(Angle)).call(this,token,value))}return _inherits(Angle,_Constant6),Angle}(Constant);Fashion.apply(Angle.prototype,{dataType:"Angle",quoteChar:void 0});var Percentage=function(_Constant7){function Percentage(token,value,quoteChar){return _classCallCheck(this,Percentage),_possibleConstructorReturn(this,(Percentage.__proto__||Object.getPrototypeOf(Percentage)).call(this,token,value))}return _inherits(Percentage,_Constant7),Percentage}(Constant);Fashion.apply(Percentage.prototype,{dataType:"Percentage",quoteChar:void 0});var Color=function(_Constant8){function Color(token,value,quoteChar){return _classCallCheck(this,Color),_possibleConstructorReturn(this,(Color.__proto__||Object.getPrototypeOf(Color)).call(this,token,value))}return _inherits(Color,_Constant8),Color}(Constant);Fashion.apply(Color.prototype,{dataType:"Color",quoteChar:void 0});var FunctionCall=function(_BaseNode26){function FunctionCall(token,id,args){_classCallCheck(this,FunctionCall);var _this84=_possibleConstructorReturn(this,(FunctionCall.__proto__||Object.getPrototypeOf(FunctionCall)).call(this,token));return _this84.id=id,_this84.args=args,_this84}return _inherits(FunctionCall,_BaseNode26),_createClass(FunctionCall,[{key:"doVisit",value:function(visitor){visitor.FunctionCall(this)}},{key:"descend",value:function(visitor){visitor.visit(this.args)}}]),FunctionCall}(BaseNode);Fashion.apply(FunctionCall.prototype,{type:"FunctionCall",id:void 0,args:void 0});var Extend=function(_BaseNode27){function Extend(cfg){return _classCallCheck(this,Extend),_possibleConstructorReturn(this,(Extend.__proto__||Object.getPrototypeOf(Extend)).call(this,cfg))}return _inherits(Extend,_BaseNode27),_createClass(Extend,[{key:"doVisit",value:function(visitor){visitor.Extend(this)}}]),Extend}(BaseNode);Fashion.apply(Extend.prototype,{type:"Extend"});var List=function(_BaseNode28){function List(token,items,separator){_classCallCheck(this,List);var _this86=_possibleConstructorReturn(this,(List.__proto__||Object.getPrototypeOf(List)).call(this,token));return _this86.items=items,_this86.separator=separator,_this86}return _inherits(List,_BaseNode28),_createClass(List,[{key:"doVisit",value:function(visitor){visitor.List(this)}},{key:"descend",value:function(visitor){visitor.visit(this.items)}}]),List}(BaseNode);Fashion.apply(List.prototype,{type:"List",items:void 0,separator:void 0,isFashionListAst:!0});var Warn=function(_BaseNode29){function Warn(cfg){return _classCallCheck(this,Warn),_possibleConstructorReturn(this,(Warn.__proto__||Object.getPrototypeOf(Warn)).call(this,cfg))}return _inherits(Warn,_BaseNode29),_createClass(Warn,[{key:"doVisit",value:function(visitor){visitor.Warn(this)}}]),Warn}(BaseNode);Fashion.apply(Warn.prototype,{type:"Warn"});var Error=function(_BaseNode30){function Error(cfg){return _classCallCheck(this,Error),_possibleConstructorReturn(this,(Error.__proto__||Object.getPrototypeOf(Error)).call(this,cfg))}return _inherits(Error,_BaseNode30),_createClass(Error,[{key:"doVisit",value:function(visitor){visitor.Error(this)}}]),Error}(BaseNode);Fashion.apply(Error.prototype,{type:"Error"});var Debug=function(_BaseNode31){function Debug(cfg){return _classCallCheck(this,Debug),_possibleConstructorReturn(this,(Debug.__proto__||Object.getPrototypeOf(Debug)).call(this,cfg))}return _inherits(Debug,_BaseNode31),_createClass(Debug,[{key:"doVisit",value:function(visitor){visitor.Debug(this)}},{key:"descend",value:function(visitor){visitor.visit(this.expr)}}]),Debug}(BaseNode);Fashion.apply(Debug.prototype,{type:"Debug",expr:void 0});var Import=function(_BaseNode32){function Import(cfg){return _classCallCheck(this,Import),_possibleConstructorReturn(this,(Import.__proto__||Object.getPrototypeOf(Import)).call(this,cfg))}return _inherits(Import,_BaseNode32),_createClass(Import,[{key:"doVisit",value:function(visitor){visitor.Import(this)}}]),Import}(BaseNode);Fashion.apply(Import.prototype,{type:"Import",source:void 0});var Require=function(_BaseNode33){function Require(cfg){return _classCallCheck(this,Require),_possibleConstructorReturn(this,(Require.__proto__||Object.getPrototypeOf(Require)).call(this,cfg))}return _inherits(Require,_BaseNode33),_createClass(Require,[{key:"doVisit",value:function(visitor){visitor.Require(this)}},{key:"descend",value:function(visitor){visitor.visit(this.source)}}]),Require}(BaseNode);Fashion.apply(Require.prototype,{type:"Require",source:void 0});var Content=function(_BaseNode34){function Content(cfg){return _classCallCheck(this,Content),_possibleConstructorReturn(this,(Content.__proto__||Object.getPrototypeOf(Content)).call(this,cfg))}return _inherits(Content,_BaseNode34),_createClass(Content,[{key:"doVisit",value:function(visitor){visitor.Content(this)}}]),Content}(BaseNode);Fashion.apply(Content.prototype,{type:"Content"});var Debugger=function(_BaseNode35){function Debugger(cfg){return _classCallCheck(this,Debugger),_possibleConstructorReturn(this,(Debugger.__proto__||Object.getPrototypeOf(Debugger)).call(this,cfg))}return _inherits(Debugger,_BaseNode35),_createClass(Debugger,[{key:"doVisit",value:function(visitor){visitor.Debugger(this)}}]),Debugger}(BaseNode);Fashion.apply(Debugger.prototype,{type:"Debugger"}),module.exports={Each:Each,For:For,While:While,Charset:Charset,Function:FunctionNode,Ruleset:Ruleset,Mixin:Mixin,Block:Block,Include:Include,Assignment:Assignment,Declaration:Declaration,VariableAssignment:VariableAssignment,If:If,Else:Else,Return:Return,Parenthetical:Parenthetical,SelectorPart:SelectorPart,SelectorProperty:SelectorProperty,CompoundSelector:CompoundSelector,MultiPartSelector:MultiPartSelector,SelectorList:SelectorList,BinaryExpression:BinaryExpression,UnaryExpression:UnaryExpression,Variable:Variable,Constant:Constant,Literal:Literal,Number:Number,String:String,Length:Length,Time:Time,Angle:Angle,Percentage:Percentage,Color:Color,FunctionCall:FunctionCall,Extend:Extend,List:List,Warn:Warn,Error:Error,Debug:Debug,Import:Import,Require:Require,Content:Content,Debugger:Debugger}},{"../../export/Base.js":19,"./BaseNode.js":59}],61:[function(require,module,exports){var Fashion=require("../export/Base.js"),FunctionCall=require("../export/type/FunctionCall.js"),Literal=require("../export/type/Literal.js"),Declaration=require("../type/Declaration.js"),Ruleset=require("../type/Ruleset.js"),SelectorList=require("../type/selectors/SelectorList.js"),ExportBuilder=(require("../Preprocessor.js"),require("../parse/ast/Nodes.js"),require("./ExportBuilder.js"));module.exports={init:function(runtime){runtime.register({create_css_variable:function(name,value,base){for(;base&&base.$previousReference;)base=base.$previousReference;return value.$referenceName=this.unbox(name),value.$referenceBase=base||value,value},name_of:function(refNode){for(;refNode&&refNode.$referenceBase;)refNode=refNode.$referenceBase;return refNode&&refNode.$referenceName}}),runtime.registerProcessor({enable:!0,execute:function(obj,ctx){var me=this,config=runtime.context.getConfig("cssVars");config&&Fashion.apply(this,config),me.enable&&(me.ctx=ctx,ctx.exportedVariables={},ctx.exportRuleset=new Ruleset({selectors:new SelectorList([new Literal("html")])}),me.visit(obj),"all"===me["export"]&&me.exportAllGlobals(obj))},exportAllGlobals:function(css){var globals=runtime.getGlobalScope().getEntries(),me=this,exportRuleset=me.ctx.exportRuleset;for(var key in globals){var entry=globals[key],value=entry;if(value&&value.ast&&value.$referenceName){var name=value.$referenceName,jsName=Fashion.getJsName(name.replace(/^--/g,"$")),varName=name.replace(/^\$/,""),dynamics=runtime._dynamics;dynamics[jsName]&&!entry.exported&&0!==varName.indexOf("include-")&&(exportRuleset.addDeclaration(new Declaration({property:"--"+varName,value:new Literal("export")})),entry.exported=!0)}}this.visit(exportRuleset)},declaration:function(decl){var name=decl.property,val=decl.value,exportedVariables=this.ctx.exportedVariables;if(0==name.indexOf("--")&&val&&val.$isFashionLiteral&&val.value&&"export"===val.value.trim()){var jsName=Fashion.getJsName(name.replace(/^--/g,"$")),globals=runtime.getGlobalScope(),dynamics=runtime._dynamics,variable=globals.get(jsName),baseName=name.replace(/^--/g,""),key=Fashion.getJsName(baseName),exported=exportedVariables[key]||{name:baseName,rulesets:[]};variable&&(dynamics[jsName]?(val&&(val.visitTarget=variable.clone()),exported.declaration=decl,exported.variable=variable,variable.exported=!0,exported.rulesets.push(decl.ruleset),exportedVariables[key]=exported):Fashion.log("cannot export "+jsName+" because it is not dynamic"))}this.visit(val)}}),runtime.registerProcessor({currDecl:null,referenceNodes:null,enable:!0,execute:function(obj,ctx){var me=this,config=runtime.context.getConfig("cssVars");if(config&&Fashion.apply(me,config),me.enable){me.ctx=ctx,me.visit(obj);var exportedVariables=me.ctx.exportedVariables;if(Object.getOwnPropertyNames(exportedVariables).length){var exportRuleset=me.ctx.exportRuleset,builder=new ExportBuilder(exportRuleset);builder["export"]=me["export"];var exportFn=builder.buildExportFunction(exportedVariables,runtime);exportRuleset.declarations.length&&(obj.push(exportRuleset),me.ctx.exportRuleset=new Ruleset({selectors:new SelectorList([new Literal("html")])})),exportFn&&(ctx.exportFn=exportFn)}}},visitItem:function(item){item.$referenceName?this.referenceNodes.push(item):item.doVisit(this)},declaration:function(decl){this.currDecl=decl,this.referenceNodes=[];var copy=decl.clone(),refNodes=this.referenceNodes,addNewDecl=!1,exportedVariables=this.ctx.exportedVariables;this.visit(copy.value);for(var i=0;i<refNodes.length;i++){for(var refBase,referenceNode=refNodes[i],refNode=referenceNode;refNode;){if(refNode.$referenceBase){refBase=refNode.$referenceBase;break}refNode=refNode.$previousReference}if(refBase){var newName,exported,visitTarget,exDecl,keyName,base=refBase,baseName=base.$referenceName.replace(/^\$/,"");if(baseName=Fashion.getJsName(baseName),newName=refNode.$referenceName.replace(/^\$/,""),keyName=Fashion.getJsName(newName),exportedVariables[baseName]?(exported=exportedVariables[baseName],exDecl=exported.declaration):exDecl=copy,!exportedVariables[keyName]){var d=new Declaration({property:"--"+newName,value:refNode.clone()});exportedVariables[keyName]={declaration:d,name:newName,rulesets:[exDecl.ruleset],variable:{$isWrapper:!0,value:d.value}},visitTarget=exDecl.visitTarget,visitTarget||(exDecl.visitTarget=visitTarget=[new Declaration({property:exDecl.property,important:exDecl.important,sourceInfo:exDecl.sourceInfo,value:exDecl.value})]),visitTarget.push(d)}}refNode=referenceNode;inner:for(;refNode;){var refName=refNode.$referenceName.replace(/^\$/,""),keyName=Fashion.getJsName(refName);if(exportedVariables[keyName]){referenceNode.visitTarget=new FunctionCall("var",[new Literal("--"+refName)]),addNewDecl=!0;break inner}refNode=refNode.$previousReference&&refNode.$previousReference.$referenceName?refNode.$previousReference:null}}addNewDecl&&(decl.visitTarget=[decl.clone(),copy]),this.currDecl=null,this.referenceNodes=null}})}}},{"../Preprocessor.js":13,"../export/Base.js":19,"../export/type/FunctionCall.js":29,"../export/type/Literal.js":32,"../parse/ast/Nodes.js":60,"../type/Declaration.js":65,"../type/Ruleset.js":66,"../type/selectors/SelectorList.js":74,"./ExportBuilder.js":63}],62:[function(require,module,exports){var Fashion=require("../export/Base.js"),Env=require("../Env.js"),Literal=require("../export/type/Literal.js"),FunctionCall=require("../export/type/FunctionCall.js");module.exports={init:function(runtime){var mimeTypeMap={otf:"font-opentype",eot:"application/vnd.ms-fontobject",ttf:"font/truetype",svg:"image/svg+xml",woff:"application/x-font-woff",woff2:"application/x-font-woff2",gif:"image/gif",png:"image/png"},report=!1,excludes=[],includes=[],maxItemSize=-1;runtime.registerProcessor({getSourceFromCall:function(obj){var source,args=obj.args;return args.items&&(args=args.items),Array.isArray(args)||(args=[args]),1===args.length&&(source=args[0]),source=source.value?source.value:""+source},getSubstring:function(source,char){var idx=source.indexOf(char);return idx>-1&&(source=source.substring(0,idx)),source},detectExtension:function(source){source=this.getSubstring(source,"#"),source=this.getSubstring(source,"?");var idx=source.lastIndexOf("."),extension=source.substring(idx+1);return extension},detectMimeType:function(source){var extension=this.detectExtension(source),mapped=mimeTypeMap[extension];return mapped||"application/octet-stream"},encodeBytes:function(bytes){if(Env.isNode)return bytes.toString("base64");for(var str="",i=0;i<bytes.length;i++)str+=String.fromCharCode(bytes[i]);return btoa(str)},isMatch:function(source,filters){for(var f=0;f<filters.length;f++)if(filters[f].test(source))return!0;return!1},isExcluded:function(source){return this.isMatch(source,excludes)},isIncluded:function(source){return this.isMatch(source,includes)},inlineUrl:function(obj,mimeType,charset){var url,queue,extension,inlineTag,inlineExtensionTag,skip,me=this,context=me.context,cache=context.cache||(context.cache={}),source=me.getSourceFromCall(obj);source&&(mimeType=mimeType||me.detectMimeType(source),charset=charset||"UTF-8",url=me.basePath+"/"+source,extension=this.detectExtension(url),inlineTag=obj.hasTag("inline"),inlineExtensionTag=obj.hasTag("inline\\:"+extension),skip=!1,this.isExcluded(source)?skip=!0:this.isIncluded(source)?skip=!1:inlineExtensionTag===!1?skip=!0:null===inlineExtensionTag&&inlineTag===!1&&(skip=!0),skip||(queue=cache[url]||function(){function inlineData(bytes){var data,arg,optNode;try{data=me.encodeBytes(bytes),arg=new Literal(encodeURI("data:"+mimeType+(charset?";charset="+charset:"")+";base64,"+data)),Fashion.debug("creating inline data node for : "+url),optNode=new FunctionCall("url",[arg])}catch(e){Fashion.error(e)}if(maxItemSize>-1&&arg.value.length>maxItemSize&&(optNode=null),optNode&&report){var size=data.length,num=token.nodes.length;Fashion.log(num+" * "+size+" bytes for "+url+".")}for(var n=0;n<token.nodes.length;n++){if(optNode){var node=token.nodes[n];node.visitTarget=optNode}context.ready.unblock()}}var token={nodes:[],url:url};if(Env.isBrowser)Env.doRequest({url:url,async:!0,binary:!0,params:{_dc:(new Date).getTime()},onComplete:function(options,xhr){try{inlineData(xhr.getBinaryData())}catch(err){Fashion.error(err)}},onError:function(options,xhr){for(var n=0;n<token.nodes.length;n++)context.ready.unblock()}});else{var fs=Env.fs;fs.readFile(url,function(err,data){err?(Fashion.error(err),context.ready.unblock()):inlineData(data)})}return token}(),queue.nodes.push(obj),context.ready.block()))},functioncall:function(obj){var name=obj.name;if("url"===name)if(this.fontFace)this.inlineUrl(obj);else if(this.currDeclaration){var name=this.currDeclaration.property;"background-image"===name&&this.inlineUrl(obj)}},declaration:function(obj){var declWas=this.declaration;this.currDeclaration=obj,obj.descend(this),this.currDeclaration=declWas;
},ruleset:function(obj){var ffWas=this.fontFace,rulesetWas=this.currRuleset;this.currRuleset=obj,obj.isAtRule()&&"@font-face"===obj.getFirstSelectorStr()&&(this.fontFace=obj),obj.descend(this),this.currRuleset=rulesetWas,this.fontFace=ffWas},execute:function(obj,ctx){this.context=ctx,this.basePath=runtime.context.getConfig("basePath");var config=runtime.context.getConfig("inliner");if(config&&config.enable){if(config.report&&(report=config.report),config.excludes)for(var i=0;i<config.excludes.length;i++)excludes.push(RegExp(config.excludes[i]));if(config.includes)for(var i=0;i<config.includes.length;i++)includes.push(RegExp(config.includes[i]));maxItemSize=config.maxItemSize||-1,this.visit(obj)}}})}}},{"../Env.js":9,"../export/Base.js":19,"../export/type/FunctionCall.js":29,"../export/type/Literal.js":32}],63:[function(require,module,exports){var Fashion=require("../export/Base.js"),Preprocessor=require("../Preprocessor.js"),Nodes=require("../parse/ast/Nodes.js"),ExportTypes=require("../export/type/Types.js"),ExportRuntime=require("../export/Runtime.js"),CssVariableManager=require("../export/css/CssVariableManager.js");CssVariableManager=new CssVariableManager;for(var IndexGenerator=function(){function IndexGenerator(){_classCallCheck(this,IndexGenerator),this.ids=[],this.index=0}return _createClass(IndexGenerator,[{key:"_getIndexes",value:function(ids){for(var prefix,len=ids.length||1,chars=this.chars,clen=1==len?chars.length-10:chars.length,out=[],i=0;i<len;i++)for(var j=0;j<clen;j++)prefix=(ids[i]||"")+chars[j],"as"!==prefix&&"do"!==prefix&&"if"!==prefix&&"in"!==prefix&&out.push(prefix);return out}},{key:"next",value:function(){var me=this;return me.index<me.ids.length?me.ids[me.index++]:(me.index=0,me.ids=me._getIndexes(me.ids),me.next())}}]),IndexGenerator}(),chars=IndexGenerator.prototype.chars=["_","$"],i=65;i<91;i++)chars.push(String.fromCharCode(i)),chars.push(String.fromCharCode(i+32));chars.push.call(chars,"0","1","2","3","4","5","6","7","8","9");var ExportBuilder=function(){function ExportBuilder(defaultRuleset){_classCallCheck(this,ExportBuilder),this.defaultRuleset=defaultRuleset}return _createClass(ExportBuilder,[{key:"instrumentObject",value:function(registered,called,isFn){var instrumented={};return Object.getOwnPropertyNames(registered).forEach(function(key){var fn=registered[key];instrumented[key]=function(){return called[key]={func:fn,isFn:isFn},fn.apply(registered,arguments)}}),instrumented}},{key:"buildExportFn",value:function(variables){var setterVariables,sortedAst,settersCode,settersFunc,me=this,runtime=this.runtime,setterAst=me.createSettersAst(variables),preprocessor=new Preprocessor({runtime:runtime}),newContext=new runtime.context.constructor({preprocessor:preprocessor}),allVariables=Fashion.chain(runtime.context.preprocessor.variables);preprocessor.enableElevationWarning=!1,preprocessor.sortAllVariables="all"===this["export"],preprocessor.loadPreprocessorCache(runtime.context.preprocessor),preprocessor.reset=function(){},preprocessor.preprocess(setterAst,!0),setterVariables=preprocessor.getVariables(),Fashion.apply(allVariables,setterVariables),preprocessor.variables=allVariables,newContext.dynamicsMap=preprocessor.getDynamicsMap(),sortedAst=preprocessor.getSortedDynamicAstNodes(),settersCode=newContext.transpiler.transpile(sortedAst),newContext.runtime.setCaches(newContext.transpiler);var origGet=runtime.constructor.prototype.get,origRegistered=runtime.registered,origFunctions=runtime.functions,registered=origRegistered,functions=origFunctions,called={},read={};runtime.registered=me.instrumentObject(registered,called,!1),runtime.functions=me.instrumentObject(functions,called,!0),runtime.constructor.prototype.get=function(name){var result=origGet.apply(this,arguments),jsName=Fashion.getJsName(name).replace(/^\$/,"");return variables[jsName]||(read[jsName]={name:jsName,variable:result}),result},newContext.runtime.copyRuntimeState(runtime),settersFunc=newContext.compile(settersCode),settersFunc(newContext.runtime,null,newContext.dynamicsMap),runtime.registered=origRegistered,runtime.functions=origFunctions,runtime.constructor.prototype.get=origGet;var keys=Object.getOwnPropertyNames(read);if(keys.length){for(var k=0;k<keys.length;k++){var key=keys[k];variables[key]=read[key]}return me.buildExportFn(variables)}var registered=[],functions=[];Object.getOwnPropertyNames(called).forEach(function(key){var value=called[key],func=called[key].func,fn=func+"";fn=fn.replace(/^.*?\(/g," function ("),value.isFn?functions.push(" "+key+": "+fn):registered.push(" "+key+": "+fn)});var fnPrefix="(function(Fashion){\n\tvar __udf = undefined,\n\t Types = Fashion.Types,\n\t __strings = {},\n\n\t __names = Fashion.css.buildNames(__strings),\n\n\t __jsNames = Fashion.css.buildJsNames(__strings);\n";fnPrefix+=runtime.createTypesBlock(ExportTypes);var fnBody=fnPrefix+"\n\tFashion.css.register(function(__rt) {\n";return fnBody+="__rt.register({\n",fnBody+=registered.join(",\n"),fnBody+="\n});\n",fnBody+=runtime.createMethodBlock(ExportRuntime.prototype),fnBody+=runtime.createPropertyBlock(),fnBody+="Fashion.apply(__rt.functions, {\n",fnBody+=functions.join(",\n").replace(/__rt\.registered/,"__rt_registered").replace(/__rt\.functions/,"__rt_functions").replace(/__rt\.mixins/,"__rt_mixins"),fnBody+="\n});\n",fnBody+="},\n",fnBody+=" function(__rt) {\n",fnBody+=runtime.createMethodBlock(ExportRuntime.prototype),fnBody+=runtime.createPropertyBlock(),fnBody+=settersCode.replace(/__rt\.registered/,"__rt_registered").replace(/__rt\.functions/,"__rt_functions").replace(/__rt\.mixins/,"__rt_mixins")+"\n",fnBody+="},\n"}},{key:"createSettersAst",value:function(exportedVariables){var setters=[];return Object.getOwnPropertyNames(exportedVariables).forEach(function(key){var ast,exported=exportedVariables[key],value=exported.variable;value.$isWrapper&&(value=value.value),ast=value.ast,ast&&setters.push(new Nodes.VariableAssignment(null,"$"+exported.name,ast))}),setters}},{key:"buildExportFunction",value:function(exportedVariables,runtime){var fnBody,keys,i,j,rs,selector,setters,setter,vars,variable,entry,me=this,selectorMap={};for(me.runtime=runtime,fnBody=me.buildExportFn(exportedVariables),keys=Object.getOwnPropertyNames(exportedVariables),i=0;i<keys.length;i++){var key=keys[i],exported=exportedVariables[key],rulesets=exported.rulesets;for(!rulesets&&me.defaultRuleset&&(rulesets=[me.defaultRuleset]),j=0;j<rulesets.length;j++)rs=rulesets[j],selector=Fashion.SourceBuilder.toSource(rs.selectors),entry=selectorMap[selector]||(selectorMap[selector]={vars:[],name:exported.name}),entry.vars.push(exported)}for(keys=Object.getOwnPropertyNames(selectorMap),fnBody+=" {\n",setters=[],i=0;i<keys.length;i++){for(setter="",key=keys[i],entry=selectorMap[key],vars=entry.vars,setter+="\t"+JSON.stringify(key)+": [\n",j=0;j<vars.length;j++)j>0&&(setter+=",\n"),variable=vars[j],setter+="\t\t"+JSON.stringify(variable.name);setter+="\n\t]",setters.push(setter)}fnBody+=setters.join(",\n"),fnBody+="});\n})(Fashion);";for(var name,jsName,match,keys=[],regex=/__rt_set\("(.+?)"/g;match=regex.exec(fnBody);)keys.push(match[1]);keys.sort(function(a,b){return a.length-b.length});for(var prefix,strings={},map={},idGen=new IndexGenerator,i=0;i<keys.length;i++)if(key=keys[i],!map[key]){map[key]=!0,prefix=idGen.next(),strings[prefix]=key,name=CssVariableManager.buildName(key),jsName=CssVariableManager.buildJsName(key);var keyRx=RegExp('"\\'+key+"\"|'\\"+key+"'","g"),nameRx=RegExp('"'+name+"\"|'"+name+"'","g"),jsNameRx=RegExp('"\\'+jsName+"\"|'\\"+jsName+"'","g");fnBody=fnBody.replace(keyRx,"__strings."+prefix).replace(nameRx,"__names."+prefix).replace(jsNameRx,"__jsNames."+prefix)}return map=JSON.stringify(strings,null,4),map=map.replace(/"(.*?)":(.*?)(,?)/g,"$1:$2$3"),fnBody=fnBody.replace("__strings = {},","__strings = "+map+",")}}]),ExportBuilder}();module.exports=ExportBuilder},{"../Preprocessor.js":13,"../export/Base.js":19,"../export/Runtime.js":21,"../export/css/CssVariableManager.js":22,"../export/type/Types.js":42,"../parse/ast/Nodes.js":60}],64:[function(require,module,exports){var SelectorList=require("../type/selectors/SelectorList.js");module.exports={init:function(runtime){function register(){registered||(registered=!0,runtime.registerProcessor({runHooks:function(obj,hooks){if(hooks)for(var h=0;h<hooks.length;h++)hooks[h].call(this,obj,this.context)},functioncall:function(obj){this.runHooks(obj,functionCallHooks[obj.name])},declaration:function(obj){this.runHooks(obj,styleHooks[obj.property]),obj.descend(this)},ruleset:function(obj){var me=this;me.currRuleset=obj;for(var selectors=obj.selectors,selectorsStr=""+selectors,len=toPrune.length,filter=void 0,i=0;i<len;i++)if(filter=toPrune[i],filter.test(selectorsStr)){if(selectors.$isFashionSelectorPart||selectors.$isFashionMultiPartSelector||selectors.$isFashionCompoundSelector)obj.selectors=null;else if(selectors.$isFashionSelectorList){selectors=selectors.items;for(var j=selectors.length-1;j>=0;j--)filter.test(""+selectors[j])&&selectors.splice(j--,1);if(0==selectors.length)obj.selectors=null;else{if(1==selectors.length){selectors=obj.selectors=selectors[0],selectorsStr=""+selectors;continue}obj.selectors=new SelectorList(selectors)}}break}null!=obj.selectors&&(me.visit(obj.selectors),obj.isAtRule()&&me.runHooks(obj,atRuleHooks[obj.getFirstSelectorStr()]),me.visit(obj.declarations),me.visit(obj.children)),me.currRuleset=null},selector:function(obj){this.runHooks(this.currRuleset,selectorHooks[""+obj])},execute:function(obj,ctx){this.context=ctx,this.visit(obj),this.context=null}}))}function registerHooks(map,obj){register();var hooks;for(var key in obj)hooks=map[key],hooks||(hooks=map[key]=[]),hooks.push(obj[key])}var selectorHooks={},styleHooks={},atRuleHooks={},functionCallHooks={},toPrune=[],registered=!1;runtime.registerSelectorHooks=function(obj){registerHooks(selectorHooks,obj)},runtime.registerAtRuleHook=function(obj){registerHooks(atRuleHooks,obj)},runtime.registerStyleHooks=function(obj){registerHooks(styleHooks,obj)},runtime.registerFunctionCallHooks=function(obj){registerHooks(functionCallHooks,obj)},null!=runtime.context.getConfig("prune")&&(toPrune=runtime.context.getConfig("prune").map(function(s){return s=s.replace(/[\-\[\]/{}()*+?.\\\^$|]/g,"\\$&"),RegExp("^"+s+"$|"+s+"\\b")}),register())}}},{"../type/selectors/SelectorList.js":74}],65:[function(require,module,exports){var Fashion=require("../export/Base.js"),Type=require("./../export/type/Type.js"),Declaration=function(_Type11){function Declaration(cfg){_classCallCheck(this,Declaration);var _this94=_possibleConstructorReturn(this,(Declaration.__proto__||Object.getPrototypeOf(Declaration)).call(this));return cfg&&Fashion.apply(_this94,cfg),_this94}return _inherits(Declaration,_Type11),_createClass(Declaration,[{key:"doVisit",value:function(visitor){visitor.declaration(this)}},{key:"descend",value:function(visitor){visitor.visit(this.value)}},{key:"copy",value:function(){return new Declaration({property:this.property,important:this.important,sourceInfo:this.sourceInfo,value:this.value.clone()})}},{key:"clone",value:function(match,replace){return replace&&this.matches(match)?replace.clone():new Declaration({property:this.property,important:this.important,sourceInfo:this.sourceInfo,ruleset:this.ruleset,value:this.value.clone(match,replace)})}}]),Declaration}(Type);Fashion.apply(Declaration.prototype,{type:"declaration",$isFashionDeclaration:!0,$canUnbox:!1,property:null,value:null,important:null,sourceInfo:null,ruleset:null}),module.exports=Declaration},{"../export/Base.js":19,"./../export/type/Type.js":40}],66:[function(require,module,exports){var Fashion=require("../export/Base.js"),Type=require("./../export/type/Type.js"),MultiPartSelector=require("./selectors/MultiPartSelector.js"),SelectorList=require("./selectors/SelectorList.js"),Ruleset=function(_Type12){function Ruleset(cfg){_classCallCheck(this,Ruleset);var _this95=_possibleConstructorReturn(this,(Ruleset.__proto__||Object.getPrototypeOf(Ruleset)).call(this));return cfg&&Fashion.apply(_this95,cfg),_this95.children=[],_this95.selectors=_this95.selectors||new SelectorList([]),_this95.declarations=_this95.declarations||[],_this95}return _inherits(Ruleset,_Type12),_createClass(Ruleset,[{key:"doVisit",value:function(visitor){visitor.ruleset(this)}},{key:"descend",value:function(visitor){visitor.visit(this.selectors),visitor.visit(this.declarations),visitor.visit(this.children)}},{key:"addDeclaration",value:function(declaration,index){declaration.ruleset=this,void 0===index?this.declarations.push(declaration):this.declarations.splice(index,0,declaration)}},{key:"getDeclarationIndex",value:function(decl){for(var i=0;i<this.declarations.length;i++)if(this.declarations[i]===decl)return i;return-1}},{key:"removeDeclaration",value:function(decl){this.declarations=Fashion.filter(this.declarations,function(d){return d!==decl})}},{key:"lastDeclaration",value:function(){return this.declarations.length&&this.declarations[this.declarations.length-1]||null}},{key:"addChildRuleset",value:function(ruleset){this.children.push(ruleset)}},{key:"removeChildRuleset",value:function(child){this.children=Fashion.filter(this.children,function(item){return item!==child})}},{key:"getFirstSelector",value:function(){var selectors=this.selectors;return selectors instanceof SelectorList&&(selectors=selectors.items[0]),selectors instanceof MultiPartSelector&&(selectors=selectors.items[0]),selectors}},{key:"getFirstSelectorStr",value:function(){return void 0===this._firstSelectorStr&&(this._firstSelectorStr=this.getFirstSelector()+""),this._firstSelectorStr}},{key:"isAtRule",value:function(){return 0===this.getFirstSelectorStr().indexOf("@")}},{key:"isMedia",value:function(){return 0===this.getFirstSelectorStr().indexOf("@media")}},{key:"isKeyFrames",value:function(){return 0===this.getFirstSelectorStr().indexOf("@keyframes")||0===this.getFirstSelectorStr().indexOf("@-webkit-keyframes")}},{key:"isPage",value:function(){return this.isAtRule()&&0===this.getFirstSelectorStr().indexOf("@page")}},{key:"isAtRoot",value:function(){return this.isAtRule()&&0===this.getFirstSelectorStr().indexOf("@at-root")}},{key:"isDirective",value:function(){return this.isAtRule()&&!this.isMedia()&&0===this.declarations.length&&0===this.children.length}},{key:"printAtRoot",value:function(){return this.isMedia()||this.isAtRoot()}}]),Ruleset}(Type);Fashion.apply(Ruleset.prototype,{type:"ruleset",$isFashionRuleset:!0,$canUnbox:!1,declarations:null,selectors:null,sourceInfo:null,blockDocs:null,parent:null,isNamespaced:null,children:null,extend:null,isAtDirective:null,atDirectiveName:null,atDirectiveValue:null,isMediaRoot:null,hasBlock:null,_firstSelectorStr:void 0}),module.exports=Ruleset},{"../export/Base.js":19,"./../export/type/Type.js":40,"./selectors/MultiPartSelector.js":73,"./selectors/SelectorList.js":74}],67:[function(require,module,exports){var Fashion=require("../export/Base.js"),BaseSourceBuilder=(require("./TypeVisitor.js"),require("../export/Output.js"),require("../export/type/SourceBuilder.js")),SourceBuilder=function(_BaseSourceBuilder){function SourceBuilder(cfg){_classCallCheck(this,SourceBuilder);var _this96=_possibleConstructorReturn(this,(SourceBuilder.__proto__||Object.getPrototypeOf(SourceBuilder)).call(this,cfg));return _this96.nullFound=!1,_this96}return _inherits(SourceBuilder,_BaseSourceBuilder),_createClass(SourceBuilder,[{key:"selectorlist",value:function(obj){var i,items=obj.items,len=items.length,output=this.output;for(i=0;i<len;i++)this.visit(items[i]),i<len-1&&(output.add(","),output.addln(),this.selectorCount++)}},{key:"selectorproperty",value:function(obj){this.visit(obj.property),this.output.add(": "),this.visit(obj.value)}},{key:"multipartselector",value:function(obj){this.list(obj)}},{key:"compoundselector",value:function(obj){this.list(obj.sort())}},{key:"selector",value:function(obj){var parentSelector=obj.parent,output=this.output;switch(obj.selectorType){case"parent":if(parentSelector)return this.visit(parent),!1;this.visit(obj.value);break;case"placeholder":output.add("%"),this.visit(obj.value);break;case"dash":output.add("-"),this.visit(obj.value);break;case"attribute":output.add("["),this.visit(obj.value),output.add("]");break;case"pseudo":output.add(":"),this.visit(obj.value);break;default:this.visit(obj.value)}}},{key:"declaration",value:function(obj){var prev,output=this.output,currDeclarationWas=this.currDeclaration,start=output.output,nullFoundWas=this.nullFound;if(obj.docs&&obj.docs.length)for(var d=0;d<obj.docs.length;d++)output.addCommentLn(obj.docs[d]);this.currDeclaration=obj,output.addln(),output.add(obj.property),output.add(":"),output.space(),prev=output.output.length,this.nullFound=!1,this.visit(obj.value),this.nullFound||output.output.length===prev&&0!==obj.property.indexOf("--")?output.output=start:(obj.important&&output.add(" !important"),output.isCompressed?obj.ruleset&&obj===obj.ruleset.lastDeclaration()||output.add(";"):output.add(";")),this.nullFound=nullFoundWas,this.currDeclaration=currDeclarationWas}},{key:"ruleset",value:function(obj){var emptyStart,output=this.output,start=output.output;if(obj.isAtDirective)return output.addln(),output.add(obj.atDirectiveName),output.add(" "),void(obj.atDirectiveValue?(this.visit(obj.atDirectiveValue),output.add(";")):output.add("{}"));if(obj.selectors){if(output.addln(),obj.sourceInfo&&(output.addComment("/* "+obj.sourceInfo+" */"),output.addln()),obj.docs&&obj.docs.length)for(var d=0;d<obj.docs.length;d++)output.addCommentLn(obj.docs[d]);if(this.selectorCount++,this.visit(obj.selectors),obj.isAtRule()&&0===obj.declarations.length&&0===obj.children.length&&!obj.hasBlock)return void output.add(";");output.space(),output.add("{"),output.indent(),emptyStart=output.output.length,this.visit(obj.declarations),obj.isAtRule()&&!obj.isAtRoot()?(this.visit(obj.children),output.unindent(),output.addln("}")):(output.unindent(),output.output.length===emptyStart?output.output=start:output.addln("}"),this.visit(obj.children))}}},{key:"visit",value:function(obj){null==obj||obj.$isFashionNull?this.nullFound=!0:_get(SourceBuilder.prototype.__proto__||Object.getPrototypeOf(SourceBuilder.prototype),"visit",this).call(this,obj)}}]),SourceBuilder}(BaseSourceBuilder);SourceBuilder.toSource=function(obj,output){var sb=new SourceBuilder;return sb.toSource(obj,output)},Fashion.apply(SourceBuilder.prototype,{output:null,selectorCount:0,currDeclaration:null}),module.exports=SourceBuilder},{"../export/Base.js":19,"../export/Output.js":20,"../export/type/SourceBuilder.js":37,"./TypeVisitor.js":68}],68:[function(require,module,exports){var BaseTypeVisitor=require("../export/type/TypeVisitor.js"),TypeVisitor=function(_BaseTypeVisitor){function TypeVisitor(cfg){return _classCallCheck(this,TypeVisitor),_possibleConstructorReturn(this,(TypeVisitor.__proto__||Object.getPrototypeOf(TypeVisitor)).call(this,cfg))}return _inherits(TypeVisitor,_BaseTypeVisitor),_createClass(TypeVisitor,[{key:"selector",value:function(obj){obj.descend(this)}},{key:"selectorproperty",value:function(obj){obj.descend(this)}},{key:"compoundselector",value:function(obj){obj.descend(this)}},{key:"multipartselector",value:function(obj){obj.descend(this)}},{key:"selectorlist",value:function(obj){obj.descend(this)}},{key:"declaration",value:function(obj){obj.descend(this)}},{key:"ruleset",value:function(obj){obj.descend(this)}}]),TypeVisitor}(BaseTypeVisitor);TypeVisitor.prototype.context=null,module.exports=TypeVisitor},{"../export/type/TypeVisitor.js":41}],69:[function(require,module,exports){var Fashion=require("../export/Base.js"),BaseTypes=require("../export/type/Types.js"),Types=Fashion.apply(BaseTypes,{Ruleset:require("./Ruleset.js"),Declaration:require("./Declaration.js"),SelectorPart:require("./selectors/SelectorPart.js"),CompoundSelector:require("./selectors/CompoundSelector.js"),MultiPartSelector:require("./selectors/MultiPartSelector.js"),SelectorList:require("./selectors/SelectorList.js"),SelectorProperty:require("./selectors/SelectorProperty.js")});module.exports=Types},{"../export/Base.js":19,"../export/type/Types.js":42,"./Declaration.js":65,"./Ruleset.js":66,"./selectors/CompoundSelector.js":72,"./selectors/MultiPartSelector.js":73,"./selectors/SelectorList.js":74,"./selectors/SelectorPart.js":75,"./selectors/SelectorProperty.js":76}],70:[function(require,module,exports){var Fashion=require("../../export/Base.js"),Type=require("../../export/type/Type.js"),BaseSelector=function(_Type13){function BaseSelector(){return _classCallCheck(this,BaseSelector),_possibleConstructorReturn(this,(BaseSelector.__proto__||Object.getPrototypeOf(BaseSelector)).call(this))}return _inherits(BaseSelector,_Type13),_createClass(BaseSelector,[{key:"clone",value:function(match,replace){if(match&&match===""+this)return replace.clone();var cloned=_get(BaseSelector.prototype.__proto__||Object.getPrototypeOf(BaseSelector.prototype),"clone",this).call(this);return this.parent&&cloned.setParent(this.parent.clone(match,replace)),cloned}},{key:"hasHash",value:function(hash){return""+this===hash}},{key:"setParent",value:function(parent){this.parent=parent}}]),BaseSelector}(Type);Fashion.apply(BaseSelector.prototype,{parent:null,position:null,$canUnbox:!1,skipParentPrepend:null}),module.exports=BaseSelector},{"../../export/Base.js":19,"../../export/type/Type.js":40}],71:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseSelector=require("./BaseSelector.js"),BaseSelectorList=function(_BaseSelector){function BaseSelectorList(items,separator){_classCallCheck(this,BaseSelectorList);var _this99=_possibleConstructorReturn(this,(BaseSelectorList.__proto__||Object.getPrototypeOf(BaseSelectorList)).call(this));return _this99.items=items,_this99.separator=separator,_this99}return _inherits(BaseSelectorList,_BaseSelector),_createClass(BaseSelectorList,[{key:"toString",value:function(){return this.items.join(this.separator)}},{key:"cloneItems",value:function(match,replace){for(var cloned=[],i=0;i<this.items.length;i++)cloned.push(this.items[i].clone(match,replace));return cloned}},{key:"unquote",value:function(){for(var items=[],i=0;i<this.items.length;i++)this.items[i]&&items.push(this.items[i].unquote());return new List(items,this.separator)}},{key:"_getHash",value:function(){for(var item,items=[],tItems=this.items,i=0;i<tItems.length;i++)item=tItems[i],items.push(item&&item.getHash()||"");return items=items.sort(),items.join(this.separator)}},{key:"setItems",value:function(items){this.items=items,this._hash=null}}]),BaseSelectorList}(BaseSelector);Fashion.apply(BaseSelectorList.prototype,{separator:null,$isFashionBaseSelectorList:!0}),Fashion.mixin(BaseSelectorList,Fashion.BaseSet),module.exports=BaseSelectorList},{"../../export/Base.js":19,"./BaseSelector.js":70}],72:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseSelector=require("./BaseSelector.js"),BaseSelectorList=require("./BaseSelectorList.js"),SelectorPart=require("./SelectorPart.js"),Literal=require("../../export/type/Literal.js"),CompoundSelector=function(_BaseSelector2){function CompoundSelector(items,preserve){_classCallCheck(this,CompoundSelector);var _this100=_possibleConstructorReturn(this,(CompoundSelector.__proto__||Object.getPrototypeOf(CompoundSelector)).call(this));return _this100.items=items,_this100.preserve=preserve,_this100._superSelectorMap={},_this100}return _inherits(CompoundSelector,_BaseSelector2),_createClass(CompoundSelector,[{key:"doVisit",value:function(visitor){visitor.compoundselector(this)}},{key:"descend",value:function(visitor){for(var i=0;i<this.items.length;i++){var item=this.items[i];item&&visitor.visit(item)}}},{key:"cloneItems",value:function(match,replace){for(var cloned=[],i=0;i<this.items.length;i++)cloned.push(this.items[i].clone(match,replace));return cloned}},{key:"clone",value:function(match,replace){if(match&&match===""+this)return replace.clone();var cloned=new CompoundSelector(this.cloneItems(match,replace));return this.parent&&cloned.setParent(this.parent.clone(match,replace)),cloned}},{key:"setItems",value:function(items){this.items=items,this._hash=null}},{key:"toString",value:function(){return this.items.join("")}},{key:"hasPlaceholder",value:function(){for(var i=0;i<this.items.length;i++){var item=this.items[i];if(item instanceof SelectorPart&&"placeholder"===item.selectorType)return!0}if(this.parent){var parent=this.parent;return parent.hasPlaceholder&&parent.hasPlaceholder()}return!1}},{key:"flatten",value:function(){if(!this.flattened){this.flattened=!0;for(var flattened=[],map={},i=0;i<this.items.length;i++){var item=this.items[i];if(item instanceof CompoundSelector)for(var sel=item,selItems=sel.flatten()&&sel.items,s=0;s<selItems.length;s++){var sItem=selItems[s];sItem.position=flattened.length,map[""+sItem]||(flattened.push(sItem),map[""+sItem]=!0)}else if(item instanceof BaseSelectorList){var list=item;if(1==list.items.length){var sItem=list.items[0];sItem.position=flattened.length,map[""+sItem]||(flattened.push(sItem),map[""+sItem]=!0)}else{var sItem=item;item.position=flattened.length,map[""+sItem]||(flattened.push(sItem),map[""+sItem]=!0)}}else{var sItem=item;sItem.position=flattened.length,(!map[""+sItem]||item.$isFashionLiteral||item.$isFashionNumber)&&(flattened.push(sItem),map[""+sItem]=!0)}}this.items=flattened}return this._hash=null,this}},{key:"sort",value:function(){return this.sorted||(this.sorted=!0,this.flatten(),this.items.sort(function(a,b){var aPart,bPart,aIsPart=a instanceof SelectorPart,bIsPart=b instanceof SelectorPart,aIsSelector=a instanceof BaseSelector,bIsSelector=b instanceof BaseSelector,aVal=""+a,bVal=""+b;if(CompoundSelector.excludeSortOps[aVal]||CompoundSelector.excludeSortOps[bVal])return a.position-b.position;if(bIsSelector){if(!aIsSelector){if(a instanceof Fashion.Literal&&0===(""+a).indexOf("-"))return 1;if(!CompoundSelector.excludeSortOps[bVal])return-1}if(bIsPart){if(!aIsPart)return-1;aPart=a,bPart=b;var res=aPart.getTypePriority()-bPart.getTypePriority();return 0===res?aPart.position-bPart.position:res}if(aIsPart)return 1}else if(aIsSelector&&!CompoundSelector.excludeSortOps[aVal])return 1;return a.position-b.position})),this._hash=null,this}},{key:"base",value:function(){var first=this.first();return first instanceof Literal?first:first instanceof SelectorPart&&"wildcard"===first.selectorType?first:null}},{key:"_getHash",value:function(){for(var base=this.base(),rest=this.rest(),parts=[],r=0;r<rest.length;r++)parts.push(rest[r].getHash());return parts=parts.sort(),base&&parts.unshift(base.getHash()),parts.join("")}},{key:"rest",value:function rest(){var base=this.base(),rest=Fashion.filter(this.items,function(item){return!base||item!==base});return rest}},{key:"isSuperSelector",value:function(selector){var key=selector,map=this._superSelectorMap,result=map[key];return void 0===result&&(result=this.isSubset(selector),map[key]=result),result}},{key:"isSubset",value:function(selector){var item,items=this.items,sItems=selector.items,longItemMap={},shortList=items,longList=sItems,res=1;items.length>sItems.length&&(shortList=sItems,longList=items,res=-1);for(var i=0;i<longList.length;i++)item=longList[i],longItemMap[""+item]=item;for(var i=0;i<shortList.length;i++)if(item=shortList[i],!longItemMap[""+item])return 0;return res}}]),CompoundSelector}(BaseSelector);CompoundSelector.excludeSortOps={"&":!0,"*":!0,"~":!0,">":!0,"|":!0,"+":!0},Fashion.mixin(CompoundSelector,Fashion.BaseSet),Fashion.apply(CompoundSelector.prototype,{type:"compoundselector",$isFashionCompoundSelector:!0,$canUnbox:!1,items:null,preserve:!1,flattened:!1,sorted:!1,_superSelectorMap:null}),module.exports=CompoundSelector},{"../../export/Base.js":19,"../../export/type/Literal.js":32,"./BaseSelector.js":70,"./BaseSelectorList.js":71,"./SelectorPart.js":75}],73:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseSelectorList=require("./BaseSelectorList.js"),MultiPartSelector=function(_BaseSelectorList){function MultiPartSelector(items,parent){_classCallCheck(this,MultiPartSelector);var _this101=_possibleConstructorReturn(this,(MultiPartSelector.__proto__||Object.getPrototypeOf(MultiPartSelector)).call(this,items," "));return parent&&_this101.setParent(parent),_this101._superSelectorMap={},_this101}return _inherits(MultiPartSelector,_BaseSelectorList),_createClass(MultiPartSelector,[{key:"doVisit",value:function(visitor){visitor.multipartselector(this)}},{key:"descend",value:function(visitor){for(var i=0;i<this.items.length;i++){var item=this.items[i];item&&visitor.visit(item)}}},{key:"clone",value:function(match,replace){if(match&&match===""+this)return replace.clone();var cloned=new MultiPartSelector(this.cloneItems(match,replace));return this.parent&&cloned.setParent(this.parent.clone(match,replace)),cloned.skipParentPrepend=this.skipParentPrepend,cloned}},{key:"calcIsSuperSelector",value:function(selector){var tmpRes,items=this.items,sItems=selector.items,shortList=items,longList=sItems,res=1;if(items.length>sItems.length&&(shortList=sItems,longList=items,res=-1),this.parent){if(!selector.parent)return 0;if(tmpRes=this.parent.isSuperSelector(selector.parent),res!==tmpRes)return 0}else if(selector.parent)return 0;for(var i=0;i<shortList.length;i++){var tmpRes;if(0===tmpRes)return 0;if(tmpRes!==res)return 0}return res}},{key:"isSuperSelector",value:function(selector){var key=selector,map=this._superSelectorMap,result=map[key];return void 0===result&&(result=this.calcIsSuperSelector(selector),map[key]=result),result}},{key:"removeAtRoot",value:function(){var items=Fashion.filter(this.items,function(item){return""+item!="@at-root"});return items.length?(this.items=items,this):null}},{key:"flatten",value:function(){for(var item,items=this.items,len=items.length,newItems=[],i=0;i<len;i++){for(item=items[i];item&&item.visitTarget;)item=item.visitTarget;item&&(item.$isFashionMultiPartSelector?newItems.push.apply(newItems,item.flatten()):(item.$isFashionCompoundSelector&&item.flatten(),newItems.push(item)))}return this.items=newItems,newItems}}]),MultiPartSelector}(BaseSelectorList);Fashion.apply(MultiPartSelector.prototype,{$isFashionMultiPartSelector:!0,type:"multipartselector",parent:null,_superSelectorMap:null}),module.exports=MultiPartSelector},{"../../export/Base.js":19,"./BaseSelectorList.js":71}],74:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseSelectorList=require("./BaseSelectorList.js"),SelectorList=function(_BaseSelectorList2){function SelectorList(list){return _classCallCheck(this,SelectorList),_possibleConstructorReturn(this,(SelectorList.__proto__||Object.getPrototypeOf(SelectorList)).call(this,list,","))}return _inherits(SelectorList,_BaseSelectorList2),_createClass(SelectorList,[{key:"doVisit",value:function(visitor){visitor.selectorlist(this)}},{key:"descend",value:function(visitor){for(var i=0;i<this.items.length;i++){var item=this.items[i];item&&visitor.visit(item)}}},{key:"clone",value:function(match,replace){var cloned=new SelectorList(this.cloneItems());return this.parent&&cloned.setParent(this.parent.clone(match,replace)),cloned}},{key:"applyInterpolations",value:function(){if(!this.interpolated){this.interpolated=!0;for(var selector,str,items,interpolated=[],selectors=this.items,s=0;s<selectors.length;s++)selector=selectors[s],str=""+selector,str.indexOf(",")===-1?interpolated.push(selector):(items=str.split(","),interpolated.push.apply(interpolated,items));this.items=interpolated}}},{key:"flatten",value:function(){for(var item,items=this.items,len=items.length,newItems=[],i=0;i<len;i++){for(item=items[i];item&&item.visitTarget;)item=item.visitTarget;item.$isFashionSelectorList?newItems.push.apply(newItems,item.flatten()):((item.$isFashionMultiPartSelector||item.$isFashionCompoundSelector)&&item.flatten(),newItems.push(item))}return this.items=newItems,newItems}}]),SelectorList}(BaseSelectorList);Fashion.apply(SelectorList.prototype,{
$isFashionSelectorList:!0,type:"selectorlist",ruleset:null,interpolated:null}),module.exports=SelectorList},{"../../export/Base.js":19,"./BaseSelectorList.js":71}],75:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseSelector=require("./BaseSelector.js"),SelectorPart=function(_BaseSelector3){function SelectorPart(value,type){_classCallCheck(this,SelectorPart);var _this103=_possibleConstructorReturn(this,(SelectorPart.__proto__||Object.getPrototypeOf(SelectorPart)).call(this));return _this103.value=value,_this103.selectorType=type,_this103}return _inherits(SelectorPart,_BaseSelector3),_createClass(SelectorPart,[{key:"doVisit",value:function(visitor){visitor.selector(this)}},{key:"descend",value:function(visitor){this.value&&visitor.visit(this.value)}},{key:"toString",value:function(){switch(this.selectorType){case"placeholder":return"%"+this.value;case"dash":return"-"+this.value;case"attribute":return"["+this.value+"]";case"pseudo":return":"+this.value;default:return""+this.value}}},{key:"clone",value:function(match,replace){if(match&&match===""+this)return replace.clone();var cloned=new SelectorPart(this.value,this.selectorType);return this.parent&&cloned.setParent(this.parent.clone(match,replace)),"parent"==this.selectorType&&this.visitTarget&&(cloned.visitTarget=this.visitTarget),cloned}},{key:"getTypePriority",value:function(){switch(this.selectorType){case"class":return 0;case"id":return 1;case"pseudo":var str=""+this.value;return 0===str.indexOf(":")?21:0===str.indexOf("not")?19:20;case"attribute":return 0;case"placeholder":return-100;default:return-50}}}]),SelectorPart}(BaseSelector);Fashion.apply(SelectorPart.prototype,{type:"selector",$isFashionSelectorPart:!0,value:null,selectorType:null}),module.exports=SelectorPart},{"../../export/Base.js":19,"./BaseSelector.js":70}],76:[function(require,module,exports){var Fashion=require("../../export/Base.js"),BaseSelector=require("./BaseSelector.js"),SelectorProperty=function(_BaseSelector4){function SelectorProperty(property,value){_classCallCheck(this,SelectorProperty);var _this104=_possibleConstructorReturn(this,(SelectorProperty.__proto__||Object.getPrototypeOf(SelectorProperty)).call(this));return _this104.property=property,_this104.value=value,_this104}return _inherits(SelectorProperty,_BaseSelector4),_createClass(SelectorProperty,[{key:"toString",value:function(){return""+this.property+": "+this.value}},{key:"doVisit",value:function(visitor){visitor.selectorproperty(this)}},{key:"descend",value:function(visitor){this.value&&visitor.visit(this.value)}}]),SelectorProperty}(BaseSelector);Fashion.apply(SelectorProperty.prototype,{type:"selectorproperty",property:null,value:null}),module.exports=SelectorProperty},{"../../export/Base.js":19,"./BaseSelector.js":70}]},{},[1])(1)});