// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(i){"use strict";var p,x,L=i.Pos;function d(t,e){for(var n,r,i=null!=(r=(n=t).flags)?r:(n.ignoreCase?"i":"")+(n.global?"g":"")+(n.multiline?"m":""),o=i,l=0;lt.length-n)break;(!r||l>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function O(t,e,n){e=d(e,"g");for(var r=n.line,i=n.ch,o=t.firstLine();o<=r;r--,i=-1){var l=t.getLine(r),h=C(l,e,i<0?0:l.length-i);if(h)return{from:L(r,h.index),to:L(r,h.index+h[0].length),match:h}}}function b(t,e,n,r){if(t.length==e.length)return n;for(var i=0,o=n+Math.max(0,t.length-e.length);;){if(i==o)return i;var l=i+o>>1,h=r(t.slice(0,l)).length;if(h==n)return l;n