This repository has been archived by the owner on Mar 13, 2023. It is now read-only.
/
emmet.js
14 lines (14 loc) · 135 KB
/
emmet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var _=(function(){var v=this;var j=v._;var D={};var C=Array.prototype,f=Object.prototype,q=Function.prototype;var m=C.slice,z=C.unshift,c=f.toString,h=f.hasOwnProperty;var L=C.forEach,o=C.map,E=C.reduce,b=C.reduceRight,a=C.filter,A=C.every,n=C.some,l=C.indexOf,k=C.lastIndexOf,s=Array.isArray,e=Object.keys,F=q.bind;var M=function(p){return new t(p)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=M}exports._=M}else{v._=M}M.VERSION="1.3.3";var I=M.each=M.forEach=function(R,Q,P){if(R==null){return}if(L&&R.forEach===L){R.forEach(Q,P)}else{if(R.length===+R.length){for(var O=0,p=R.length;O<p;O++){if(O in R&&Q.call(P,R[O],O,R)===D){return}}}else{for(var N in R){if(M.has(R,N)){if(Q.call(P,R[N],N,R)===D){return}}}}}};M.map=M.collect=function(P,O,N){var p=[];if(P==null){return p}if(o&&P.map===o){return P.map(O,N)}I(P,function(S,Q,R){p[p.length]=O.call(N,S,Q,R)});if(P.length===+P.length){p.length=P.length}return p};M.reduce=M.foldl=M.inject=function(Q,P,p,O){var N=arguments.length>2;if(Q==null){Q=[]}if(E&&Q.reduce===E){if(O){P=M.bind(P,O)}return N?Q.reduce(P,p):Q.reduce(P)}I(Q,function(T,R,S){if(!N){p=T;N=true}else{p=P.call(O,p,T,R,S)}});if(!N){throw new TypeError("Reduce of empty array with no initial value")}return p};M.reduceRight=M.foldr=function(Q,P,p,O){var N=arguments.length>2;if(Q==null){Q=[]}if(b&&Q.reduceRight===b){if(O){P=M.bind(P,O)}return N?Q.reduceRight(P,p):Q.reduceRight(P)}var R=M.toArray(Q).reverse();if(O&&!N){P=M.bind(P,O)}return N?M.reduce(R,P,p,O):M.reduce(R,P)};M.find=M.detect=function(P,O,N){var p;y(P,function(S,Q,R){if(O.call(N,S,Q,R)){p=S;return true}});return p};M.filter=M.select=function(P,O,N){var p=[];if(P==null){return p}if(a&&P.filter===a){return P.filter(O,N)}I(P,function(S,Q,R){if(O.call(N,S,Q,R)){p[p.length]=S}});return p};M.reject=function(P,O,N){var p=[];if(P==null){return p}I(P,function(S,Q,R){if(!O.call(N,S,Q,R)){p[p.length]=S}});return p};M.every=M.all=function(P,O,N){var p=true;if(P==null){return p}if(A&&P.every===A){return P.every(O,N)}I(P,function(S,Q,R){if(!(p=p&&O.call(N,S,Q,R))){return D}});return !!p};var y=M.some=M.any=function(P,O,N){O||(O=M.identity);var p=false;if(P==null){return p}if(n&&P.some===n){return P.some(O,N)}I(P,function(S,Q,R){if(p||(p=O.call(N,S,Q,R))){return D}});return !!p};M.include=M.contains=function(O,N){var p=false;if(O==null){return p}if(l&&O.indexOf===l){return O.indexOf(N)!=-1}p=y(O,function(P){return P===N});return p};M.invoke=function(N,O){var p=m.call(arguments,2);return M.map(N,function(P){return(M.isFunction(O)?O||P:P[O]).apply(P,p)})};M.pluck=function(N,p){return M.map(N,function(O){return O[p]})};M.max=function(P,O,N){if(!O&&M.isArray(P)&&P[0]===+P[0]){return Math.max.apply(Math,P)}if(!O&&M.isEmpty(P)){return -Infinity}var p={computed:-Infinity};I(P,function(T,Q,S){var R=O?O.call(N,T,Q,S):T;R>=p.computed&&(p={value:T,computed:R})});return p.value};M.min=function(P,O,N){if(!O&&M.isArray(P)&&P[0]===+P[0]){return Math.min.apply(Math,P)}if(!O&&M.isEmpty(P)){return Infinity}var p={computed:Infinity};I(P,function(T,Q,S){var R=O?O.call(N,T,Q,S):T;R<p.computed&&(p={value:T,computed:R})});return p.value};M.shuffle=function(O){var p=[],N;I(O,function(R,P,Q){N=Math.floor(Math.random()*(P+1));p[P]=p[N];p[N]=R});return p};M.sortBy=function(O,P,p){var N=M.isFunction(P)?P:function(Q){return Q[P]};return M.pluck(M.map(O,function(S,Q,R){return{value:S,criteria:N.call(p,S,Q,R)}}).sort(function(T,S){var R=T.criteria,Q=S.criteria;if(R===void 0){return 1}if(Q===void 0){return -1}return R<Q?-1:R>Q?1:0}),"value")};M.groupBy=function(O,P){var p={};var N=M.isFunction(P)?P:function(Q){return Q[P]};I(O,function(S,Q){var R=N(S,Q);(p[R]||(p[R]=[])).push(S)});return p};M.sortedIndex=function(R,Q,O){O||(O=M.identity);var p=0,P=R.length;while(p<P){var N=(p+P)>>1;O(R[N])<O(Q)?p=N+1:P=N}return p};M.toArray=function(p){if(!p){return[]}if(M.isArray(p)){return m.call(p)}if(M.isArguments(p)){return m.call(p)}if(p.toArray&&M.isFunction(p.toArray)){return p.toArray()}return M.values(p)};M.size=function(p){return M.isArray(p)?p.length:M.keys(p).length};M.first=M.head=M.take=function(O,N,p){return(N!=null)&&!p?m.call(O,0,N):O[0]};M.initial=function(O,N,p){return m.call(O,0,O.length-((N==null)||p?1:N))};M.last=function(O,N,p){if((N!=null)&&!p){return m.call(O,Math.max(O.length-N,0))}else{return O[O.length-1]}};M.rest=M.tail=function(O,p,N){return m.call(O,(p==null)||N?1:p)};M.compact=function(p){return M.filter(p,function(N){return !!N})};M.flatten=function(N,p){return M.reduce(N,function(O,P){if(M.isArray(P)){return O.concat(p?P:M.flatten(P))}O[O.length]=P;return O},[])};M.without=function(p){return M.difference(p,m.call(arguments,1))};M.uniq=M.unique=function(Q,P,O){var p=O?M.map(Q,O):Q;var N=[];if(Q.length<3){P=true}M.reduce(p,function(R,T,S){if(P?M.last(R)!==T||!R.length:!M.include(R,T)){R.push(T);N.push(Q[S])}return R},[]);return N};M.union=function(){return M.uniq(M.flatten(arguments,true))};M.intersection=M.intersect=function(N){var p=m.call(arguments,1);return M.filter(M.uniq(N),function(O){return M.every(p,function(P){return M.indexOf(P,O)>=0})})};M.difference=function(N){var p=M.flatten(m.call(arguments,1),true);return M.filter(N,function(O){return !M.include(p,O)})};M.zip=function(){var p=m.call(arguments);var P=M.max(M.pluck(p,"length"));var O=new Array(P);for(var N=0;N<P;N++){O[N]=M.pluck(p,""+N)}return O};M.indexOf=function(Q,O,P){if(Q==null){return -1}var N,p;if(P){N=M.sortedIndex(Q,O);return Q[N]===O?N:-1}if(l&&Q.indexOf===l){return Q.indexOf(O)}for(N=0,p=Q.length;N<p;N++){if(N in Q&&Q[N]===O){return N}}return -1};M.lastIndexOf=function(O,N){if(O==null){return -1}if(k&&O.lastIndexOf===k){return O.lastIndexOf(N)}var p=O.length;while(p--){if(p in O&&O[p]===N){return p}}return -1};M.range=function(R,P,Q){if(arguments.length<=1){P=R||0;R=0}Q=arguments[2]||1;var N=Math.max(Math.ceil((P-R)/Q),0);var p=0;var O=new Array(N);while(p<N){O[p++]=R;R+=Q}return O};var G=function(){};M.bind=function d(P,N){var O,p;if(P.bind===F&&F){return F.apply(P,m.call(arguments,1))}if(!M.isFunction(P)){throw new TypeError}p=m.call(arguments,2);return O=function(){if(!(this instanceof O)){return P.apply(N,p.concat(m.call(arguments)))}G.prototype=P.prototype;var R=new G;var Q=P.apply(R,p.concat(m.call(arguments)));if(Object(Q)===Q){return Q}return R}};M.bindAll=function(N){var p=m.call(arguments,1);if(p.length==0){p=M.functions(N)}I(p,function(O){N[O]=M.bind(N[O],N)});return N};M.memoize=function(O,N){var p={};N||(N=M.identity);return function(){var P=N.apply(this,arguments);return M.has(p,P)?p[P]:(p[P]=O.apply(this,arguments))}};M.delay=function(N,O){var p=m.call(arguments,2);return setTimeout(function(){return N.apply(null,p)},O)};M.defer=function(p){return M.delay.apply(M,[p,1].concat(m.call(arguments,1)))};M.throttle=function(O,P){var N,R,S,T,Q,U;var p=M.debounce(function(){Q=T=false},P);return function(){N=this;R=arguments;var V=function(){S=null;if(Q){O.apply(N,R)}p()};if(!S){S=setTimeout(V,P)}if(T){Q=true}else{U=O.apply(N,R)}p();T=true;return U}};M.debounce=function(N,P,p){var O;return function(){var S=this,R=arguments;var Q=function(){O=null;if(!p){N.apply(S,R)}};if(p&&!O){N.apply(S,R)}clearTimeout(O);O=setTimeout(Q,P)}};M.once=function(O){var p=false,N;return function(){if(p){return N}p=true;return N=O.apply(this,arguments)}};M.wrap=function(p,N){return function(){var O=[p].concat(m.call(arguments,0));return N.apply(this,O)}};M.compose=function(){var p=arguments;return function(){var N=arguments;for(var O=p.length-1;O>=0;O--){N=[p[O].apply(this,N)]}return N[0]}};M.after=function(N,p){if(N<=0){return p()}return function(){if(--N<1){return p.apply(this,arguments)}}};M.keys=e||function(O){if(O!==Object(O)){throw new TypeError("Invalid object")}var N=[];for(var p in O){if(M.has(O,p)){N[N.length]=p}}return N};M.values=function(p){return M.map(p,M.identity)};M.functions=M.methods=function(O){var N=[];for(var p in O){if(M.isFunction(O[p])){N.push(p)}}return N.sort()};M.extend=function(p){I(m.call(arguments,1),function(N){for(var O in N){p[O]=N[O]}});return p};M.pick=function(N){var p={};I(M.flatten(m.call(arguments,1)),function(O){if(O in N){p[O]=N[O]}});return p};M.defaults=function(p){I(m.call(arguments,1),function(N){for(var O in N){if(p[O]==null){p[O]=N[O]}}});return p};M.clone=function(p){if(!M.isObject(p)){return p}return M.isArray(p)?p.slice():M.extend({},p)};M.tap=function(N,p){p(N);return N};function J(P,O,N){if(P===O){return P!==0||1/P==1/O}if(P==null||O==null){return P===O}if(P._chain){P=P._wrapped}if(O._chain){O=O._wrapped}if(P.isEqual&&M.isFunction(P.isEqual)){return P.isEqual(O)}if(O.isEqual&&M.isFunction(O.isEqual)){return O.isEqual(P)}var S=c.call(P);if(S!=c.call(O)){return false}switch(S){case"[object String]":return P==String(O);case"[object Number]":return P!=+P?O!=+O:(P==0?1/P==1/O:P==+O);case"[object Date]":case"[object Boolean]":return +P==+O;case"[object RegExp]":return P.source==O.source&&P.global==O.global&&P.multiline==O.multiline&&P.ignoreCase==O.ignoreCase}if(typeof P!="object"||typeof O!="object"){return false}var T=N.length;while(T--){if(N[T]==P){return true}}N.push(P);var R=0,p=true;if(S=="[object Array]"){R=P.length;p=R==O.length;if(p){while(R--){if(!(p=R in P==R in O&&J(P[R],O[R],N))){break}}}}else{if("constructor" in P!="constructor" in O||P.constructor!=O.constructor){return false}for(var Q in P){if(M.has(P,Q)){R++;if(!(p=M.has(O,Q)&&J(P[Q],O[Q],N))){break}}}if(p){for(Q in O){if(M.has(O,Q)&&!(R--)){break}}p=!R}}N.pop();return p}M.isEqual=function(N,p){return J(N,p,[])};M.isEmpty=function(N){if(N==null){return true}if(M.isArray(N)||M.isString(N)){return N.length===0}for(var p in N){if(M.has(N,p)){return false}}return true};M.isElement=function(p){return !!(p&&p.nodeType==1)};M.isArray=s||function(p){return c.call(p)=="[object Array]"};M.isObject=function(p){return p===Object(p)};M.isArguments=function(p){return c.call(p)=="[object Arguments]"};if(!M.isArguments(arguments)){M.isArguments=function(p){return !!(p&&M.has(p,"callee"))}}M.isFunction=function(p){return c.call(p)=="[object Function]"};M.isString=function(p){return c.call(p)=="[object String]"};M.isNumber=function(p){return c.call(p)=="[object Number]"};M.isFinite=function(p){return M.isNumber(p)&&isFinite(p)};M.isNaN=function(p){return p!==p};M.isBoolean=function(p){return p===true||p===false||c.call(p)=="[object Boolean]"};M.isDate=function(p){return c.call(p)=="[object Date]"};M.isRegExp=function(p){return c.call(p)=="[object RegExp]"};M.isNull=function(p){return p===null};M.isUndefined=function(p){return p===void 0};M.has=function(N,p){return h.call(N,p)};M.noConflict=function(){v._=j;return this};M.identity=function(p){return p};M.times=function(P,O,N){for(var p=0;p<P;p++){O.call(N,p)}};M.escape=function(p){return(""+p).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};M.result=function(p,O){if(p==null){return null}var N=p[O];return M.isFunction(N)?N.call(p):N};M.mixin=function(p){I(M.functions(p),function(N){w(N,M[N]=p[N])})};var x=0;M.uniqueId=function(p){var N=x++;return p?p+N:N};M.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var u=/.^/;var g={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};for(var H in g){g[g[H]]=H}var i=/\\|'|\r|\n|\t|\u2028|\u2029/g;var B=/\\(\\|'|r|n|t|u2028|u2029)/g;var K=function(p){return p.replace(B,function(N,O){return g[O]})};M.template=function(R,Q,O){O=M.defaults(O||{},M.templateSettings);var P="__p+='"+R.replace(i,function(S){return"\\"+g[S]}).replace(O.escape||u,function(S,T){return"'+\n_.escape("+K(T)+")+\n'"}).replace(O.interpolate||u,function(S,T){return"'+\n("+K(T)+")+\n'"}).replace(O.evaluate||u,function(S,T){return"';\n"+K(T)+"\n;__p+='"})+"';\n";if(!O.variable){P="with(obj||{}){\n"+P+"}\n"}P="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+P+"return __p;\n";var N=new Function(O.variable||"obj","_",P);if(Q){return N(Q,M)}var p=function(S){return N.call(this,S,M)};p.source="function("+(O.variable||"obj")+"){\n"+P+"}";return p};M.chain=function(p){return M(p).chain()};var t=function(p){this._wrapped=p};M.prototype=t.prototype;var r=function(N,p){return p?M(N).chain():N};var w=function(p,N){t.prototype[p]=function(){var O=m.call(arguments);z.call(O,this._wrapped);return r(N.apply(M,O),this._chain)}};M.mixin(M);I(["pop","push","reverse","shift","sort","splice","unshift"],function(p){var N=C[p];t.prototype[p]=function(){var O=this._wrapped;N.apply(O,arguments);var P=O.length;if((p=="shift"||p=="splice")&&P===0){delete O[0]}return r(O,this._chain)}});I(["concat","join","slice"],function(p){var N=C[p];t.prototype[p]=function(){return r(N.apply(this._wrapped,arguments),this._chain)}});t.prototype.chain=function(){this._chain=true;return this};t.prototype.value=function(){return this._wrapped};return M}).call({});var emmet=(function(b){var d="html";var h="plain";if(typeof _=="undefined"){try{_=b[["require"][0]]("underscore")}catch(g){}}if(typeof _=="undefined"){throw"Cannot access to Underscore.js lib"}var c={_:_};var j=function(){};function i(k,e,l){var m;if(e&&e.hasOwnProperty("constructor")){m=e.constructor}else{m=function(){k.apply(this,arguments)}}_.extend(m,k);j.prototype=k.prototype;m.prototype=new j();if(e){_.extend(m.prototype,e)}if(l){_.extend(m,l)}m.prototype.constructor=m;m.__super__=k.prototype;return m}var f=null;function a(e){if(!(e in c)&&f){f(e)}return c[e]}return{define:function(k,e){if(!(k in c)){c[k]=_.isFunction(e)?this.exec(e):e}},require:a,exec:function(k,e){return k.call(e||b,_.bind(a,this),_,this)},extend:function(e,k){var l=i(this,e,k);l.extend=this.extend;if(e.hasOwnProperty("toString")){l.prototype.toString=e.toString}return l},expandAbbreviation:function(r,n,m,q){if(!r){return""}n=n||d;var l=a("filters");var k=a("abbreviationParser");m=a("profile").get(m,n);a("tabStops").resetTabstopIndex();var p=l.extractFromAbbreviation(r);var o=k.parse(p[0],{syntax:n,contextNode:q});var e=l.composeList(n,m,p[1]);l.apply(o,e,m);return o.valueOf()},defaultSyntax:function(){return d},defaultProfile:function(){return h},log:function(){if(b.console&&b.console.log){b.console.log.apply(b.console,arguments)}},setModuleLoader:function(e){f=e}}})(this);if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=emmet}exports.emmet=emmet}if(typeof define!=="undefined"){define(emmet)}emmet.define("abbreviationParser",function(h,s){var f=/^[\w\-\$\:@\!%]+\+?$/i;var g=/[\w\-:\$@]/;var t={"[":"]","(":")","{":"}"};var q=Array.prototype.splice;var e=[];var c=[];var i=[];function k(u){this.parent=null;this.children=[];this._attributes=[];this.abbreviation="";this.counter=1;this._name=null;this._text="";this.repeatCount=1;this.hasImplicitRepeat=false;this._data={};this.start="";this.end="";this.content="";this.padding=""}k.prototype={addChild:function(v,u){v=v||new k();v.parent=this;if(s.isUndefined(u)){this.children.push(v)}else{this.children.splice(u,0,v)}return v},clone:function(){var v=new k();var u=["abbreviation","counter","_name","_text","repeatCount","hasImplicitRepeat","start","end","content","padding"];s.each(u,function(w){v[w]=this[w]},this);v._attributes=s.map(this._attributes,function(w){return s.clone(w)});v._data=s.clone(this._data);v.children=s.map(this.children,function(w){w=w.clone();w.parent=v;return w});return v},remove:function(){if(this.parent){this.parent.children=s.without(this.parent.children,this)}return this},replace:function(){var w=this.parent;var u=s.indexOf(w.children,this);var v=s.flatten(arguments);q.apply(w.children,[u,1].concat(v));s.each(v,function(x){x.parent=w})},updateProperty:function(u,v){this[u]=v;s.each(this.children,function(w){w.updateProperty(u,v)});return this},find:function(u){return this.findAll(u)[0]},findAll:function(v){if(!s.isFunction(v)){var w=v.toLowerCase();v=function(x){return x.name().toLowerCase()==w}}var u=[];s.each(this.children,function(x){if(v(x)){u.push(x)}u=u.concat(x.findAll(v))});return s.compact(u)},data:function(u,v){if(arguments.length==2){this._data[u]=v;if(u=="resource"&&h("elements").is(v,"snippet")){this.content=v.data;if(this._text){this.content=h("abbreviationUtils").insertChildContent(v.data,this._text)}}}return this._data[u]},name:function(){var u=this.matchedResource();if(h("elements").is(u,"element")){return u.name}return this._name},attributeList:function(){var u=[];var v=this.matchedResource();if(h("elements").is(v,"element")&&s.isArray(v.attributes)){u=u.concat(v.attributes)}return m(u.concat(this._attributes))},attribute:function(v,w){if(arguments.length==2){var u=s.indexOf(s.pluck(this._attributes,"name"),v.toLowerCase());if(~u){this._attributes[u].value=w}else{this._attributes.push({name:v,value:w})}}return(s.find(this.attributeList(),function(x){return x.name==v})||{}).value},matchedResource:function(){return this.data("resource")},index:function(){return this.parent?s.indexOf(this.parent.children,this):-1},_setRepeat:function(u){if(u){this.repeatCount=parseInt(u,10)||1}else{this.hasImplicitRepeat=true}},setAbbreviation:function(u){u=u||"";var w=this;u=u.replace(/\*(\d+)?$/,function(z,y){w._setRepeat(y);return""});this.abbreviation=u;var x=l(u);if(x){u=x.element;this.content=this._text=x.text}var v=j(u);if(v){u=v.element;this._attributes=v.attributes}this._name=u;if(this._name&&!f.test(this._name)){throw"Invalid abbreviation"}},valueOf:function(){var v=h("utils");var z=this.start;var u=this.end;var x=this.content;var w=this;s.each(i,function(A){z=A(z,w,"start");x=A(x,w,"content");u=A(u,w,"end")});var y=s.map(this.children,function(A){return A.valueOf()}).join("");x=h("abbreviationUtils").insertChildContent(x,y,{keepVariable:false});return z+v.padString(x,this.padding)+u},toString:function(){return this.valueOf()},hasEmptyChildren:function(){return !!s.find(this.children,function(u){return u.isEmpty()})},hasImplicitName:function(){return !this._name&&!this.isTextNode()},isGroup:function(){return !this.abbreviation},isEmpty:function(){return !this.abbreviation&&!this.children.length},isRepeating:function(){return this.repeatCount>1||this.hasImplicitRepeat},isTextNode:function(){return !this.name()&&!this.attributeList().length},isElement:function(){return !this.isEmpty()&&!this.isTextNode()},deepestChild:function(){if(!this.children.length){return null}var u=this;while(u.children.length){u=s.last(u.children)}return u}};function n(u){return u.substring(1,u.length-1)}function p(w,u){var v;while((v=w.next())){if(v===u){return true}if(v=="\\"){continue}}return false}function a(D){D=h("utils").trim(D);var z=new k();var x=z.addChild(),v;var B=h("stringStream").create(D);var w=1000,C;var y=function(F){x.addChild(F)};var u=function(){B.start=B.pos;B.eatWhile(function(G){if(G=="["||G=="{"){if(B.skipToPair(G,t[G])){B.backUp(1);return true}throw'Invalid abbreviation: mo matching "'+t[G]+'" found for character at '+B.pos}if(G=="+"){B.next();var F=B.eol()||~"+>^*".indexOf(B.peek());B.backUp(1);return F}return G!="("&&d(G)})};while(!B.eol()&&--w>0){v=B.peek();switch(v){case"(":B.start=B.pos;if(B.skipToPair("(",")")){var E=a(n(B.current()));if((C=B.match(/^\*(\d+)?/,true))){x._setRepeat(C[1])}s.each(E.children,y)}else{throw'Invalid abbreviation: mo matching ")" found for character at '+B.pos}break;case">":x=x.addChild();B.next();break;case"+":x=x.parent.addChild();B.next();break;case"^":var A=x.parent||x;x=(A.parent||A).addChild();B.next();break;default:u();x.setAbbreviation(B.current());B.start=B.pos}}if(w<1){throw"Endless loop detected"}return z}function o(x,w){x=h("utils").trim(x);var u=[];var A=h("stringStream").create(x);A.eatSpace();while(!A.eol()){A.start=A.pos;if(A.eatWhile(g)){var y=A.current();var z="";if(A.peek()=="="){A.next();A.start=A.pos;var v=A.peek();if(v=='"'||v=="'"){A.next();if(p(A,v)){z=A.current();z=z.substring(1,z.length-1)}else{throw"Invalid attribute value"}}else{if(A.eatWhile(/[^\s\]]/)){z=A.current()}else{throw"Invalid attribute value"}}}u.push({name:y,value:z});A.eatSpace()}else{break}}return u}function j(x){var u=[];var v={"#":"id",".":"class"};var w=null;var z=h("stringStream").create(x);while(!z.eol()){switch(z.peek()){case"#":case".":if(w===null){w=z.pos}var y=v[z.peek()];z.next();z.start=z.pos;z.eatWhile(g);u.push({name:y,value:z.current()});break;case"[":if(w===null){w=z.pos}z.start=z.pos;if(!z.skipToPair("[","]")){throw"Invalid attribute set definition"}u=u.concat(o(n(z.current())));break;default:z.next()}}if(!u.length){return null}return{element:x.substring(0,w),attributes:m(u)}}function m(u){u=s.map(u,function(w){return s.clone(w)});var v={};return s.filter(u,function(w){if(!(w.name in v)){return v[w.name]=w}var x=v[w.name];if(w.name.toLowerCase()=="class"){x.value+=(x.value.length?" ":"")+w.value}else{x.value=w.value}return false})}function l(u){if(!~u.indexOf("{")){return null}var v=h("stringStream").create(u);while(!v.eol()){switch(v.peek()){case"[":case"(":v.skipToPair(v.peek(),t[v.peek()]);break;case"{":v.start=v.pos;v.skipToPair("{","}");return{element:u.substring(0,v.start),text:n(v.current())};default:v.next()}}}function b(w){for(var v=w.children.length-1,u,y,x;v>=0;v--){y=w.children[v];if(y.isRepeating()){x=u=y.repeatCount;y.repeatCount=1;y.updateProperty("counter",1);y.updateProperty("maxCount",x);while(--u>0){y.parent.addChild(y.clone(),v+1).updateProperty("counter",u+1).updateProperty("maxCount",x)}}}s.each(w.children,b);return w}function r(v){for(var u=v.children.length-1;u>=0;u--){var w=v.children[u];if(w.isGroup()){w.replace(r(w).children)}else{if(w.isEmpty()){w.remove()}}}s.each(v.children,r);return v}function d(w){var v=w.charCodeAt(0);var u="#.*:$-_!@|%";return(v>64&&v<91)||(v>96&&v<123)||(v>47&&v<58)||u.indexOf(w)!=-1}i.push(function(v,u){return h("utils").replaceCounter(v,u.counter,u.maxCount)});return{parse:function(w,v){v=v||{};var u=a(w);if(v.contextNode){u._name=v.contextNode.name;var x={};s.each(u._attributes,function(y){x[y.name]=y});s.each(v.contextNode.attributes,function(y){if(y.name in x){x[y.name].value=y.value}else{y=s.clone(y);u._attributes.push(y);x[y.name]=y}})}s.each(e,function(y){y(u,v)});u=r(b(u));s.each(c,function(y){y(u,v)});return u},AbbreviationNode:k,addPreprocessor:function(u){if(!s.include(e,u)){e.push(u)}},removeFilter:function(u){s.without(e,u)},addPostprocessor:function(u){if(!s.include(c,u)){c.push(u)}},removePostprocessor:function(u){c=s.without(c,u)},addOutputProcessor:function(u){if(!s.include(i,u)){i.push(u)}},removeOutputProcessor:function(u){i=s.without(i,u)},isAllowedChar:function(u){u=String(u);return d(u)||~">+^[](){}".indexOf(u)}}});emmet.exec(function(b,a){function c(e,d){var g=b("resources");var f=b("elements");var h=b("abbreviationParser");a.each(a.clone(e.children),function(m){var i=g.getMatchedResource(m,d);if(a.isString(i)){m.data("resource",f.create("snippet",i))}else{if(f.is(i,"reference")){var j=h.parse(i.data,{syntax:d});if(m.repeatCount>1){var l=j.findAll(function(n){return n.hasImplicitRepeat});a.each(l,function(n){n.repeatCount=m.repeatCount;n.hasImplicitRepeat=false})}var k=j.deepestChild();if(k){a.each(m.children,function(n){k.addChild(n)})}a.each(j.children,function(n){a.each(m.attributeList(),function(o){n.attribute(o.name,o.value)})});m.replace(j.children)}else{m.data("resource",i)}}c(m,d)})}b("abbreviationParser").addPreprocessor(function(d,f){var e=f.syntax||emmet.defaultSyntax();c(d,e)})});emmet.exec(function(e,d){var h=e("abbreviationParser");var c="$#";function g(l){var j=e("range");var i=[];var k=e("stringStream").create(l);while(!k.eol()){if(k.peek()=="\\"){k.next()}else{k.start=k.pos;if(k.match(c,true)){i.push(j.create(k.start,c));continue}}k.next()}return i}function a(l,k){var j=e("utils");var i=g(l);i.reverse();d.each(i,function(m){l=j.replaceSubstring(l,k,m)});return l}function f(i){if(g(i.content).length){return true}return !!d.find(i.attributeList(),function(j){return !!g(j.value).length})}function b(l,k,j){var i=l.findAll(function(n){return f(n)});if(f(l)){i.unshift(l)}if(i.length){d.each(i,function(n){n.content=a(n.content,k);d.each(n._attributes,function(o){o.value=a(o.value,k)})})}else{var m=l.deepestChild()||l;if(j){m.content=k}else{m.content=e("abbreviationUtils").insertChildContent(m.content,k)}}}h.addPreprocessor(function(i,l){if(l.pastedContent){var k=e("utils");var j=d.map(k.splitByLines(l.pastedContent,true),k.trim);i.findAll(function(m){if(m.hasImplicitRepeat){m.data("paste",j);return m.repeatCount=j.length}})}});h.addPostprocessor(function(i,k){var j=i.findAll(function(m){var l=m.data("paste");var n="";if(d.isArray(l)){n=l[m.counter-1]}else{if(d.isFunction(l)){n=l(m.counter-1,m.content)}else{if(l){n=l}}}if(n){b(m,n,!!m.data("pasteOverwrites"))}m.data("paste",null);return !!l});if(!j.length&&k.pastedContent){b(i,k.pastedContent)}})});emmet.exec(function(b,a){function c(d){var e=b("tagName");a.each(d.children,function(f){if(f.hasImplicitName()||f.data("forceNameResolving")){f._name=e.resolve(f.parent.name())}c(f)});return d}b("abbreviationParser").addPostprocessor(c)});emmet.define("cssParser",function(g,s){var o,j=[],q,p,n;o={lines:null,total_lines:0,linenum:-1,line:"",ch:"",chnum:-1,init:function(v){var u=o;u.lines=v.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n");u.total_lines=u.lines.length;u.chnum=-1;u.linenum=-1;u.ch="";u.line="";u.nextLine();u.nextChar()},nextLine:function(){var u=this;u.linenum+=1;if(u.total_lines<=u.linenum){u.line=false}else{u.line=u.lines[u.linenum]}if(u.chnum!==-1){u.chnum=0}return u.line},nextChar:function(){var u=this;u.chnum+=1;while(u.line.charAt(u.chnum)===""){if(this.nextLine()===false){u.ch=false;return false}u.chnum=-1;u.ch="\n";return"\n"}u.ch=u.line.charAt(u.chnum);return u.ch},peek:function(){return this.line.charAt(this.chnum+1)}};p=function(u){return(u=="&"||u==="_"||u==="-"||(u>="a"&&u<="z")||(u>="A"&&u<="Z"))};n=function(u){return(u!==false&&u>="0"&&u<="9")};q=(function(){var u="{}[]()+*=.,;:>~|\\%$#@^!".split(""),w="*^|$~".split(""),x={},y={},v=0;for(;v<u.length;v+=1){x[u[v]]=true}for(v=0;v<w.length;v+=1){y[w[v]]=true}return function(z,A){if(A){return !!y[z]}return !!x[z]}}());function i(u){return typeof u!=="undefined"}function r(){return{"char":o.chnum,line:o.linenum}}function t(y,x,v){var u=o,z=v||{};j.push({charstart:i(z["char"])?z["char"]:u.chnum,charend:i(z.charend)?z.charend:u.chnum,linestart:i(z.line)?z.line:u.linenum,lineend:i(z.lineend)?z.lineend:u.linenum,value:y,type:x||y})}function m(u,z){var x=o,y=z||{},A=i(y["char"])?y["char"]:x.chnum,v=i(y.line)?y.line:x.linenum;return{name:"ParseError",message:u+" at line "+(v+1)+" char "+(A+1),walker:x,tokens:j}}function e(){var w=o.ch,v="",u=r();while(w===" "||w==="\t"){v+=w;w=o.nextChar()}t(v,"white",u)}function b(){var u=o,A=u.ch,x=A,y,v=r();y=u.nextChar();if(y==="/"){x+=y;var z=u.peek();while(z&&z!=="\n"){x+=y;y=u.nextChar();z=u.peek()}}else{if(y==="*"){while(!(A==="*"&&y==="/")){x+=y;A=y;y=u.nextChar()}}else{v.charend=v["char"];v.lineend=v.line;return t(x,x,v)}}x+=y;u.nextChar();t(x,"comment",v)}function l(){var u=o,A=u.ch,z=A,x=A,y,v=r();A=u.nextChar();while(A!==z){if(A==="\n"){y=u.nextChar();if(y==="\\"){x+=A+y}else{throw m("Unterminated string",v)}}else{if(A==="\\"){x+=A+u.nextChar()}else{x+=A}}A=u.nextChar()}x+=A;u.nextChar();t(x,"string",v)}function k(){var u=o,z=u.ch,y=0,x=z,v=r();z=u.nextChar();while(z!==")"&&!y){if(z==="("){y++}else{if(z===")"){y--}else{if(z===false){throw m("Unterminated brace",v)}}}x+=z;z=u.nextChar()}x+=z;u.nextChar();t(x,"brace",v)}function c(y){var u=o,z=u.ch,v=r(),x=(y)?y+z:z;z=u.nextChar();if(y){v["char"]-=y.length}while(p(z)||n(z)){x+=z;z=u.nextChar()}t(x,"identifier",v)}function f(){var v=o,A=v.ch,x=r(),y=A,u=y===".",z;A=v.nextChar();z=!n(A);if(u&&z){x.charend=x["char"];x.lineend=x.line;return t(y,".",x)}if(y==="-"&&z){return c("-")}while(A!==false&&(n(A)||(!u&&A==="."))){if(A==="."){u=true}y+=A;A=v.nextChar()}t(y,"number",x)}function h(){var u=o,z=u.ch,v=r(),x=z,y=u.nextChar();if(y==="="&&q(x,true)){x+=y;t(x,"match",v);u.nextChar();return}v.charend=v["char"]+1;v.lineend=v.line;t(x,x,v)}function a(){var u=o.ch;if(u===" "||u==="\t"){return e()}if(u==="/"){return b()}if(u==='"'||u==="'"){return l()}if(u==="("){return k()}if(u==="-"||u==="."||n(u)){return f()}if(p(u)){return c()}if(q(u)){return h()}if(u==="\n"){t("line");o.nextChar();return}throw m("Unrecognized character")}function d(u,v){return u.charAt(v)=="\r"&&u.charAt(v+1)=="\n"?"\r\n":u.charAt(v)}return{lex:function(u){o.init(u);j=[];while(o.ch!==false){a()}return j},parse:function(u){var v=0;return s.map(this.lex(u),function(w){if(w.type=="line"){w.value=d(u,v)}return{type:w.type,start:v,end:(v+=w.value.length)}})},toSource:function(y){var w=0,u=y.length,v,x="";for(;w<u;w+=1){v=y[w];if(v.type==="line"){x+="\n"}else{x+=v.value}}return x}}});emmet.define("xmlParser",function(n,z){var x={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:true,allowMissing:true};var e=null,g=null;function p(E,D){function B(G){D.tokenize=G;return G(E,D)}var C=E.next();if(C=="<"){if(E.eat("!")){if(E.eat("[")){if(E.match("CDATA[")){return B(w("atom","]]>"))}else{return null}}else{if(E.match("--")){return B(w("comment","-->"))}else{if(E.match("DOCTYPE",true,true)){E.eatWhile(/[\w\._\-]/);return B(y(1))}else{return null}}}}else{if(E.eat("?")){E.eatWhile(/[\w\._\-]/);D.tokenize=w("meta","?>");return"meta"}else{g=E.eat("/")?"closeTag":"openTag";E.eatSpace();e="";var F;while((F=E.eat(/[^\s\u00a0=<>\"\'\/?]/))){e+=F}D.tokenize=o;return"tag"}}}else{if(C=="&"){var A;if(E.eat("#")){if(E.eat("x")){A=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";")}else{A=E.eatWhile(/[\d]/)&&E.eat(";")}}else{A=E.eatWhile(/[\w\.\-:]/)&&E.eat(";")}return A?"atom":"error"}else{E.eatWhile(/[^&<]/);return"text"}}}function o(C,B){var A=C.next();if(A==">"||(A=="/"&&C.eat(">"))){B.tokenize=p;g=A==">"?"endTag":"selfcloseTag";return"tag"}else{if(A=="="){g="equals";return null}else{if(/[\'\"]/.test(A)){B.tokenize=j(A);return B.tokenize(C,B)}else{C.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);return"word"}}}}function j(A){return function(C,B){while(!C.eol()){if(C.next()==A){B.tokenize=o;break}}return"string"}}function w(B,A){return function(D,C){while(!D.eol()){if(D.match(A)){C.tokenize=p;break}D.next()}return B}}function y(A){return function(D,C){var B;while((B=D.next())!==null){if(B=="<"){C.tokenize=y(A+1);return C.tokenize(D,C)}else{if(B==">"){if(A==1){C.tokenize=p;break}else{C.tokenize=y(A-1);return C.tokenize(D,C)}}}}return"meta"}}var l=null,h;function a(){for(var A=arguments.length-1;A>=0;A--){l.cc.push(arguments[A])}}function d(){a.apply(null,arguments);return true}function i(A,C){var B=x.doNotIndent.hasOwnProperty(A)||(l.context&&l.context.noIndent);l.context={prev:l.context,tagName:A,indent:l.indented,startOfLine:C,noIndent:B}}function u(){if(l.context){l.context=l.context.prev}}function c(A){if(A=="openTag"){l.tagName=e;return d(m,b(l.startOfLine))}else{if(A=="closeTag"){var B=false;if(l.context){if(l.context.tagName!=e){if(x.implicitlyClosed.hasOwnProperty(l.context.tagName.toLowerCase())){u()}B=!l.context||l.context.tagName!=e}}else{B=true}if(B){h="error"}return d(s(B))}}return d()}function b(A){return function(B){if(B=="selfcloseTag"||(B=="endTag"&&x.autoSelfClosers.hasOwnProperty(l.tagName.toLowerCase()))){r(l.tagName.toLowerCase());return d()}if(B=="endTag"){r(l.tagName.toLowerCase());i(l.tagName,A);return d()}return d()}}function s(A){return function(B){if(A){h="error"}if(B=="endTag"){u();return d()}h="error";return d(arguments.callee)}}function r(B){var A;while(true){if(!l.context){return}A=l.context.tagName.toLowerCase();if(!x.contextGrabbers.hasOwnProperty(A)||!x.contextGrabbers[A].hasOwnProperty(B)){return}u()}}function m(A){if(A=="word"){h="attribute";return d(q,m)}if(A=="endTag"||A=="selfcloseTag"){return a()}h="error";return d(m)}function q(A){if(A=="equals"){return d(v,m)}if(!x.allowMissing){h="error"}return(A=="endTag"||A=="selfcloseTag")?a():d()}function v(A){if(A=="string"){return d(t)}if(A=="word"&&x.allowUnquoted){h="string";return d()}h="error";return(A=="endTag"||A=="selfCloseTag")?a():d()}function t(A){if(A=="string"){return d(t)}else{return a()}}function f(){return{tokenize:p,cc:[],indented:0,startOfLine:true,tagName:null,context:null}}function k(D,C){if(D.sol()){C.startOfLine=true;C.indented=0}if(D.eatSpace()){return null}h=g=e=null;var B=C.tokenize(D,C);C.type=g;if((B||g)&&B!="comment"){l=C;while(true){var A=C.cc.pop()||c;if(A(g||B)){break}}}C.startOfLine=false;return h||B}return{parse:function(B,E){E=E||0;var A=f();var D=n("stringStream").create(B);var C=[];while(!D.eol()){C.push({type:k(D,A),start:D.start+E,end:D.pos+E});D.start=D.pos}return C}}});
/*!
* string_score.js: String Scoring Algorithm 0.1.10
*
* http://joshaven.com/string_score
* https://github.com/joshaven/string_score
*
* Copyright (C) 2009-2011 Joshaven Potter <yourtech@gmail.com>
* Special thanks to all of the contributors listed here https://github.com/joshaven/string_score
* MIT license: http://www.opensource.org/licenses/mit-license.php
*
* Date: Tue Mar 1 2011
*/
emmet.define("string-score",function(b,a){return{score:function(j,o,u){if(j==o){return 1}if(o==""){return 0}var h=0,s=o.length,r=j.length,q,m,g=1,l;for(var f=0,t,p,k,d,e,n;f<s;++f){k=o.charAt(f);d=j.indexOf(k.toLowerCase());e=j.indexOf(k.toUpperCase());n=Math.min(d,e);p=(n>-1)?n:Math.max(d,e);if(p===-1){if(u){g+=1-u;continue}else{return 0}}else{t=0.1}if(j[p]===k){t+=0.1}if(p===0){t+=0.6;if(f===0){q=1}}else{if(j.charAt(p-1)===" "){t+=0.8}}j=j.substring(p+1,r);h+=t}m=h/s;l=((m*(s/r))+m)/2;l=l/g;if(q&&(l+0.15<1)){l+=0.15}return l}}});emmet.define("utils",function(b,a){var c="${0}";return{reTag:/<\/?[\w:\-]+(?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*\s*(\/?)>$/,endsWithTag:function(d){return this.reTag.test(d)},isNumeric:function(d){if(typeof(d)=="string"){d=d.charCodeAt(0)}return(d&&d>47&&d<58)},trim:function(d){return(d||"").replace(/^\s+|\s+$/g,"")},getNewline:function(){var e=b("resources");if(!e){return"\n"}var d=e.getVariable("newline");return a.isString(d)?d:"\n"},setNewline:function(e){var d=b("resources");d.setVariable("newline",e);d.setVariable("nl",e)},splitByLines:function(g,f){var e=this.getNewline();var d=(g||"").replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").replace(/\r/g,"\n").replace(/\n/g,e).split(e);if(f){d=a.filter(d,function(h){return h.length&&!!this.trim(h)},this)}return d},normalizeNewline:function(d){return this.splitByLines(d).join(this.getNewline())},repeatString:function(g,f){var d=[];for(var e=0;e<f;e++){d.push(g)}return d.join("")},getStringsPads:function(e){var f=a.map(e,function(g){return a.isString(g)?g.length:+g});var d=a.max(f);return a.map(f,function(g){var h=d-g;return h?this.repeatString(" ",h):""},this)},padString:function(k,i){var g=(a.isNumber(i))?this.repeatString(b("resources").getVariable("indentation")||"\t",i):i;var d=[];var f=this.splitByLines(k);var e=this.getNewline();d.push(f[0]);for(var h=1;h<f.length;h++){d.push(e+g+f[h])}return d.join("")},zeroPadString:function(g,f){var e="";var d=g.length;while(f>d++){e+="0"}return e+g},unindentString:function(g,f){var d=this.splitByLines(g);for(var e=0;e<d.length;e++){if(d[e].search(f)===0){d[e]=d[e].substr(f.length)}}return d.join(this.getNewline())},replaceUnescapedSymbol:function(k,g,f){var j=0;var n=k.length;var h=g.length;var m=0;while(j<n){if(k.charAt(j)=="\\"){j+=h+1}else{if(k.substr(j,h)==g){var d=h;m++;var e=f;if(a.isFunction(f)){var l=f(k,g,j,m);if(l){d=l[0].length;e=l[1]}else{e=false}}if(e===false){j++;continue}k=k.substring(0,j)+e+k.substring(j+d);n=k.length;j+=e.length}else{j++}}}return k},replaceVariables:function(g,e){e=e||{};var f=a.isFunction(e)?e:function(i,h){return h in e?e[h]:null};var d=b("resources");return b("tabStops").processText(g,{variable:function(h){var i=f(h.token,h.name,h);if(i===null){i=d.getVariable(h.name)}if(i===null||a.isUndefined(i)){i=h.token}return i}})},replaceCounter:function(h,g,e){var f="$";h=String(h);g=String(g);if(/^\-?\d+$/.test(g)){g=+g}var d=this;return this.replaceUnescapedSymbol(h,f,function(r,n,s,q){if(r.charAt(s+1)=="{"||d.isNumeric(r.charAt(s+1))){return false}var p=s+1;while(r.charAt(p)=="$"&&r.charAt(p+1)!="{"){p++}var l=p-s;var i=0,o=false,k;if((k=r.substr(p).match(/^@(\-?)(\d*)/))){p+=k[0].length;if(k[1]){o=true}i=parseInt(k[2]||1,10)-1}if(o&&e&&a.isNumber(g)){g=e-g+1}g+=i;return[r.substring(s,p),d.zeroPadString(g+"",l)]})},matchesTag:function(d){return this.reTag.test(d||"")},escapeText:function(d){return d.replace(/([\$\\])/g,"\\$1")},unescapeText:function(d){return d.replace(/\\(.)/g,"$1")},getCaretPlaceholder:function(){return a.isFunction(c)?c.apply(this,arguments):c},setCaretPlaceholder:function(d){c=d},getLinePadding:function(d){return(d.match(/^(\s+)/)||[""])[0]},getLinePaddingFromPosition:function(d,f){var e=this.findNewlineBounds(d,f);return this.getLinePadding(e.substring(d))},escapeForRegexp:function(e){var d=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");return e.replace(d,"\\$&")},prettifyNumber:function(d,e){return d.toFixed(typeof e=="undefined"?2:e).replace(/\.?0+$/,"")},replaceSubstring:function(f,e,g,d){if(a.isObject(g)&&"end" in g){d=g.end;g=g.start}if(a.isString(d)){d=g+d.length}if(a.isUndefined(d)){d=g}if(g<0||g>f.length){return f}return f.substring(0,g)+e+f.substring(d)},narrowToNonSpace:function(g,h,d){var e=b("range").create(h,d);var f=/[\s\n\r\u00a0]/;while(e.start<e.end){if(!f.test(g.charAt(e.start))){break}e.start++}while(e.end>e.start){e.end--;if(!f.test(g.charAt(e.end))){e.end++;break}}return e},findNewlineBounds:function(k,m){var d=k.length,l=0,e=d-1,h;for(var g=m-1;g>0;g--){h=k.charAt(g);if(h=="\n"||h=="\r"){l=g+1;break}}for(var f=m;f<d;f++){h=k.charAt(f);if(h=="\n"||h=="\r"){e=f;break}}return b("range").create(l,e-l)},deepMerge:function(){var m,f,d,e,k,l,j=arguments[0]||{},h=1,g=arguments.length;if(!a.isObject(j)&&!a.isFunction(j)){j={}}for(;h<g;h++){if((m=arguments[h])!==null){for(f in m){d=j[f];e=m[f];if(j===e){continue}if(e&&(a.isObject(e)||(k=a.isArray(e)))){if(k){k=false;l=d&&a.isArray(d)?d:[]}else{l=d&&a.isObject(d)?d:{}}j[f]=this.deepMerge(l,e)}else{if(e!==undefined){j[f]=e}}}}}return j}}});emmet.define("range",function(b,a){function c(f,e,g){switch(g){case"eq":case"==":return f===e;case"lt":case"<":return f<e;case"lte":case"<=":return f<=e;case"gt":case">":return f>e;case"gte":case">=":return f>=e}}function d(f,e){if(a.isObject(f)&&"start" in f){this.start=Math.min(f.start,f.end);this.end=Math.max(f.start,f.end)}else{if(a.isArray(f)){this.start=f[0];this.end=f[1]}else{e=a.isString(e)?e.length:+e;this.start=f;this.end=f+e}}}d.prototype={length:function(){return Math.abs(this.end-this.start)},equal:function(e){return this.cmp(e,"eq","eq")},shift:function(e){this.start+=e;this.end+=e;return this},overlap:function(e){return e.start<=this.end&&e.end>=this.start},intersection:function(f){if(this.overlap(f)){var g=Math.max(f.start,this.start);var e=Math.min(f.end,this.end);return new d(g,e-g)}return null},union:function(f){if(this.overlap(f)){var g=Math.min(f.start,this.start);var e=Math.max(f.end,this.end);return new d(g,e-g)}return null},inside:function(e){return this.cmp(e,"lte","gt")},contains:function(e){return this.cmp(e,"lt","gt")},include:function(e){return this.cmp(e,"lte","gte")},cmp:function(i,h,g){var f,e;if(i instanceof d){f=i.start;e=i.end}else{f=e=i}return c(this.start,f,h||"<=")&&c(this.end,e,g||">")},substring:function(e){return this.length()>0?e.substring(this.start,this.end):""},clone:function(){return new d(this.start,this.length())},toArray:function(){return[this.start,this.end]},toString:function(){return this.valueOf()},valueOf:function(){return"{"+this.start+", "+this.length()+"}"}};return{create:function(f,e){if(a.isUndefined(f)||f===null){return null}if(f instanceof d){return f}if(a.isObject(f)&&"start" in f&&"end" in f){e=f.end-f.start;f=f.start}return new d(f,e)},create2:function(f,e){if(a.isNumber(f)&&a.isNumber(e)){e-=f}return this.create(f,e)}}});emmet.define("handlerList",function(c,b){function a(){this._list=[]}a.prototype={add:function(e,d){this._list.push(b.extend({order:0},d||{},{fn:e}))},remove:function(d){this._list=b.without(this._list,b.find(this._list,function(e){return e.fn===d}))},list:function(){return b.sortBy(this._list,"order").reverse()},listFn:function(){return b.pluck(this.list(),"fn")},exec:function(f,e){e=e||[];var d=null;b.find(this.list(),function(g){d=g.fn.apply(g,e);if(d!==f){return true}});return d}};return{create:function(){return new a()}}});emmet.define("tokenIterator",function(b,a){function c(d){this.tokens=d;this._position=0;this.reset()}c.prototype={next:function(){if(this.hasNext()){var d=this.tokens[++this._i];this._position=d.start;return d}return null},current:function(){return this.tokens[this._i]},position:function(){return this._position},hasNext:function(){return this._i<this._il-1},reset:function(){this._i=-1;this._il=this.tokens.length},item:function(){return this.tokens[this._i]},itemNext:function(){return this.tokens[this._i+1]},itemPrev:function(){return this.tokens[this._i-1]},nextUntil:function(e,g){var d;var f=a.isString(e)?function(h){return h.type==e}:e;while((d=this.next())){if(g){g.call(this,d)}if(f.call(this,d)){break}}}};return{create:function(d){return new c(d)}}});emmet.define("stringStream",function(b,a){function c(d){this.pos=this.start=0;this.string=d}c.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos===0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}},eat:function(d){var f=this.string.charAt(this.pos),e;if(typeof d=="string"){e=f==d}else{e=f&&(d.test?d.test(f):d(f))}if(e){++this.pos;return f}},eatWhile:function(d){var e=this.pos;while(this.eat(d)){}return this.pos>e},eatSpace:function(){var d=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>d},skipToEnd:function(){this.pos=this.string.length},skipTo:function(d){var e=this.string.indexOf(d,this.pos);if(e>-1){this.pos=e;return true}},skipToPair:function(e,h){var g=0,f;var i=this.pos,d=this.string.length;while(i<d){f=this.string.charAt(i++);if(f==e){g++}else{if(f==h){g--;if(g<1){this.pos=i;return true}}}}return false},backUp:function(d){this.pos-=d},match:function(g,e,d){if(typeof g=="string"){var h=d?function(i){return i.toLowerCase()}:function(i){return i};if(h(this.string).indexOf(h(g),this.pos)==this.pos){if(e!==false){this.pos+=g.length}return true}}else{var f=this.string.slice(this.pos).match(g);if(f&&e!==false){this.pos+=f[0].length}return f}},current:function(){return this.string.slice(this.start,this.pos)}};return{create:function(d){return new c(d)}}});emmet.define("resources",function(b,k){var m="system";var l="user";var a={};var i=/^<(\w+\:?[\w\-]*)((?:\s+[\w\:\-]+\s*=\s*(['"]).*?\3)*)\s*(\/?)>/;var e={};var c={};var j=b("handlerList").create();function g(o){var n=b("utils");return n.replaceUnescapedSymbol(o,"|",n.getCaretPlaceholder())}function h(n,p,o){p=g(p);if(o=="snippets"){return b("elements").create("snippet",p)}if(o=="abbreviations"){return f(n,p)}}function f(o,q){o=b("utils").trim(o);var p=b("elements");var n;if((n=i.exec(q))){return p.create("element",n[1],n[2],n[4]=="/")}else{return p.create("reference",q)}}function d(n){return n.replace(/:$/,"").replace(/:/g,"-")}return{setVocabulary:function(o,n){a={};if(n==m){e=o}else{c=o}},getVocabulary:function(n){return n==m?e:c},getMatchedResource:function(o,n){return j.exec(null,k.toArray(arguments))||this.findSnippet(n,o.name())},getVariable:function(n){return(this.getSection("variables")||{})[n]},setVariable:function(o,p){var n=this.getVocabulary("user")||{};if(!("variables" in n)){n.variables={}}n.variables[o]=p;this.setVocabulary(n,"user")},hasSyntax:function(n){return n in this.getVocabulary(l)||n in this.getVocabulary(m)},addResolver:function(o,n){j.add(o,n)},removeResolver:function(n){j.remove(n)},getSection:function(n){if(!n){return null}if(!(n in a)){a[n]=b("utils").deepMerge({},e[n],c[n])}var q=a[n],p=k.rest(arguments),o;while(q&&(o=p.shift())){if(o in q){q=q[o]}else{return null}}return q},findItem:function(n,p){var o=this.getSection(n);while(o){if(p in o){return o[p]}o=this.getSection(o["extends"])}},findSnippet:function(p,q,o){if(!p||!q){return null}o=o||[];var s=[q];if(~q.indexOf("-")){s.push(q.replace(/\-/g,":"))}var r=this.getSection(p),n=null;k.find(["snippets","abbreviations"],function(t){var u=this.getSection(p,t);if(u){return k.find(s,function(v){if(u[v]){return n=h(v,u[v],t)}})}},this);o.push(p);if(!n&&r["extends"]&&!k.include(o,r["extends"])){return this.findSnippet(r["extends"],q,o)}return n},fuzzyFindSnippet:function(p,q,u){u=u||0.3;var r=this.getAllSnippets(p);var t=b("string-score");q=d(q);var s=k.map(r,function(w,v){return{key:v,score:t.score(w.nk,q,0.1)}});var n=k.last(k.sortBy(s,"score"));if(n&&n.score>=u){var o=n.key;return r[o].parsedValue}},getAllSnippets:function(p){var r="all-"+p;if(!a[r]){var n=[],s=p;var o=[];do{var q=this.getSection(s);if(!q){break}k.each(["snippets","abbreviations"],function(t){var u={};k.each(q[t]||null,function(x,w){u[w]={nk:d(w),value:x,parsedValue:h(w,x,t),type:t}});n.push(u)});o.push(s);s=q["extends"]}while(s&&!k.include(o,s));a[r]=k.extend.apply(k,n.reverse())}return a[r]}}});emmet.define("actions",function(b,a){var d={};function c(e){return b("utils").trim(e.charAt(0).toUpperCase()+e.substring(1).replace(/_[a-z]/g,function(f){return" "+f.charAt(1).toUpperCase()}))}return{add:function(f,g,e){f=f.toLowerCase();e=e||{};if(!e.label){e.label=c(f)}d[f]={name:f,fn:g,options:e}},get:function(e){return d[e.toLowerCase()]},run:function(f,e){if(!a.isArray(e)){e=a.rest(arguments)}var g=this.get(f);if(g){return g.fn.apply(emmet,e)}else{emmet.log('Action "%s" is not defined',f);return false}},getAll:function(){return d},getList:function(){return a.values(this.getAll())},getMenu:function(f){var e=[];f=f||[];a.each(this.getList(),function(k){if(k.options.hidden||a.include(f,k.name)){return}var h=c(k.name);var g=e;if(k.options.label){var l=k.options.label.split("/");h=l.pop();var i,j;while((i=l.shift())){j=a.find(g,function(m){return m.type=="submenu"&&m.name==i});if(!j){j={name:i,type:"submenu",items:[]};g.push(j)}g=j.items}}g.push({type:"action",name:k.name,label:h})});return e},getActionNameForMenuTitle:function(g,f){var e=null;a.find(f||this.getMenu(),function(h){if(h.type=="action"){if(h.label==g||h.name==g){return e=h.name}}else{return e=this.getActionNameForMenuTitle(g,h.items)}},this);return e||null}}});emmet.define("profile",function(d,c){var a={};var b={tag_case:"asis",attr_case:"asis",attr_quotes:"double",tag_nl:"decide",tag_nl_leaf:false,place_cursor:true,indent:true,inline_break:3,self_closing_tag:"xhtml",filters:"",extraFilters:""};function g(i){c.extend(this,b,i)}g.prototype={tagName:function(i){return h(i,this.tag_case)},attributeName:function(i){return h(i,this.attr_case)},attributeQuote:function(){return this.attr_quotes=="single"?"'":'"'},selfClosing:function(){if(this.self_closing_tag=="xhtml"){return" /"}if(this.self_closing_tag===true){return"/"}return""},cursor:function(){return this.place_cursor?d("utils").getCaretPlaceholder():""}};function h(j,i){switch(String(i||"").toLowerCase()){case"lower":return j.toLowerCase();case"upper":return j.toUpperCase()}return j}function f(j,i){return a[j.toLowerCase()]=new g(i)}function e(){f("xhtml");f("html",{self_closing_tag:false});f("xml",{self_closing_tag:true,tag_nl:true});f("plain",{tag_nl:false,indent:false,place_cursor:false});f("line",{tag_nl:false,indent:false,extraFilters:"s"})}e();return{create:function(j,i){if(arguments.length==2){return f(j,i)}else{return new g(c.defaults(j||{},b))}},get:function(j,i){if(!j&&i){var k=d("resources").findItem(i,"profile");if(k){j=k}}if(!j){return a.plain}if(j instanceof g){return j}if(c.isString(j)&&j.toLowerCase() in a){return a[j.toLowerCase()]}return this.create(j)},remove:function(i){i=(i||"").toLowerCase();if(i in a){delete a[i]}},reset:function(){a={};e()},stringCase:h}});emmet.define("editorUtils",function(b,a){return{isInsideTag:function(f,e){var d=/^<\/?\w[\w\:\-]*.*?>/;var g=e;while(g>-1){if(f.charAt(g)=="<"){break}g--}if(g!=-1){var c=d.exec(f.substring(g));if(c&&e>g&&e<g+c[0].length){return true}}return false},outputInfo:function(e,c,d){d=d||e.getProfileName();return{syntax:String(c||e.getSyntax()),profile:d||null,content:String(e.getContent())}},unindent:function(c,d){return b("utils").unindentString(d,this.getCurrentLinePadding(c))},getCurrentLinePadding:function(c){return b("utils").getLinePadding(c.getCurrentLine())}}});emmet.define("actionUtils",function(b,a){return{mimeTypes:{gif:"image/gif",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",svg:"image/svg+xml",html:"text/html",htm:"text/html"},extractAbbreviation:function(h){var f=h.length;var k=-1;var j=0;var g=0;var d=0;var i=b("utils");var e=b("abbreviationParser");while(true){f--;if(f<0){k=0;break}var c=h.charAt(f);if(c=="]"){g++}else{if(c=="["){if(!g){k=f+1;break}g--}else{if(c=="}"){d++}else{if(c=="{"){if(!d){k=f+1;break}d--}else{if(c==")"){j++}else{if(c=="("){if(!j){k=f+1;break}j--}else{if(g||d){continue}else{if(!e.isAllowedChar(c)||(c==">"&&i.endsWithTag(h.substring(0,f+1)))){k=f+1;break}}}}}}}}}if(k!=-1&&!d&&!g&&!j){return h.substring(k).replace(/^[\*\+\>\^]+/,"")}else{return""}},getImageSize:function(j){var f="\211PNG\r\n\032\n",i="\377\330",d="GIF8",h=0,c=function(){return j.charCodeAt(h++)};if(j.substr(0,8)===f){h=j.indexOf("IHDR")+4;return{width:(c()<<24)|(c()<<16)|(c()<<8)|c(),height:(c()<<24)|(c()<<16)|(c()<<8)|c()}}else{if(j.substr(0,4)===d){h=6;return{width:c()|(c()<<8),height:c()|(c()<<8)}}else{if(j.substr(0,2)===i){h=2;var e=j.length;while(h<e){if(c()!=255){return}var g=c();if(g==218){break}var k=(c()<<8)|c();if(g>=192&&g<=207&&!(g&4)&&!(g&8)){h+=1;return{height:(c()<<8)|c(),width:(c()<<8)|c()}}else{h+=k-2}}}}}},captureContext:function(i){var d={html:1,xml:1,xsl:1};var g=String(i.getSyntax());if(g in d){var j=String(i.getContent());var c=b("htmlMatcher").find(j,i.getCaretPos());if(c&&c.type=="tag"){var h=c.open;var f={name:h.name,attributes:[]};var e=b("xmlEditTree").parse(h.range.substring(j));if(e){f.attributes=a.map(e.getAll(),function(k){return{name:k.name(),value:k.value()}})}return f}}return null},findExpressionBounds:function(f,e){var g=String(f.getContent());var d=g.length;var h=f.getCaretPos()-1;var c=h+1;while(h>=0&&e(g.charAt(h),h,g)){h--}while(c<d&&e(g.charAt(c),c,g)){c++}if(c>h){return b("range").create([++h,c])}},compoundUpdate:function(c,e){if(e){var d=c.getSelectionRange();c.replaceContent(e.data,e.start,e.end,true);c.createSelection(e.caret,e.caret+d.end-d.start);return true}return false},detectSyntax:function(d,e){var c=e||"html";if(!b("resources").hasSyntax(c)){c="html"}if(c=="html"&&(this.isStyle(d)||this.isInlineCSS(d))){c="css"}if(c=="styl"){c="stylus"}return c},detectProfile:function(e){var c=e.getSyntax();var d=b("resources").findItem(c,"profile");if(d){return d}switch(c){case"xml":case"xsl":return"xml";case"css":if(this.isInlineCSS(e)){return"line"}break;case"html":d=b("resources").getVariable("profile");if(!d){d=this.isXHTML(e)?"xhtml":"html"}return d}return"xhtml"},isXHTML:function(c){return c.getContent().search(/<!DOCTYPE[^>]+XHTML/i)!=-1},isStyle:function(e){var f=String(e.getContent());var d=e.getCaretPos();var c=b("htmlMatcher").tag(f,d);return c&&c.open.name.toLowerCase()=="style"&&c.innerRange.cmp(d,"lte","gte")},isInlineCSS:function(f){var g=String(f.getContent());var e=f.getCaretPos();var d=b("xmlEditTree").parseFromPosition(g,e,true);if(d){var c=d.itemFromPosition(e,true);return c&&c.name().toLowerCase()=="style"&&c.valueRange(true).cmp(e,"lte","gte")}return false}}});emmet.define("abbreviationUtils",function(b,a){return{isUnary:function(d){if(d.children.length||d._text||this.isSnippet(d)){return false}var c=d.matchedResource();return c&&c.is_empty},isInline:function(c){return c.isTextNode()||!c.name()||b("tagName").isInlineLevel(c.name())},isBlock:function(c){return this.isSnippet(c)||!this.isInline(c)},isSnippet:function(c){return b("elements").is(c.matchedResource(),"snippet")},hasTagsInContent:function(c){return b("utils").matchesTag(c.content)},hasBlockChildren:function(c){return(this.hasTagsInContent(c)&&this.isBlock(c))||a.any(c.children,function(d){return this.isBlock(d)},this)},insertChildContent:function(g,e,d){d=a.extend({keepVariable:true,appendIfNoChild:true},d||{});var f=false;var c=b("utils");g=c.replaceVariables(g,function(j,i,k){var h=j;if(i=="child"){h=c.padString(e,c.getLinePaddingFromPosition(g,k.start));f=true;if(d.keepVariable){h+=j}}return h});if(!f&&d.appendIfNoChild){g+=e}return g}}});emmet.define("base64",function(b,a){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(k){var d=[];var s,q,o,r,p,n,m,l,j,g;var f=0,h=k.length,e=c;while(f<h){l=k.charCodeAt(f++);j=k.charCodeAt(f++);g=k.charCodeAt(f++);s=l&255;q=j&255;o=g&255;r=s>>2;p=((s&3)<<4)|(q>>4);n=((q&15)<<2)|(o>>6);m=o&63;if(isNaN(j)){n=m=64}else{if(isNaN(g)){m=64}}d.push(e.charAt(r)+e.charAt(p)+e.charAt(n)+e.charAt(m))}return d.join("")},decode:function(k){var g,e,d,o,n,m,l,q,j=0,r=0,h=[];var f=c,p=k.length;if(!k){return k}k+="";do{o=f.indexOf(k.charAt(j++));n=f.indexOf(k.charAt(j++));m=f.indexOf(k.charAt(j++));l=f.indexOf(k.charAt(j++));q=o<<18|n<<12|m<<6|l;g=q>>16&255;e=q>>8&255;d=q&255;if(m==64){h[r++]=String.fromCharCode(g)}else{if(l==64){h[r++]=String.fromCharCode(g,e)}else{h[r++]=String.fromCharCode(g,e,d)}}}while(j<p);return h.join("")}}});emmet.define("htmlMatcher",function(c,h){var a=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;var i=/^<\/([\w\:\-]+)[^>]*>/;function b(l,k){return{name:k[1],selfClose:!!k[3],range:c("range").create(l,k[0]),type:"open"}}function g(l,k){return{name:k[1],range:c("range").create(l,k[0]),type:"close"}}function f(l,k){return{range:c("range").create(l,h.isNumber(k)?k-l:k[0]),type:"comment"}}function d(n){var l={},k;return{open:function(p){var o=this.matches(p);return o&&o.type=="open"?o:null},close:function(p){var o=this.matches(p);return o&&o.type=="close"?o:null},matches:function(o){var m="p"+o;if(!(m in l)){if(n.charAt(o)=="<"){var p=n.slice(o);if((k=p.match(a))){l[m]=b(o,k)}else{if((k=p.match(i))){l[m]=g(o,k)}else{l[m]=false}}}}return l[m]},text:function(){return n}}}function e(l,m,k){return l.substring(m,m+k.length)==k}function j(l,m){var p=[],t=null;var r=m.text();for(var o=l.range.end,n=r.length;o<n;o++){if(e(r,o,"<!--")){for(var k=o;k<n;k++){if(e(r,k,"-->")){o=k+3;break}}}if((t=m.matches(o))){if(t.type=="open"&&!t.selfClose){p.push(t.name)}else{if(t.type=="close"){if(!p.length){return t.name==l.name?t:null}if(h.last(p)==t.name){p.pop()}else{var s=false;while(p.length&&!s){var q=p.pop();if(q==t.name){s=true}}if(!p.length&&!s){return t.name==l.name?t:null}}}}}}}return{find:function(w,v){var s=c("range");var t=d(w);var q=null,x=null;var n,p;for(var o=v;o>=0;o--){if((q=t.open(o))){if(q.selfClose){if(q.range.cmp(v,"lt","gt")){break}continue}x=j(q,t);if(x){var l=s.create2(q.range.start,x.range.end);if(l.contains(v)){break}}else{if(q.range.contains(v)){break}}q=null}else{if(e(w,o,"-->")){for(n=o-1;n>=0;n--){if(e(w,n,"-->")){break}else{if(e(w,n,"<!--")){o=n;break}}}}else{if(e(w,o,"<!--")){for(n=o+4,p=w.length;n<p;n++){if(e(w,n,"-->")){n+=3;break}}q=f(o,n);break}}}}if(q){var m=null;var k=null;if(x){m=s.create2(q.range.start,x.range.end);k=s.create2(q.range.end,x.range.start)}else{m=k=s.create2(q.range.start,q.range.end)}if(q.type=="comment"){var u=m.substring(w);k.start+=u.length-u.replace(/^<\!--\s*/,"").length;k.end-=u.length-u.replace(/\s*-->$/,"").length}return{open:q,close:x,type:q.type=="comment"?"comment":"tag",innerRange:k,innerContent:function(){return this.innerRange.substring(w)},outerRange:m,outerContent:function(){return this.outerRange.substring(w)},range:!k.length()||!k.cmp(v,"lte","gte")?m:k,content:function(){return this.range.substring(w)},source:w}}},tag:function(l,m){var k=this.find(l,m);if(k&&k.type=="tag"){return k}}}});emmet.define("tabStops",function(d,c){var e=100;var b=0;var a={replaceCarets:false,escape:function(f){return"\\"+f},tabstop:function(f){return f.token},variable:function(f){return f.token}};d("abbreviationParser").addOutputProcessor(function(l,i,h){var g=0;var j=d("tabStops");var f=d("utils");var k={tabstop:function(n){var o=parseInt(n.group,10);if(o===0){return"${0}"}if(o>g){g=o}if(n.placeholder){var m=o+b;var p=j.processText(n.placeholder,k);return"${"+m+":"+p+"}"}else{return"${"+(o+b)+"}"}}};l=j.processText(l,k);l=f.replaceVariables(l,j.variablesResolver(i));b+=g+1;return l});return{extract:function(m,k){var h=d("utils");var g={carets:""};var l=[];k=c.extend({},a,k,{tabstop:function(p){var o=p.token;var n="";if(p.placeholder=="cursor"){l.push({start:p.start,end:p.start+o.length,group:"carets",value:""})}else{if("placeholder" in p){g[p.group]=p.placeholder}if(p.group in g){n=g[p.group]}l.push({start:p.start,end:p.start+o.length,group:p.group,value:n})}return o}});if(k.replaceCarets){m=m.replace(new RegExp(h.escapeForRegexp(h.getCaretPlaceholder()),"g"),"${0:cursor}")}m=this.processText(m,k);var j="",f=0;var i=c.map(l,function(p){j+=m.substring(f,p.start);var o=j.length;var n=g[p.group]||"";j+=n;f=p.end;return{group:p.group,start:o,end:o+n.length}});j+=m.substring(f);return{text:j,tabstops:c.sortBy(i,"start")}},processText:function(l,o){o=c.extend({},a,o);var g="";var n=d("stringStream").create(l);var f,h,j;while((f=n.next())){if(f=="\\"&&!n.eol()){g+=o.escape(n.next());continue}j=f;if(f=="$"){n.start=n.pos-1;if((h=n.match(/^[0-9]+/))){j=o.tabstop({start:g.length,group:n.current().substr(1),token:n.current()})}else{if((h=n.match(/^\{([a-z_\-][\w\-]*)\}/))){j=o.variable({start:g.length,name:h[1],token:n.current()})}else{if((h=n.match(/^\{([0-9]+)(:.+?)?\}/,false))){n.skipToPair("{","}");var i={start:g.length,group:h[1],token:n.current()};var k=i.token.substring(i.group.length+2,i.token.length-1);if(k){i.placeholder=k.substr(1)}j=o.tabstop(i)}}}}g+=j}return g},upgrade:function(h,i){var g=0;var f={tabstop:function(j){var k=parseInt(j.group,10);if(k>g){g=k}if(j.placeholder){return"${"+(k+i)+":"+j.placeholder+"}"}else{return"${"+(k+i)+"}"}}};c.each(["start","end","content"],function(j){h[j]=this.processText(h[j],f)},this);return g},variablesResolver:function(h){var g={};var f=d("resources");return function(j,l){if(l=="child"){return j}if(l=="cursor"){return d("utils").getCaretPlaceholder()}var i=h.attribute(l);if(!c.isUndefined(i)&&i!==j){return i}var k=f.getVariable(l);if(k){return k}if(!g[l]){g[l]=e++}return"${"+g[l]+":"+l+"}"}},resetTabstopIndex:function(){b=0;e=100}}});emmet.define("preferences",function(d,c){var b={};var h={};var e=null;var g=null;function a(i){if(c.isString(i)){i=i.toLowerCase();return i=="yes"||i=="true"||i=="1"}return !!i}function f(i){return c.isObject(i)&&"value" in i&&c.keys(i).length<3}return{define:function(j,l,k){var i=j;if(c.isString(j)){i={};i[j]={value:l,description:k}}c.each(i,function(n,m){h[m]=f(n)?n:{value:n}})},set:function(j,k){var i=j;if(c.isString(j)){i={};i[j]=k}c.each(i,function(m,l){if(!(l in h)){throw'Property "'+l+'" is not defined. You should define it first with `define` method of current module'}if(m!==h[l].value){switch(typeof h[l].value){case"boolean":m=a(m);break;case"number":m=parseInt(m+"",10)||0;break;default:if(m!==null){m+=""}}b[l]=m}else{if(l in b){delete b[l]}}})},get:function(i){if(i in b){return b[i]}if(i in h){return h[i].value}return void 0},getArray:function(i){var j=this.get(i);if(c.isUndefined(j)||j===null||j===""){return null}j=c.map(j.split(","),d("utils").trim);if(!j.length){return null}return j},getDict:function(j){var i={};c.each(this.getArray(j),function(l){var k=l.split(":");i[k[0]]=k[1]});return i},description:function(i){return i in h?h[i].description:void 0},remove:function(i){if(!c.isArray(i)){i=[i]}c.each(i,function(j){if(j in b){delete b[j]}if(j in h){delete h[j]}})},list:function(){return c.map(c.keys(h).sort(),function(i){return{name:i,value:this.get(i),type:typeof h[i].value,description:h[i].description}},this)},load:function(i){c.each(i,function(k,j){this.set(j,k)},this)},exportModified:function(){return c.clone(b)},reset:function(){b={}},_startTest:function(){e=h;g=b;h={};b={}},_stopTest:function(){h=e;b=g}}});emmet.define("filters",function(c,b){var e={};var a="html";function d(f){if(!f){return[]}if(b.isString(f)){return f.split(/[\|,]/g)}return f}return{add:function(f,g){e[f]=g},apply:function(f,i,h){var g=c("utils");h=c("profile").get(h);b.each(d(i),function(k){var j=g.trim(k.toLowerCase());if(j&&j in e){f=e[j](f,h)}});return f},composeList:function(f,g,i){g=c("profile").get(g);var h=d(g.filters||c("resources").findItem(f,"filters")||a);if(g.extraFilters){h=h.concat(d(g.extraFilters))}if(i){h=h.concat(d(i))}if(!h||!h.length){h=d(a)}return h},extractFromAbbreviation:function(f){var g="";f=f.replace(/\|([\w\|\-]+)$/,function(i,h){g=h;return""});return[f,d(g)]}}});emmet.define("elements",function(d,c){var f={};var b=/([\w\-:]+)\s*=\s*(['"])(.*?)\2/g;var a={add:function(h,g){var i=this;f[h]=function(){var j=g.apply(i,arguments);if(j){j.type=h}return j}},get:function(g){return f[g]},create:function(i){var h=[].slice.call(arguments,1);var g=this.get(i);return g?g.apply(this,h):null},is:function(h,g){return h&&h.type===g}};function e(g){return{data:g}}a.add("element",function(h,j,k){var i={name:h,is_empty:!!k};if(j){i.attributes=[];if(c.isArray(j)){i.attributes=j}else{if(c.isString(j)){var g;while((g=b.exec(j))){i.attributes.push({name:g[1],value:g[3]})}}else{c.each(j,function(m,l){i.attributes.push({name:l,value:m})})}}}return i});a.add("snippet",e);a.add("reference",e);a.add("empty",function(){return{}});return a});emmet.define("editTree",function(e,d,b){var c=e("range").create;function a(h,g){this.options=d.extend({offset:0},g);this.source=h;this._children=[];this._positions={name:0};this.initialize.apply(this,arguments)}a.extend=b.extend;a.prototype={initialize:function(){},_updateSource:function(i,l,g){var h=c(l,d.isUndefined(g)?0:g-l);var k=i.length-h.length();var j=function(m){d.each(m,function(o,n){if(o>=h.end){m[n]+=k}})};j(this._positions);d.each(this.list(),function(m){j(m._positions)});this.source=e("utils").replaceSubstring(this.source,i,h)},add:function(g,i,j){var h=new f(g,i);this._children.push(h);return h},get:function(g){if(d.isNumber(g)){return this.list()[g]}if(d.isString(g)){return d.find(this.list(),function(h){return h.name()===g})}return g},getAll:function(h){if(!d.isArray(h)){h=[h]}var i=[],g=[];d.each(h,function(j){if(d.isString(j)){i.push(j)}else{if(d.isNumber(j)){g.push(j)}}});return d.filter(this.list(),function(k,j){return d.include(g,j)||d.include(i,k.name())})},value:function(g,i,j){var h=this.get(g);if(h){return h.value(i)}if(!d.isUndefined(i)){return this.add(g,i,j)}},values:function(g){return d.map(this.getAll(g),function(h){return h.value()})},remove:function(g){var h=this.get(g);if(h){this._updateSource("",h.fullRange());this._children=d.without(this._children,h)}},list:function(){return this._children},indexOf:function(g){return d.indexOf(this.list(),this.get(g))},name:function(g){if(!d.isUndefined(g)&&this._name!==(g=String(g))){this._updateSource(g,this._positions.name,this._positions.name+this._name.length);this._name=g}return this._name},nameRange:function(g){return c(this._positions.name+(g?this.options.offset:0),this.name())},range:function(g){return c(g?this.options.offset:0,this.valueOf())},itemFromPosition:function(h,g){return d.find(this.list(),function(i){return i.range(g).inside(h)})},toString:function(){return this.valueOf()},valueOf:function(){return this.source}};function f(g,h,i){this.parent=g;this._name=h.value;this._value=i?i.value:"";this._positions={name:h.start,value:i?i.start:-1};this.initialize.apply(this,arguments)}f.extend=b.extend;f.prototype={initialize:function(){},_pos:function(g,h){return g+(h?this.parent.options.offset:0)},value:function(g){if(!d.isUndefined(g)&&this._value!==(g=String(g))){this.parent._updateSource(g,this.valueRange());this._value=g}return this._value},name:function(g){if(!d.isUndefined(g)&&this._name!==(g=String(g))){this.parent._updateSource(g,this.nameRange());this._name=g}return this._name},namePosition:function(g){return this._pos(this._positions.name,g)},valuePosition:function(g){return this._pos(this._positions.value,g)},range:function(g){return c(this.namePosition(g),this.valueOf())},fullRange:function(g){return this.range(g)},nameRange:function(g){return c(this.namePosition(g),this.name())},valueRange:function(g){return c(this.valuePosition(g),this.value())},toString:function(){return this.valueOf()},valueOf:function(){return this.name()+this.value()}};return{EditContainer:a,EditElement:f,createToken:function(j,h,g){var i={start:j||0,value:h||"",type:g};i.end=i.start+i.value.length;return i}}});emmet.define("cssEditTree",function(d,m){var e={styleBefore:"\n\t",styleSeparator:": ",offset:0};var b=1;var i=2;function f(o,n){return d("range").create(o,n)}function g(p,n){n=n||(b|i);var o=["white","line"];if((n&i)==i){while(p.length&&m.include(o,m.last(p).type)){p.pop()}}if((n&b)==b){while(p.length&&m.include(o,p[0].type)){p.shift()}}return p}function j(p){var q=[],o;var r=p.position(),n;while((o=p.next())){if(o.type=="{"){break}q.push(o)}g(q);if(q.length){r=q[0].start;n=m.last(q).end}else{n=r}return f(r,n-r)}function l(p){var r=["white","line",":"];var q=[],o,s,n;p.nextUntil(function(){return !m.include(r,this.itemNext().type)});s=p.current().end;while((o=p.next())){if(o.type=="}"||o.type==";"){g(q,b|(o.type=="}"?i:0));if(q.length){s=q[0].start;n=m.last(q).end}else{n=s}return f(s,n-s)}q.push(o)}if(q.length){return f(q[0].start,m.last(q).end-q[0].start)}}function k(s){var r=d("stringStream").create(s);var p;var n=[];var o=/[\s\u00a0,]/;var q=function(){r.next();n.push(f(r.start,r.current()));r.start=r.pos};r.eatSpace();r.start=r.pos;while((p=r.next())){if(p=='"'||p=="'"){r.next();if(!r.skipTo(p)){break}q()}else{if(p=="("){r.backUp(1);if(!r.skipToPair("(",")")){break}r.backUp(1);q()}else{if(o.test(p)){n.push(f(r.start,r.current().length-1));r.eatWhile(o);r.start=r.pos}}}}q();return m.chain(n).filter(function(t){return !!t.length()}).uniq(false,function(t){return t.toString()}).value()}function c(p){var q=p.tokens;for(var o=p._i+1,n=q.length;o<n;o++){if(q[o].type==":"){return true}if(q[o].type=="identifier"||q[o].type=="line"){return false}}return false}var h=d("editTree").EditContainer.extend({initialize:function(n,v){m.defaults(this.options,e);var r=d("editTree");var q=d("tokenIterator").create(d("cssParser").parse(n));var t=j(q);this._positions.name=t.start;this._name=t.substring(n);if(!q.current()||q.current().type!="{"){throw"Invalid CSS rule"}this._positions.contentStart=q.position()+1;var u,s,o;while((o=q.next())){if(o.type=="identifier"&&c(q)){u=f(o);s=l(q);var p=(q.current()&&q.current().type==";")?f(q.current()):f(s.end,0);this._children.push(new a(this,r.createToken(u.start,u.substring(n)),r.createToken(s.start,s.substring(n)),r.createToken(p.start,p.substring(n))))}}this._saveStyle()},_saveStyle:function(){var p=this._positions.contentStart;var o=this.source;var n=d("utils");m.each(this.list(),function(r){r.styleBefore=o.substring(p,r.namePosition());var q=n.splitByLines(r.styleBefore);if(q.length>1){r.styleBefore="\n"+m.last(q)}r.styleSeparator=o.substring(r.nameRange().end,r.valuePosition());r.styleBefore=m.last(r.styleBefore.split("*/"));r.styleSeparator=r.styleSeparator.replace(/\/\*.*?\*\//g,"");p=r.range().end})},add:function(n,v,u){var s=this.list();var o=this._positions.contentStart;var x=m.pick(this.options,"styleBefore","styleSeparator");var r=d("editTree");if(m.isUndefined(u)){u=s.length}var t=s[u];if(t){o=t.fullRange().start}else{if((t=s[u-1])){t.end(";");o=t.range().end}}if(t){x=m.pick(t,"styleBefore","styleSeparator")}var p=r.createToken(o+x.styleBefore.length,n);var q=r.createToken(p.end+x.styleSeparator.length,v);var w=new a(this,p,q,r.createToken(q.end,";"));m.extend(w,x);this._updateSource(w.styleBefore+w.toString(),o);this._children.splice(u,0,w);return w}});var a=d("editTree").EditElement.extend({initialize:function(q,o,p,n){this.styleBefore=q.options.styleBefore;this.styleSeparator=q.options.styleSeparator;this._end=n.value;this._positions.end=n.start},valueParts:function(o){var n=k(this.value());if(o){var p=this.valuePosition(true);m.each(n,function(q){q.shift(p)})}return n},end:function(n){if(!m.isUndefined(n)&&this._end!==n){this.parent._updateSource(n,this._positions.end,this._positions.end+this._end.length);this._end=n}return this._end},fullRange:function(o){var n=this.range(o);n.start-=this.styleBefore.length;return n},valueOf:function(){return this.name()+this.styleSeparator+this.value()+this.end()}});return{parse:function(o,n){return new h(o,n)},parseFromPosition:function(o,q,p){var n=this.extractRule(o,q,p);if(!n||!n.inside(q)){return null}return this.parse(n.substring(o),{offset:n.start})},extractRule:function(r,t,u){var w="";var q=r.length;var p=t;var v="{}/\\<>\n\r";var s=-1,n;while(p>=0){n=r.charAt(p);if(n=="{"){s=p;break}else{if(n=="}"&&!u){p++;break}}p--}while(p<q){n=r.charAt(p);if(n=="{"){s=p}else{if(n=="}"){if(s!=-1){w=r.substring(s,p+1)}break}}p++}if(w){p=s-1;var o="";while(p>=0){n=r.charAt(p);if(v.indexOf(n)!=-1){break}p--}o=r.substring(p+1,s).replace(/^[\s\n\r]+/m,"");return d("range").create(s-o.length,w.length+o.length)}return null},baseName:function(n){return n.replace(/^\s*\-\w+\-/,"")},findParts:k}});emmet.define("xmlEditTree",function(d,c){var b={styleBefore:" ",styleSeparator:"=",styleQuote:'"',offset:0};var e=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/m;var a=d("editTree").EditContainer.extend({initialize:function(j,h){c.defaults(this.options,b);this._positions.name=1;var i=null;var k=d("xmlParser").parse(j);var g=d("range");c.each(k,function(l){l.value=g.create(l).substring(j);switch(l.type){case"tag":if(/^<[^\/]+/.test(l.value)){this._name=l.value.substring(1)}break;case"attribute":if(i){this._children.push(new f(this,i))}i=l;break;case"string":this._children.push(new f(this,i,l));i=null;break}},this);if(i){this._children.push(new f(this,i))}this._saveStyle()},_saveStyle:function(){var h=this.nameRange().end;var g=this.source;c.each(this.list(),function(i){i.styleBefore=g.substring(h,i.namePosition());if(i.valuePosition()!==-1){i.styleSeparator=g.substring(i.namePosition()+i.name().length,i.valuePosition()-i.styleQuote.length)}h=i.range().end})},add:function(g,n,m){var k=this.list();var h=this.nameRange().end;var j=d("editTree");var o=c.pick(this.options,"styleBefore","styleSeparator","styleQuote");if(c.isUndefined(m)){m=k.length}var l=k[m];if(l){h=l.fullRange().start}else{if((l=k[m-1])){h=l.range().end}}if(l){o=c.pick(l,"styleBefore","styleSeparator","styleQuote")}n=o.styleQuote+n+o.styleQuote;var i=new f(this,j.createToken(h+o.styleBefore.length,g),j.createToken(h+o.styleBefore.length+g.length+o.styleSeparator.length,n));c.extend(i,o);this._updateSource(i.styleBefore+i.toString(),h);this._children.splice(m,0,i);return i}});var f=d("editTree").EditElement.extend({initialize:function(h,j,k){this.styleBefore=h.options.styleBefore;this.styleSeparator=h.options.styleSeparator;var i="",g=h.options.styleQuote;if(k){i=k.value;g=i.charAt(0);if(g=='"'||g=="'"){i=i.substring(1)}else{g=""}if(g&&i.charAt(i.length-1)==g){i=i.substring(0,i.length-1)}}this.styleQuote=g;this._value=i;this._positions.value=k?k.start+g.length:-1},fullRange:function(h){var g=this.range(h);g.start-=this.styleBefore.length;return g},valueOf:function(){return this.name()+this.styleSeparator+this.styleQuote+this.value()+this.styleQuote}});return{parse:function(h,g){return new a(h,g)},parseFromPosition:function(h,j,i){var g=this.extractTag(h,j,i);if(!g||!g.inside(j)){return null}return this.parse(g.substring(h),{offset:g.start})},extractTag:function(n,o,p){var m=n.length,j;var l=d("range");var h=Math.min(2000,m);var g=null;var k=function(q){var i;if(n.charAt(q)=="<"&&(i=n.substr(q,h).match(e))){return l.create(q,i[0])}};for(j=o;j>=0;j--){if((g=k(j))){break}}if(g&&(g.inside(o)||p)){return g}if(!g&&p){return null}for(j=o;j<m;j++){if((g=k(j))){return g}}}}});emmet.define("expandAbbreviation",function(c,b){var a=c("handlerList").create();var d=null;var e=c("actions");e.add("expand_abbreviation",function(i,f,h){var g=b.toArray(arguments);var j=c("editorUtils").outputInfo(i,f,h);g[1]=j.syntax;g[2]=j.profile;return a.exec(false,g)});e.add("expand_abbreviation_with_tab",function(k,i,h){var f=k.getSelection();var g=c("resources").getVariable("indentation");if(f){var n=c("utils");var j=c("range").create(k.getSelectionRange());var l=n.padString(f,g);k.replaceContent(g+"${0}",k.getCaretPos());var m=c("range").create(k.getCaretPos(),j.length());k.replaceContent(l,m.start,m.end,true);k.createSelection(m.start,m.start+l.length);return true}if(!e.run("expand_abbreviation",k,i,h)){k.replaceContent(g,k.getCaretPos())}return true},{hidden:true});a.add(function(j,f,i){var h=j.getSelectionRange().end;var g=d.findAbbreviation(j);if(g){var k=emmet.expandAbbreviation(g,f,i,c("actionUtils").captureContext(j));if(k){j.replaceContent(k,h-g.length,h);return true}}return false},{order:-1});return d={addHandler:function(g,f){a.add(g,f)},removeHandler:function(f){a.remove(f)},findAbbreviation:function(h){var g=c("range").create(h.getSelectionRange());var i=String(h.getContent());if(g.length()){return g.substring(i)}var f=h.getCurrentLineRange();return c("actionUtils").extractAbbreviation(i.substring(f.start,g.start))}}});emmet.define("wrapWithAbbreviation",function(b,a){var c=null;b("actions").add("wrap_with_abbreviation",function(j,m,g,f){var e=b("editorUtils").outputInfo(j,g,f);var l=b("utils");var d=b("editorUtils");m=m||j.prompt("Enter abbreviation");if(!m){return null}m=String(m);var i=b("range").create(j.getSelectionRange());if(!i.length()){var h=b("htmlMatcher").tag(e.content,i.start);if(!h){return false}i=l.narrowToNonSpace(e.content,h.range)}var k=l.escapeText(i.substring(e.content));var n=c.wrap(m,d.unindent(j,k),e.syntax,e.profile,b("actionUtils").captureContext(j));if(n){j.replaceContent(n,i.start,i.end);return true}return false});return c={wrap:function(m,l,g,f,i){var e=b("filters");var k=b("utils");g=g||emmet.defaultSyntax();f=b("profile").get(f,g);b("tabStops").resetTabstopIndex();var h=e.extractFromAbbreviation(m);var j=b("abbreviationParser").parse(h[0],{syntax:g,pastedContent:l,contextNode:i});if(j){var d=e.composeList(g,f,h[1]);e.apply(j,d,f);return k.replaceVariables(j.valueOf())}return null}}});emmet.exec(function(e,d){var c=e("preferences");function h(k){var j=e("range").create(k.getSelectionRange());var l=e("editorUtils").outputInfo(k);if(!j.length()){var i=e("htmlMatcher").tag(l.content,k.getCaretPos());if(i){j=i.outerRange}}return b(k,"<!--","-->",j)}function f(j){var i=e("range").create(j.getSelectionRange());var m=e("editorUtils").outputInfo(j);if(!i.length()){var l=e("cssEditTree").parseFromPosition(m.content,j.getCaretPos());if(l){var k=g(l,j.getCaretPos());i=k?k.range(true):e("range").create(l.nameRange(true).start,l.source)}}if(!i.length()){i=e("range").create(j.getCurrentLineRange());e("utils").narrowToNonSpace(m.content,i)}return b(j,"/*","*/",i)}function g(l,j){var i=j-(l.options.offset||0);var k=/^[\s\n\r]/;return d.find(l.list(),function(m){if(m.range().end===i){return k.test(l.source.charAt(i))}return m.range().inside(i)})}function a(m,p,o,k){var n=-1;var l=-1;var i=function(q,r){return m.substr(r,q.length)==q};while(p--){if(i(o,p)){n=p;break}}if(n!=-1){p=n;var j=m.length;while(j>=p++){if(i(k,p)){l=p+k.length;break}}}return(n!=-1&&l!=-1)?e("range").create(n,l-n):null}function b(l,m,q,k){var i=e("editorUtils");var n=i.outputInfo(l).content;var j=l.getCaretPos();var o=null;var p=e("utils");function r(t){return t.replace(new RegExp("^"+p.escapeForRegexp(m)+"\\s*"),function(u){j-=u.length;return""}).replace(new RegExp("\\s*"+p.escapeForRegexp(q)+"$"),"")}var s=a(n,j,m,q);if(s&&s.overlap(k)){k=s;o=r(k.substring(n))}else{o=m+" "+k.substring(n).replace(new RegExp(p.escapeForRegexp(m)+"\\s*|\\s*"+p.escapeForRegexp(q),"g"),"")+" "+q;j+=m.length+1}if(o!==null){o=p.escapeText(o);l.setCaretPos(k.start);l.replaceContent(i.unindent(l,o),k.start,k.end);l.setCaretPos(j);return true}return false}e("actions").add("toggle_comment",function(k){var m=e("editorUtils").outputInfo(k);if(m.syntax=="css"){var j=k.getCaretPos();var i=e("htmlMatcher").tag(m.content,j);if(i&&i.open.range.inside(j)){m.syntax="html"}}var l=c.getArray("css.syntaxes");if(d.include(l,m.syntax)){return f(k)}return h(k)})});emmet.exec(function(b,a){function c(l,h,k){h=h||1;k=k||0;var j=l.getCaretPos()+k;var m=String(l.getContent());var i=m.length;var n=-1;var e=/^\s+$/;function p(q){var s=q;while(s>=0){var r=m.charAt(s);if(r=="\n"||r=="\r"){break}s--}return m.substring(s,q)}while(j<=i&&j>=0){j+=h;var f=m.charAt(j);var g=m.charAt(j+1);var o=m.charAt(j-1);switch(f){case'"':case"'":if(g==f&&o=="="){n=j+1}break;case">":if(g=="<"){n=j+1}break;case"\n":case"\r":if(e.test(p(j-1))){n=j}break}if(n!=-1){break}}return n}var d=b("actions");d.add("prev_edit_point",function(g){var f=g.getCaretPos();var e=c(g,-1);if(e==f){e=c(g,-1,-2)}if(e!=-1){g.setCaretPos(e);return true}return false},{label:"Previous Edit Point"});d.add("next_edit_point",function(f){var e=c(f,1);if(e!=-1){f.setCaretPos(e);return true}return false})});emmet.exec(function(f,r){var m=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;function h(A,C,D,F){var z=f("range");var B=f("editorUtils").outputInfo(A).content;var u=B.length;var E,t;var x=z.create(-1,0);var w=z.create(A.getSelectionRange());var v=w.start,y=100000;while(v>=0&&v<u&&--y>0){if((E=D(B,v,C))){if(x.equal(E)){break}x=E.clone();t=F(E.substring(B),E.start,w.clone());if(t){A.createSelection(t.start,t.end);return true}else{v=C?E.start:E.end-1}}v+=C?-1:1}return false}function s(u){var t=true;return h(u,false,function(w,v){if(t){t=false;return j(w,v)}else{return d(w,v)}},function(v,x,w){return e(v,x,w,false)})}function q(t){return h(t,true,d,function(u,w,v){return e(u,w,v,true)})}function o(t,z,v){v=v||0;var w=f("range");var C=[];var B=-1,A="",x="",y,u;r.each(z,function(D){switch(D.type){case"tag":u=t.substring(D.start,D.end);if(/^<[\w\:\-]/.test(u)){C.push(w.create({start:D.start+1,end:D.end}))}break;case"attribute":B=D.start;A=t.substring(D.start,D.end);break;case"string":C.push(w.create(B,D.end-B));y=w.create(D);x=y.substring(t);if(a(x.charAt(0))){y.start++}if(a(x.charAt(x.length-1))){y.end--}C.push(y);if(A=="class"){C=C.concat(i(y.substring(t),y.start))}break}});r.each(C,function(D){D.shift(v)});return r.chain(C).filter(function(D){return !!D.length()}).uniq(false,function(D){return D.toString()}).value()}function i(w,y){y=y||0;var t=[];var x=f("stringStream").create(w);var u=f("range");x.eatSpace();x.start=x.pos;var v;while((v=x.next())){if(/[\s\u00a0]/.test(v)){t.push(u.create(x.start+y,x.pos-x.start-1));x.eatSpace();x.start=x.pos}}t.push(u.create(x.start+y,x.pos-x.start));return t}function e(t,A,x,z){var w=o(t,f("xmlParser").parse(t),A);if(z){w.reverse()}var y=r.find(w,function(B){return B.equal(x)});if(y){var v=r.indexOf(w,y);if(v<w.length-1){return w[v+1]}return null}if(z){return r.find(w,function(B){return B.start<x.start})}if(!y){var u=r.filter(w,function(B){return B.inside(x.end)});if(u.length>1){return u[1]}}return r.find(w,function(B){return B.end>x.end})}function j(u,v){var t;while(v>=0){if((t=d(u,v))){return t}v--}return null}function d(u,v){var t;if(u.charAt(v)=="<"&&(t=u.substring(v,u.length).match(m))){return f("range").create(v,t[0])}}function a(t){return t=='"'||t=="'"}function k(y){var z=y.valueRange(true);var t=[y.range(true),z];var w=f("stringStream");var v=f("cssEditTree");var u=f("range");var x=y.value();r.each(y.valueParts(),function(A){var D=A.clone();t.push(D.shift(z.start));var C=w.create(A.substring(x));if(C.match(/^[\w\-]+\(/,true)){C.start=C.pos;C.skipToPair("(",")");var B=C.current();t.push(u.create(D.start+C.start,B));r.each(v.findParts(B),function(E){t.push(u.create(D.start+C.start+E.start,E.substring(B)))})}});return r.chain(t).filter(function(A){return !!A.length()}).uniq(false,function(A){return A.toString()}).value()}function n(z,v,A){var C=null;var B,F=null,t;var w=z.list();var x,E;if(A){w.reverse();x=function(G){return G.range(true).start<=v.start};E=function(G){return G.start<v.start}}else{x=function(G){return G.range(true).end>=v.end};E=function(G){return G.end>v.start}}var D=function(G){return G.equal(v)};var u=function(G){return G.inside(v.end)};while((C=r.find(w,x))){B=k(C);if(A){B.reverse()}F=r.find(B,D);if(!F){var y=r.filter(B,u);if(y.length>1){F=y[1];break}if((F=r.find(B,E))){break}}else{t=r.indexOf(B,F);if(t!=B.length-1){F=B[t+1];break}}F=null;v.start=v.end=A?C.range(true).start-1:C.range(true).end+1}return F}function b(t){return h(t,false,f("cssEditTree").extractRule,p)}function l(t){return h(t,true,f("cssEditTree").extractRule,c)}function p(w,x,u){var t=f("cssEditTree").parse(w,{offset:x});var v=t.nameRange(true);if(u.end<v.end){return v}return n(t,u,false)}function c(x,y,u){var t=f("cssEditTree").parse(x,{offset:y});var w=n(t,u,true);if(!w){var v=t.nameRange(true);if(u.start>v.start){return v}}return w}var g=f("actions");g.add("select_next_item",function(t){if(t.getSyntax()=="css"){return b(t)}else{return s(t)}});g.add("select_previous_item",function(t){if(t.getSyntax()=="css"){return l(t)}else{return q(t)}})});emmet.exec(function(c,b){var e=c("actions");var d=c("htmlMatcher");var f=null;function a(h,m){m=String((m||"out").toLowerCase());var l=c("editorUtils").outputInfo(h);var g=c("range");var j=g.create(h.getSelectionRange());var i=l.content;if(f&&!f.range.equal(j)){f=null}if(f&&j.length()){if(m=="in"){if(f.type=="tag"&&!f.close){return false}else{if(f.range.equal(f.outerRange)){f.range=f.innerRange}else{var k=c("utils").narrowToNonSpace(i,f.innerRange);f=d.find(i,k.start+1);if(f&&f.range.equal(j)&&f.outerRange.equal(j)){f.range=f.innerRange}}}}else{if(!f.innerRange.equal(f.outerRange)&&f.range.equal(f.innerRange)&&j.equal(f.range)){f.range=f.outerRange}else{f=d.find(i,j.start);if(f&&f.range.equal(j)&&f.innerRange.equal(j)){f.range=f.outerRange}}}}else{f=d.find(i,j.start)}if(f&&!f.range.equal(j)){h.createSelection(f.range.start,f.range.end);return true}f=null;return false}e.add("match_pair",a,{hidden:true});e.add("match_pair_inward",function(g){return a(g,"in")},{label:"HTML/Match Pair Tag (inward)"});e.add("match_pair_outward",function(g){return a(g,"out")},{label:"HTML/Match Pair Tag (outward)"});e.add("matching_pair",function(i){var j=String(i.getContent());var h=i.getCaretPos();if(j.charAt(h)=="<"){h++}var g=d.tag(j,h);if(g&&g.close){if(g.open.range.inside(h)){i.setCaretPos(g.close.range.start)}else{i.setCaretPos(g.open.range.start)}return true}return false},{label:"HTML/Go To Matching Tag Pair"})});emmet.exec(function(b,a){b("actions").add("remove_tag",function(h){var d=b("utils");var j=b("editorUtils").outputInfo(h);var c=b("htmlMatcher").tag(j.content,h.getCaretPos());if(c){if(!c.close){h.replaceContent(d.getCaretPlaceholder(),c.range.start,c.range.end)}else{var i=d.narrowToNonSpace(j.content,c.innerRange);var e=d.findNewlineBounds(j.content,i.start);var g=d.getLinePadding(e.substring(j.content));var f=i.substring(j.content);f=d.unindentString(f,g);h.replaceContent(d.getCaretPlaceholder()+d.escapeText(f),c.outerRange.start,c.outerRange.end)}return true}return false},{label:"HTML/Remove Tag"})});emmet.exec(function(c,b){function a(j,i,e){var f=c("utils");var h=i.selfClosing()||" /";var k=e.open.range.substring(e.source).replace(/\s*>$/,h+">");var g=j.getCaretPos();if(k.length+e.outerRange.start<g){g=k.length+e.outerRange.start}k=f.escapeText(k);j.replaceContent(k,e.outerRange.start,e.outerRange.end);j.setCaretPos(g);return true}function d(j,g,m){var l=c("utils");var e=l.getNewline();var f=c("resources").getVariable("indentation");var i=j.getCaretPos();var h=(g.tag_nl===true)?e+f+e:"";var k=m.outerContent().replace(/\s*\/>$/,">");i=m.outerRange.start+k.length;k+=h+"</"+m.open.name+">";k=l.escapeText(k);j.replaceContent(k,m.outerRange.start,m.outerRange.end);j.setCaretPos(i);return true}c("actions").add("split_join_tag",function(h,g){var j=c("htmlMatcher");var i=c("editorUtils").outputInfo(h,null,g);var f=c("profile").get(i.profile);var e=j.tag(i.content,h.getCaretPos());if(e){return e.close?a(h,f,e):d(h,f,e)}return false},{label:"HTML/Split\\Join Tag Declaration"})});emmet.define("reflectCSSValue",function(d,c){var b=d("handlerList").create();d("actions").add("reflect_css_value",function(h){if(h.getSyntax()!="css"){return false}return d("actionUtils").compoundUpdate(h,a(h))},{label:"CSS/Reflect Value"});function a(m){var k=d("cssEditTree");var n=d("editorUtils").outputInfo(m);var l=m.getCaretPos();var h=k.parseFromPosition(n.content,l);if(!h){return}var p=h.itemFromPosition(l,true);if(!p){return}var o=h.source;var j=h.options.offset;var i=l-j-p.range().start;b.exec(false,[p]);if(o!==h.source){return{data:h.source,start:j,end:j+o.length,caret:j+p.range().start+i}}}function e(i){i=d("cssEditTree").baseName(i);var j="^(?:\\-\\w+\\-)?",h;if(i=="opacity"||i=="filter"){return new RegExp(j+"(?:opacity|filter)$")}else{if((h=i.match(/^border-radius-(top|bottom)(left|right)/))){return new RegExp(j+"(?:"+i+"|border-"+h[1]+"-"+h[2]+"-radius)$")}else{if((h=i.match(/^border-(top|bottom)-(left|right)-radius/))){return new RegExp(j+"(?:"+i+"|border-radius-"+h[1]+h[2]+")$")}}}return new RegExp(j+i+"$")}function g(h,j){var i=f(h.name(),h.value(),j.name(),j.value());j.value(i)}function f(k,n,o,j){var l=d("cssEditTree");var i=d("utils");k=l.baseName(k);o=l.baseName(o);if(k=="opacity"&&o=="filter"){return j.replace(/opacity=[^)]*/i,"opacity="+Math.floor(parseFloat(n)*100))}else{if(k=="filter"&&o=="opacity"){var h=n.match(/opacity=([^)]*)/i);return h?i.prettifyNumber(parseInt(h[1],10)/100):j}}return n}b.add(function(h){var i=e(h.name());c.each(h.parent.list(),function(j){if(i.test(j.name())){g(h,j)}})},{order:-1});return{addHandler:function(i,h){b.add(i,h)},removeHandler:function(h){b.remove(h)}}});emmet.exec(function(b,a){b("actions").add("evaluate_math_expression",function(f){var c=b("actionUtils");var k=b("utils");var h=String(f.getContent());var i=".+-*/\\";var d=b("range").create(f.getSelectionRange());if(!d.length()){d=c.findExpressionBounds(f,function(e){return k.isNumeric(e)||i.indexOf(e)!=-1})}if(d&&d.length()){var j=d.substring(h);j=j.replace(/([\d\.\-]+)\\([\d\.\-]+)/g,"Math.round($1/$2)");try{var l=k.prettifyNumber(new Function("return "+j)());f.replaceContent(l,d.start,d.end);f.setCaretPos(d.start+l.length);return true}catch(g){}}return false},{label:"Numbers/Evaluate Math Expression"})});emmet.exec(function(b,a){function e(m,i){var o=b("utils");var h=b("actionUtils");var n=false;var g=false;var f=h.findExpressionBounds(m,function(q,s,r){if(o.isNumeric(q)){return true}if(q=="."){if(!o.isNumeric(r.charAt(s+1))){return false}return g?false:g=true}if(q=="-"){return n?false:n=true}return false});if(f&&f.length()){var p=f.substring(String(m.getContent()));var l=parseFloat(p);if(!a.isNaN(l)){l=o.prettifyNumber(l+i);if(/^(\-?)0+[1-9]/.test(p)){var j="";if(RegExp.$1){j="-";l=l.substring(1)}var k=l.split(".");k[0]=o.zeroPadString(k[0],d(p));l=j+k.join(".")}m.replaceContent(l,f.start,f.end);m.createSelection(f.start,f.start+l.length);return true}}return false}function d(f){f=f.replace(/^\-/,"");if(~f.indexOf(".")){return f.split(".")[0].length}return f.length}var c=b("actions");a.each([1,-1,10,-10,0.1,-0.1],function(f){var g=f>0?"increment":"decrement";c.add(g+"_number_by_"+String(Math.abs(f)).replace(".","").substring(0,2),function(h){return e(h,f)},{label:"Numbers/"+g.charAt(0).toUpperCase()+g.substring(1)+" number by "+Math.abs(f)})})});emmet.exec(function(c,b){var d=c("actions");var a=c("preferences");a.define("css.closeBraceIndentation","\n","Indentation before closing brace of CSS rule. Some users prefere indented closing brace of CSS rule for better readability. This preference’s value will be automatically inserted before closing brace when user adds newline in newly created CSS rule (e.g. when “Insert formatted linebreak” action will be performed in CSS file). If you’re such user, you may want to write put a value like <code>\\n\\t</code> in this preference.");d.add("insert_formatted_line_break_only",function(n){var s=c("utils");var p=c("resources");var h=c("editorUtils").outputInfo(n);var m=n.getCaretPos();var f=s.getNewline();var j;if(b.include(["html","xml","xsl"],h.syntax)){j=p.getVariable("indentation");var t=c("htmlMatcher").tag(h.content,m);if(t&&!t.innerRange.length()){n.replaceContent(f+j+s.getCaretPlaceholder()+f,m);return true}}else{if(h.syntax=="css"){var o=h.content;if(m&&o.charAt(m-1)=="{"){var g=a.get("css.closeBraceIndentation");j=p.getVariable("indentation");var k=o.charAt(m)=="}";if(!k){for(var l=m,r=o.length,e;l<r;l++){e=o.charAt(l);if(e=="{"){break}if(e=="}"){g="";k=true;break}}}if(!k){g+="}"}var q=f+j+s.getCaretPlaceholder()+g;n.replaceContent(q,m);return true}}}return false},{hidden:true});d.add("insert_formatted_line_break",function(l){if(!d.run("insert_formatted_line_break_only",l)){var o=c("utils");var h=c("editorUtils").getCurrentLinePadding(l);var n=String(l.getContent());var k=l.getCaretPos();var m=n.length;var f=o.getNewline();var p=l.getCurrentLineRange();var g="";for(var j=p.end+1,e;j<m;j++){e=n.charAt(j);if(e==" "||e=="\t"){g+=e}else{break}}if(g.length>h.length){l.replaceContent(f+g,k,k,true)}else{l.replaceContent(f,k)}}return true},{hidden:true})});emmet.exec(function(b,a){b("actions").add("merge_lines",function(h){var g=b("htmlMatcher");var k=b("utils");var c=b("editorUtils");var d=c.outputInfo(h);var j=b("range").create(h.getSelectionRange());if(!j.length()){var e=g.find(d.content,h.getCaretPos());if(e){j=e.outerRange}}if(j.length()){var m=j.substring(d.content);var n=k.splitByLines(m);for(var f=1;f<n.length;f++){n[f]=n[f].replace(/^\s+/,"")}m=n.join("").replace(/\s{2,}/," ");var l=m.length;m=k.escapeText(m);h.replaceContent(m,j.start,j.end);h.createSelection(j.start,j.start+l);return true}return false})});emmet.exec(function(b,a){b("actions").add("encode_decode_data_url",function(h){var i=String(h.getSelection());var g=h.getCaretPos();if(!i){var j=String(h.getContent()),f;while(g-->=0){if(e("src=",j,g)){if((f=j.substr(g).match(/^(src=(["'])?)([^'"<>\s]+)\1?/))){i=f[3];g+=f[1].length}break}else{if(e("url(",j,g)){if((f=j.substr(g).match(/^(url\((['"])?)([^'"\)\s]+)\1?/))){i=f[3];g+=f[1].length}break}}}}if(i){if(e("data:",i)){return c(h,i,g)}else{return d(h,i,g)}}return false},{label:"Encode\\Decode data:URL image"});function e(f,g,h){h=h||0;return g.charAt(h)==f.charAt(0)&&g.substr(h,f.length)==f}function d(i,k,m){var h=b("file");var g=b("actionUtils");var l=i.getFilePath();var j="application/octet-stream";if(l===null){throw"You should save your file before using this action"}var f=h.locateFile(l,k);if(f===null){throw"Can't find "+k+" file"}h.read(f,function(p,o){if(p){throw"Unable to read "+f+": "+p}var n=b("base64").encode(String(o));if(!n){throw"Can't encode file content to base64"}n="data:"+(g.mimeTypes[String(h.getExt(f))]||j)+";base64,"+n;i.replaceContent("$0"+n,m,m+k.length)});return true}function c(i,j,k){var h=String(i.prompt("Enter path to file (absolute or relative)"));if(!h){return false}var g=b("file");var f=g.createPath(i.getFilePath(),h);if(!f){throw"Can't save file"}g.save(f,b("base64").decode(j.replace(/^data\:.+?;.+?,/,"")));i.replaceContent("$0"+h,k,k+j.length);return true}});emmet.exec(function(c,b){function e(g){var i=g.getCaretPos();var h=c("editorUtils").outputInfo(g);var f=c("xmlEditTree").parseFromPosition(h.content,i,true);if(f&&(f.name()||"").toLowerCase()=="img"){d(g,f.value("src"),function(k){if(k){var j=f.range(true);f.value("width",k.width);f.value("height",k.height,f.indexOf("width")+1);c("actionUtils").compoundUpdate(g,b.extend(j,{data:f.toString(),caret:i}))}})}}function a(h){var j=h.getCaretPos();var i=c("editorUtils").outputInfo(h);var g=c("cssEditTree").parseFromPosition(i.content,j,true);if(g){var k=g.itemFromPosition(j,true),f;if(k&&(f=/url\((["']?)(.+?)\1\)/i.exec(k.value()||""))){d(h,f[2],function(m){if(m){var l=g.range(true);g.value("width",m.width+"px");g.value("height",m.height+"px",g.indexOf("width")+1);c("actionUtils").compoundUpdate(h,b.extend(l,{data:g.toString(),caret:j}))}})}}}function d(h,j,l){var i;var k=c("actionUtils");if(j){if(/^data:/.test(j)){i=c("base64").decode(j.replace(/^data\:.+?;.+?,/,""));return l(k.getImageSize(i))}var g=c("file");var f=g.locateFile(h.getFilePath(),j);if(f===null){throw"Can't find "+j+" file"}g.read(f,function(n,m){if(n){throw"Unable to read "+f+": "+n}m=String(m);l(k.getImageSize(m))})}}c("actions").add("update_image_size",function(f){if(b.include(["css","less","scss"],String(f.getSyntax()))){a(f)}else{e(f)}return true})});emmet.define("cssResolver",function(o,y){var b=null;var f={prefix:"emmet",obsolete:false,transformName:function(z){return"-"+this.prefix+"-"+z},properties:function(){return q("css."+this.prefix+"Properties")||[]},supports:function(z){return y.include(this.properties(),z)}};var p={};var t="${1};";var h=o("preferences");h.define("css.valueSeparator",": ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations.");h.define("css.propertyEnd",";","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations.");h.define("stylus.valueSeparator"," ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations in Stylus dialect.");h.define("stylus.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in Stylus dialect.");h.define("sass.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in SASS dialect.");h.define("scss.propertyEnd",";","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in SASS dialect.");h.define("css.syntaxes","css, less, sass, scss, stylus, styl","List of syntaxes that should be treated as CSS dialects.");h.define("css.autoInsertVendorPrefixes",true,"Automatically generate vendor-prefixed copies of expanded CSS property. By default, Emmet will generate vendor-prefixed properties only when you put dash before abbreviation (e.g. <code>-bxsh</code>). With this option enabled, you don’t need dashes before abbreviations: Emmet will produce vendor-prefixed properties for you.");var u=y.template("A comma-separated list of CSS properties that may have <code><%= vendor %></code> vendor prefix. This list is used to generate a list of prefixed properties when expanding <code>-property</code> abbreviations. Empty list means that all possible CSS values may have <code><%= vendor %></code> prefix.");var e=y.template("A comma-separated list of <em>additional</em> CSS properties for <code>css.<%= vendor %>Preperties</code> preference. You should use this list if you want to add or remove a few CSS properties to original set. To add a new property, simply write its name, to remove it, precede property with hyphen.<br>For example, to add <em>foo</em> property and remove <em>border-radius</em> one, the preference value will look like this: <code>foo, -border-radius</code>.");var d={webkit:"animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow, box-sizing, border-radius",moz:"animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow, background-clip, border-radius",ms:"accelerator, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode",o:"dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style"};y.each(d,function(A,z){h.define("css."+z+"Properties",A,u({vendor:z}));h.define("css."+z+"PropertiesAddon","",e({vendor:z}))});h.define("css.unitlessProperties","z-index, line-height, opacity, font-weight, zoom","The list of properties whose values must not contain units.");h.define("css.intUnit","px","Default unit for integer values");h.define("css.floatUnit","em","Default unit for float values");h.define("css.keywords","auto, inherit","A comma-separated list of valid keywords that can be used in CSS abbreviations.");h.define("css.keywordAliases","a:auto, i:inherit, s:solid, da:dashed, do:dotted, t:transparent","A comma-separated list of keyword aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:keyword_name</code>.");h.define("css.unitAliases","e:em, p:%, x:ex, r:rem","A comma-separated list of unit aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:unit_value</code>.");h.define("css.color.short",true,"Should color values like <code>#ffffff</code> be shortened to <code>#fff</code> after abbreviation with color was expanded.");h.define("css.color.case","keep","Letter case of color values generated by abbreviations with color (like <code>c#0</code>). Possible values are <code>upper</code>, <code>lower</code> and <code>keep</code>.");h.define("css.fuzzySearch",true,"Enable fuzzy search among CSS snippet names. When enabled, every <em>unknown</em> snippet will be scored against available snippet names (not values or CSS properties!). The match with best score will be used to resolve snippet value. For example, with this preference enabled, the following abbreviations are equal: <code>ov:h</code> == <code>ov-h</code> == <code>o-h</code> == <code>oh</code>");h.define("css.fuzzySearchMinScore",0.3,"The minium score (from 0 to 1) that fuzzy-matched abbreviation should achive. Lower values may produce many false-positive matches, higher values may reduce possible matches.");h.define("css.alignVendor",false,"If set to <code>true</code>, all generated vendor-prefixed properties will be aligned by real property name.");function v(z){var A=z&&z.charCodeAt(0);return(z&&z=="."||(A>47&&A<58))}function x(A){var z=o("utils");A=z.trim(A);if(~A.indexOf("/*")||/[\n\r]/.test(A)){return false}if(!/^[a-z0-9\-]+\s*\:/i.test(A)){return false}A=o("tabStops").processText(A,{replaceCarets:true,tabstop:function(){return"value"}});return A.split(":").length==2}function n(z){if(z.charAt(0)=="-"&&!/^\-[\.\d]/.test(z)){z=z.replace(/^\-+/,"")}if(z.charAt(0)=="#"){return i(z)}return r(z)}function i(C){var A=C.replace(/^#+/,"")||"0";if(A.toLowerCase()=="t"){return"transparent"}var B=o("utils").repeatString;var z=null;switch(A.length){case 1:z=B(A,6);break;case 2:z=B(A,3);break;case 3:z=A.charAt(0)+A.charAt(0)+A.charAt(1)+A.charAt(1)+A.charAt(2)+A.charAt(2);break;case 4:z=A+A.substr(0,2);break;case 5:z=A+A.charAt(0);break;default:z=A.substr(0,6)}if(h.get("css.color.short")){var D=z.split("");if(D[0]==D[1]&&D[2]==D[3]&&D[4]==D[5]){z=D[0]+D[2]+D[4]}}switch(h.get("css.color.case")){case"upper":z=z.toUpperCase();break;case"lower":z=z.toLowerCase();break}return"#"+z}function r(A){var z=h.getDict("css.keywordAliases");return A in z?z[A]:A}function a(A){var z=h.getDict("css.unitAliases");return A in z?z[A]:A}function k(z){return y.include(h.getArray("css.keywords"),r(z))}function g(A,z){var B=p[z];if(!B){B=y.find(p,function(C){return C.prefix==z})}return B&&B.supports(A)}function s(B,A){var z=[];y.each(p,function(D,C){if(g(B,C)){z.push(C)}});if(!z.length&&!A){y.each(p,function(D,C){if(!D.obsolete){z.push(C)}})}return z}function m(z,A){if(y.isString(A)){A={prefix:A}}p[z]=y.extend({},f,A)}function l(A,z){if(z){if(z=="styl"){z="stylus"}var B=h.get(z+"."+A);if(!y.isUndefined(B)){return B}}return h.get("css."+A)}function c(B,A){var z=B.indexOf(":");B=B.substring(0,z).replace(/\s+$/,"")+l("valueSeparator",A)+o("utils").trim(B.substring(z+1));return B.replace(/\s*;\s*$/,l("propertyEnd",A))}function w(B,A,z){if(!y.isString(B)){B=B.data}if(!x(B)){return B}if(A){if(~B.indexOf(";")){B=B.split(";").join(" !important;")}else{B+=" !important"}}return c(B,z)}function q(z){var A=h.getArray(z);y.each(h.getArray(z+"Addon"),function(B){if(B.charAt(0)=="-"){A=y.without(A,B.substr(1))}else{if(B.charAt(0)=="+"){B=B.substr(1)}A.push(B)}});return A}m("w",{prefix:"webkit"});m("m",{prefix:"moz"});m("s",{prefix:"ms"});m("o",{prefix:"o"});o("resources").addResolver(function(A,z){var B=h.getArray("css.syntaxes");if(y.include(B,z)&&A.isElement()){return b.expandToSnippet(A.abbreviation,z)}return null});var j=o("expandAbbreviation");j.addHandler(function(E,C,B){var z=h.getArray("css.syntaxes");if(!y.include(z,C)){return false}var D=E.getSelectionRange().end;var H=j.findAbbreviation(E);if(H){var F=emmet.expandAbbreviation(H,C,B);if(F){var A=D-H.length;var G=D;if(E.getContent().charAt(D)==";"&&F.charAt(F.length-1)==";"){G++}E.replaceContent(F,A,G);return true}}return false});return b={addPrefix:m,supportsPrefix:g,prefixed:function(A,z){return g(A,z)?"-"+z+"-"+A:A},listPrefixes:function(){return y.map(p,function(z){return z.prefix})},getPrefix:function(z){return p[z]},removePrefix:function(z){if(z in p){delete p[z]}},extractPrefixes:function(A){if(A.charAt(0)!="-"){return{property:A,prefixes:null}}var B=1,z=A.length,C;var D=[];while(B<z){C=A.charAt(B);if(C=="-"){B++;break}if(C in p){D.push(C)}else{D.length=0;B=1;break}B++}if(B==z-1){B=1;D.length=1}return{property:A.substring(B),prefixes:D.length?D:"all"}},findValuesInAbbreviation:function(I,A){A=A||"css";var C=0,F=I.length,G="",z;while(C<F){z=I.charAt(C);if(v(z)||z=="#"||(z=="-"&&v(I.charAt(C+1)))){G=I.substring(C);break}C++}var H=I.substring(0,I.length-G.length);var E=o("resources");var D=[];while(~H.indexOf("-")&&!E.findSnippet(A,H)){var B=H.split("-");var J=B.pop();if(!k(J)){break}D.unshift(J);H=B.join("-")}return D.join("-")+G},parseValues:function(C){var B=o("stringStream").create(C);var z=[];var A=null;while((A=B.next())){if(A=="#"){B.match(/^t|[0-9a-f]+/i,true);z.push(B.current())}else{if(A=="-"){if(k(y.last(z))||(B.start&&v(C.charAt(B.start-1)))){B.start=B.pos}B.match(/^\-?[0-9]*(\.[0-9]+)?[a-z%\.]*/,true);z.push(B.current())}else{B.match(/^[0-9]*(\.[0-9]*)?[a-z%]*/,true);z.push(B.current())}}B.start=B.pos}return y.map(y.compact(z),n)},extractValues:function(A){var z=this.findValuesInAbbreviation(A);if(!z){return{property:A,values:null}}return{property:A.substring(0,A.length-z.length).replace(/-$/,""),values:this.parseValues(z)}},normalizeValue:function(B,A){A=(A||"").toLowerCase();var z=h.getArray("css.unitlessProperties");return B.replace(/^(\-?[0-9\.]+)([a-z]*)$/,function(E,D,C){if(!C&&(D=="0"||y.include(z,A))){return D}if(!C){return D.replace(/\.$/,"")+h.get(~D.indexOf(".")?"css.floatUnit":"css.intUnit")}return D+a(C)})},expand:function(N,M,G){G=G||"css";var E=o("resources");var D=h.get("css.autoInsertVendorPrefixes");var F=/^(.+)\!$/.test(N);if(F){N=RegExp.$1}var A=E.findSnippet(G,N);if(A&&!D){return w(A,F,G)}var B=this.extractPrefixes(N);var C=this.extractValues(B.property);var K=y.extend(B,C);if(!A){A=E.findSnippet(G,K.property)}else{K.values=null}if(!A&&h.get("css.fuzzySearch")){A=E.fuzzyFindSnippet(G,K.property,parseFloat(h.get("css.fuzzySearchMinScore")))}if(!A){A=K.property+":"+t}else{if(!y.isString(A)){A=A.data}}if(!x(A)){return A}var I=this.splitSnippet(A);var O=[];if(!M&&K.values){M=y.map(K.values,function(P){return this.normalizeValue(P,I.name)},this).join(" ")+";"}I.value=M||I.value;var H=K.prefixes=="all"||(!K.prefixes&&D)?s(I.name,D&&K.prefixes!="all"):K.prefixes;var L=[],J;y.each(H,function(P){if(P in p){J=p[P].transformName(I.name);L.push(J);O.push(w(J+":"+I.value,F,G))}});O.push(w(I.name+":"+I.value,F,G));L.push(I.name);if(h.get("css.alignVendor")){var z=o("utils").getStringsPads(L);O=y.map(O,function(Q,P){return z[P]+Q})}return O},expandToSnippet:function(A,z){var B=this.expand(A,null,z);if(y.isArray(B)){return B.join("\n")}if(!y.isString(B)){return B.data}return String(B)},splitSnippet:function(A){var z=o("utils");A=z.trim(A);if(A.indexOf(":")==-1){return{name:A,value:t}}var B=A.split(":");return{name:z.trim(B.shift()),value:z.trim(B.join(":")).replace(/^(\$\{0\}|\$0)(\s*;?)$/,"${1}$2")}},getSyntaxPreference:l,transformSnippet:w}});emmet.define("cssGradient",function(i,u){var p=["top","to bottom","0deg"];var c=null;var s=["css","less","sass","scss","stylus","styl"];var e=/\d+deg/i;var g=/top|bottom|left|right/i;var f=i("preferences");f.define("css.gradient.prefixes","webkit, moz, o","A comma-separated list of vendor-prefixes for which values should be generated.");f.define("css.gradient.oldWebkit",true,"Generate gradient definition for old Webkit implementations");f.define("css.gradient.omitDefaultDirection",true,"Do not output default direction definition in generated gradients.");f.define("css.gradient.defaultProperty","background-image","When gradient expanded outside CSS value context, it will produce properties with this name.");f.define("css.gradient.fallback",false,"With this option enabled, CSS gradient generator will produce <code>background-color</code> property with gradient first color as fallback for old browsers.");function k(v){return i("utils").trim(v).replace(/\s+/g," ")}function m(y){var x=p[0];var z=i("stringStream").create(i("utils").trim(y));var v=[],w;while((w=z.next())){if(z.peek()==","){v.push(z.current());z.next();z.eatSpace();z.start=z.pos}else{if(w=="("){z.skipTo(")")}}}v.push(z.current());v=u.compact(u.map(v,k));if(!v.length){return null}if(e.test(v[0])||g.test(v[0])){x=v.shift()}return{type:"linear",direction:x,colorStops:u.map(v,q)}}function q(w){w=k(w);var x=null;w=w.replace(/^(\w+\(.+?\))\s*/,function(z,A){x=A;return""});if(!x){var y=w.split(" ");x=y[0];w=y[1]||""}var v={color:x};if(w){w.replace(/^(\-?[\d\.]+)([a-z%]+)?$/,function(A,B,z){v.position=B;if(~B.indexOf(".")){z=""}else{if(!z){z="%"}}if(z){v.unit=z}})}return v}function j(x,v){var y=i("resources");var w=i("preferences");var z=y.findSnippet(v,x);if(!z&&w.get("css.fuzzySearch")){z=y.fuzzyFindSnippet(v,x,parseFloat(w.get("css.fuzzySearchMinScore")))}if(z){if(!u.isString(z)){z=z.data}return i("cssResolver").splitSnippet(z).name}}function l(v){var w=0;u.each(v,function(y,x){if(!x){return y.position=y.position||0}if(x==v.length-1&&!("position" in y)){y.position=1}if("position" in y){var A=v[w].position||0;var z=(y.position-A)/(x-w);u.each(v.slice(w,x),function(C,B){C.position=A+z*B});w=x}})}function n(v){var w=parseFloat(v);if(!u.isNaN(w)){switch(w%360){case 0:return"left";case 90:return"bottom";case 180:return"right";case 240:return"top"}}return v}function d(x){x=n(x);if(e.test(x)){throw"The direction is an angle that can’t be converted."}var w=function(v){return ~x.indexOf(v)?"100%":"0"};return w("right")+" "+w("bottom")+", "+w("left")+" "+w("top")}function t(v){var w=f.getArray("css.gradient.prefixes");var x=w?u.map(w,function(y){return"-"+y+"-"+v}):[];x.push(v);return x}function b(y,v){var x=[];var w=i("cssResolver");if(f.get("css.gradient.fallback")&&~v.toLowerCase().indexOf("background")){x.push({name:"background-color",value:"${1:"+y.colorStops[0].color+"}"})}u.each(f.getArray("css.gradient.prefixes"),function(A){var z=w.prefixed(v,A);if(A=="webkit"&&f.get("css.gradient.oldWebkit")){try{x.push({name:z,value:c.oldWebkitLinearGradient(y)})}catch(B){}}x.push({name:z,value:c.toString(y,A)})});return x.sort(function(A,z){return z.name.length-A.name.length})}function h(J,D,z){var C=J.parent;var G=i("utils");var y=i("preferences").get("css.alignVendor");var K=J.styleSeparator;var E=J.styleBefore;u.each(C.getAll(t(J.name())),function(L){if(L!=J&&/gradient/i.test(L.value())){if(L.styleSeparator.length<K.length){K=L.styleSeparator}if(L.styleBefore.length<E.length){E=L.styleBefore}C.remove(L)}});if(y){if(E!=J.styleBefore){var v=J.fullRange();C._updateSource(E,v.start,v.start+J.styleBefore.length);J.styleBefore=E}if(K!=J.styleSeparator){C._updateSource(K,J.nameRange().end,J.valueRange().start);J.styleSeparator=K}}var F=J.value();if(!z){z=i("range").create(0,J.value())}var w=function(L){return G.replaceSubstring(F,L,z)};J.value(w(c.toString(D))+"${2}");var x=b(D,J.name());if(y){var I=u.pluck(x,"value");var A=u.pluck(x,"name");I.push(J.value());A.push(J.name());var B=G.getStringsPads(u.map(I,function(L){return L.substring(0,L.indexOf("("))}));var H=G.getStringsPads(A);J.name(u.last(H)+J.name());u.each(x,function(M,L){M.name=H[L]+M.name;M.value=B[L]+M.value});J.value(u.last(B)+J.value())}u.each(x,function(L){C.add(L.name,L.value,C.indexOf(J))})}function r(v){var w=v.value();var y=null;var x=u.find(v.valueParts(),function(z){return y=c.parse(z.substring(w))});if(x&&y){return{gradient:y,valueRange:x}}return null}function a(z,w){var A=f.get("css.gradient.defaultProperty");if(!A){return false}var B=String(z.getContent());var E=i("range").create(z.getCurrentLineRange());var G=E.substring(B).replace(/^\s+/,function(H){E.start+=H.length;return""}).replace(/\s+$/,function(H){E.end-=H.length;return""});var y=i("cssResolver");var D=c.parse(G);if(D){var C=b(D,A);C.push({name:A,value:c.toString(D)+"${2}"});var F=y.getSyntaxPreference("valueSeparator",w);var x=y.getSyntaxPreference("propertyEnd",w);if(i("preferences").get("css.alignVendor")){var v=i("utils").getStringsPads(u.map(C,function(H){return H.value.substring(0,H.value.indexOf("("))}));u.each(C,function(I,H){I.value=v[H]+I.value})}C=u.map(C,function(H){return H.name+F+H.value+x});z.replaceContent(C.join("\n"),E.start,E.end);return true}return false}function o(x,y){var w=null;var v=i("cssEditTree").parseFromPosition(x,y,true);if(v){w=v.itemFromPosition(y,true);if(!w){w=u.find(v.list(),function(z){return z.range(true).end==y})}}return{rule:v,property:w}}i("expandAbbreviation").addHandler(function(E,y,x){var w=i("editorUtils").outputInfo(E,y,x);if(!u.include(s,w.syntax)){return false}var G=E.getCaretPos();var F=w.content;var C=o(F,G);if(C.property){var B=r(C.property);if(B){var H=C.rule.options.offset||0;var z=H+C.rule.toString().length;if(/[\n\r]/.test(C.property.value())){var D=C.property.valueRange(true).start+B.valueRange.end;F=i("utils").replaceSubstring(F,";",D);var A=o(F,G);if(A.property){B=r(A.property);C=A}}C.property.end(";");var v=j(C.property.name(),y);if(v){C.property.name(v)}h(C.property,B.gradient,B.valueRange);E.replaceContent(C.rule.toString(),H,z,true);return true}}return a(E,y)});i("reflectCSSValue").addHandler(function(y){var v=i("utils");var w=r(y);if(!w){return false}var x=y.value();var z=function(A){return v.replaceSubstring(x,A,w.valueRange)};u.each(y.parent.getAll(t(y.name())),function(B){if(B===y){return}var A=B.value().match(/^\s*(\-([a-z]+)\-)?linear\-gradient/);if(A){B.value(z(c.toString(w.gradient,A[2]||"")))}else{if((A=B.value().match(/\s*\-webkit\-gradient/))){B.value(z(c.oldWebkitLinearGradient(w.gradient)))}}});return true});return c={parse:function(w){var v=null;i("utils").trim(w).replace(/^([\w\-]+)\((.+?)\)$/,function(z,y,x){y=y.toLowerCase().replace(/^\-[a-z]+\-/,"");if(y=="linear-gradient"||y=="lg"){v=m(x);return""}return z});return v},oldWebkitLinearGradient:function(w){if(u.isString(w)){w=this.parse(w)}if(!w){return null}var v=u.map(w.colorStops,u.clone);u.each(v,function(x){if(!("position" in x)){return}if(~x.position.indexOf(".")||x.unit=="%"){x.position=parseFloat(x.position)/(x.unit=="%"?100:1)}else{throw"Can't convert color stop '"+(x.position+(x.unit||""))+"'"}});l(v);v=u.map(v,function(y,x){if(!y.position&&!x){return"from("+y.color+")"}if(y.position==1&&x==v.length-1){return"to("+y.color+")"}return"color-stop("+(y.position.toFixed(2).replace(/\.?0+$/,""))+", "+y.color+")"});return"-webkit-gradient(linear, "+d(w.direction)+", "+v.join(", ")+")"},toString:function(y,x){if(y.type=="linear"){var w=(x?"-"+x+"-":"")+"linear-gradient";var v=u.map(y.colorStops,function(z){return z.color+("position" in z?" "+z.position+(z.unit||""):"")});if(y.direction&&(!f.get("css.gradient.omitDefaultDirection")||!u.include(p,y.direction))){v.unshift(y.direction)}return w+"("+v.join(", ")+")"}}}});emmet.exec(function(b,a){var c=b("handlerList").create();var d=b("resources");a.extend(d,{addGenerator:function(g,f,e){if(a.isString(g)){g=new RegExp(g)}c.add(function(j,i){var h;if((h=g.exec(j.name()))){return f(h,j,i)}return null},e)}});d.addResolver(function(){return c.exec(null,a.toArray(arguments))})});emmet.define("tagName",function(c,b){var d={empty:[],blockLevel:"address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6".split(","),inlineLevel:"a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(",")};var a={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};return{resolve:function(e){e=(e||"").toLowerCase();if(e in a){return this.getMapping(e)}if(this.isInlineLevel(e)){return"span"}return"div"},getMapping:function(e){return a[e.toLowerCase()]},isInlineLevel:function(e){return this.isTypeOf(e,"inlineLevel")},isBlockLevel:function(e){return this.isTypeOf(e,"blockLevel")},isEmptyElement:function(e){return this.isTypeOf(e,"empty")},isTypeOf:function(e,f){return b.include(d[f],e)},addMapping:function(e,f){a[e]=f},removeMapping:function(e){if(e in a){delete a[e]}},addElementToCollection:function(f,g){if(!d[g]){d[g]=[]}var e=this.getCollection(g);if(!b.include(e,f)){e.push(f)}},removeElementFromCollection:function(e,f){if(f in d){d[f]=b.without(this.getCollection(f),e)}},getCollection:function(e){return d[e]}}});emmet.exec(function(b,i){var j=b("preferences");j.define("bem.elementSeparator","__","Class name’s element separator.");j.define("bem.modifierSeparator","_","Class name’s modifier separator.");j.define("bem.shortElementPrefix","-","Symbol for describing short “block-element” notation. Class names prefixed with this symbol will be treated as element name for parent‘s block name. Each symbol instance traverses one level up in parsed tree for block name lookup. Empty value will disable short notation.");var c=false;function d(){return{element:j.get("bem.elementSeparator"),modifier:j.get("bem.modifierSeparator")}}function g(l){if(b("abbreviationUtils").isSnippet(l)){return l}l.__bem={block:"",element:"",modifier:""};var m=f(l.attribute("class")).split(" ");var k=/^[a-z]\-/i;l.__bem.block=i.find(m,function(n){return k.test(n)});if(!l.__bem.block){k=/^[a-z]/i;l.__bem.block=i.find(m,function(n){return k.test(n)})||""}m=i.chain(m).map(function(n){return e(n,l)}).flatten().uniq().value().join(" ");if(m){l.attribute("class",m)}return l}function f(n){var l=b("utils");n=(" "+(n||"")+" ").replace(/\s+/g," ");var k=j.get("bem.shortElementPrefix");if(k){var m=new RegExp("\\s("+l.escapeForRegexp(k)+"+)","g");n=n.replace(m,function(p,o){return" "+l.repeatString(d().element,o.length)})}return l.trim(n)}function e(k,t){k=h(k,t,"element");k=h(k,t,"modifier");var m="",o="",l="";var n=d();if(~k.indexOf(n.element)){var s=k.split(n.element);var q=s[1].split(n.modifier);m=s[0];o=q.shift();l=q.join(n.modifier)}else{if(~k.indexOf(n.modifier)){var r=k.split(n.modifier);m=r.shift();l=r.join(n.modifier)}}if(m||o||l){if(!m){m=t.__bem.block}var p=m;var u=[];if(o){p+=n.element+o;u.push(p)}else{u.push(p)}if(l){u.push(p+n.modifier+l)}t.__bem.block=m;t.__bem.element=o;t.__bem.modifier=l;return u}return k}function h(k,s,m){var l=d();var q=new RegExp("^("+l[m]+")+","g");if(q.test(k)){var n=0;var r=k.replace(q,function(t){n=t.length/l[m].length;return""});var p=s;while(p.parent&&n--){p=p.parent}if(!p||!p.__bem){p=s}if(p&&p.__bem){var o=p.__bem.block;if(m=="modifier"&&p.__bem.element){o+=l.element+p.__bem.element}return o+l[m]+r}}return k}function a(k,m){if(k.name){g(k,m)}var l=b("abbreviationUtils");i.each(k.children,function(n){a(n,m);if(!l.isSnippet(n)&&n.start){c=true}});return k}b("filters").add("bem",function(k,l){c=false;k=a(k,l);if(c){k=b("filters").apply(k,"html",l)}return k})});emmet.exec(function(c,b){var a=c("preferences");a.define("filter.commentAfter",'\n<!-- /<%= attr("id", "#") %><%= attr("class", ".") %> -->',"A definition of comment that should be placed <i>after</i> matched element when <code>comment</code> filter is applied. This definition is an ERB-style template passed to <code>_.template()</code> function (see Underscore.js docs for details). In template context, the following properties and functions are availabe:\n<ul><li><code>attr(name, before, after)</code> – a function that outputsspecified attribute value concatenated with <code>before</code> and <code>after</code> strings. If attribute doesn't exists, the empty string will be returned.</li><li><code>node</code> – current node (instance of <code>AbbreviationNode</code>)</li><li><code>name</code> – name of current tag</li><li><code>padding</code> – current string padding, can be used for formatting</li></ul>");a.define("filter.commentBefore","","A definition of comment that should be placed <i>before</i> matched element when <code>comment</code> filter is applied. For more info, read description of <code>filter.commentAfter</code> property");a.define("filter.commentTrigger","id, class","A comma-separated list of attribute names that should exist in abbreviatoin where comment should be added. If you wish to add comment for every element, set this option to <code>*</code>");function d(h,l,g){var k=c("utils");var f=a.get("filter.commentTrigger");if(f!="*"){var j=b.find(f.split(","),function(o){return !!h.attribute(k.trim(o))});if(!j){return}}var m={node:h,name:h.name(),padding:h.parent?h.parent.padding:"",attr:function(p,q,r){var o=h.attribute(p);if(o){return(q||"")+o+(r||"")}return""}};var n=k.normalizeNewline(l?l(m):"");var i=k.normalizeNewline(g?g(m):"");h.start=h.start.replace(/</,n+"<");h.end=h.end.replace(/>/,">"+i)}function e(f,h,i){var g=c("abbreviationUtils");b.each(f.children,function(j){if(g.isBlock(j)){d(j,h,i)}e(j,h,i)});return f}c("filters").add("c",function(g){var f=b.template(a.get("filter.commentBefore"));var h=b.template(a.get("filter.commentAfter"));return e(g,f,h)})});emmet.exec(function(b,a){var c={"<":"<",">":">","&":"&"};function d(f){return f.replace(/([<>&])/g,function(h,g){return c[g]})}b("filters").add("e",function e(f){a.each(f.children,function(g){g.start=d(g.start);g.end=d(g.end);g.content=d(g.content);e(g)});return f})});emmet.exec(function(d,l){var h="%s";var o=d("preferences");o.define("format.noIndentTags","html","A comma-separated list of tag names that should not get inner indentation.");o.define("format.forceIndentationForTags","body","A comma-separated list of tag names that should <em>always</em> get inner indentation.");function k(p){if(l.include(o.getArray("format.noIndentTags")||[],p.name())){return""}return d("resources").getVariable("indentation")}function a(p){return p.parent&&d("abbreviationUtils").hasBlockChildren(p.parent)}function n(p){return p.parent&&!p.parent.parent&&!p.index()}function e(r,q){var p=d("abbreviationUtils");if(q.tag_nl===true||p.isBlock(r)){return true}if(!r.parent||!q.inline_break){return false}return g(r.parent,q)}function j(q,p){return q.children.length&&e(q.children[0],p)}function g(s,r){var q=0;var p=d("abbreviationUtils");return !!l.find(s.children,function(t){if(t.isTextNode()||!p.isInline(t)){q=0}else{if(p.isInline(t)){q++}}if(q>=r.inline_break){return true}})}function f(p){return !p.parent}function m(q,p){q.start=q.end="";if(!n(q)&&p.tag_nl!==false&&e(q,p)){if(f(q.parent)||!d("abbreviationUtils").isInline(q.parent)){q.start=d("utils").getNewline()+q.start}}return q}function i(r,q){var p=d("abbreviationUtils");var s=l.any(r.children,function(t){if(p.isSnippet(t)){return false}return !p.isInline(t)});if(!s){return g(r,q)}return true}function c(w,v){w.start=w.end=h;var s=d("utils");var t=d("abbreviationUtils");var u=t.isUnary(w);var r=s.getNewline();var q=k(w);if(v.tag_nl!==false){var p=v.tag_nl===true&&(v.tag_nl_leaf||w.children.length);if(!p){p=l.include(o.getArray("format.forceIndentationForTags")||[],w.name())}if(!w.isTextNode()){if(e(w,v)){if(!n(w)&&(!t.isSnippet(w.parent)||w.index())){w.start=r+w.start}if(t.hasBlockChildren(w)||j(w,v)||(p&&!u)){w.end=r+w.end}if(t.hasTagsInContent(w)||(p&&!w.children.length&&!u)){w.start+=r+q}}else{if(t.isInline(w)&&a(w)&&!n(w)){w.start=r+w.start}else{if(t.isInline(w)&&i(w,v)){w.end=r+w.end}}}w.padding=q}}return w}d("filters").add("_format",function b(p,r,s){s=s||0;var q=d("abbreviationUtils");l.each(p.children,function(t){if(q.isSnippet(t)){m(t,r,s)}else{c(t,r,s)}b(t,r,s+1)});return p})});emmet.exec(function(b,a){function c(g){return b("utils").trim(g).replace(/\s+/g,".")}function d(h,k){var j="";var g=[];var i=k.attributeQuote();var l=k.cursor();a.each(h.attributeList(),function(m){var n=k.attributeName(m.name);switch(n.toLowerCase()){case"id":j+="#"+(m.value||l);break;case"class":j+="."+c(m.value||l);break;default:g.push(":"+n+" => "+i+(m.value||l)+i)}});if(g.length){j+="{"+g.join(", ")+"}"}return j}function f(p,j){if(!p.parent){return p}var q=b("abbreviationUtils");var m=b("utils");var n=d(p,j);var o=j.cursor();var i=q.isUnary(p);var k=j.self_closing_tag&&i?"/":"";var g="";var h="%"+j.tagName(p.name());if(h.toLowerCase()=="%div"&&n&&n.indexOf("{")==-1){h=""}p.end="";g=h+n+k+" ";var l="%s";p.start=m.replaceSubstring(p.start,g,p.start.indexOf(l),l);if(!p.children.length&&!i){p.start+=o}return p}b("filters").add("haml",function e(g,i,j){j=j||0;var h=b("abbreviationUtils");if(!j){g=b("filters").apply(g,"_format",i)}a.each(g.children,function(k){if(!h.isSnippet(k)){f(k,i,j)}e(k,i,j+1)});return g})});emmet.exec(function(b,a){function c(h,g){var f=g.attributeQuote();var i=g.cursor();return a.map(h.attributeList(),function(j){var k=g.attributeName(j.name);return" "+k+"="+f+(j.value||i)+f}).join("")}function e(o,i){if(!o.parent){return o}var p=b("abbreviationUtils");var l=b("utils");var m=c(o,i);var n=i.cursor();var h=p.isUnary(o);var f="";var j="";if(!o.isTextNode()){var g=i.tagName(o.name());if(h){f="<"+g+m+i.selfClosing()+">";o.end=""}else{f="<"+g+m+">";j="</"+g+">"}}var k="%s";o.start=l.replaceSubstring(o.start,f,o.start.indexOf(k),k);o.end=l.replaceSubstring(o.end,j,o.end.indexOf(k),k);if(!o.children.length&&!h&&!~o.content.indexOf(n)&&!b("tabStops").extract(o.content).tabstops.length){o.start+=n}return o}b("filters").add("html",function d(f,h,i){i=i||0;var g=b("abbreviationUtils");if(!i){f=b("filters").apply(f,"_format",h)}a.each(f.children,function(j){if(!g.isSnippet(j)){e(j,h,i)}d(j,h,i+1)});return f})});emmet.exec(function(c,b){var a=/^\s+/;var d=/[\n\r]/g;c("filters").add("s",function e(f){var g=c("abbreviationUtils");b.each(f.children,function(h){if(!g.isSnippet(h)){h.start=h.start.replace(a,"");h.end=h.end.replace(a,"")}h.start=h.start.replace(d,"");h.end=h.end.replace(d,"");h.content=h.content.replace(d,"");e(h)});return f})});emmet.exec(function(b,a){b("preferences").define("filter.trimRegexp","[\\s|\\u00a0]*[\\d|#|\\-|*|\\u2022]+\\.?\\s*","Regular expression used to remove list markers (numbers, dashes, bullets, etc.) in <code>t</code> (trim) filter. The trim filter is useful for wrapping with abbreviation lists, pased from other documents (for example, Word documents).");function c(d,e){a.each(d.children,function(f){if(f.content){f.content=f.content.replace(e,"")}c(f,e)});return d}b("filters").add("t",function(d){var e=new RegExp(b("preferences").get("filter.trimRegexp"));return c(d,e)})});emmet.exec(function(d,c){var b={"xsl:variable":1,"xsl:with-param":1};function a(f){f.start=f.start.replace(/\s+select\s*=\s*(['"]).*?\1/,"")}d("filters").add("xsl",function e(f){var g=d("abbreviationUtils");c.each(f.children,function(h){if(!g.isSnippet(h)&&(h.name()||"").toLowerCase() in b&&h.children.length){a(h)}e(h)});return f})});emmet.define("lorem",function(b,i){var c={en:{common:["lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit"],words:["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]},ru:{common:["далеко-далеко","за","словесными","горами","в стране","гласных","и согласных","живут","рыбные","тексты"],words:["вдали","от всех","они","буквенных","домах","на берегу","семантика","большого","языкового","океана","маленький","ручеек","даль","журчит","по всей","обеспечивает","ее","всеми","необходимыми","правилами","эта","парадигматическая","страна","которой","жаренные","предложения","залетают","прямо","рот","даже","всемогущая","пунктуация","не","имеет","власти","над","рыбными","текстами","ведущими","безорфографичный","образ","жизни","однажды","одна","маленькая","строчка","рыбного","текста","имени","lorem","ipsum","решила","выйти","большой","мир","грамматики","великий","оксмокс","предупреждал","о","злых","запятых","диких","знаках","вопроса","коварных","точках","запятой","но","текст","дал","сбить","себя","толку","он","собрал","семь","своих","заглавных","букв","подпоясал","инициал","за","пояс","пустился","дорогу","взобравшись","первую","вершину","курсивных","гор","бросил","последний","взгляд","назад","силуэт","своего","родного","города","буквоград","заголовок","деревни","алфавит","подзаголовок","своего","переулка","грустный","реторический","вопрос","скатился","его","щеке","продолжил","свой","путь","дороге","встретил","рукопись","она","предупредила","моей","все","переписывается","несколько","раз","единственное","что","меня","осталось","это","приставка","возвращайся","ты","лучше","свою","безопасную","страну","послушавшись","рукописи","наш","продолжил","свой","путь","вскоре","ему","повстречался","коварный","составитель","рекламных","текстов","напоивший","языком","речью","заманивший","свое","агенство","которое","использовало","снова","снова","своих","проектах","если","переписали","то","живет","там","до","сих","пор"]}};var j=b("preferences");j.define("lorem.defaultLang","en");b("abbreviationParser").addPreprocessor(function(k){var m=/^(?:lorem|lipsum)([a-z]{2})?(\d*)$/i,l;k.findAll(function(n){if(n._name&&(l=n._name.match(m))){var o=l[2]||30;var p=l[1]||j.get("lorem.defaultLang")||"en";n._name="";n.data("forceNameResolving",n.isRepeating()||n.attributeList().length);n.data("pasteOverwrites",true);n.data("paste",function(q){return e(p,o,!q)})}})});function f(l,k){return Math.round(Math.random()*(k-l)+l)}function h(m,o){var l=m.length;var n=Math.min(l,o);var k=[];while(k.length<n){var p=f(0,l-1);if(!i.include(k,p)){k.push(p)}}return i.map(k,function(q){return m[q]})}function d(k){if(i.isString(k)){return k.charAt(f(0,k.length-1))}return k[f(0,k.length-1)]}function g(l,k){if(l.length){l[0]=l[0].charAt(0).toUpperCase()+l[0].substring(1)}return l.join(" ")+(k||d("?!..."))}function a(m){var k=m.length;var l=0;if(k>3&&k<=6){l=f(0,1)}else{if(k>6&&k<=12){l=f(0,2)}else{l=f(1,4)}}i.each(i.range(l),function(n){if(n<m.length-1){m[n]+=","}})}function e(q,l,n){var o=c[q];if(!o){return""}var k=[];var m=0;var p;l=parseInt(l,10);if(n&&o.common){p=o.common.slice(0,l);if(p.length>5){p[4]+=","}m+=p.length;k.push(g(p,"."))}while(m<l){p=h(o.words,Math.min(f(3,12)*f(1,5),l-m));m+=p.length;a(p);k.push(g(p))}return k.join(" ")}return{addLang:function(l,k){if(i.isString(k)){k={words:i.compact(k.split(" "))}}else{if(i.isArray(k)){k={words:k}}}c[l]=k}}});emmet.define("bootstrap",function(require,_){function getFileName(path){var re=/([\w\.\-]+)$/i;var m=re.exec(path);return m?m[1]:""}function normalizeProfile(profile){if(_.isObject(profile)){if("indent" in profile){profile.indent=!!profile.indent}if("self_closing_tag" in profile){if(_.isNumber(profile.self_closing_tag)){profile.self_closing_tag=!!profile.self_closing_tag}}}return profile}return{loadExtensions:function(fileList){var file=require("file");var payload={};var utils=require("utils");var userSnippets=null;var that=this;var reader=_.bind(file.readText||file.read,file);var next=function(){if(fileList.length){var f=fileList.shift();reader(f,function(err,content){if(err){emmet.log('Unable to read "'+f+'" file: '+err);return next()}switch(file.getExt(f)){case"js":try{eval(content)}catch(e){emmet.log('Unable to eval "'+f+'" file: '+e)}break;case"json":var fileName=getFileName(f).toLowerCase().replace(/\.json$/,"");if(/^snippets/.test(fileName)){if(fileName==="snippets"){userSnippets=that.parseJSON(content)}else{payload.snippets=utils.deepMerge(payload.snippets||{},that.parseJSON(content))}}else{payload[fileName]=content}break}next()})}else{if(userSnippets){payload.snippets=utils.deepMerge(payload.snippets||{},userSnippets)}that.loadUserData(payload)}};next()},loadPreferences:function(data){require("preferences").load(this.parseJSON(data))},loadSnippets:function(data){data=this.parseJSON(data);var res=require("resources");var userData=res.getVocabulary("user")||{};res.setVocabulary(require("utils").deepMerge(userData,data),"user")},loadSystemSnippets:function(data){require("resources").setVocabulary(this.parseJSON(data),"system")},resetSnippets:function(){require("resources").setVocabulary({},"user")},loadUserData:function(data){data=this.parseJSON(data);if(data.snippets){this.loadSnippets(data.snippets)}if(data.preferences){this.loadPreferences(data.preferences)}if(data.profiles){this.loadProfiles(data.profiles)}var profiles=data.syntaxProfiles||data.syntaxprofiles;if(profiles){this.loadSyntaxProfiles(profiles)}},resetUserData:function(){this.resetSnippets();require("preferences").reset();require("profile").reset()},loadSyntaxProfiles:function(profiles){profiles=this.parseJSON(profiles);var snippets={};_.each(profiles,function(options,syntax){if(!(syntax in snippets)){snippets[syntax]={}}snippets[syntax].profile=normalizeProfile(options)});this.loadSnippets(snippets)},loadProfiles:function(profiles){var profile=require("profile");_.each(this.parseJSON(profiles),function(options,name){profile.create(name,normalizeProfile(options))})},parseJSON:function(str){if(_.isObject(str)){return str}try{return(new Function("return "+str))()}catch(e){return{}}}}});emmet.exec(function(b,a){b("actions").add("select_line",function(d){var c=d.getCurrentLineRange();d.createSelection(c.start,c.end);return true})});