amis.define("502930f",function(e,n){"use strict";function t(e,n){var t=r(e);return a(t,n)}function r(e){function n(n){return e.positionAt(n.offset).line}function t(n){return e.positionAt(n.offset+n.len).line}function r(){switch(e.languageId){case"scss":return new u.SCSSScanner;case"less":return new o.LESSScanner;default:return new s.Scanner}}function a(e,r){var i=n(e),a=t(e);return i!==a?{startLine:i,endLine:a,kind:r}:null}var c=[],l=[],f=r();f.ignoreComment=!1,f.setSource(e.getText());for(var d,p=f.scan(),g=function(){switch(p.type){case s.TokenType.CurlyL:case u.InterpolationFunction:l.push({line:n(p),type:"brace",isStart:!0});break;case s.TokenType.CurlyR:if(0!==l.length){var r=i(l,"brace");if(!r)break;var o=t(p);"brace"===r.type&&(t(d)!==o&&o--,r.line!==o&&c.push({startLine:r.line,endLine:o,kind:void 0}))}break;case s.TokenType.Comment:var g=function(e){return"#region"===e?{line:n(p),type:"comment",isStart:!0}:{line:t(p),type:"comment",isStart:!1}},m=function(n){var t=n.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//);if(t)return g(t[1]);if("scss"===e.languageId||"less"===e.languageId){var r=n.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/);if(r)return g(r[1])}return null},v=m(p);if(v)if(v.isStart)l.push(v);else{var r=i(l,"comment");if(!r)break;"comment"===r.type&&r.line!==v.line&&c.push({startLine:r.line,endLine:v.line,kind:"region"})}else{var L=a(p,"comment");L&&c.push(L)}}d=p,p=f.scan()};p.type!==s.TokenType.EOF;)g();return c}function i(e,n){if(0===e.length)return null;for(var t=e.length-1;t>=0;t--)if(e[t].type===n&&e[t].isStart)return e.splice(t,1)[0];return null}function a(e,n){var t=n&&n.rangeLimit||Number.MAX_VALUE,r=e.sort(function(e,n){var t=e.startLine-n.startLine;return 0===t&&(t=e.endLine-n.endLine),t}),i=[],a=-1;return r.forEach(function(e){e.startLine<a&&a<e.endLine||(i.push(e),a=e.endLine)}),i.length<t?i:i.slice(0,t)}Object.defineProperty(n,"__esModule",{value:!0});var s=e("d7eab65"),u=e("79d9776"),o=e("7a9d733");n.getFoldingRanges=t});