Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/edit/matchbrackets",["module","exports","require","../../lib/codemirror"],(function(t,e,r){window,function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=t.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function a(t,e,a){var o=t.getLineHandle(e.line),h=e.ch-1,l=a&&a.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var s=i(a),u=!l&&h>=0&&s.test(o.text.charAt(h))&&n[o.text.charAt(h)]||s.test(o.text.charAt(h+1))&&n[o.text.charAt(++h)];if(!u)return null;var f=">"==u.charAt(1)?1:-1;if(a&&a.strict&&f>0!=(h==e.ch))return null;var m=t.getTokenTypeAt(r(e.line,h+1)),g=c(t,r(e.line,h+(f>0?1:0)),f,m,a);return null==g?null:{from:r(e.line,h),to:g&&g.pos,match:g&&g.ch==u.charAt(0),forward:f>0}}function c(t,e,a,c,o){for(var h=o&&o.maxScanLineLength||1e4,l=o&&o.maxScanLines||1e3,s=[],u=i(o),f=a>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),m=e.line;m!=f;m+=a){var g=t.getLine(m);if(g){var d=a>0?0:g.length-1,k=a>0?g.length:-1;if(!(g.length>h))for(m==e.line&&(d=e.ch-(a<0?1:0));d!=k;d+=a){var p=g.charAt(d);if(u.test(p)&&(void 0===c||(t.getTokenTypeAt(r(m,d+1))||"")==(c||""))){var v=n[p];if(v&&">"==v.charAt(1)==a>0)s.push(p);else{if(!s.length)return{pos:r(m,d),ch:p};s.pop()}}}}}return m-a!=(a>0?t.lastLine():t.firstLine())&&null}function o(t,n,i){for(var c=t.state.matchBrackets.maxHighlightLineLength||1e3,o=i&&i.highlightNonMatching,h=[],l=t.listSelections(),s=0;s<l.length;s++){var u=l[s].empty()&&a(t,l[s].head,i);if(u&&(u.match||!1!==o)&&t.getLine(u.from.line).length<=c){var f=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(t.markText(u.from,r(u.from.line,u.from.ch+1),{className:f})),u.to&&t.getLine(u.to.line).length<=c&&h.push(t.markText(u.to,r(u.to.line,u.to.ch+1),{className:f}))}}if(h.length){e&&t.state.focused&&t.focus();var m=function(){t.operation((function(){for(var t=0;t<h.length;t++)h[t].clear()}))};if(!n)return m;setTimeout(m,800)}}function h(t){t.operation((function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=o(t,!1,t.state.matchBrackets)}))}function l(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}t.defineOption("matchBrackets",!1,(function(e,r,n){n&&n!=t.Init&&(e.off("cursorActivity",h),e.off("focus",h),e.off("blur",l),l(e)),r&&(e.state.matchBrackets="object"==typeof r?r:{},e.on("cursorActivity",h),e.on("focus",h),e.on("blur",l))})),t.defineExtension("matchBrackets",(function(){o(this,!0)})),t.defineExtension("findMatchingBracket",(function(t,e,r){return(r||"boolean"==typeof e)&&(r?(r.strict=e,e=r):e=e?{strict:!0}:null),a(this,t,e)})),t.defineExtension("scanForBracket",(function(t,e,r,n){return c(this,t,e,r,n)}))}("object"==typeof e&&"object"==typeof t?r("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=matchbrackets.js.map