amis.define("c4abc2e",function(e,t){"use strict";function n(e){for(var t=r.createScanner(e),n=new d(0,e.length,[],void 0),a=n,s=-1,f=null,c=null,l=t.scan();l!==i.TokenType.EOS;){switch(l){case i.TokenType.StartTagOpen:var u=new d(t.getTokenOffset(),e.length,[],a);a.children.push(u),a=u;break;case i.TokenType.StartTag:a.tag=t.getTokenText();break;case i.TokenType.StartTagClose:a.end=t.getTokenEnd(),a.startTagEnd=t.getTokenEnd(),a.tag&&o.isVoidElement(a.tag)&&a.parent&&(a.closed=!0,a=a.parent);break;case i.TokenType.StartTagSelfClose:a.parent&&(a.closed=!0,a.end=t.getTokenEnd(),a.startTagEnd=t.getTokenEnd(),a=a.parent);break;case i.TokenType.EndTagOpen:s=t.getTokenOffset(),f=null;break;case i.TokenType.EndTag:f=t.getTokenText().toLowerCase();break;case i.TokenType.EndTagClose:if(f){for(var T=a;!T.isSameTag(f)&&T.parent;)T=T.parent;if(T.parent){for(;a!==T;)a.end=s,a.closed=!1,a=a.parent;a.closed=!0,a.endTagStart=s,a.end=t.getTokenEnd(),a=a.parent}}break;case i.TokenType.AttributeName:c=t.getTokenText();var h=a.attributes;h||(a.attributes=h={}),h[c]=null;break;case i.TokenType.AttributeValue:var g=t.getTokenText(),h=a.attributes;h&&c&&(h[c]=g,c=null)}l=t.scan()}for(;a.parent;)a.end=e.length,a.closed=!1,a=a.parent;return{roots:n.children,findNodeBefore:n.findNodeBefore.bind(n),findNodeAt:n.findNodeAt.bind(n)}}Object.defineProperty(t,"__esModule",{value:!0});var r=e("3dfa3cb"),a=e("3faaa4f"),i=e("d8847af"),o=e("0da881f"),d=function(){function e(e,t,n,r){this.start=e,this.end=t,this.children=n,this.parent=r,this.closed=!1}return Object.defineProperty(e.prototype,"attributeNames",{get:function(){return this.attributes?Object.keys(this.attributes):[]},enumerable:!0,configurable:!0}),e.prototype.isSameTag=function(e){return this.tag&&e&&this.tag.length===e.length&&this.tag.toLowerCase()===e},Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.children[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length?this.children[this.children.length-1]:void 0},enumerable:!0,configurable:!0}),e.prototype.findNodeBefore=function(e){var t=a.findFirst(this.children,function(t){return e<=t.start})-1;if(t>=0){var n=this.children[t];if(e>n.start){if(e<n.end)return n.findNodeBefore(e);var r=n.lastChild;return r&&r.end===n.end?n.findNodeBefore(e):n}}return this},e.prototype.findNodeAt=function(e){var t=a.findFirst(this.children,function(t){return e<=t.start})-1;if(t>=0){var n=this.children[t];if(e>n.start&&e<=n.end)return n.findNodeAt(e)}return this},e}();t.Node=d,t.parse=n});