Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/comment/continuecomment",["module","exports","require","../../lib/codemirror"],(function(e,n,t){window,function(e){var n=/\S/g,t=String.prototype.repeat||function(e){return Array(e+1).join(this)};function o(n){if(n.getOption("disableInput"))return e.Pass;for(var o,r=n.listSelections(),c=[],a=0;a<r.length;a++){var m=r[a].head;if(!/\bcomment\b/.test(n.getTokenTypeAt(m)))return e.Pass;var f=n.getModeAt(m);if(o){if(o!=f)return e.Pass}else o=f;var s,u,d=null,h=o.blockCommentStart,p=o.lineComment;if(h&&o.blockCommentContinue){var b=(s=n.getLine(m.line)).lastIndexOf(o.blockCommentEnd,m.ch-o.blockCommentEnd.length);if(-1!=b&&b==m.ch-o.blockCommentEnd.length||p&&(u=s.lastIndexOf(p,m.ch-1))>-1&&/\bcomment\b/.test(n.getTokenTypeAt({line:m.line,ch:u+1})));else if(m.ch>=h.length&&(u=s.lastIndexOf(h,m.ch-h.length))>-1&&u>b)if(i(0,s)>=u)d=s.slice(0,u);else{var g,C=n.options.tabSize;u=e.countColumn(s,u,C),d=n.options.indentWithTabs?t.call("\t",g=Math.floor(u/C))+t.call(" ",u-C*g):t.call(" ",u)}else(u=s.indexOf(o.blockCommentContinue))>-1&&u<=m.ch&&u<=i(0,s)&&(d=s.slice(0,u));null!=d&&(d+=o.blockCommentContinue)}if(null==d&&p&&l(n))if(null==s&&(s=n.getLine(m.line)),u=s.indexOf(p),m.ch||u){if(u>-1&&i(0,s)>=u){if(!(d=i(m.ch,s)>-1)){var v=n.getLine(m.line+1)||"",y=v.indexOf(p);d=y>-1&&i(0,v)>=y||null}d&&(d=s.slice(0,u)+p+s.slice(u+p.length).match(/^\s*/)[0])}}else d="";if(null==d)return e.Pass;c[a]="\n"+d}n.operation((function(){for(var e=r.length-1;e>=0;e--)n.replaceRange(c[e],r[e].from(),r[e].to(),"+insert")}))}function i(e,t){n.lastIndex=e;var o=n.exec(t);return o?o.index:-1}function l(e){var n=e.getOption("continueComments");return!n||"object"!=typeof n||!1!==n.continueLineComment}e.defineOption("continueComments",null,(function(n,t,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),t){var l="Enter";"string"==typeof t?l=t:"object"==typeof t&&t.key&&(l=t.key);var r={name:"continueComment"};r[l]=o,n.addKeyMap(r)}}))}("object"==typeof n&&"object"==typeof e?t("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=continuecomment.js.map