amis.define("e7e5934",function(t,e){"use strict";function n(t,e){function n(e){var n=a(t,e),r=n.filter(function(t,e){if(0===e)return!0;var a=n[e-1];return t[0]===a[0]&&t[1]===a[1]?!1:!0}).map(function(e){return{range:o.Range.create(t.positionAt(e[0]),t.positionAt(e[1])),kind:g.SelectionRangeKind.Declaration}});return r}return e.map(n)}function a(t,e){var n=i.parse(t.getText()),a=t.offsetAt(e),f=n.findNodeAt(a),g=r(f);if(f.startTagEnd&&!f.endTagStart){var T=o.Range.create(t.positionAt(f.startTagEnd-2),t.positionAt(f.startTagEnd)),d=t.getText(T);g.unshift("/>"===d?[f.start+1,f.startTagEnd-2]:[f.start+1,f.startTagEnd-1]);var u=s(t,f,a);return g=u.concat(g)}if(!f.startTagEnd||!f.endTagStart)return g;if(g.unshift([f.start,f.end]),f.start<a&&a<f.startTagEnd){g.unshift([f.start+1,f.startTagEnd-1]);var u=s(t,f,a);return g=u.concat(g)}return f.startTagEnd<=a&&a<=f.endTagStart?(g.unshift([f.startTagEnd,f.endTagStart]),g):(a>=f.endTagStart+2&&g.unshift([f.endTagStart+2,f.end-1]),g)}function r(t){for(var e=t,n=function(t){return t.startTagEnd&&t.endTagStart&&t.startTagEnd<t.endTagStart?[[t.startTagEnd,t.endTagStart],[t.start,t.end]]:[[t.start,t.end]]},a=[];e.parent;)e=e.parent,n(e).forEach(function(t){return a.push(t)});return a}function s(t,e,n){for(var a=o.Range.create(t.positionAt(e.start),t.positionAt(e.end)),r=t.getText(a),s=n-e.start,i=f.createScanner(r),T=i.scan(),d=e.start,u=[],c=!1,k=-1;T!==g.TokenType.EOS;){switch(T){case g.TokenType.AttributeName:if(s<i.getTokenOffset()){c=!1;break}s<=i.getTokenEnd()&&u.unshift([i.getTokenOffset(),i.getTokenEnd()]),c=!0,k=i.getTokenOffset();break;case g.TokenType.AttributeValue:if(!c)break;var E=i.getTokenText();if(s<i.getTokenOffset()){u.push([k,i.getTokenEnd()]);break}s>=i.getTokenOffset()&&s<=i.getTokenEnd()&&(u.unshift([i.getTokenOffset(),i.getTokenEnd()]),('"'===E[0]&&'"'===E[E.length-1]||"'"===E[0]&&"'"===E[E.length-1])&&s>=i.getTokenOffset()+1&&s<=i.getTokenEnd()-1&&u.unshift([i.getTokenOffset()+1,i.getTokenEnd()-1]),u.push([k,i.getTokenEnd()]))}T=i.scan()}return u.map(function(t){return[t[0]+d,t[1]+d]})}Object.defineProperty(e,"__esModule",{value:!0});var o=t("c1fd486"),f=t("3dfa3cb"),i=t("c4abc2e"),g=t("d8847af");e.getSelectionRanges=n});