!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=u,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=n(e.next()),"string"):(t.tokenizer=n(")",!1),"string")}function r(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=u,u(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=u):r.skipToEnd(),"comment")}}function n(e,t){function r(n,i){var a=n.next(),f=n.peek(),c=n.string.charAt(n.pos-2);return"\\"!==a&&f===e||a===e&&"\\"!==c?(a!==e&&t&&n.next(),i.tokenizer=u,"string"):"#"===a&&"{"===f?(i.tokenizer=o(r),n.next(),"operator"):"string"}return null==t&&(t=!0),r}function o(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):u(t,r)}}function i(t){if(0==t.indentCount){t.indentCount++;var r=t.scopes[0].offset,n=r+e.indentUnit;t.scopes.unshift({offset:n})}}function a(e){1!=e.scopes.length&&e.scopes.shift()}function u(e,f){var c=e.peek();if(e.match("/*"))return f.tokenizer=r(e.indentation(),!0),f.tokenizer(e,f);if(e.match("//"))return f.tokenizer=r(e.indentation(),!1),f.tokenizer(e,f);if(e.match("#{"))return f.tokenizer=o(u),"operator";if('"'===c||"'"===c)return e.next(),f.tokenizer=n(c),"string";if(f.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(f.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(f.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(f.cursorHalf=0),"unit";if(e.match(s))return e.peek()||(f.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return f.tokenizer=t,e.peek()||(f.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(f.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(f.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(m))return e.peek()||(f.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(f.cursorHalf=0),"attribute";if(!e.peek())return f.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return i(f),"atom";if("#"===e.peek())return i(f),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return i(f),"atom";if("#"===e.peek())return i(f),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(s))return"keyword";if(e.match(/^url/)&&"("===e.peek())return f.tokenizer=t,"atom";if("="===c&&e.match(/^=[\w-]+/))return i(f),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||a(f)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return i(f),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"propery":e.match(/ *:/,!1)?(i(f),f.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(i(f),"atom");if(":"===c)return e.match(l)?"keyword":(e.next(),f.cursorHalf=1,"operator")}return e.match(m)?"operator":(e.next(),null)}function f(t,r){t.sol()&&(r.indentCount=0);var n=r.tokenizer(t,r),o=t.current();if("@return"!==o&&"}"!==o||a(r),null!==n){for(var i=t.pos-o.length,u=i+e.indentUnit*r.indentCount,f=[],c=0;c<r.scopes.length;c++){var s=r.scopes[c];s.offset<=u&&f.push(s)}r.scopes=f}return n}var c=["true","false","null","auto"],s=new RegExp("^"+c.join("|")),p=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],m=function(e){return new RegExp("^"+e.join("|"))}(p),l=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:u,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=f(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")});