-
Notifications
You must be signed in to change notification settings - Fork 2
/
emmet.es.min.js
5 lines (5 loc) · 80.5 KB
/
emmet.es.min.js
1
2
3
4
5
function isNumber$1(e){return 47<e&&e<58}function isAlpha$1(e,t,r){return r=r||90,(t=t||65)<=(e&=-33)&&e<=r}function isAlphaNumericWord(e){return isNumber$1(e)||isAlphaWord(e)}function isAlphaWord(e){return 95===e||isAlpha$1(e)}function isUmlaut(e){return 196===e||214==e||220===e||228===e||246===e||252===e}function isWhiteSpace$3(e){return 32===e||9===e||160===e}function isSpace(e){return isWhiteSpace$3(e)||10===e||13===e}function isQuote$2(e){return 39===e||34===e}class Scanner{constructor(e,t,r){null==r&&"string"==typeof e&&(r=e.length),this.string=e,this.pos=this.start=t||0,this.end=r||0}eof(){return this.pos>=this.end}limit(e,t){return new Scanner(this.string,e,t)}peek(){return this.string.charCodeAt(this.pos)}next(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)}eat(e){var t=this.peek(),t="function"==typeof e?e(t):t===e;return t&&this.next(),t}eatWhile(e){for(var t=this.pos;!this.eof()&&this.eat(e););return this.pos!==t}backUp(e){this.pos-=e||1}current(){return this.substring(this.start,this.pos)}substring(e,t){return this.string.slice(e,t)}error(e,t=this.pos){return new ScannerError(e+" at "+(t+1),t,this.string)}}class ScannerError extends Error{constructor(e,t,r){super(e),this.pos=t,this.string=r}}function tokenScanner$1(e){return{tokens:e,start:0,pos:0,size:e.length}}function peek$3(e){return e.tokens[e.pos]}function next(e){return e.tokens[e.pos++]}function slice(e,t=e.start,r=e.pos){return e.tokens.slice(t,r)}function readable$1(e){return e.pos<e.size}function consume$2(e,t){var r=peek$3(e);return!(!r||!t(r))&&(e.pos++,!0)}function error$1(e,t,r=peek$3(e)){r&&null!=r.start&&(t+=" at "+r.start);const n=new Error(t);return n.pos=r&&r.start,n}function abbreviation(e,t={}){e=tokenScanner$1(e),t=statements(e,t);if(readable$1(e))throw error$1(e,"Unexpected character");return t}function statements(e,t){var r,n={type:"TokenGroup",elements:[]};let o=n;const a=[];for(;readable$1(e)&&(r=element$2(e,t)||group(e,t));)if(o.elements.push(r),consume$2(e,isChildOperator))a.push(o),o=r;else if(!consume$2(e,isSiblingOperator$1)&&consume$2(e,isClimbOperator))for(;a.length&&(o=a.pop()),consume$2(e,isClimbOperator););return n}function group(e,t){if(consume$2(e,isGroupStart)){const r=statements(e,t);return isBracket$2(next(e),"group",!1)&&(r.repeat=repeater$1(e)),r}}function element$2(e,t){let r;const n={type:"TokenElement",name:void 0,attributes:void 0,value:void 0,repeat:void 0,selfClose:!1,elements:[]};for(elementName(e,t)&&(n.name=slice(e));readable$1(e);)if(e.start=e.pos,n.repeat||isEmpty(n)||!consume$2(e,isRepeater))if(!n.value&&text(e))n.value=getText(e);else{if(!(r=shortAttribute(e,"id",t)||shortAttribute(e,"class",t)||attributeSet(e))){!isEmpty(n)&&consume$2(e,isCloseOperator)&&(n.selfClose=!0,!n.repeat&&consume$2(e,isRepeater)&&(n.repeat=e.tokens[e.pos-1]));break}n.attributes?n.attributes=n.attributes.concat(r):n.attributes=Array.isArray(r)?r.slice():[r]}else n.repeat=e.tokens[e.pos-1];return isEmpty(n)?void 0:n}function attributeSet(e){if(consume$2(e,isAttributeSetStart)){const r=[];for(var t;readable$1(e);)if(t=attribute(e))r.push(t);else{if(consume$2(e,isAttributeSetEnd))break;if(!consume$2(e,isWhiteSpace$2))throw error$1(e,`Unexpected "${peek$3(e).type}" token`)}return r}}function shortAttribute(t,r,n){if(isOperator$1(peek$3(t),r)){t.pos++;let e=1;for(;isOperator$1(peek$3(t),r);)t.pos++,e++;const o={name:[createLiteral$1(r)]};return 1<e&&(o.multiple=!0),n.jsx&&text(t)?(o.value=getText(t),o.expression=!0):o.value=literal$1$1(t)?slice(t):void 0,o}}function attribute(t){if(quoted(t))return{value:slice(t)};if(literal$1$1(t,!0)){let e;return{name:slice(t),value:e=consume$2(t,isEquals)&&(quoted(t)||literal$1$1(t,!0))?slice(t):e}}}function repeater$1(e){return isRepeater(peek$3(e))?e.tokens[e.pos++]:void 0}function quoted(e){var t=e.pos,r=peek$3(e);if(isQuote$1(r)){for(e.pos++;readable$1(e);)if(isQuote$1(next(e),r.single))return e.start=t,!0;throw error$1(e,"Unclosed quote",r)}return!1}function literal$1$1(e,t){var r=e.pos;const n={attribute:0,expression:0,group:0};for(;readable$1(e);){var o=peek$3(e);if(n.expression)isBracket$2(o,"expression")&&(n[o.context]+=o.open?1:-1);else{if(isQuote$1(o)||isOperator$1(o)||isWhiteSpace$2(o)||isRepeater(o))break;if(isBracket$2(o)){if(!t)break;if(o.open)n[o.context]++;else{if(!n[o.context])break;n[o.context]--}}}e.pos++}return r!==e.pos&&(e.start=r,!0)}function elementName(e,t){var r=e.pos;if(t.jsx&&consume$2(e,isCapitalizedLiteral))for(;readable$1(e);){var n=e["pos"];if(!consume$2(e,isClassNameOperator)||!consume$2(e,isCapitalizedLiteral)){e.pos=n;break}}for(;readable$1(e)&&consume$2(e,isElementName$1););return e.pos!==r&&(e.start=r,!0)}function text(t){var r=t.pos;if(consume$2(t,isTextStart)){let e=0;for(;readable$1(t);){var n=next(t);if(isBracket$2(n,"expression"))if(n.open)e++;else{if(!e)break;e--}}return t.start=r,!0}return!1}function getText(e){let t=e.start,r=e.pos;return isBracket$2(e.tokens[t],"expression",!0)&&t++,isBracket$2(e.tokens[r-1],"expression",!1)&&r--,slice(e,t,r)}function isBracket$2(e,t,r){return Boolean(e&&"Bracket"===e.type&&(!t||e.context===t)&&(null==r||e.open===r))}function isOperator$1(e,t){return Boolean(e&&"Operator"===e.type&&(!t||e.operator===t))}function isQuote$1(e,t){return Boolean(e&&"Quote"===e.type&&(null==t||e.single===t))}function isWhiteSpace$2(e){return Boolean(e&&"WhiteSpace"===e.type)}function isEquals(e){return isOperator$1(e,"equal")}function isRepeater(e){return Boolean(e&&"Repeater"===e.type)}function isLiteral$2(e){return"Literal"===e.type}function isCapitalizedLiteral(e){return!!isLiteral$2(e)&&(65<=(e=e.value.charCodeAt(0))&&e<=90)}function isElementName$1(e){return"Literal"===e.type||"RepeaterNumber"===e.type||"RepeaterPlaceholder"===e.type}function isClassNameOperator(e){return isOperator$1(e,"class")}function isAttributeSetStart(e){return isBracket$2(e,"attribute",!0)}function isAttributeSetEnd(e){return isBracket$2(e,"attribute",!1)}function isTextStart(e){return isBracket$2(e,"expression",!0)}function isGroupStart(e){return isBracket$2(e,"group",!0)}function createLiteral$1(e){return{type:"Literal",value:e}}function isEmpty(e){return!e.name&&!e.value&&!e.attributes}function isChildOperator(e){return isOperator$1(e,"child")}function isSiblingOperator$1(e){return isOperator$1(e,"sibling")}function isClimbOperator(e){return isOperator$1(e,"climb")}function isCloseOperator(e){return isOperator$1(e,"close")}var Chars$3,OperatorType,Chars$2;function escaped(e){return!!e.eat(Chars$3.Escape)&&(e.start=e.pos,e.eof()||e.pos++,!0)}function tokenize$1(e){const t=new Scanner(e),r=[],n={group:0,attribute:0,expression:0,quote:0};for(var o,a;!t.eof();){if(o=t.peek(),!(a=getToken$1(t,n)))throw t.error("Unexpected character");r.push(a),"Quote"===a.type?n.quote=o===n.quote?0:o:"Bracket"===a.type&&(n[a.context]+=a.open?1:-1)}return r}function getToken$1(e,t){return field$2(e,t)||repeaterPlaceholder(e)||repeaterNumber(e)||repeater(e)||whiteSpace$1(e)||literal$2(e,t)||operator$1(e)||quote(e)||bracket$1(e)}function literal$2(e,t){var r=e.pos,n=t.expression;let o="";for(;!e.eof();)if(escaped(e))o+=e.current();else{var a=e.peek();if(a===Chars$3.Slash&&!t.quote&&!t.expression&&!t.attribute){var i=e.string.charCodeAt(e.pos-1),s=e.string.charCodeAt(e.pos+1);if(isNumber$1(i)&&isNumber$1(s)){o+=e.string[e.pos++];continue}}if(a===t.quote||a===Chars$3.Dollar||isAllowedOperator(a,t))break;if(n){if(a===Chars$3.CurlyBracketOpen)t.expression++;else if(a===Chars$3.CurlyBracketClose){if(!(t.expression>n))break;t.expression--}}else if(!t.quote){if(!t.attribute&&!isElementName(a))break;if(isAllowedSpace(a,t)||isAllowedRepeater(a,t)||isQuote$2(a)||bracketType(a))break}o+=e.string[e.pos++]}if(r!==e.pos)return e.start=r,{type:"Literal",value:o,start:r,end:e.pos}}function whiteSpace$1(e){var t=e.pos;if(e.eatWhile(isSpace))return{type:"WhiteSpace",start:t,end:e.pos,value:e.substring(t,e.pos)}}function quote(e){var t=e.peek();if(isQuote$2(t))return{type:"Quote",single:t===Chars$3.SingleQuote,start:e.pos++,end:e.pos}}function bracket$1(e){var t=e.peek(),r=bracketType(t);if(r)return{type:"Bracket",open:isOpenBracket$2(t),context:r,start:e.pos++,end:e.pos}}function operator$1(e){var t=operatorType$1(e.peek());if(t)return{type:"Operator",operator:t,start:e.pos++,end:e.pos}}function repeater(r){var n=r.pos;if(r.eat(Chars$3.Asterisk)){r.start=r.pos;let e=1,t=!1;return r.eatWhile(isNumber$1)?e=Number(r.current()):t=!0,{type:"Repeater",count:e,value:0,implicit:t,start:n,end:r.pos}}}function repeaterPlaceholder(e){var t=e.pos;if(e.eat(Chars$3.Dollar)&&e.eat(Chars$3.Hash))return{type:"RepeaterPlaceholder",value:void 0,start:t,end:e.pos};e.pos=t}function repeaterNumber(n){var o=n.pos;if(n.eatWhile(Chars$3.Dollar)){var a=n.pos-o;let e=!1,t=1,r=0;if(n.eat(Chars$3.At)){for(;n.eat(Chars$3.Climb);)r++;e=n.eat(Chars$3.Dash),n.start=n.pos,n.eatWhile(isNumber$1)&&(t=Number(n.current()))}return n.start=o,{type:"RepeaterNumber",size:a,reverse:e,base:t,parent:r,start:o,end:n.pos}}}function field$2(r,e){var n=r.pos;if((e.expression||e.attribute)&&r.eat(Chars$3.Dollar)&&r.eat(Chars$3.CurlyBracketOpen)){r.start=r.pos;let e,t="";if(r.eatWhile(isNumber$1)?(e=Number(r.current()),t=r.eat(Chars$3.Colon)?consumePlaceholder$2(r):""):isAlpha$1(r.peek())&&(t=consumePlaceholder$2(r)),r.eat(Chars$3.CurlyBracketClose))return{type:"Field",index:e,name:t,start:n,end:r.pos};throw r.error("Expecting }")}r.pos=n}function consumePlaceholder$2(e){const t=[];for(e.start=e.pos;!e.eof();)if(e.eat(Chars$3.CurlyBracketOpen))t.push(e.pos);else if(e.eat(Chars$3.CurlyBracketClose)){if(!t.length){e.pos--;break}t.pop()}else e.pos++;if(t.length)throw e.pos=t.pop(),e.error("Expecting }");return e.current()}function isAllowedOperator(e,t){e=operatorType$1(e);return!(!e||t.quote||t.expression)&&(!t.attribute||"equal"===e)}function isAllowedSpace(e,t){return isSpace(e)&&!t.expression}function isAllowedRepeater(e,t){return e===Chars$3.Asterisk&&!t.attribute&&!t.expression}function bracketType(e){return e===Chars$3.RoundBracketOpen||e===Chars$3.RoundBracketClose?"group":e===Chars$3.SquareBracketOpen||e===Chars$3.SquareBracketClose?"attribute":e===Chars$3.CurlyBracketOpen||e===Chars$3.CurlyBracketClose?"expression":void 0}function operatorType$1(e){return(e===Chars$3.Child?"child":e===Chars$3.Sibling&&"sibling")||e===Chars$3.Climb&&"climb"||e===Chars$3.Dot&&"class"||e===Chars$3.Hash&&"id"||e===Chars$3.Slash&&"close"||e===Chars$3.Equals&&"equal"||void 0}function isOpenBracket$2(e){return e===Chars$3.CurlyBracketOpen||e===Chars$3.SquareBracketOpen||e===Chars$3.RoundBracketOpen}function isElementName(e){return isAlphaNumericWord(e)||isUmlaut(e)||e===Chars$3.Dash||e===Chars$3.Colon||e===Chars$3.Excl}!function(e){e[e.CurlyBracketOpen=123]="CurlyBracketOpen",e[e.CurlyBracketClose=125]="CurlyBracketClose",e[e.Escape=92]="Escape",e[e.Equals=61]="Equals",e[e.SquareBracketOpen=91]="SquareBracketOpen",e[e.SquareBracketClose=93]="SquareBracketClose",e[e.Asterisk=42]="Asterisk",e[e.Hash=35]="Hash",e[e.Dollar=36]="Dollar",e[e.Dash=45]="Dash",e[e.Dot=46]="Dot",e[e.Slash=47]="Slash",e[e.Colon=58]="Colon",e[e.Excl=33]="Excl",e[e.At=64]="At",e[e.Underscore=95]="Underscore",e[e.RoundBracketOpen=40]="RoundBracketOpen",e[e.RoundBracketClose=41]="RoundBracketClose",e[e.Sibling=43]="Sibling",e[e.Child=62]="Child",e[e.Climb=94]="Climb",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote"}(Chars$3=Chars$3||{});const operators={child:">",class:".",climb:"^",id:"#",equal:"=",close:"/",sibling:"+"},tokenVisitor={Literal(e){return e.value},Quote(e){return e.single?"'":'"'},Bracket(e){return"attribute"===e.context?e.open?"[":"]":"expression"===e.context?e.open?"{":"}":e.open?"(":"}"},Operator(e){return operators[e.operator]},Field(e,t){return null!=e.index?e.name?`\${${e.index}:${e.name}}`:"${"+e.index:e.name?t.getVariable(e.name):""},RepeaterPlaceholder(e,t){let r;for(let e=t.repeaters.length-1;0<=e;e--)if(t.repeaters[e].implicit){r=t.repeaters[e];break}return t.inserted=!0,t.getText(r&&r.value)},RepeaterNumber(e,t){let r=1;var n,o=t.repeaters.length-1,a=t.repeaters[o];a&&(r=e.reverse?e.base+a.count-a.value-1:e.base+a.value,e.parent&&(n=Math.max(0,o-e.parent))!==o&&(o=t.repeaters[n],r+=a.count*o.value));let i=String(r);for(;i.length<e.size;)i="0"+i;return i},WhiteSpace(e){return e.value}};function stringify$1(e,t){if(tokenVisitor[e.type])return tokenVisitor[e.type](e,t);throw new Error("Unknown token "+e.type)}const urlRegex=/^((https?:|ftp:|file:)?\/\/|(www|ftp)\.)[^ ]*$/,emailRegex=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,5}$/;function convert(e,r={}){let n=!1,o;r.text&&(o=Array.isArray(r.text)?r.text.filter(e=>e.trim()):r.text);var t,a,e={type:"Abbreviation",children:convertGroup(e,{inserted:!1,repeaters:[],text:r.text,cleanText:o,repeatGuard:r.maxRepeat||Number.POSITIVE_INFINITY,getText(e){n=!0;let t;if(Array.isArray(r.text)){if(void 0!==e&&0<=e&&e<o.length)return o[e];t=void 0!==e?r.text[e]:r.text.join("\n")}else t=null!=(e=r.text)?e:"";return t},getVariable(e){var t=r.variables&&r.variables[e];return null!=t?t:e}})};return null==r.text||n||(t=deepestNode(last$1(e.children)))&&(insertText(t,a=Array.isArray(r.text)?r.text.join("\n"):r.text),"a"===t.name&&r.href&&insertHref(t,a)),e}function convertStatement(t,r){let n=[];if(t.repeat){var o,a,e=t.repeat;const i=Object.assign({},e);i.count=i.implicit&&Array.isArray(r.text)?r.cleanText.length:i.count||1,r.repeaters.push(i);for(let e=0;e<i.count;e++)if(i.value=e,t.repeat=i,o=(isGroup(t)?convertGroup:convertElement)(t,r),!i.implicit||r.inserted||(a=(a=last$1(o))&&deepestNode(a))&&insertText(a,r.getText(i.value)),n=n.concat(o),--r.repeatGuard<=0)break;r.repeaters.pop(),t.repeat=e,i.implicit&&(r.inserted=!0)}else n=n.concat((isGroup(t)?convertGroup:convertElement)(t,r));return n}function convertElement(e,t){let r=[];const n={type:"AbbreviationNode",name:e.name&&stringifyName(e.name,t),value:e.value&&stringifyValue$1(e.value,t),attributes:void 0,children:r,repeat:e.repeat&&Object.assign({},e.repeat),selfClosing:e.selfClose};let o=[n];for(const a of e.elements)r=r.concat(convertStatement(a,t));if(e.attributes){n.attributes=[];for(const i of e.attributes)n.attributes.push(convertAttribute(i,t))}return n.name||n.attributes||!n.value||n.value.some(isField$1)?n.children=r:o=o.concat(r),o}function convertGroup(e,t){let r=[];for(const n of e.elements)r=r.concat(convertStatement(n,t));return r=e.repeat?attachRepeater(r,e.repeat):r}function convertAttribute(e,t){let r=!1,n=!1,o=e.expression?"expression":"raw",a;const i=e.name&&stringifyName(e.name,t);if(i&&"!"===i[0]&&(r=!0),i&&"."===i[i.length-1]&&(n=!0),e.value){const l=e.value.slice();var s;isQuote$1(l[0])?(s=l.shift(),l.length&&last$1(l).type===s.type&&l.pop(),o=s.single?"singleQuote":"doubleQuote"):isBracket$2(l[0],"expression",!0)&&(o="expression",l.shift(),isBracket$2(last$1(l),"expression",!1)&&l.pop()),a=stringifyValue$1(l,t)}return{name:n||r?i.slice(r?1:0,n?-1:void 0):i,value:a,boolean:n,implied:r,valueType:o,multiple:e.multiple}}function stringifyName(t,r){let n="";for(let e=0;e<t.length;e++)n+=stringify$1(t[e],r);return n}function stringifyValue$1(r,n){const o=[];let a="";for(let e=0,t;e<r.length;e++)isField$1(t=r[e])?(a&&(o.push(a),a=""),o.push(t)):a+=stringify$1(t,n);return a&&o.push(a),o}function isGroup(e){return"TokenGroup"===e.type}function isField$1(e){return"object"==typeof e&&"Field"===e.type&&null!=e.index}function last$1(e){return e[e.length-1]}function deepestNode(e){return e.children.length?deepestNode(last$1(e.children)):e}function insertText(e,t){e.value?"string"==typeof last$1(e.value)?e.value[e.value.length-1]+=t:e.value.push(t):e.value=[t]}function insertHref(e,t){let r="";urlRegex.test(t)?(r=t,/\w+:/.test(r)||r.startsWith("//")||(r="http://"+r)):emailRegex.test(t)&&(r="mailto:"+t);const n=null==(t=e.attributes)?void 0:t.find(e=>"href"===e.name);n?n.value||(n.value=[r]):(e.attributes||(e.attributes=[]),e.attributes.push({name:"href",value:[r],valueType:"doubleQuote"}))}function attachRepeater(e,t){for(const r of e)r.repeat||(r.repeat=Object.assign({},t));return e}function parseAbbreviation(t,e){try{return convert(abbreviation("string"==typeof t?tokenize$1(t):t,e),e)}catch(e){throw e instanceof ScannerError&&"string"==typeof t&&(e.message+=`
${t}
${"-".repeat(e.pos)}^`),e}}function tokenize(e,t){let r=0,n;const o=new Scanner(e),a=[];for(;!o.eof();){if(!(n=getToken(o,0===r&&!t)))throw o.error("Unexpected character");if("Bracket"===n.type&&(!r&&n.open&&mergeTokens(o,a),(r+=n.open?1:-1)<0))throw o.error("Unexpected bracket",n.start);a.push(n),shouldConsumeDashAfter(n)&&(n=operator(o))&&a.push(n)}return a}function getToken(e,t){return field$1(e)||customProperty(e)||numberValue(e)||colorValue(e)||stringValue(e)||bracket(e)||operator(e)||whiteSpace(e)||literal$1(e,t)}function field$1(r){var n=r.pos;if(r.eat(Chars$2.Dollar)&&r.eat(Chars$2.CurlyBracketOpen)){r.start=r.pos;let e,t="";if(r.eatWhile(isNumber$1)?(e=Number(r.current()),t=r.eat(Chars$2.Colon)?consumePlaceholder$1(r):""):isAlpha$1(r.peek())&&(t=consumePlaceholder$1(r)),r.eat(Chars$2.CurlyBracketClose))return{type:"Field",index:e,name:t,start:n,end:r.pos};throw r.error("Expecting }")}r.pos=n}function consumePlaceholder$1(e){const t=[];for(e.start=e.pos;!e.eof();)if(e.eat(Chars$2.CurlyBracketOpen))t.push(e.pos);else if(e.eat(Chars$2.CurlyBracketClose)){if(!t.length){e.pos--;break}t.pop()}else e.pos++;if(t.length)throw e.pos=t.pop(),e.error("Expecting }");return e.current()}function literal$1(e,t){var r=e.pos;if(e.eat(isIdentPrefix)?e.eatWhile(r?isKeyword:isLiteral$1):e.eat(isAlphaWord)?e.eatWhile(t?isLiteral$1:isKeyword):(e.eat(Chars$2.Dot),e.eatWhile(isLiteral$1)),r!==e.pos)return e.start=r,createLiteral(e,e.start=r)}function createLiteral(e,t=e.start,r=e.pos){return{type:"Literal",value:e.substring(t,r),start:t,end:r}}function numberValue(e){var t,r=e.pos;if(consumeNumber(e))return e.start=r,t=e.current(),e.start=e.pos,e.eat(Chars$2.Percent)||e.eatWhile(isAlphaWord),{type:"NumberValue",value:Number(t),rawValue:t,unit:e.current(),start:r,end:e.pos}}function stringValue(e){var t=e.peek(),r=e.pos;let n=!1;if(isQuote$2(t)){for(e.pos++;!e.eof();){if(e.eat(t)){n=!0;break}e.pos++}return e.start=r,{type:"StringValue",value:e.substring(r+1,e.pos-(n?1:0)),quote:t===Chars$2.SingleQuote?"single":"double",start:r,end:e.pos}}}function colorValue(r){var n=r.pos;if(r.eat(Chars$2.Hash)){var o,a,i,s=r.pos;let e="",t="";return t=r.eatWhile(isHex)?(e=r.substring(s,r.pos),colorAlpha(r)):r.eat(Chars$2.Transparent)?(e="0",colorAlpha(r)||"0"):colorAlpha(r),e||t||r.eof()?({r:s,g:o,b:a,a:i}=parseColor(e,t),{type:"ColorValue",r:s,g:o,b:a,a:i,raw:r.substring(n+1,r.pos),start:n,end:r.pos}):createLiteral(r,n)}r.pos=n}function colorAlpha(e){var t=e.pos;return e.eat(Chars$2.Dot)?(e.start=t,e.eatWhile(isNumber$1)?e.current():"1"):""}function whiteSpace(e){var t=e.pos;if(e.eatWhile(isSpace))return{type:"WhiteSpace",start:t,end:e.pos}}function customProperty(e){var t=e.pos;if(e.eat(Chars$2.Dash)&&e.eat(Chars$2.Dash))return e.start=t,e.eatWhile(isKeyword),{type:"CustomProperty",value:e.current(),start:t,end:e.pos};e.pos=t}function bracket(e){var t=e.peek();if(isBracket$1(t))return{type:"Bracket",open:t===Chars$2.RoundBracketOpen,start:e.pos++,end:e.pos}}function operator(e){var t=operatorType(e.peek());if(t)return{type:"Operator",operator:t,start:e.pos++,end:e.pos}}function consumeNumber(e){var t,r=e.pos,n=(e.eat(Chars$2.Dash),e.pos),o=e.eatWhile(isNumber$1),a=e.pos;return e.eat(Chars$2.Dot)&&(t=e.eatWhile(isNumber$1),o||t||(e.pos=a)),e.pos===n&&(e.pos=r),e.pos!==r}function isIdentPrefix(e){return e===Chars$2.At||e===Chars$2.Dollar}function operatorType(e){return e===Chars$2.Sibling&&OperatorType.Sibling||e===Chars$2.Excl&&OperatorType.Important||e===Chars$2.Comma&&OperatorType.ArgumentDelimiter||e===Chars$2.Colon&&OperatorType.PropertyDelimiter||e===Chars$2.Dash&&OperatorType.ValueDelimiter||void 0}function isHex(e){return isNumber$1(e)||isAlpha$1(e,65,70)}function isKeyword(e){return isAlphaNumericWord(e)||e===Chars$2.Dash}function isBracket$1(e){return e===Chars$2.RoundBracketOpen||e===Chars$2.RoundBracketClose}function isLiteral$1(e){return isAlphaWord(e)||e===Chars$2.Percent||e===Chars$2.Slash}function parseColor(e,t){let r="0",n="0",o="0",a=Number(null!=t&&""!==t?t:1);if("t"===e)a=0;else switch(e.length){case 0:break;case 1:r=n=o=e+e;break;case 2:r=n=o=e;break;case 3:r=e[0]+e[0],n=e[1]+e[1],o=e[2]+e[2];break;default:e+=e,r=e.slice(0,2),n=e.slice(2,4),o=e.slice(4,6)}return{r:parseInt(r,16),g:parseInt(n,16),b:parseInt(o,16),a:a}}function shouldConsumeDashAfter(e){return"ColorValue"===e.type||"NumberValue"===e.type&&!e.unit}function mergeTokens(e,t){let r=0,n=0;for(;t.length;){var o=last(t);if("Literal"!==o.type&&"NumberValue"!==o.type)break;r=o.start,n=n||o.end,t.pop()}r!==n&&t.push(createLiteral(e,r,n))}function last(e){return e[e.length-1]}function tokenScanner(e){return{tokens:e,start:0,pos:0,size:e.length}}function peek$2(e){return e.tokens[e.pos]}function readable(e){return e.pos<e.size}function consume$1(e,t){return!!t(peek$2(e))&&(e.pos++,!0)}function error(e,t,r=peek$2(e)){r&&null!=r.start&&(t+=" at "+r.start);const n=new Error(t);return n.pos=r&&r.start,n}function parser(e,t={}){var r,n=tokenScanner(e);const o=[];for(;readable(n);)if(r=consumeProperty(n,t))o.push(r);else if(!consume$1(n,isSiblingOperator))throw error(n,"Unexpected token");return o}function consumeProperty(e,t){let r,n=!1;var o;const a=[];var i=peek$2(e),s=!!t.value;for(s||!isLiteral(i)||isFunctionStart(e)||(e.pos++,r=i.value,consume$1(e,isValueDelimiter)),s&&consume$1(e,isWhiteSpace$1);readable(e);)if(consume$1(e,isImportant))n=!0;else if(o=consumeValue(e,s))a.push(o);else if(!consume$1(e,isFragmentDelimiter))break;if(r||a.length||n)return{name:r,value:a,important:n}}function consumeValue(e,t){const r=[];var n;let o;for(;readable(e);)if(isValue(n=peek$2(e)))e.pos++,isLiteral(n)&&(o=consumeArguments(e))?r.push({type:"FunctionCall",name:n.value,arguments:o}):r.push(n);else{if(!(isValueDelimiter(n)||t&&isWhiteSpace$1(n)))break;e.pos++}return r.length?{type:"CSSValue",value:r}:void 0}function consumeArguments(e){var t,r=e.pos;if(consume$1(e,isOpenBracket$1)){const n=[];for(;readable(e)&&!consume$1(e,isCloseBracket$1);)if(t=consumeValue(e,!0))n.push(t);else if(!consume$1(e,isWhiteSpace$1)&&!consume$1(e,isArgumentDelimiter))throw error(e,"Unexpected token");return e.start=r,n}}function isLiteral(e){return e&&"Literal"===e.type}function isBracket(e,t){return e&&"Bracket"===e.type&&(null==t||e.open===t)}function isOpenBracket$1(e){return isBracket(e,!0)}function isCloseBracket$1(e){return isBracket(e,!1)}function isWhiteSpace$1(e){return e&&"WhiteSpace"===e.type}function isOperator(e,t){return e&&"Operator"===e.type&&(!t||e.operator===t)}function isSiblingOperator(e){return isOperator(e,OperatorType.Sibling)}function isArgumentDelimiter(e){return isOperator(e,OperatorType.ArgumentDelimiter)}function isFragmentDelimiter(e){return isArgumentDelimiter(e)}function isImportant(e){return isOperator(e,OperatorType.Important)}function isValue(e){return"StringValue"===e.type||"ColorValue"===e.type||"NumberValue"===e.type||"Literal"===e.type||"Field"===e.type||"CustomProperty"===e.type}function isValueDelimiter(e){return isOperator(e,OperatorType.PropertyDelimiter)||isOperator(e,OperatorType.ValueDelimiter)}function isFunctionStart(e){var t=e.tokens[e.pos],e=e.tokens[e.pos+1];return t&&e&&isLiteral(t)&&"Bracket"===e.type}function parse$2(t,e){try{return parser("string"==typeof t?tokenize(t,e&&e.value):t,e)}catch(e){throw e instanceof ScannerError&&"string"==typeof t&&(e.message+=`
${t}
${"-".repeat(e.pos)}^`),e}}function mergeAttributes(e,t){if(e.attributes){const n=[],o={};for(const a of e.attributes)if(a.name){var r=a.name;if(r in o){const i=o[r];"class"===r?i.value=mergeValue(i.value,a.value," "):mergeDeclarations(i,a,t)}else n.push(o[r]=Object.assign({},a))}else n.push(a);e.attributes=n}}function mergeValue(e,t,r){if(e&&t){e.length&&r&&append(e,r);for(const o of t)append(e,o);return e}const n=e||t;return n&&n.slice()}function mergeDeclarations(e,t,r){return e.name=t.name,r.options["output.reverseAttributes"]||(e.value=t.value),e.implied||(e.implied=t.implied),e.boolean||(e.boolean=t.boolean),"expression"!==e.valueType&&(e.valueType=t.valueType),e}function append(e,t){var r=e.length-1;"string"==typeof e[r]&&"string"==typeof t?e[r]+=t:e.push(t)}function walk$1(e,t,r){const n=[e],o=e=>{t(e,n,r),n.push(e),e.children.forEach(o),n.pop()};e.children.forEach(o)}function findDeepest(e){let t;for(;e.children.length;)e=(t=e).children[e.children.length-1];return{parent:t,node:e}}function isNode(e){return"AbbreviationNode"===e.type}function resolveSnippets(e,i){const s=[],l=i.options["output.reverseAttributes"],u=e=>{var t=e.name&&i.snippets[e.name];if(!t||s.includes(t))return null;var r=parseAbbreviation(t,i);s.push(t),walkResolve(r,u),s.pop();for(const n of r.children){if(e.attributes){const o=n.attributes||[],a=e.attributes||[];n.attributes=l?a.concat(o):o.concat(a)}mergeNodes(e,n)}return r};return walkResolve(e,u),e}function walkResolve(e,t,r){let n=[];for(const a of e.children){var o=t(a);if(o){n=n.concat(o.children);const i=findDeepest(o);isNode(i.node)&&(i.node.children=i.node.children.concat(walkResolve(a,t)))}else n.push(a),a.children=walkResolve(a,t)}return e.children=n}function mergeNodes(e,t){e.selfClosing&&(t.selfClosing=!0),null!=e.value&&(t.value=e.value),e.repeat&&(t.repeat=e.repeat)}!function(e){e.Sibling="+",e.Important="!",e.ArgumentDelimiter=",",e.ValueDelimiter="-",e.PropertyDelimiter=":"}(OperatorType=OperatorType||{}),function(e){e[e.Hash=35]="Hash",e[e.Dollar=36]="Dollar",e[e.Dash=45]="Dash",e[e.Dot=46]="Dot",e[e.Colon=58]="Colon",e[e.Comma=44]="Comma",e[e.Excl=33]="Excl",e[e.At=64]="At",e[e.Percent=37]="Percent",e[e.Underscore=95]="Underscore",e[e.RoundBracketOpen=40]="RoundBracketOpen",e[e.RoundBracketClose=41]="RoundBracketClose",e[e.CurlyBracketOpen=123]="CurlyBracketOpen",e[e.CurlyBracketClose=125]="CurlyBracketClose",e[e.Sibling=43]="Sibling",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Transparent=116]="Transparent",e[e.Slash=47]="Slash"}(Chars$2=Chars$2||{});const expressionStart="{",expressionEnd="}";function createOutputStream(e,t=0){return{options:e,value:"",level:t,offset:0,line:0,column:0}}function push(e,t){const r=e.options["output.text"];_push(e,r(t,e.offset,e.line,e.column))}function pushString(r,e){var n=splitByLines$1(e);for(let e=0,t=n.length-1;e<=t;e++)push(r,n[e]),e!==t&&pushNewline(r,!0)}function pushNewline(e,t){var r=e.options["output.baseIndent"];push(e,e.options["output.newline"]+r),e.line++,e.column=r.length,t&&pushIndent(e,!0===t?e.level:t)}function pushIndent(e,t=e.level){const r=e.options["output.indent"];push(e,r.repeat(Math.max(t,0)))}function pushField(e,t,r){const n=e.options["output.field"];_push(e,n(t,r,e.offset,e.line,e.column))}function tagName(e,t){return strCase(e,t.options["output.tagCase"])}function attrName(e,t){return strCase(e,t.options["output.attributeCase"])}function attrQuote(e,t,r){return"expression"===e.valueType?r?expressionStart:expressionEnd:"single"===t.options["output.attributeQuotes"]?"'":'"'}function isBooleanAttribute(e,t){return e.boolean||t.options["output.booleanAttributes"].includes((e.name||"").toLowerCase())}function selfClose(e){switch(e.options["output.selfClosingStyle"]){case"xhtml":return" /";case"xml":return"/";default:return""}}function isInline(e,t){return"string"==typeof e?t.options.inlineElements.includes(e.toLowerCase()):e.name?isInline(e.name,t):Boolean(e.value&&!e.attributes)}function splitByLines$1(e){return e.split(/\r\n|\r|\n/g)}function _push(e,t){e.value+=t,e.offset+=t.length,e.column+=t.length}function strCase(e,t){return t?"upper"===t?e.toUpperCase():e.toLowerCase():e}const elementMap={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"};function implicitTag(e,t,r){!e.name&&e.attributes&&resolveImplicitTag(e,t,r)}function resolveImplicitTag(e,t,r){var t=getParentElement(t),n=r.context?r.context.name:"",t=lowercase(t?t.name:n);e.name=elementMap[t]||(isInline(t,r)?"span":"div")}function lowercase(e){return(e||"").toLowerCase()}function getParentElement(t){for(let e=t.length-1;0<=e;e--){var r=t[e];if(isNode(r))return r}}var TemplateChars,CSSSnippetType,latin={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","решила","выйти","большой","мир","грамматики","великий","оксмокс","предупреждал","о","злых","запятых","диких","знаках","вопроса","коварных","точках","запятой","но","текст","дал","сбить","себя","толку","он","собрал","семь","своих","заглавных","букв","подпоясал","инициал","за","пояс","пустился","дорогу","взобравшись","первую","вершину","курсивных","гор","бросил","последний","взгляд","назад","силуэт","своего","родного","города","буквоград","заголовок","деревни","алфавит","подзаголовок","своего","переулка","грустный","реторический","вопрос","скатился","его","щеке","продолжил","свой","путь","дороге","встретил","рукопись","она","предупредила","моей","все","переписывается","несколько","раз","единственное","что","меня","осталось","это","приставка","возвращайся","ты","лучше","свою","безопасную","страну","послушавшись","рукописи","наш","продолжил","свой","путь","вскоре","ему","повстречался","коварный","составитель","рекламных","текстов","напоивший","языком","речью","заманивший","свое","агентство","которое","использовало","снова","снова","своих","проектах","если","переписали","то","живет","там","до","сих","пор"]},sp={common:["mujer","uno","dolor","más","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","paño","suntuoso","molde","namibia","planeador","mirar","demás","oficinista","excepción","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cuórum","dignísimo","facilismo","letra","nihilista","expedición","alma","alveolar","aparte","león","animal","como","paria","belleza","modo","natividad","justo","ataque","séquito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunción","incidente","marejada","placenta","amanecer","fuga","previsor","presentación","lejos","necesariamente","sospechoso","adiposidad","quindío","pócima","voluble","débito","sintió","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","mínima","mayores","repugnante","dulce","obcecado","montaña","enigma","total","deletéreo","décima","cábala","fotografía","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magnífico","distinción","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crepúsculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abadía","analfabeto","remo","fugacidad","oficio","en","almácigo","vos","pan","represión","números","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patrón","explícito","paloma","síndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","apéndice","arquitecto","columna","yugo","computador","mula","a","propósito","fantasía","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]};const vocabularies={ru:ru,sp:sp,latin:latin},reLorem=/^lorem([a-z]*)(\d*)(-\d*)?$/i;function lorem(e,t,r){let n;var o,a,i;e.name&&(n=e.name.match(reLorem))&&(o=vocabularies[n[1]]||vocabularies.latin,a=rand(a=n[2]?Math.max(1,Number(n[2])):30,n[3]?Math.max(a,Number(n[3].slice(1))):a),i=e.repeat||findRepeater(t),e.name=e.attributes=void 0,e.value=[paragraph(o,a,!i||0===i.value)],e.repeat&&1<t.length&&resolveImplicitTag(e,t,r))}function rand(e,t){return Math.floor(Math.random()*(t-e)+e)}function sample(e,t){var r=e.length,n=Math.min(r,t);const o=[];for(;o.length<n;){var a=e[rand(0,r)];o.includes(a)||o.push(a)}return o}function choice(e){return e[rand(0,e.length-1)]}function sentence(e,t){return(e=e.length?[capitalize(e[0])].concat(e.slice(1)):e).join(" ")+(t||choice("?!..."))}function capitalize(e){return e[0].toUpperCase()+e.slice(1)}function insertCommas(r){if(r.length<2)return r;var n=(r=r.slice()).length;const o=/,$/;let a=0;a=3<n&&n<=6?rand(0,1):6<n&&n<=12?rand(0,2):rand(1,4);for(let e=0,t;e<a;e++)t=rand(0,n-2),o.test(r[t])||(r[t]+=",");return r}function paragraph(e,t,r){const n=[];let o=0,a;for(r&&e.common&&(a=e.common.slice(0,t),o+=a.length,n.push(sentence(insertCommas(a),".")));o<t;)a=sample(e.words,Math.min(rand(2,30),t-o)),o+=a.length,n.push(sentence(insertCommas(a)));return n.join(" ")}function findRepeater(t){for(let e=t.length-1;0<=e;e--){var r=t[e];if("AbbreviationNode"===r.type&&r.repeat)return r.repeat}}function xsl(e){matchesName(e.name)&&e.attributes&&(e.children.length||e.value)&&(e.attributes=e.attributes.filter(isAllowed))}function isAllowed(e){return"select"!==e.name}function matchesName(e){return"xsl:variable"===e||"xsl:with-param"===e}const reElement=/^(-+)([a-z0-9]+[a-z0-9-]*)/i,reModifier=/^(_+)([a-z0-9]+[a-z0-9-_]*)/i,blockCandidates1=e=>/^[a-z]\-/i.test(e),blockCandidates2=e=>/^[a-z]/i.test(e);function bem(e,t,r){expandClassNames(e),expandShortNotation(e,t,r)}function expandClassNames(e){const t=getBEMData(e),r=[];for(const o of t.classNames){var n=o.indexOf("_");0<n&&!o.startsWith("-")?(r.push(o.slice(0,n)),r.push(o.slice(n))):r.push(o)}r.length&&(t.classNames=r.filter(uniqueClass),t.block=findBlockName(t.classNames),updateClass(e,t.classNames.join(" ")))}function expandShortNotation(e,t,r){var n=getBEMData(e);const o=[];var a,i=r["options"],s=t.slice(1).concat(e);for(a of n.classNames){let e="",t;var l=a;(t=a.match(reElement))&&(e=getBlockName(s,t[1].length,r.context)+i["bem.element"]+t[2],o.push(e),a=a.slice(t[0].length)),(t=a.match(reModifier))&&(e||(e=getBlockName(s,t[1].length),o.push(e)),o.push(""+e+i["bem.modifier"]+t[2]),a=a.slice(t[0].length)),a===l&&o.push(l)}const u=o.filter(uniqueClass);u.length&&updateClass(e,u.join(" "))}function getBEMData(t){if(!t._bem){let e="";if(t.attributes)for(const r of t.attributes)if("class"===r.name&&r.value){e=stringifyValue(r.value);break}t._bem=parseBEM(e)}return t._bem}function getBEMDataFromContext(e){return e._bem||(e._bem=parseBEM(e.attributes&&e.attributes.class||"")),e._bem}function parseBEM(e){e=e?e.split(/\s+/):[];return{classNames:e,block:findBlockName(e)}}function getBlockName(e,t=0,r){let n=Math.max(e.length-t,0);do{var o=e[n];if(o){o=getBEMData(o);if(o.block)return o.block}}while(0<n--);if(r){t=getBEMDataFromContext(r);if(t.block)return t.block}return""}function findBlockName(e){return find(e,blockCandidates1)||find(e,blockCandidates2)||void 0}function find(e,t){for(const r of e){if(reElement.test(r)||reModifier.test(r))break;if(t(r))return r}}function updateClass(e,t){for(const r of e.attributes)if("class"===r.name){r.value=[t];break}}function stringifyValue(e){let t="";for(const r of e)t+="string"==typeof r?r:r.name;return t}function uniqueClass(e,t,r){return!!e&&r.indexOf(e)===t}function walk(e,a,i){const n=(e,t,r)=>{var{parent:n,current:o}=i;i.parent=o,i.current=e,a(e,t,r,i,s),i.current=o,i.parent=n},s=(e,t,r)=>{i.ancestors.push(i.current),n(e,t,r),i.ancestors.pop()};e.children.forEach(n)}function createWalkState(e){return{current:null,parent:void 0,ancestors:[],config:e,field:1,out:createOutputStream(e.options)}}const caret=[{type:"Field",index:0,name:""}];function isSnippet(e){return!!e&&(!e.name&&!e.attributes)}function isInlineElement(e,t){return!!e&&isInline(e,t)}function isField(e){return"object"==typeof e&&"Field"===e.type}function pushTokens(e,t){var r=t["out"];let n=-1;for(const o of e)"string"==typeof o?pushString(r,o):(pushField(r,t.field+o.index,o.name),o.index>n&&(n=o.index));-1!==n&&(t.field+=n+1)}function splitByLines(e){const t=[];let r=[];for(const n of e)if("string"==typeof n){const o=n.split(/\r\n?|\n/g);for(r.push(o.shift()||"");o.length;)t.push(r),r=[o.shift()||""]}else r.push(n);return r.length&&t.push(r),t}function shouldOutputAttribute(e){return!e.implied||"raw"!==e.valueType||!!e.value&&0<e.value.length}function template(e){const t=[],r={pos:0,text:e};var n;let o=r.pos;var a;for(r.pos;r.pos<r.text.length;)a=r.pos,(n=consumePlaceholder(r))?(o!==r.pos&&t.push(e.slice(o,a)),t.push(n),o=r.pos):r.pos++;return o!==r.pos&&t.push(e.slice(o)),t}function consumePlaceholder(n){if(peek$1(n)===TemplateChars.Start){var o=++n.pos;let e=o,t=o,r=1;for(;n.pos<n.text.length;){var a=peek$1(n);if(isTokenStart(a)){for(e=n.pos;isToken(peek$1(n));)n.pos++;t=n.pos}else{if(a===TemplateChars.Start)r++;else if(a===TemplateChars.End&&0==--r)return{before:n.text.slice(o,e),after:n.text.slice(t,n.pos++),name:n.text.slice(e,t)};n.pos++}}}}function peek$1(e,t=e.pos){return e.text.charCodeAt(t)}function isTokenStart(e){return 65<=e&&e<=90}function isToken(e){return isTokenStart(e)||47<e&&e<58||e===TemplateChars.Underscore||e===TemplateChars.Dash}function createCommentState(e){e=e.options;return{enabled:e["comment.enabled"],trigger:e["comment.trigger"],before:e["comment.before"]?template(e["comment.before"]):void 0,after:e["comment.after"]?template(e["comment.after"]):void 0}}function commentNodeBefore(e,t){shouldComment(e,t)&&t.comment.before&&output(e,t.comment.before,t)}function commentNodeAfter(e,t){shouldComment(e,t)&&t.comment.after&&output(e,t.comment.after,t)}function shouldComment(e,t){const r=t["comment"];if(!(r.enabled&&r.trigger&&e.name&&e.attributes))return!1;for(const n of e.attributes)if(n.name&&r.trigger.includes(n.name))return!0;return!1}function output(e,t,r){const n={};var o=r["out"];for(const a of e.attributes)a.name&&a.value&&(n[a.name.toUpperCase()]=a.value);for(const i of t)"string"==typeof i?pushString(o,i):n[i.name]&&(pushString(o,i.before),pushTokens(n[i.name],r),pushString(o,i.after))}!function(e){e[e.Start=91]="Start",e[e.End=93]="End",e[e.Underscore=95]="Underscore",e[e.Dash=45]="Dash"}(TemplateChars=TemplateChars||{});const htmlTagRegex=/^<([\w\-:]+)[\s>]/,reservedKeywords=new Set(["for","while","of","async","await","const","let","var","continue","break","debugger","do","export","import","in","instanceof","new","return","switch","this","throw","try","catch","typeof","void","with","yield"]);function html(e,t){const r=createWalkState(t);return r.comment=createCommentState(t),walk(e,element$1,r),r.out.value}function element$1(e,t,r,n,o){const{out:a,config:i}=n;var s=shouldFormat$1(e,t,r,n),l=getIndent(n);if(a.level+=l,s&&pushNewline(a,!0),e.name){var u,p=tagName(e.name,i);if(commentNodeBefore(e,n),pushString(a,"<"+p),e.attributes)for(const c of e.attributes)shouldOutputAttribute(c)&&pushAttribute(c,n);!e.selfClosing||e.children.length||e.value?(pushString(a,">"),pushSnippet(e,n,o)||(e.value&&((u=e.value.some(hasNewline)||startsWithBlockTag(e.value,i))&&pushNewline(n.out,++a.level),pushTokens(e.value,n),u&&pushNewline(n.out,--a.level)),e.children.forEach(o),e.value||e.children.length||((u=i.options["output.formatLeafNode"]||i.options["output.formatForce"].includes(e.name))&&pushNewline(n.out,++a.level),pushTokens(caret,n),u&&pushNewline(n.out,--a.level))),pushString(a,`</${p}>`),commentNodeAfter(e,n)):pushString(a,selfClose(i)+">")}else!pushSnippet(e,n,o)&&e.value&&(pushTokens(e.value,n),e.children.forEach(o));s&&t===r.length-1&&n.parent&&(u=isSnippet(n.parent)?0:1,pushNewline(a,a.level-u)),a.level-=l}function pushAttribute(o,a){var{out:i,config:s}=a;if(o.name){var l=s.options["markup.attributes"],u=s.options["markup.valuePrefix"];let{name:e,value:t}=o,r=attrQuote(o,s,!0),n=attrQuote(o,s);e=attrName(e=l?getMultiValue(e,l,o.multiple)||e:e,s);l=u?getMultiValue(o.name,u,o.multiple):null;l&&1===(null===t||void 0===t?void 0:t.length)&&"string"==typeof t[0]&&(u=t[0],t=[isPropKey(u)?l+"."+u:l+`['${u}']`],s.options["jsx.enabled"]&&(r=expressionStart,n=expressionEnd)),isBooleanAttribute(o,s)&&!t?s.options["output.compactBoolean"]||(t=[e]):t=t||caret,pushString(i," "+e),t?(pushString(i,"="+r),pushTokens(t,a),pushString(i,n)):"html"!==s.options["output.selfClosingStyle"]&&pushString(i,"="+r+n)}}function pushSnippet(t,r,n){if(t.value&&t.children.length){var o=t.value.findIndex(isField);if(-1!==o){pushTokens(t.value.slice(0,o),r);var a=r.out.line;let e=o+1;return t.children.forEach(n),r.out.line!==a&&"string"==typeof t.value[e]&&pushString(r.out,t.value[e++].trimLeft()),pushTokens(t.value.slice(e),r),!0}}return!1}function shouldFormat$1(r,n,o,a){var{config:i,parent:e}=a;if(!i.options["output.format"])return!1;if(0===n&&!e)return!1;if(e&&isSnippet(e)&&1===o.length)return!1;if(isSnippet(r)&&(isSnippet(o[n-1])||isSnippet(o[n+1])||r.value.some(hasNewline)||r.value.some(isField)&&r.children.length))return!0;if(isInline(r,i)){if(0===n){for(let e=0;e<o.length;e++)if(!isInline(o[e],i))return!0}else if(!isInline(o[n-1],i))return!0;if(i.options["output.inlineBreak"]){let e=1,t=n,r=n;for(;isInlineElement(o[--t],i);)e++;for(;isInlineElement(o[++r],i);)e++;if(e>=i.options["output.inlineBreak"])return!0}for(let e=0,t=r.children.length;e<t;e++)if(shouldFormat$1(r.children[e],e,r.children,a))return!0;return!1}return!0}function getIndent(e){const{config:t,parent:r}=e;return!r||isSnippet(r)||r.name&&t.options["output.formatSkip"].includes(r.name)?0:1}function hasNewline(e){return"string"==typeof e&&/\r|\n/.test(e)}function startsWithBlockTag(e,t){if(e.length&&"string"==typeof e[0]){const r=htmlTagRegex.exec(e[0]);if(null!==r&&void 0!==r&&r.length&&!t.options.inlineElements.includes(r[1].toLowerCase()))return!0}return!1}function getMultiValue(e,t,r){return r&&t[e+"*"]||t[e]}function isPropKey(e){return!reservedKeywords.has(e)&&/^[a-zA-Z_$][\w_$]*$/.test(e)}function indentFormat(e,t,r){const n=createWalkState(t);return n.options=r||{},walk(e,element,n),n.out.value}function element(e,t,r,n,o){const{out:a,options:i}=n,{primary:s,secondary:l}=collectAttributes(e);var u=n.parent?1:0;a.level+=u,shouldFormat(e,t,r,n)&&pushNewline(a,!0),!e.name||"div"===e.name&&s.length||pushString(a,(i.beforeName||"")+e.name+(i.afterName||"")),pushPrimaryAttributes(s,n),pushSecondaryAttributes(l.filter(shouldOutputAttribute),n),!e.selfClosing||e.value||e.children.length?(pushValue(e,n),e.children.forEach(o)):n.options.selfClose&&pushString(a,n.options.selfClose),a.level-=u}function collectAttributes(e){const t=[],r=[];if(e.attributes)for(const n of e.attributes)(isPrimaryAttribute(n)?t:r).push(n);return{primary:t,secondary:r}}function pushPrimaryAttributes(e,t){for(const r of e)r.value&&("class"===r.name?(pushString(t.out,"."),pushTokens(r.value.map(e=>"string"==typeof e?e.replace(/\s+/g,"."):e),t)):(pushString(t.out,"#"),pushTokens(r.value,t)))}function pushSecondaryAttributes(t,r){if(t.length){var{out:n,config:o,options:a}=r;a.beforeAttribute&&pushString(n,a.beforeAttribute);for(let e=0;e<t.length;e++){var i=t[e];pushString(n,attrName(i.name||"",o)),isBooleanAttribute(i,o)&&!i.value?!o.options["output.compactBoolean"]&&a.booleanValue&&pushString(n,"="+a.booleanValue):(pushString(n,"="+attrQuote(i,o,!0)),pushTokens(i.value||caret,r),pushString(n,attrQuote(i,o))),e!==t.length-1&&a.glueAttribute&&pushString(n,a.glueAttribute)}a.afterAttribute&&pushString(n,a.afterAttribute)}}function pushValue(e,r){if(e.value||!e.children.length){var t=e.value||caret,n=splitByLines(t);const{out:a,options:i}=r;if(1===n.length)(e.name||e.attributes)&&push(a," "),pushTokens(t,r);else{const s=[];let t=0;for(const l of n){var o=valueLength(l);s.push(o),o>t&&(t=o)}a.level++;for(let e=0;e<n.length;e++)pushNewline(a,!0),i.beforeTextLine&&push(a,i.beforeTextLine),pushTokens(n[e],r),i.afterTextLine&&(push(a," ".repeat(t-s[e])),push(a,i.afterTextLine));a.level--}}}function isPrimaryAttribute(e){return"class"===e.name||"id"===e.name}function valueLength(e){let t=0;for(const r of e)t+=("string"==typeof r?r:r.name).length;return t}function shouldFormat(e,t,r,n){return!(!n.parent&&0===t)&&!isSnippet(e)}function haml(e,t){return indentFormat(e,t,{beforeName:"%",beforeAttribute:"(",afterAttribute:")",glueAttribute:" ",afterTextLine:" |",booleanValue:"true",selfClose:"/"})}function slim(e,t){return indentFormat(e,t,{beforeAttribute:" ",glueAttribute:" ",beforeTextLine:"| ",selfClose:"/"})}function pug(e,t){return indentFormat(e,t,{beforeAttribute:"(",afterAttribute:")",glueAttribute:", ",beforeTextLine:"| ",selfClose:"xml"===t.options["output.selfClosingStyle"]?"/":""})}const formatters={html:html,haml:haml,slim:slim,pug:pug};function parse$1(e,t){let r;if("string"==typeof e){const n=Object.assign({},t);t.options["jsx.enabled"]&&(n.jsx=!0),t.options["markup.href"]&&(n.href=!0),e=parseAbbreviation(e,n),r=t.text,t.text=void 0}return walk$1(e=resolveSnippets(e,t),transform,t),t.text=null!==r&&void 0!==r?r:t.text,e}function stringify(e,t){const r=formatters[t.syntax]||html;return r(e,t)}function transform(e,t,r){implicitTag(e,t,r),mergeAttributes(e,r),lorem(e,t,r),"xsl"===r.syntax&&xsl(e),r.options["bem.enabled"]&&bem(e,t,r)}!function(e){e.Raw="Raw",e.Property="Property"}(CSSSnippetType=CSSSnippetType||{});const reProperty=/^([a-z-]+)(?:\s*:\s*([^\n\r;]+?);*)?$/,opt={value:!0};function createSnippet(e,t){const r=t.match(reProperty);if(r){var n={},o=r[2]?r[2].split("|").map(parseValue):[];for(const a of o)for(const i of a)collectKeywords(i,n);return{type:CSSSnippetType.Property,key:e,property:r[1],value:o,keywords:n,dependencies:[]}}return{type:CSSSnippetType.Raw,key:e,value:t}}function nest(e){const t=[];let r;for(const n of(e=e.slice().sort(snippetsSort)).filter(isProperty)){for(;t.length;){if(r=t[t.length-1],n.property.startsWith(r.property)&&45===n.property.charCodeAt(r.property.length)){r.dependencies.push(n),t.push(n);break}t.pop()}t.length||t.push(n)}return e}function snippetsSort(e,t){return e.key===t.key?0:e.key<t.key?-1:1}function parseValue(e){return parse$2(e.trim(),opt)[0].value}function isProperty(e){return e.type===CSSSnippetType.Property}function collectKeywords(e,t){for(const n of e.value){var r;"Literal"===n.type?t[n.value]=n:"FunctionCall"===n.type?t[n.name]=n:"Field"===n.type&&(r=n.name.trim())&&(t[r]={type:"Literal",value:r})}}function scoreMatch(e,t,r=!1){if((e=e.toLowerCase())===(t=t.toLowerCase()))return 1;if(!e||!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;var n=e.length,o=t.length;if(!r&&o<n)return 0;var a=Math.min(n,o),i=Math.max(n,o);let s=1,l=1,u=i;var p,c;let f=!1,m=!1;for(;s<n;){for(p=e.charCodeAt(s),f=!1,m=!1;l<o;){if(p===(c=t.charCodeAt(l))){f=!0,u+=i-(m?s:l);break}m=45===c,l++}if(!f){if(r)break;return 0}s++}var d=s/i,a=i-a,a=sum(i)-sum(a);return u*d/a}function sum(e){return e*(e+1)/2}function color(e,t){return e.r||e.g||e.b||e.a?1===e.a?asHex(e,t):asRGB(e):"transparent"}function asHex(e,t){const r=t&&isShortHex(e.r)&&isShortHex(e.g)&&isShortHex(e.b)?toShortHex:toHex;return"#"+r(e.r)+r(e.g)+r(e.b)}function asRGB(e){const t=[e.r,e.g,e.b];return 1!==e.a&&t.push(frac(e.a,8)),`${3===t.length?"rgb":"rgba"}(${t.join(", ")})`}function frac(e,t=4){return e.toFixed(t).replace(/\.?0+$/,"")}function isShortHex(e){return!(e%17)}function toShortHex(e){return(e>>4).toString(16)}function toHex(e){return pad(e.toString(16),2)}function pad(e,t){for(;e.length<t;)e="0"+e;return e}const CSSAbbreviationScope={Global:"@@global",Section:"@@section",Property:"@@property",Value:"@@value"};function css(t,r){var e,n=createOutputStream(r.options),o=r.options["output.format"];(null==(e=r.context)?void 0:e.name)===CSSAbbreviationScope.Section&&(t=t.filter(e=>e.snippet));for(let e=0;e<t.length;e++)o&&0!==e&&pushNewline(n,!0),property(t[e],n,r);return n.value}function property(e,t,r){var n=r.options["stylesheet.json"];if(e.name)pushString(t,(n?toCamelCase(e.name):e.name)+r.options["stylesheet.between"]),e.value.length?propertyValue(e,t,r):pushField(t,0,""),n?push(t,","):(outputImportant(e,t,!0),push(t,r.options["stylesheet.after"]));else{for(const o of e.value)for(const a of o.value)outputToken(a,t,r);outputImportant(e,t,0<e.value.length)}}function propertyValue(t,r,n){var e=n.options["stylesheet.json"],o=e?getSingleNumeric(t):null;if(!o||o.unit&&"px"!==o.unit){var a=getQuote(n);e&&push(r,a);for(let e=0;e<t.value.length;e++)0!==e&&push(r,", "),outputValue(t.value[e],r,n);e&&push(r,a)}else push(r,String(o.value))}function outputImportant(e,t,r){e.important&&(r&&push(t," "),push(t,"!important"))}function outputValue(r,n,o){for(let e=0,t=-1;e<r.value.length;e++){var a=r.value[e];0===e||"Field"===a.type&&a.start===t||push(n," "),outputToken(a,n,o),t=a.end}}function outputToken(t,r,n){if("ColorValue"===t.type)push(r,color(t,n.options["stylesheet.shortHex"]));else if("Literal"===t.type||"CustomProperty"===t.type)pushString(r,t.value);else if("NumberValue"===t.type)pushString(r,frac(t.value,4)+t.unit);else if("StringValue"===t.type){var e="double"===t.quote?'"':"'";pushString(r,e+t.value+e)}else if("Field"===t.type)pushField(r,t.index,t.name);else if("FunctionCall"===t.type){push(r,t.name+"(");for(let e=0;e<t.arguments.length;e++)e&&push(r,", "),outputValue(t.arguments[e],r,n);push(r,")")}}function getSingleNumeric(e){if(1===e.value.length){e=e.value[0];if(1===e.value.length&&"NumberValue"===e.value[0].type)return e.value[0]}}function toCamelCase(e){return e.replace(/\-(\w)/g,(e,t)=>t.toUpperCase())}function getQuote(e){return e.options["stylesheet.jsonDoubleQuotes"]?'"':"'"}const gradientName="lg";function parse(e,t){var r=(null==(r=t.cache)?void 0:r.stylesheetSnippets)||convertSnippets(t.snippets),n=(t.cache&&(t.cache.stylesheetSnippets=r),"string"==typeof e&&(e=parse$2(e,{value:isValueScope(t)})),getSnippetsForScope(r,t));for(const o of e)resolveNode(o,n,t);return e}function convertSnippets(e){const t=[];for(const r of Object.keys(e))t.push(createSnippet(r,e[r]));return nest(t)}function resolveNode(e,t,r){if(!resolveGradient(e,r)){var n=r.options["stylesheet.fuzzySearchMinScore"];if(isValueScope(r)){const a=r.context.name;var o=t.find(e=>e.type===CSSSnippetType.Property&&e.property===a);resolveValueKeywords(e,r,o,n),e.snippet=o}else e.name&&(o=findBestMatch(e.name,t,n,!0),(e.snippet=o)&&(o.type===CSSSnippetType.Property?resolveAsProperty(e,o,r):resolveAsSnippet(e,o)))}return(e.name||r.context)&&resolveNumericValue(e,r),e}function resolveGradient(e,t){let r=null;var n=1===e.value.length?e.value[0]:null;return!(!(r=n&&1===n.value.length&&"FunctionCall"===(n=n.value[0]).type&&n.name===gradientName?n:r)&&e.name!==gradientName)&&(r=r?Object.assign(Object.assign({},r),{name:"linear-gradient"}):{type:"FunctionCall",name:"linear-gradient",arguments:[cssValue(field(0,""))]},t.context||(e.name="background-image"),e.value=[cssValue(r)],!0)}function resolveAsProperty(e,t,r){var n=getUnmatchedPart(e.name,t.key);if(n){if(e.value.length)return e;n=resolveKeyword(n,r,t);if(!n)return e;e.value.push(cssValue(n))}if(e.name=t.property,e.value.length)resolveValueKeywords(e,r,t);else if(t.value.length){const o=t.value[0];e.value=1===t.value.length||o.some(hasField)?o:o.map(e=>wrapWithField(e,r))}return e}function resolveValueKeywords(e,t,r,n){for(const o of e.value){const a=[];for(const i of o.value)if("Literal"===i.type)a.push(resolveKeyword(i.value,t,r,n)||i);else if("FunctionCall"===i.type){const s=resolveKeyword(i.name,t,r,n);s&&"FunctionCall"===s.type?a.push(Object.assign(Object.assign({},s),{arguments:i.arguments.concat(s.arguments.slice(i.arguments.length))})):a.push(i)}else a.push(i);o.value=a}}function resolveAsSnippet(e,t){let r=0,n;const o=/\$\{(\d+)(:[^}]+)?\}/g,a=e.value[0],i=[];for(;n=o.exec(t.value);)r!==n.index&&i.push(literal(t.value.slice(r,n.index))),r=n.index+n[0].length,a&&a.value.length?i.push(a.value.shift()):i.push(field(Number(n[1]),n[2]?n[2].slice(1):""));var s=t.value.slice(r);return s&&i.push(literal(s)),e.name=void 0,e.value=[cssValue(...i)],e}function findBestMatch(e,t,r=0,n=!1){let o=null,a=0;for(const s of t){var i=scoreMatch(e,getScoringPart(s),n);if(1===i)return s;i&&i>=a&&(a=i,o=s)}return a>=r?o:null}function getScoringPart(e){return"string"==typeof e?e:e.key}function getUnmatchedPart(r,n){for(let e=0,t=0;e<r.length;e++){if(-1===(t=n.indexOf(r[e],t)))return r.slice(e);t++}return""}function resolveKeyword(e,t,r,n){let o;if(r){if(o=findBestMatch(e,Object.keys(r.keywords),n))return r.keywords[o];for(const a of r.dependencies)if(o=findBestMatch(e,Object.keys(a.keywords),n))return a.keywords[o]}return(o=findBestMatch(e,t.options["stylesheet.keywords"],n))?literal(o):null}function resolveNumericValue(e,t){var r=t.options["stylesheet.unitAliases"];const n=t.options["stylesheet.unitless"];for(const o of e.value)for(const a of o.value)"NumberValue"===a.type&&(a.unit?a.unit=r[a.unit]||a.unit:0===a.value||n.includes(e.name)||(a.unit=a.rawValue.includes(".")?t.options["stylesheet.floatUnit"]:t.options["stylesheet.intUnit"]))}function cssValue(...e){return{type:"CSSValue",value:e}}function literal(e){return{type:"Literal",value:e}}function field(e,t){return{type:"Field",index:e,name:t}}function hasField(e){for(const t of e.value)if("Field"===t.type||"FunctionCall"===t.type&&t.arguments.some(hasField))return!0;return!1}function wrapWithField(e,r,n={index:1}){let o=[];for(const a of e.value)switch(a.type){case"ColorValue":o.push(field(n.index++,color(a,r.options["stylesheet.shortHex"])));break;case"Literal":o.push(field(n.index++,a.value));break;case"NumberValue":o.push(field(n.index++,""+a.value+a.unit));break;case"StringValue":var t="single"===a.quote?"'":'"';o.push(field(n.index++,t+a.value+t));break;case"FunctionCall":o.push(field(n.index++,a.name),literal("("));for(let e=0,t=a.arguments.length;e<t;e++)o=o.concat(wrapWithField(a.arguments[e],r,n).value),e!==t-1&&o.push(literal(", "));o.push(literal(")"));break;default:o.push(a)}return Object.assign(Object.assign({},e),{value:o})}function isValueScope(e){return!!e.context&&(e.context.name===CSSAbbreviationScope.Value||!e.context.name.startsWith("@@"))}function getSnippetsForScope(e,t){if(t.context){if(t.context.name===CSSAbbreviationScope.Section)return e.filter(e=>e.type===CSSSnippetType.Raw);if(t.context.name===CSSAbbreviationScope.Property)return e.filter(e=>e.type===CSSSnippetType.Property)}return e}var Chars$1,Brackets,Chars,markupSnippets={a:"a[href]","a:blank":"a[href='http://${0}' target='_blank' rel='noopener noreferrer']","a:link":"a[href='http://${0}']","a:mail":"a[href='mailto:${0}']","a:tel":"a[href='tel:+${0}']",abbr:"abbr[title]","acr|acronym":"acronym[title]",base:"base[href]/",basefont:"basefont/",br:"br/",frame:"frame/",hr:"hr/",bdo:"bdo[dir]","bdo:r":"bdo[dir=rtl]","bdo:l":"bdo[dir=ltr]",col:"col/",link:"link[rel=stylesheet href]/","link:css":"link[href='${1:style}.css']","link:print":"link[href='${1:print}.css' media=print]","link:favicon":"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']","link:mf|link:manifest":"link[rel='manifest' href='${1:manifest.json}']","link:touch":"link[rel=apple-touch-icon href='${1:favicon.png}']","link:rss":"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']","link:atom":"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']","link:im|link:import":"link[rel=import href='${1:component}.html']",meta:"meta/","meta:utf":"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']","meta:vp":"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']","meta:compat":"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']","meta:edge":"meta:compat[content='${1:ie=edge}']","meta:redirect":"meta[http-equiv=refresh content='0; url=${1:http://example.com}']","meta:refresh":"meta[http-equiv=refresh content='${1:5}']","meta:kw":"meta[name=keywords content]","meta:desc":"meta[name=description content]",style:"style",script:"script","script:src":"script[src]","script:module":"script[type=module src]",img:"img[src alt]/","img:s|img:srcset":"img[srcset src alt]","img:z|img:sizes":"img[sizes srcset src alt]",picture:"picture","src|source":"source/","src:sc|source:src":"source[src type]","src:s|source:srcset":"source[srcset]","src:t|source:type":"source[srcset type='${1:image/}']","src:z|source:sizes":"source[sizes srcset]","src:m|source:media":"source[media='(${1:min-width: })' srcset]","src:mt|source:media:type":"source:media[type='${2:image/}']","src:mz|source:media:sizes":"source:media[sizes srcset]","src:zt|source:sizes:type":"source[sizes srcset type='${1:image/}']",iframe:"iframe[src frameborder=0]",embed:"embed[src type]/",object:"object[data type]",param:"param[name value]/",map:"map[name]",area:"area[shape coords href alt]/","area:d":"area[shape=default]","area:c":"area[shape=circle]","area:r":"area[shape=rect]","area:p":"area[shape=poly]",form:"form[action]","form:get":"form[method=get]","form:post":"form[method=post]",label:"label[for]",input:"input[type=${1:text}]/",inp:"input[name=${1} id=${1}]","input:h|input:hidden":"input[type=hidden name]","input:t|input:text":"inp[type=text]","input:search":"inp[type=search]","input:email":"inp[type=email]","input:url":"inp[type=url]","input:p|input:password":"inp[type=password]","input:datetime":"inp[type=datetime]","input:date":"inp[type=date]","input:datetime-local":"inp[type=datetime-local]","input:month":"inp[type=month]","input:week":"inp[type=week]","input:time":"inp[type=time]","input:tel":"inp[type=tel]","input:number":"inp[type=number]","input:color":"inp[type=color]","input:c|input:checkbox":"inp[type=checkbox]","input:r|input:radio":"inp[type=radio]","input:range":"inp[type=range]","input:f|input:file":"inp[type=file]","input:s|input:submit":"input[type=submit value]","input:i|input:image":"input[type=image src alt]","input:b|input:btn|input:button":"input[type=button value]","input:reset":"input:button[type=reset]",isindex:"isindex/",select:"select[name=${1} id=${1}]","select:d|select:disabled":"select[disabled.]","opt|option":"option[value]",textarea:"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]",marquee:"marquee[behavior direction]","menu:c|menu:context":"menu[type=context]","menu:t|menu:toolbar":"menu[type=toolbar]",video:"video[src]",audio:"audio[src]","html:xml":"html[xmlns=http://www.w3.org/1999/xhtml]",keygen:"keygen/",command:"command/","btn:s|button:s|button:submit":"button[type=submit]","btn:r|button:r|button:reset":"button[type=reset]","btn:b|button:b|button:button":"button[type=button]","btn:d|button:d|button:disabled":"button[disabled.]","fst:d|fset:d|fieldset:d|fieldset:disabled":"fieldset[disabled.]",bq:"blockquote",fig:"figure",figc:"figcaption",pic:"picture",ifr:"iframe",emb:"embed",obj:"object",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",tarea:"textarea",leg:"legend",sect:"section",art:"article",hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",mn:"main",tem:"template",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",out:"output",det:"details",sum:"summary",cmd:"command","ri:d|ri:dpr":"img:s","ri:v|ri:viewport":"img:z","ri:a|ri:art":"pic>src:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{<!DOCTYPE html>}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{\x3c!-- ${0} --\x3e}","cc:ie":"{\x3c!--[if IE]>${0}<![endif]--\x3e}","cc:noie":"{\x3c!--[if !IE]>\x3c!--\x3e${0}\x3c!--<![endif]--\x3e}"},stylesheetSnippets={"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${2});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:start|end|flex-start|flex-end|center|space-between|space-around|stretch|space-evenly",ai:"align-items:start|end|flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:time",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:start|end|auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:${1:#000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:${1:#000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:${1:#000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:${1:#000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:${1:#000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bfv:"backface-visibility:hidden|visible",bg:"background:${1:#000}","bg:n":"background: none",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:${1:#fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:#000}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:${1:#000}",cr:"color:rgb(${1:0}, ${2:0}, ${3:0})",cra:"color:rgba(${1:0}, ${2:0}, ${3:0}, ${4:.5})",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters(${0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|grid|inline-grid|subgrid|list-item|run-in|contents|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fd:"font-display:auto|block|swap|fallback|optional",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fft:'font-family:"Times New Roman", Times, Baskerville, Georgia, serif',ffa:'font-family:Arial, "Helvetica Neue", Helvetica, sans-serif',ffv:"font-family:Verdana, Geneva, sans-serif",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fvs:"font-variation-settings:normal|inherit|initial|unset",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fsz:"font-size",fsza:"font-size-adjust",g:"gap",gtc:"grid-template-columns:repeat(${0})|minmax()",gtr:"grid-template-rows:repeat(${0})|minmax()",gta:"grid-template-areas",gt:"grid-template",gg:"grid-gap",gcg:"grid-column-gap",grg:"grid-row-gap",gac:"grid-auto-columns:auto|minmax()",gar:"grid-auto-rows:auto|minmax()",gaf:"grid-auto-flow:row|column|dense|inherit|initial|unset",gd:"grid",gc:"grid-column",gcs:"grid-column-start",gce:"grid-column-end",gr:"grid-row",grs:"grid-row-start",gre:"grid-row-end",ga:"grid-area",h:"height",jc:"justify-content:start|end|stretch|flex-start|flex-end|center|space-between|space-around|space-evenly",ji:"justify-items:start|end|center|stretch",js:"justify-self:start|end|center|stretch",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",ol:"outline",olc:"outline-color:${1:#000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width|thin|medium|thick","op|opa":"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub",w:"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wid:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"},xslSnippets={"tm|tmatch":"xsl:template[match mode]","tn|tname":"xsl:template[name]",call:"xsl:call-template[name]",ap:"xsl:apply-templates[select mode]",api:"xsl:apply-imports",imp:"xsl:import[href]",inc:"xsl:include[href]",ch:"xsl:choose","wh|xsl:when":"xsl:when[test]",ot:"xsl:otherwise",if:"xsl:if[test]",par:"xsl:param[name]",pare:"xsl:param[name select]",var:"xsl:variable[name]",vare:"xsl:variable[name select]",wp:"xsl:with-param[name select]",key:"xsl:key[name match use]",elem:"xsl:element[name]",attr:"xsl:attribute[name]",attrs:"xsl:attribute-set[name]",cp:"xsl:copy[select]",co:"xsl:copy-of[select]",val:"xsl:value-of[select]","for|each":"xsl:for-each[select]",tex:"xsl:text",com:"xsl:comment",msg:"xsl:message[terminate=no]",fall:"xsl:fallback",num:"xsl:number[value]",nam:"namespace-alias[stylesheet-prefix result-prefix]",pres:"xsl:preserve-space[elements]",strip:"xsl:strip-space[elements]",proc:"xsl:processing-instruction[name]",sort:"xsl:sort[select order]",choose:"xsl:choose>xsl:when+xsl:otherwise",xsl:"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}","!!!":'{<?xml version="1.0" encoding="UTF-8"?>}'},pugSnippets={"!!!":"{doctype html}"},variables={lang:"en",locale:"en-US",charset:"UTF-8",indentation:"\t",newline:"\n"};const defaultSyntaxes={markup:"html",stylesheet:"css"},defaultOptions$1={inlineElements:["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"],"output.indent":"\t","output.baseIndent":"","output.newline":"\n","output.tagCase":"","output.attributeCase":"","output.attributeQuotes":"double","output.format":!0,"output.formatLeafNode":!1,"output.formatSkip":["html"],"output.formatForce":["body"],"output.inlineBreak":3,"output.compactBoolean":!1,"output.booleanAttributes":["contenteditable","seamless","async","autofocus","autoplay","checked","controls","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","novalidate","readonly","required","reversed","selected","typemustmatch"],"output.reverseAttributes":!1,"output.selfClosingStyle":"html","output.field":(e,t)=>t,"output.text":e=>e,"markup.href":!0,"comment.enabled":!1,"comment.trigger":["id","class"],"comment.before":"","comment.after":"\n\x3c!-- /[#ID][.CLASS] --\x3e","bem.enabled":!1,"bem.element":"__","bem.modifier":"_","jsx.enabled":!1,"stylesheet.keywords":["auto","inherit","unset","none"],"stylesheet.unitless":["z-index","line-height","opacity","font-weight","zoom","flex","flex-grow","flex-shrink"],"stylesheet.shortHex":!0,"stylesheet.between":": ","stylesheet.after":";","stylesheet.intUnit":"px","stylesheet.floatUnit":"em","stylesheet.unitAliases":{e:"em",p:"%",x:"ex",r:"rem"},"stylesheet.json":!1,"stylesheet.jsonDoubleQuotes":!1,"stylesheet.fuzzySearchMinScore":0},defaultConfig={type:"markup",syntax:"html",variables:variables,snippets:{},options:defaultOptions$1},syntaxConfig={markup:{snippets:parseSnippets(markupSnippets)},xhtml:{options:{"output.selfClosingStyle":"xhtml"}},xml:{options:{"output.selfClosingStyle":"xml"}},xsl:{snippets:parseSnippets(xslSnippets),options:{"output.selfClosingStyle":"xml"}},jsx:{options:{"jsx.enabled":!0,"markup.attributes":{class:"className","class*":"styleName",for:"htmlFor"},"markup.valuePrefix":{"class*":"styles"}}},vue:{options:{"markup.attributes":{"class*":":class"}}},svelte:{options:{"jsx.enabled":!0}},pug:{snippets:parseSnippets(pugSnippets)},stylesheet:{snippets:parseSnippets(stylesheetSnippets)},sass:{options:{"stylesheet.after":""}},stylus:{options:{"stylesheet.between":" ","stylesheet.after":""}}};function parseSnippets(r){const n={};return Object.keys(r).forEach(e=>{for(const t of e.split("|"))n[t]=r[e]}),n}function resolveConfig(e={},t={}){var r=e.type||"markup",n=e.syntax||defaultSyntaxes[r];return Object.assign(Object.assign(Object.assign({},defaultConfig),e),{type:r,syntax:n,variables:mergedData(r,n,"variables",e,t),snippets:mergedData(r,n,"snippets",e,t),options:mergedData(r,n,"options",e,t)})}function mergedData(e,t,r,n,o={}){var a=syntaxConfig[e],e=o[e],i=syntaxConfig[t],o=o[t];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},defaultConfig[r]),a&&a[r]),i&&i[r]),e&&e[r]),o&&o[r]),n[r])}function backwardScanner(e,t=0){return{text:e,start:t,pos:e.length}}function sol(e){return e.pos===e.start}function peek(e,t=0){return e.text.charCodeAt(e.pos-1+t)}function previous(e){if(!sol(e))return e.text.charCodeAt(--e.pos)}function consume(e,t){if(sol(e))return!1;t="function"==typeof t?t(peek(e)):t===peek(e);return t&&e.pos--,!!t}function consumeWhile(e,t){for(var r=e.pos;consume(e,t););return e.pos<r}function isQuote(e){return e===Chars$1.SingleQuote||e===Chars$1.DoubleQuote}function consumeQuoted(e){var t=e.pos,r=previous(e);if(isQuote(r))for(;!sol(e);)if(previous(e)===r&&peek(e)!==Chars$1.Escape)return!0;return e.pos=t,!1}!function(e){e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Escape=92]="Escape"}(Chars$1=Chars$1||{}),function(e){e[e.SquareL=91]="SquareL",e[e.SquareR=93]="SquareR",e[e.RoundL=40]="RoundL",e[e.RoundR=41]="RoundR",e[e.CurlyL=123]="CurlyL",e[e.CurlyR=125]="CurlyR"}(Brackets=Brackets||{});const bracePairs={[Brackets.SquareL]:Brackets.SquareR,[Brackets.RoundL]:Brackets.RoundR,[Brackets.CurlyL]:Brackets.CurlyR};function isHtml(e){var t=e.pos;if(!consume(e,Chars.AngleRight))return!1;let r=!1;for(consume(e,Chars.Slash);!sol(e);){if(consumeWhile(e,isWhiteSpace),consumeIdent(e)){if(consume(e,Chars.Slash)){r=consume(e,Chars.AngleLeft);break}if(consume(e,Chars.AngleLeft)){r=!0;break}if(consume(e,isWhiteSpace))continue;if(consume(e,Chars.Equals)){if(consumeIdent(e))continue;break}if(consumeAttributeWithUnquotedValue(e)){r=!0;break}break}if(!consumeAttribute(e))break}return e.pos=t,r}function consumeAttribute(e){return consumeAttributeWithQuotedValue(e)||consumeAttributeWithUnquotedValue(e)}function consumeAttributeWithQuotedValue(e){var t=e.pos;return!!(consumeQuoted(e)&&consume(e,Chars.Equals)&&consumeIdent(e))||(e.pos=t,!1)}function consumeAttributeWithUnquotedValue(e){var t=e.pos;const r=[];for(;!sol(e);){var n=peek(e);if(isCloseBracket(n))r.push(n);else if(isOpenBracket(n)){if(r.pop()!==bracePairs[n])break}else if(!isUnquotedValue(n))break;e.pos--}return!(t===e.pos||!consume(e,Chars.Equals)||!consumeIdent(e))||(e.pos=t,!1)}function consumeIdent(e){return consumeWhile(e,isIdent)}function isIdent(e){return e===Chars.Colon||e===Chars.Dash||isAlpha(e)||isNumber(e)}function isAlpha(e){return 65<=(e&=-33)&&e<=90}function isNumber(e){return 47<e&&e<58}function isWhiteSpace(e){return e===Chars.Space||e===Chars.Tab}function isUnquotedValue(e){return!isNaN(e)&&e!==Chars.Equals&&!isWhiteSpace(e)&&!isQuote(e)}function isOpenBracket(e){return e===Brackets.CurlyL||e===Brackets.RoundL||e===Brackets.SquareL}function isCloseBracket(e){return e===Brackets.CurlyR||e===Brackets.RoundR||e===Brackets.SquareR}!function(e){e[e.Tab=9]="Tab",e[e.Space=32]="Space",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Colon=58]="Colon",e[e.Equals=61]="Equals",e[e.AngleLeft=60]="AngleLeft",e[e.AngleRight=62]="AngleRight"}(Chars=Chars||{});const code=e=>e.charCodeAt(0),specialChars="#.*:$-_!@%^+>/".split("").map(code),defaultOptions={type:"markup",lookAhead:!0,prefix:""};function extractAbbreviation(e,t=e.length,r={}){var n,o,a=Object.assign(Object.assign({},defaultOptions),r),i=(t=Math.min(e.length,Math.max(0,null==t?e.length:t)),getStartOffset(e,t=a.lookAhead?offsetPastAutoClosed(e,t,a):t,a.prefix||""));if(-1!==i){const s=backwardScanner(e,i),l=(s.pos=t,[]);for(;!sol(s);){if(n=peek(s),l.includes(Brackets.CurlyR)){if(n===Brackets.CurlyR){l.push(n),s.pos--;continue}if(n!==Brackets.CurlyL){s.pos--;continue}}if(isCloseBrace(n,a.type))l.push(n);else if(isOpenBrace(n,a.type)){if(l.pop()!==bracePairs[n])break}else{if(l.includes(Brackets.SquareR)||l.includes(Brackets.CurlyR)){s.pos--;continue}if(isHtml(s)||!isAbbreviation(n))break}s.pos--}return l.length||s.pos===t?void 0:{abbreviation:o=e.slice(s.pos,t).replace(/^[*+>^]+/,""),location:t-o.length,start:r.prefix?i-r.prefix.length:t-o.length,end:t}}}function offsetPastAutoClosed(e,t,r){for(isQuote(e.charCodeAt(t))&&t++;isCloseBrace(e.charCodeAt(t),r.type);)t++;return t}function getStartOffset(e,t,r){if(!r)return 0;const n=backwardScanner(e);var o,a=r.split("").map(code);for(n.pos=t;!sol(n);)if(!consumePair(n,Brackets.SquareR,Brackets.SquareL)&&!consumePair(n,Brackets.CurlyR,Brackets.CurlyL)){if(o=n.pos,consumeArray(n,a))return o;n.pos--}return-1}function consumePair(e,t,r){var n=e.pos;if(consume(e,t))for(;!sol(e);){if(consume(e,r))return!0;e.pos--}return e.pos=n,!1}function consumeArray(t,r){var e=t.pos;let n=!1;for(let e=r.length-1;0<=e&&!sol(t)&&consume(t,r[e]);e--)n=0===e;return n||(t.pos=e),n}function isAbbreviation(e){return 64<e&&e<91||96<e&&e<123||47<e&&e<58||specialChars.includes(e)}function isOpenBrace(e,t){return e===Brackets.RoundL||"markup"===t&&(e===Brackets.SquareL||e===Brackets.CurlyL)}function isCloseBrace(e,t){return e===Brackets.RoundR||"markup"===t&&(e===Brackets.SquareR||e===Brackets.CurlyR)}function expandAbbreviation(e,t){t=resolveConfig(t);return("stylesheet"===t.type?stylesheet:markup)(e,t)}function markup(e,t){return stringify(parse$1(e,t),t)}function stylesheet(e,t){return css(parse(e,t),t)}export{CSSAbbreviationScope,expandAbbreviation as default,extractAbbreviation as extract,markup,parseAbbreviation as markupAbbreviation,parse$1 as parseMarkup,parse as parseStylesheet,convertSnippets as parseStylesheetSnippets,resolveConfig,stringify as stringifyMarkup,css as stringifyStylesheet,stylesheet,parse$2 as stylesheetAbbreviation};