(function(){"use strict";function t(t,n){var r=n&&n.schemaInfo,i=n&&n.quoteChar||'"';if(!r)return;var s=t.getCursor(),o=t.getTokenAt(s),u=CodeMirror.innerMode(t.getMode(),o.state);if(u.mode.name!="xml")return;var a=[],f=!1,l,c=o.string.charAt(0)=="<";if(!u.state.tagName||c){c&&(l=o.string.slice(1),f=!0);var h=u.state.context,p=h&&r[h.tagName],d=h?p&&p.children:r["!top"];if(d)for(var v=0;v<d.length;++v)(!l||d[v].indexOf(l)==0)&&a.push("<"+d[v]);else for(var m in r)r.hasOwnProperty(m)&&m!="!top"&&(!l||m.indexOf(l)==0)&&a.push("<"+m);h&&(!l||("/"+h.tagName).indexOf(l)==0)&&a.push("</"+h.tagName+">")}else{var p=r[u.state.tagName],g=p&&p.attrs;if(!g)return;if(o.type=="string"||o.string=="="){var y=t.getRange(e(s.line,Math.max(0,s.ch-60)),e(s.line,o.type=="string"?o.start:o.end)),b=y.match(/([^\s\u00a0=<>\"\']+)=$/),w;if(!b||!g.hasOwnProperty(b[1])||!(w=g[b[1]]))return;o.type=="string"&&(l=o.string,/['"]/.test(o.string.charAt(0))&&(i=o.string.charAt(0),l=o.string.slice(1)),f=!0);for(var v=0;v<w.length;++v)(!l||w[v].indexOf(l)==0)&&a.push(i+w[v]+i)}else{o.type=="attribute"&&(l=o.string,f=!0);for(var E in g)g.hasOwnProperty(E)&&(!l||E.indexOf(l)==0)&&a.push(E)}}return{list:a,from:f?e(s.line,o.start):s,to:f?e(s.line,o.end):s}}var e=CodeMirror.Pos;CodeMirror.xmlHint=t,CodeMirror.registerHelper("hint","xml",t)})();