Liferay.Loader.define("liferay!layout-content-page-editor-web$codemirror@5.65.2/addon/hint/xml-hint",["module","exports","require","../../lib/codemirror"],(function(t,e,r){window,function(t){"use strict";var e=t.Pos;function matches(t,e,r){return r?t.indexOf(e)>=0:0==t.lastIndexOf(e,0)}t.registerHelper("hint","xml",(function getHints(r,n){var s=n&&n.schemaInfo,i=n&&n.quoteChar||'"',a=n&&n.matchInMiddle;if(s){var o=r.getCursor(),l=r.getTokenAt(o);if(l.end>o.ch&&(l.end=o.ch,l.string=l.string.slice(0,o.ch-l.start)),(y=t.innerMode(r.getMode(),l.state)).mode.xmlCurrentTag){var h,c,g=[],f=!1,u=/\btag\b/.test(l.type)&&!/>$/.test(l.string),d=u&&/^\w/.test(l.string);if(d){var m=r.getLine(o.line).slice(Math.max(0,l.start-2),l.start),p=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;p&&(c=l.start-("close"==p?2:1))}else u&&"<"==l.string?p="open":u&&"</"==l.string&&(p="close");var v=y.mode.xmlCurrentTag(y.state);if(!u&&!v||p){d&&(h=l.string),f=p;var y,x=y.mode.xmlCurrentContext?y.mode.xmlCurrentContext(y.state):[],b=(y=x.length&&x[x.length-1])&&s[y],w=y?b&&b.children:s["!top"];if(w&&"close"!=p)for(var C=0;C<w.length;++C)h&&!matches(w[C],h,a)||g.push("<"+w[C]);else if("close"!=p)for(var O in s)!s.hasOwnProperty(O)||"!top"==O||"!attrs"==O||h&&!matches(O,h,a)||g.push("<"+O);y&&(!h||"close"==p&&matches(y,h,a))&&g.push("</"+y+">")}else{var A=(b=v&&s[v.name])&&b.attrs,M=s["!attrs"];if(!A&&!M)return;if(A){if(M){var P={};for(var H in M)M.hasOwnProperty(H)&&(P[H]=M[H]);for(var H in A)A.hasOwnProperty(H)&&(P[H]=A[H]);A=P}}else A=M;if("string"==l.type||"="==l.string){var $,L=(m=r.getRange(e(o.line,Math.max(0,o.ch-60)),e(o.line,"string"==l.type?l.start:l.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!L||!A.hasOwnProperty(L[1])||!($=A[L[1]]))return;if("function"==typeof $&&($=$.call(this,r)),"string"==l.type){h=l.string;var I=0;/['"]/.test(l.string.charAt(0))&&(i=l.string.charAt(0),h=l.string.slice(1),I++);var T=l.string.length;if(/['"]/.test(l.string.charAt(T-1))&&(i=l.string.charAt(T-1),h=l.string.substr(I,T-2)),I){var j=r.getLine(o.line);j.length>l.end&&j.charAt(l.end)==i&&l.end++}f=!0}var returnHintsFromAtValues=function(t){if(t)for(var e=0;e<t.length;++e)h&&!matches(t[e],h,a)||g.push(i+t[e]+i);return returnHints()};return $&&$.then?$.then(returnHintsFromAtValues):returnHintsFromAtValues($)}for(var q in"attribute"==l.type&&(h=l.string,f=!0),A)!A.hasOwnProperty(q)||h&&!matches(q,h,a)||g.push(q)}return returnHints()}}function returnHints(){return{list:g,from:f?e(o.line,null==c?l.start:c):o,to:f?e(o.line,l.end):o}}}))}("object"==typeof e&&"object"==typeof t?r("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=xml-hint.js.map