=o&&(i=Jt(t,jn($t(t,a))-e.wrapper.clientHeight),o=a)),{from:i,to:Math.max(o,i+1)}}function gi(e,t){var n,r,i,o,l,a,s,c,u,d,h,f=e.display,p=Gr(e.display);return t.top<0&&(t.top=0),n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:f.scroller.scrollTop,r=br(e),i={},t.bottom-t.top>r&&(t.bottom=t.top+r),o=e.doc.height+mr(f),l=t.topo-p,t.topn+r&&(s=Math.min(t.top,(a?o:t.bottom)-r))!=n&&(i.scrollTop=s),c=e.options.fixedGutter?0:f.gutters.offsetWidth,u=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:f.scroller.scrollLeft-c,d=vr(e)-f.gutters.offsetWidth,(h=t.right-t.left>d)&&(t.right=t.left+d),t.left<10?i.scrollLeft=0:t.leftd+u-3&&(i.scrollLeft=t.right+(h?0:10)-d),i}function yi(e,t){null!=t&&(wi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function vi(e){wi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,n){null==t&&null==n||wi(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function wi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,xi(e,Ir(e,t.from),Ir(e,t.to),t.margin))}function xi(e,t,n,r){var i=gi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});bi(e,i.scrollLeft,i.scrollTop)}function ki(e,t){Math.abs(e.doc.scrollTop-t)<2||(Ee||Ki(e,{top:t}),Ci(e,t,!0),Ee&&Ki(e),Ri(e,100))}function Ci(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Si(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,qi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ti(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+mr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+yr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Li(e,t){var n,r,i;for(t=t||Ti(e),n=e.display.barWidth,r=e.display.barHeight,Mi(e,t),i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&fi(e),Mi(e,Ti(e)),n=e.display.barWidth,r=e.display.barHeight}function Mi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function Ni(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&l(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new K[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,
+n.display.scrollbarFiller),L(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?Si:ki)(n,e)},n),n.display.scrollbars.addClass&&st(n.display.wrapper,n.display.scrollbars.addClass)}function Ai(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++G,markArrays:null},function t(e){F?F.ops.push(e):e.ownsGroup=F={ops:[e],delayedCallbacks:[]}}(e.curOp)}function Oi(e){var t=e.curOp;t&&Jn(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new U(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Wi(e){var t=e.cm,n=t.display;e.updatedDisplay&&fi(t),e.barMeasure=Ti(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+yr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-vr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Di(e){var t,n=e.cm;null!=e.adjustWidthTo&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null==i||_e||(o=it("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-pr(e.display))+"px;\n height: "+(t.bottom-t.top+yr(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)))}(o,function h(e,t,n,r){var i,o,l,a,s,c,u,d;for(null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?nn(t.line,t.ch+1,"before"):t,t=t.ch?nn(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t),o=0;o<5&&(l=!1,a=Hr(e,t),s=n&&n!=t?Hr(e,n):a,c=gi(e,i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft,null!=c.scrollTop&&(ki(e,c.scrollTop),1=s.display.viewTo||(c=+new Date+s.options.workTime,u=pn(s,h.highlightFrontier),d=[],h.iter(u.line,Math.min(h.first+h.size,s.display.viewTo+500),function(e){var t,n,r,i,o,l,a;if(u.line>=s.display.viewFrom){for(t=e.styles,n=e.text.length>s.options.maxHighlightLength?Ut(h.mode,u.state):null,r=hn(s,e,u,!0),n&&(u.state=n),e.styles=r.styles,i=e.styleClasses,(o=r.classes)?e.styleClasses=o:i&&(e.styleClasses=null),l=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),a=0;!l&&ac
+)return Ri(s,s.options.workDelay),!0}),h.highlightFrontier=u.line,h.modeFrontier=Math.max(h.modeFrontier,u.line),d.length&&Ei(s,function(){for(var e=0;e=s.viewFrom&&t.visible.to<=s.viewTo&&(null==s.updateLineNumbers||s.updateLineNumbers>=s.viewTo)&&s.renderedView==s.view&&0==ni(e))&&(_i(e)&&(ei(e),t.dims=qr(e)),n=c.first+c.size,r=Math.max(t.visible.from-e.options.viewportMargin,c.first),i=Math.min(n,t.visible.to+e.options.viewportMargin),s.viewFromi&&s.viewTo-i<20&&(i=Math.min(n,s.viewTo)),P&&(r=In(e.doc,r),i=Fn(e.doc,i)),o=r!=s.viewFrom||i!=s.viewTo||s.lastWrapHeight!=t.wrapperHeight||s.lastWrapWidth!=t.wrapperWidth,function u(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Qn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Qn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Zr(e,n)))),r.viewTo=n}(e,r,i),s.viewOffset=jn($t(e.doc,s.viewFrom)),e.display.mover.style.top=s.viewOffset+"px",l=ni(e),!(!o&&0==l&&!t.force&&s.renderedView==s.view&&(null==s.updateLineNumbers||s.updateLineNumbers>=s.viewTo))&&(a=function d(e){var t,n,r;return!e.hasFocus()&&(t=at())&<(e.display.lineDiv,t)?(n={activeElt:t},window.getSelection&&(r=window.getSelection()).anchorNode&&r.extend&<(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset),n):null}(e),4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ji(e,t))break;fi(e),r=Ti(e),ri(e),Li(e,r),Ui(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n,r=new U(e,t);ji(e,r)&&(fi(e),Vi(e,r),n=Ti(e),ri(e),Li(e,n),Ui(e,n),r.finish())}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",er(e,"gutterChanged",e)}function Ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+yr(e)+"px"}function qi(e){var t,n,r,i,o,l,a=e.display,s=a.view;if(a.alignWidgets||a.gutters.firstChild&&e.options.fixedGutter){for(t=_r(a)-a.scroller.scrollLeft+e.doc.scrollLeft,n=a.gutters.offsetWidth,r=t+"px",i=0;ii.clientWidth,o=i.scrollHeight>i.clientHeight,f&&n||p&&o){if(p&&Ze&&je)e:for(l=t.target,a=r.view;l!=i;l=l.parentNode)for(s=0;si-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function c(e,t){return t?(yo(e.done),gt(e.done)):e.done.length&&!gt(e.done).ranges?gt(e.done):1s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift();s.done.push(n),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=i,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,l||zt(e,"historyAdded")}function bo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function l(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,gt(i.done),t))?i.done[i.done.length-1]=t:wo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&yo(i.undone)}function wo(e,t){var n=gt(t);n&&n.ranges&&n.equals(e)||t.push(e)}function xo(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function ko(e){var t,n;if(!e)return null;for(n=0;n=t.ch:l.to>t.ch))){if(i&&(zt(a,"beforeCursorEnter"),a.explicitlyCleared)){if(f.markedSpans){--o;continue}break}if(!a.atomic)continue;return n&&(u=a.find(r<0?1:-1),d=void 0,(r<0?c:s)&&(u=Fo(e,u,-r,u&&u.line==t.line?f:null)),u&&u.line==t.line&&(d=rn(u,n))&&(r<0?d<0:0e.first?un(e,nn(t.line-1)):null:0e.lastLine()||(t.from.lineo&&(t={from:t.from,to:nn(o,$t(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Xt(e,t.from,t.to),n=n||oo(e,t),e.cm?function p(e,t,n){var r,i,o,l,a=e.doc,s=e.display,c=t.from,u=t.to,d=!1,h=c.line;e.options.lineWrapping||(h=Qt(Hn($t(a,c.line))),a.iter(h,u.line+1,function(e){if(e==s.maxLine)return d=!0}));-1s.maxLineLength&&(s.maxLine=e,s.maxLineLength=t,s.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0));(function f(e,t){var n,r,i;if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier=this.string.length},A.prototype.sol=function(){return this.pos==this.lineStart},A.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},A.prototype.next=function(){if(this.post},A.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},A.prototype.skipToEnd=function(){this.pos=this.string.length},A.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},z.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},z.prototype.nextLine=function(){this.line++,0e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return i?(this.vert.style.display="block",this.vert.style.bottom=r?o+"px":"0",t=e.viewHeight-(r?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),r?(this.horiz.style.display="block",this.horiz.style.right=i?o+"px":"0",this.horiz.style.left=e.barLeft+"px",n=e.viewWidth-e.barLeft-(i?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+n)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0);null!=r&&e&&this.collapsed&&Qr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Po(e.doc)),e&&er(e,"markerCleared",e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},Q.prototype.find=function(e,t){var n,r,i,o,l;for(null==e&&"bookmark"==this.type&&(e=1),i=0;i=e.ch)&&t.push(i.marker.parent||i.marker);return t},findMarks:function(i,o,l){i=un(this,i),o=un(this,o);var a=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t,n,r=e.markedSpans;if(r)for(t=0;t=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||l&&!l(n.marker)||a.push(n.marker.parent||n.marker);++s}),a},getAllMarks:function(){var r=[];return this.iter(function(e){var t,n=e.markedSpans;if(n)for(t=0;tt&&(t=e.from),null!=e.to&&e.toe.text.length?null:r}function yl(e,t,n){var r=gl(e,t.ch,n);return null==r?null:new nn(t.line,r,n<0?"after":"before")}function vl(e,t,n,r,i){var o,l,a,s,c,u;return e&&("rtl"==t.doc.direction&&(i=-i),o=Nt(n,t.doc.direction))?(a=i<0==(1==(l=i<0?gt(o):o[0]).level)?"after":"before",0u&&t.push(new X(nn(a,u),nn(a,pt(c,l,n))));t.length||t.push(new X(v,v)),zo(w,to(y,C.ranges.slice(0,k).concat(t),k),{origin:"*mouse",scroll:!1}),y.scrollIntoView(e)}else d=x,h=Al(y,e,b.unit),f=d.anchor,f=0=t.to||i.linea.bottom?20:0)&&setTimeout(Hi(y,function(){s==r&&(l.scroller.scrollTop+=n,o(e))}),50))}:u)(e)}),i=Hi(y,u);y.state.selectingText=i,L(l.wrapper.ownerDocument,"mousemove",r),L(l.wrapper.ownerDocument,"mouseup",i)})(e,r,t,o)}(i,t,r,e):Bt(e)==o.scroller&&Ht(e):2==n?(t&&Lo(i.doc,t),setTimeout(function(){return o.input.focus()},20)):3==n&&(p?i.display.input.onContextMenu(e):ui(i)))))}function Al(e,t,n){if("char"==n)return new X(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new X(nn(t.line,0),un(e.doc,nn(t.line+1,0)));var r=n(e,t);return new X(r.from,r.to)}function Ol(e,t,n,r){var i,o,l,a,s,c;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(u){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;if(r&&Ht(t),o>(a=(l=e.display).lineDiv.getBoundingClientRect()).bottom||!Pt(e,n))return Ft(t);for(o-=a.top-l.viewOffset,s=0;s=i)return zt(e,n,e,Jt(e.doc,o),e.display.gutterSpecs[s].className,t),Ft(t)}function zl(e,t){return Ol(e,t,"gutterClick",!0)}function Wl(e,t){fr(e.display,t)||function n(e,t){return Pt(e,"gutterContextMenu")&&Ol(e,t,"gutterContextMenu",!1)}(e,t)||Wt(e,t,"contextmenu")||p||e.display.input.onContextMenu(t)}function Dl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ar(e)}function Pl(e,t,n){var r,i,o=n&&n!=ge;!t!=!o&&(r=e.display.dragFunctions,(i=t?L:Ot)(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop))}function El(e){e.options.lineWrapping?(st(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(l(e.display.wrapper,"CodeMirror-wrap"),Kn(e)),Xr(e),Qr(e),Ar(e),setTimeout(function(){return Li(e)},100)}function Hl(e,t){var n,r,i,o,l,a=this;if(!(this instanceof Hl))return new Hl(e,t);for(o in this.options=t=t?dt(t):{},dt(ye,t,!1),"string"==typeof(n=t.value)?n=new te(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n,r=new Hl.inputStyles[t.inputStyle](this),Dl((i=this.display=new Zi(e,n,r,t)).wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ni(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new s,keySeq:null,specialChars:null},t.autofocus&&!Ye&&i.input.focus(),Re&&Be<11&&setTimeout(function(){return a.display.input.reset(!0)},20),function c(o){var r,i,e,l=o.display;L(l.scroller,"mousedown",Hi(o,Nl)),L(l.scroller,"dblclick",Re&&Be<11?Hi(o,function(e){var t,n;Wt(o,e)||!(t=Yr(o,e))||zl(o,e)||fr(o.display,e)||(Ht(e),n=o.findWordAt(t),Lo(o.doc,n.anchor,n.head))}):function(e){return Wt(o,e)||Ht(e)});L(l.scroller,"contextmenu",function(e){return Wl(o,e)}),L(l.input.getField(),"contextmenu",function(e){l.scroller.contains(e.target)||Wl(o,e)});i={end:0};function a(){l.activeTouch&&(r=setTimeout(function(){return l.activeTouch=null},1e3),(i=l.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return 1;var n=t.left-e.left,r=t.top-e.top;return 400g.first?ht($t(g,t-1).text,null,o):0:"add"==n?c=a+e.options.indentUnit:"subtract"==n?c=a-e.options.indentUnit:"number"==typeof n&&(c=a+n),c=Math.max(0,c),u="",d=0,e.options.indentWithTabs)for(h=Math.floor(c/o);h;--h)d+=o,u+="\t";if(do,a=w(t),s=null,l&&1o?"cut":"+input")},jo(e.doc,m),er(e,"inputRead",e,m);t&&!l&&jl(e,t),vi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=u),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Bl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ei(t,function(){return Rl(t,n,0,null,"paste")}),1)}function jl(e,t){var n,r,i,o,l,a;if(e.options.electricChars&&e.options.smartIndent)for(r=(n=e.doc.sel).ranges.length-1;0<=r;r--)if(!(100<(i=n.ranges[r]).head.ch||r&&n.ranges[r-1].head.line==i.head.line)){if(l=!1,(o=e.getModeAt(i.head)).electricChars){for(a=0;a=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after"),r=Lt(g,a.ch,a.sticky),i=g[r],"ltr"==t.doc.direction&&i.level%2==0&&(0a.ch:i.from=i.from&&d>=c.begin))?!(p=(f=function(e,t,n){for(var r,i,o,l=function(e,t){return t?new nn(a.line,s(e,1),"before"):new nn(a.line,e,"after")};0<=e&&e=o.first+o.size)&&(l=new nn(e,l.ch,l.sticky),p=$t(o,e))}())return;l=vl(c,o.cm,p,l.line,m)}else l=t;return 1}if("char"==s||"codepoint"==s)g();else if("column"==s)g(!0);else if("word"==s||"group"==s)for(e=null,t="group"==s,n=o.cm&&o.cm.getHelper(l,"wordChars"),r=!0;!(a<0)||g(!r);r=!1){if(u=xt(i=p.text.charAt(l.ch)||"\n",n)?"w":t&&"\n"==i?"n":!t||/\s/.test(i)?null:"p",!t||r||u||(u="s"),e&&e!=u){a<0&&(a=1,g(),l.sticky="after");break}if(u&&(e=u),0=s.height){a.hitSide=!0;break}i+=5*n}return a}function _l(e,t){var n,r,i,o,l,a=kr(e,t.line);return!a||a.hidden?null:(r=wr(a,n=$t(e.doc,t.line),t.line),o="left",(i=Nt(n,e.doc.direction))&&(o=Lt(i,t.ch)%2?"right":"left"),(l=Tr(r.map,t.ch,o)).offset="right"==l.collapse?l.end:l.start,l)}function $l(e,t){return t&&(e.bad=!0),e}function Xl(e,t,n){var r,i,o;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return $l(e.clipPos(nn(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(i=0;il.doc.first&&(r=$t(l.doc,t.line-1).text)&&(t=new nn(t.line,1),l.replaceRange(n.charAt(0)+l.doc.lineSeparator()+r.charAt(r.length-1),nn(t.line-1,r.length-1),t,"+transpose"))),o.push(new X(t,t)));l.setSelections(o)})},newlineAndIndent:function(r){return Ei(r,function(){var e,t,n=r.listSelections();for(e=n.length-1;0<=e;e--)r.replaceRange(r.doc.lineSeparator(),n[e].anchor,n[e].head,"+input");for(n=r.listSelections(),t=0;te&&0==rn(t,this.pos)&&n==this.button},ge={toString:function(){return"CodeMirror.Init"}},ye={},ve={},Hl.defaults=ye,Hl.optionHandlers=ve,be=[],Hl.defineInitHook=function(e){return be.push(e)},we=null,(xe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new s,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}).prototype.init=function(e){var t=this,l=this,a=l.cm,s=l.div=e.lineDiv;function c(e){for(var t=e.target;t;t=t.parentNode){if(t==s)return 1;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}}function n(e){var t,n,r,i,o;if(c(e)&&!Wt(a,e)){if(a.somethingSelected())Fl({lineWise:!1,text:a.getSelections()}),"cut"==e.type&&a.replaceSelection("",null,"cut");else{if(!a.options.lineWiseCopyCut)return;Fl({lineWise:!0,text:(t=Vl(a)).text}),"cut"==e.type&&a.operation(function(){a.setSelections(t.ranges,0,m),a.replaceSelection("",null,"cut")})}e.clipboardData&&(e.clipboardData.clearData(),n=we.text.join("\n"),e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)?e.preventDefault():(i=(r=Gl()).firstChild,a.display.lineSpace.insertBefore(r,a.display.lineSpace.firstChild),i.value=we.text.join("\n"),o=at(),u(i),setTimeout(function(){a.display.lineSpace.removeChild(r),o.focus(),o==s&&l.showPrimarySelection()},50))}}s.contentEditable=!0,Kl(s,a.options.spellcheck,a.options.autocorrect,a.options.autocapitalize),L(s,"paste",function(e){!c(e)||Wt(a,e)||Bl(e,a)||Be<=11&&setTimeout(Hi(a,function(){return t.updateFromDOM()}),20)}),L(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),L(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),L(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),L(s,
+"touchstart",function(){return l.forceCompositionEnd()}),L(s,"input",function(){t.composing||t.readFromDOMSoon()}),L(s,"copy",n),L(s,"cut",n)},xe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xe.prototype.prepareSelection=function(){var e=ii(this.cm,!1);return e.focus=at()==this.div,e},xe.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},xe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xe.prototype.showPrimarySelection=function(){var e,t,n,r,i,o,l,a,s,c=this.getSelection(),u=this.cm,d=u.doc.sel.primary(),h=d.from(),f=d.to();if(u.display.viewTo==u.display.viewFrom||h.line>=u.display.viewTo||f.line=u.display.viewFrom&&_l(u,h)||{node:n[0].measure.map[2],offset:0},i=(i=f.linee.firstLine()&&(r=nn(r.line-1,$t(e.doc,r.line-1).length)),i.ch==$t(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;if(a=r.line==t.viewFrom||0==(o=Zr(e,r.line))?(l=Qt(t.view[0].line),t.view[0].node):(l=Qt(t.view[o].line),t.view[o-1].node.nextSibling),u=(s=Zr(e,i.line))==t.view.length-1?(c=t.viewTo-1,t.lineDiv.lastChild):(c=Qt(t.view[s+1].line)-1,t.view[s+1].node.previousSibling),!a)return!1;for(d=e.doc.splitLines(function C(s,e,t,c,u){var n="",d=!1,h=s.doc.lineSeparator(),f=!1;function p(){d&&(n+=h,f&&(n+=h),d=f=!1)}function m(e){e&&(p(),n+=e)}function g(e){var t,n,r,i,o,l;if(1==e.nodeType){if(t=e.getAttribute("cm-text"))return void m(t);if(n=e.getAttribute("cm-marker"))return void((i=s.findMarks(nn(c,0),nn(u+1,0),function a(t){return function(e){return e.id==t}}(+n))).length&&(r=i[0].find(0))&&m(Xt(s.doc,r.from,r.to).join(h)));if("false"==e.getAttribute("contenteditable"))return;if(o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName),!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;for(o&&p(),l=0;lr.ch&&v.charCodeAt(v.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;return d[d.length-1]=v.slice(0,v.length-p).replace(
+/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,""),x=nn(l,f),k=nn(c,h.length?gt(h).length-p:0),1c&&(Il(this,n.head.line,e,!0),c=n.head.line,t==this.doc.sel.primIndex&&vi(this));else{for(r=n.from(),i=n.to(),o=Math.max(c,r.line),c=Math.min(this.lastLine(),i.line-(i.ch?0:1))+1,l=o;l>1)?t[2*l-1]:0)>=i)r=l;else{if(!(t[2*l+1]a)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(o=e.bottom),l+t.offsetWidth>s&&(l=s-t.offsetWidth)),t.style.top=o+"px",t.style.left=t.style.right="","right"==i?(l=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&function u(e,t){var n=gi(e,t);null!=n.scrollTop&&ki(e,n.scrollTop),null!=n.scrollLeft&&Si(e,n.scrollLeft)}(this,{left:l,top:o,right:l+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Ii(Tl),triggerOnKeyPress:Ii(Ml),triggerOnKeyUp:Ll,triggerOnMouseDown:Ii(Nl),execCommand:function(e){if(ce.hasOwnProperty(e))return ce[e].call(null,this)},triggerElectric:Ii(function(e){jl(this,e)}),findPosH:function(e,t,n,r){var i,o,l=1;for(t<0&&(l=-1,t=-t),i=un(this.doc,e),o=0;o","i")}function l(e,t){var n,r,i,o;for(n in e)for(r=t[n]||(t[n]=[]),o=(i=e[n]).length-1;0<=o;o--)r.unshift(i[o])}i={},m.defineMode("htmlmixed",function(d,e){var t,h=m.getMode(d,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag,allowMissingTagName:e.allowMissingTagName}),f={},n=e&&e.tags,r=e&&e.scriptTypes;if(l(o,f),n&&l(n,f),r)for(t=r.length-1;0<=t;t--)f.script.unshift(["type",r[t].matches,r[t].mode]);function p(e,t){var n,r,i,o,l,a,s=h.token(e,t.htmlState),c=/\btag\b/.test(s);return c&&!/[<>\s\/]/.test(e.current())&&(n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&f.hasOwnProperty(n)?t.inTag=n+" ":t.inTag&&c&&/>$/.test(e.current())?(r=/^([\S]+) (.*)/.exec(t.inTag),t.inTag=null,i=">"==e.current()&&function u(e,t){var n,r;for(n=0;n")):null:t.match("--")?r(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(function i(r){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=i(r+1),t.tokenize(e,t);if(">"==n){if(1!=r)return t.tokenize=i(r-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=d("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",n.tokenize=u,"tag bracket"):"&"==e?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function u(e,t){var n,r=e.next();return">"==r||"/"==r&&e.eat(">")?(t.tokenize=c,o=">"==r?"endTag":"selfcloseTag","tag bracket"):"="==r?(o="equals",null):"<"==r?(t.tokenize=c,t.state=m,t.tagName=t.tagStart=null,(n=t.tokenize(e,t))?n+" tag error":"tag error"):/[\'\"]/.test(r)?(t.tokenize=function i(n){var e=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=u;break}return"string"};return e.isInAttribute=!0,e}(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=c;break}e.next()}return n}}function h(e){return e&&e.toLowerCase()}function f(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function i(e){e.context&&(e.context=e.context.prev)}function p(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!s.contextGrabbers.hasOwnProperty(h(n))||!s.contextGrabbers[h(n)].hasOwnProperty(h(t)))return;i(e)}}function m(e,t,n){return"openTag"==e?(n.tagStart=t.column(),g):"closeTag"==e?y:m}function g(e,t,n){return"word"==e?(n.tagName=t.current(),l="tag",w):s.allowMissingTagName&&"endTag"==e?(l="tag bracket",w(e,0,n)):(l="error",g)}function y(e,t,n){if("word"!=e)return s.allowMissingTagName&&"endTag"==e?(l="tag bracket",v(e,0,n)):(l="error",b);var r=t.current();return n.context&&n.context.tagName!=r&&s.implicitlyClosed.hasOwnProperty(h(n.context.tagName))&&i(n),n.context&&n.context.tagName==r||!1===s.matchClosing?(l="tag",v):(l="tag error",b)}function v(e,t,n){return"endTag"!=e?(l="error",v):(i(n),m)}function b(e,t,n){return l="error",v(e,0,n)}function w(e,t,n){if("word"==e)return l="attribute",x;if("endTag"!=e&&"selfcloseTag"!=e)return l="error",w;var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(h(r))?p(n,r):(p(n,r),n.context=new f(n,r,i==n.indented)),m}function x(e,t,n){return"equals"==e?k:(s.allowMissing||(l="error"),w(e,0,n))}function k(e,t,n){return"string"==e?C:"word"==e&&s.allowUnquoted?(l="string",w):(l="error",w(e,0,n))}function C(e,t,n){return"string"==e?C:w(e,0,n)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:m,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(l=null,t.state=t.state(o||n,e,t),l&&(n="error"==l?n+" error":l)),n},indent:function(e,t,n){var r,i,o=e.context;if(e.tokenize.isInAttribute
+)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(o&&o.noIndent)return S.Pass;if(e.tokenize!=u&&e.tokenize!=c)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=w)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){var t,n=[];for(t=e.context;t;t=t.prev)n.push(t.tagName);return n.reverse()}}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror")):"function"==typeof u&&u.amd?u(["../../lib/codemirror"],l):l(n),a=function(lt){"use strict";lt.defineMode("javascript",function(e,u){var r,i,c,l,a,t,n,o,s,d,h,f,p=e.indentUnit,m=u.statementIndent,g=u.jsonld,y=u.json||g,v=!1!==u.trackScope,b=u.typescript,w=u.wordCharacters||/[\w$\xa1-\uffff]/,x=(n=S("keyword a"),o=S("keyword b"),s=S("keyword c"),d=S("keyword d"),h=S("operator"),{"if":S("if"),"while":n,"with":n,"else":o,"do":o,"try":o,"finally":o,"return":d,"break":d,"continue":d,"new":S("new"),"delete":s,"void":s,"throw":s,"debugger":S("debugger"),"var":S("var"),"const":S("var"),"let":S("var"),"function":S("function"),"catch":S("catch"),"for":S("for"),"switch":S("switch"),"case":S("case"),"default":S("default"),"in":h,"typeof":h,"instanceof":h,"true":f={type:"atom",style:"atom"},"false":f,"null":f,undefined:f,NaN:f,Infinity:f,"this":S("this"),"class":S("class"),"super":S("atom"),"yield":s,"export":S("export"),"import":S("import"),"extends":s,await:s}),k=/[+\-*&%=<>!?|~^@]/,C=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function S(e){return{type:e,style:"keyword"}}function T(e,t,n){return r=e,i=n,t}function L(e,t){var n,r,i=e.next();if('"'==i||"'"==i)return t.tokenize=function o(i){return function(e,t){var n,r=!1;if(g&&"@"==e.peek()&&e.match(C))return t.tokenize=L,T("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=L),T("string","string")}}(i),t.tokenize(e,t);if("."==i&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return T("number","number");if("."==i&&e.match(".."))return T("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return T(i);if("="==i&&e.eat(">"))return T("=>","operator");if("0"==i&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return T("number","number");if(/\d/.test(i))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),T("number","number");if("/"==i)return e.eat("*")?(t.tokenize=M)(e,t):e.eat("/")?(e.skipToEnd(),T("comment","comment")):ot(e,t,1)?(function l(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),T("regexp","string-2")):(e.eat("="),T("operator","operator",e.current()));if("`"==i)return(t.tokenize=N)(e,t);if("#"==i&&"!"==e.peek())return e.skipToEnd(),T("meta","meta");if("#"==i&&e.eatWhile(w))return T("variable","property");if("<"==i&&e.match("!--")||"-"==i&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),T("comment","comment");if(k.test(i))return">"==i&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=i&&"="!=i||e.eat("="):/[<>*+\-|&?]/.test(i)&&(e.eat(i),">"==i&&e.eat(i))),"?"==i&&e.eat(".")?T("."):T("operator","operator",e.current());if(w.test(i)){if(e.eatWhile(w),n=e.current(),"."!=t.lastType){if(x.propertyIsEnumerable(n))return T((r=x[n]).type,r.style,n);if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return T("async","keyword",n)}return T("variable","variable",n)}}function M(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=L;break}r="*"==n}return T("comment","comment")}function N(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=L;break}r=!r&&"\\"==n}return T("quasi","string-2",e.current())}function A(e,t){var n,r,i,o,l,a,s;if(t.fatArrowAt&&(t.fatArrowAt=null),!((n=e.string.indexOf("=>",e.start))<0)){for(b&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n)))&&(n=r.index),i=0,o=!1,l=n-1;0<=l;--l)if(a=e.string.charAt(l),0<=(s=c.indexOf(a))&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(w.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;if(e.string.charAt(l-1)==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}o&&!i&&(t.fatArrowAt=l)}}function O(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function z(e,t){var n,r;if(v){for(n=e.localVars;n;n=n.next)if(n.name==t)return 1;for(r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return 1}}function W(e,t,n,r,i){var o=e.cc;for(a.state=e,a.stream=i,a.marked=null,a.cc=o,a.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():y?$:q)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return a.marked?a.marked:"variable"==n&&z(e,r)?"variable-2":t}}function D(){for(var e=arguments.length-1;0<=e;e--)a.cc.push(arguments[e])}function P(){return D.apply(null,arguments),!0}function E(e,t){for(var n=t;n;n=n.next)if(n.name==e)return 1}function H(e){var t,n=a.state;if(a.marked="def",v){if(n.context)if(
+"var"==n.lexical.info&&n.context&&n.context.block){if(null!=(t=function r(e,t){{if(t){if(t.block){var n=r(e,t.prev);return n?n==t.prev?t:new F(n,t.vars,!0):null}return E(e,t.vars)?t:new F(t.prev,new R(e,t.vars),!1)}return null}}(e,n.context)))return void(n.context=t)}else if(!E(e,n.localVars))return void(n.localVars=new R(e,n.localVars));u.globalVars&&!E(e,n.globalVars)&&(n.globalVars=new R(e,n.globalVars))}}function I(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function F(e,t,n){this.prev=e,this.vars=t,this.block=n}function R(e,t){this.name=e,this.next=t}function B(){a.state.context=new F(a.state.context,a.state.localVars,!1),a.state.localVars=t}function j(){a.state.context=new F(a.state.context,a.state.localVars,!0),a.state.localVars=null}function V(){a.state.localVars=a.state.context.vars,a.state.context=a.state.context.prev}function K(r,i){var e=function(){var e,t=a.state,n=t.indented;if("stat"==t.lexical.type)n=t.lexical.indented;else for(e=t.lexical;e&&")"==e.type&&e.align;e=e.prev)n=e.indented;t.lexical=new O(n,a.stream.column(),r,null,t.lexical,i)};return e.lex=!0,e}function G(){var e=a.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function U(t){return function n(e){return e==t?P():";"==t||"}"==e||")"==e||"]"==e?D():P(n)}}function q(e,t){return"var"==e?P(K("vardef",t),Oe,U(";"),G):"keyword a"==e?P(K("form"),Y,q,G):"keyword b"==e?P(K("form"),q,G):"keyword d"==e?a.stream.match(/^\s*$/,!1)?P():P(K("stat"),Q,U(";"),G):"debugger"==e?P(U(";")):"{"==e?P(K("}"),j,pe,G,V):";"==e?P():"if"==e?("else"==a.state.lexical.info&&a.state.cc[a.state.cc.length-1]==G&&a.state.cc.pop()(),P(K("form"),Y,q,G,He)):"function"==e?P(Be):"for"==e?P(K("form"),j,Ie,q,V,G):"class"==e||b&&"interface"==t?(a.marked="keyword",P(K("form","class"==e?e:t),Ue,G)):"variable"==e?b&&"declare"==t?(a.marked="keyword",P(q)):b&&("module"==t||"enum"==t||"type"==t)&&a.stream.match(/^\s*\w/,!1)?(a.marked="keyword","enum"==t?P(rt):"type"==t?P(Ve,U("operator"),be,U(";")):P(K("form"),ze,U("{"),K("}"),pe,G,G)):b&&"namespace"==t?(a.marked="keyword",P(K("form"),$,q,G)):b&&"abstract"==t?(a.marked="keyword",P(q)):P(K("stat"),ae):"switch"==e?P(K("form"),Y,U("{"),K("}","switch"),j,pe,G,G,V):"case"==e?P($,U(":")):"default"==e?P(U(":")):"catch"==e?P(K("form"),B,_,q,G,V):"export"==e?P(K("stat"),Xe,G):"import"==e?P(K("stat"),Ze,G):"async"==e?P(q):"@"==t?P($,q):D(K("stat"),$,U(";"),G)}function _(e){if("("==e)return P(Ke,U(")"))}function $(e,t){return Z(e,t,!1)}function X(e,t){return Z(e,t,!0)}function Y(e){return"("!=e?D():P(K(")"),Q,U(")"),G)}function Z(e,t,n){var r,i;if(a.state.fatArrowAt==a.stream.start){if(r=n?ie:re,"("==e)return P(B,K(")"),he(Ke,")"),G,U("=>"),r,V);if("variable"==e)return D(B,ze,U("=>"),r,V)}return i=n?ee:J,l.hasOwnProperty(e)?P(i):"function"==e?P(Be,i):"class"==e||b&&"interface"==t?(a.marked="keyword",P(K("form"),Ge,G)):"keyword c"==e||"async"==e?P(n?X:$):"("==e?P(K(")"),Q,U(")"),G,i):"operator"==e||"spread"==e?P(n?X:$):"["==e?P(K("]"),nt,G,i):"{"==e?fe(ce,"}",null,i):"quasi"==e?D(te,i):"new"==e?P(function o(t){return function(e){return"."==e?P(t?le:oe):"variable"==e&&b?P(Me,t?ee:J):D(t?X:$)}}(n)):P()}function Q(e){return e.match(/[;\}\)\],]/)?D():D($)}function J(e,t){return","==e?P(Q):ee(e,t,!1)}function ee(e,t,n){var r=0==n?J:ee,i=0==n?$:X;return"=>"==e?P(B,n?ie:re,V):"operator"==e?/\+\+|--/.test(t)||b&&"!"==t?P(r):b&&"<"==t&&a.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?P(K(">"),he(be,">"),G,r):"?"==t?P($,U(":"),i):P(i):"quasi"==e?D(te,r):";"!=e?"("==e?fe(X,")","call",r):"."==e?P(se,r):"["==e?P(K("]"),Q,U("]"),G,r):b&&"as"==t?(a.marked="keyword",P(be,r)):"regexp"==e?(a.state.lastType=a.marked="operator",a.stream.backUp(a.stream.pos-a.stream.start-1),P(i)):void 0:void 0}function te(e,t){return"quasi"!=e?D():"${"!=t.slice(t.length-2)?P(te):P(Q,ne)}function ne(e){if("}"==e)return a.marked="string-2",a.state.tokenize=N,P(te)}function re(e){return A(a.stream,a.state),D("{"==e?q:$)}function ie(e){return A(a.stream,a.state),D("{"==e?q:X)}function oe(e,t){if("target"==t)return a.marked="keyword",P(J)}function le(e,t){if("target"==t)return a.marked="keyword",P(ee)}function ae(e){return":"==e?P(G,q):D(J,U(";"),G)}function se(e){if("variable"==e)return a.marked="property",P()}function ce(e,t){if("async"==e)return a.marked="property",P(ce);if("variable"==e||"keyword"==a.style){return(a.marked="property","get"==t||"set"==t)?P(ue):(b&&a.state.fatArrowAt==a.stream.start&&(n=a.stream.match(/^\s*:\s*/,!1))&&(a.state.fatArrowAt=a.stream.pos+n[0].length),P(de));var n}else{if("number"==e||"string"==e)return a.marked=g?"property":a.style+" property",P(de);if("jsonld-keyword"==e)return P(de);if(b&&I(t))return a.marked="keyword",P(ce);if("["==e)return P($,me,U("]"),de);if("spread"==e)return P(X,de);if("*"==t)return a.marked="keyword",P(ce);if(":"==e)return D(de)}}function ue(e){return"variable"!=e?D(de):(a.marked="property",P(Be))}function de(e){return":"==e?P(X):"("==e?D(Be):void 0}function he(r,i,o){function l(e,t){if(o?-1"),be):"quasi"==e?D(Ce,Le):void 0}function we(e){if("=>"==e)return P(be)}function xe(e){return e.match(/[\}\)\]]/)?P():","==e||";"==e?P(xe):D(ke,xe)}function ke(e,t){return"variable"==e||"keyword"==a.style?(a.marked="property",P(ke)):"?"==t||"number"==e||"string"==e?P(ke):":"==e?P(be):"["==e?P(U("variable"),ge,U("]"),ke):"("==e?D(je,ke):e.match(/[;\}\)\],]/)?void 0:P()}function Ce(e,t){return"quasi"!=e?D():"${"!=t.slice(t.length-2)?P(Ce):P(be,Se)}function Se(e){if("}"==e)return a.marked="string-2",a.state.tokenize=N,P(Ce)}function Te(e,t){return"variable"==e&&a.stream.match(/^\s*[?:]/,!1)||"?"==t?P(Te):":"==e?P(be):"spread"==e?P(Te):D(be)}function Le(e,t){return"<"==t?P(K(">"),he(be,">"),G,Le):"|"==t||"."==e||"&"==t?P(be):"["==e?P(be,U("]"),Le):"extends"==t||"implements"==t?(a.marked="keyword",P(be)):"?"==t?P(be,U(":"),be):void 0}function Me(e,t){if("<"==t)return P(K(">"),he(be,">"),G,Le)}function Ne(){return D(be,Ae)}function Ae(e,t){if("="==t)return P(be)}function Oe(e,t){return"enum"==t?(a.marked="keyword",P(rt)):D(ze,me,Pe,Ee)}function ze(e,t){return b&&I(t)?(a.marked="keyword",P(ze)):"variable"==e?(H(t),P()):"spread"==e?P(ze):"["==e?fe(De,"]"):"{"==e?fe(We,"}"):void 0}function We(e,t){return"variable"!=e||a.stream.match(/^\s*:/,!1)?("variable"==e&&(a.marked="property"),"spread"==e?P(ze):"}"==e?D():"["==e?P($,U("]"),U(":"),We):P(U(":"),ze,Pe)):(H(t),P(Pe))}function De(){return D(ze,Pe)}function Pe(e,t){if("="==t)return P(X)}function Ee(e){if(","==e)return P(Oe)}function He(e,t){if("keyword b"==e&&"else"==t)return P(K("form","else"),q,G)}function Ie(e,t){return"await"==t?P(Ie):"("==e?P(K(")"),Fe,G):void 0}function Fe(e){return"var"==e?P(Oe,Re):("variable"==e?P:D)(Re)}function Re(e,t){return")"==e?P():";"==e?P(Re):"in"==t||"of"==t?(a.marked="keyword",P($,Re)):D($,Re)}function Be(e,t){return"*"==t?(a.marked="keyword",P(Be)):"variable"==e?(H(t),P(Be)):"("==e?P(B,K(")"),he(Ke,")"),G,ye,q,V):b&&"<"==t?P(K(">"),he(Ne,">"),G,Be):void 0}function je(e,t){return"*"==t?(a.marked="keyword",P(je)):"variable"==e?(H(t),P(je)):"("==e?P(B,K(")"),he(Ke,")"),G,ye,V):b&&"<"==t?P(K(">"),he(Ne,">"),G,je):void 0}function Ve(e,t){return"keyword"==e||"variable"==e?(a.marked="type",P(Ve)):"<"==t?P(K(">"),he(Ne,">"),G):void 0}function Ke(e,t){return"@"==t&&P($,Ke),"spread"==e?P(Ke):b&&I(t)?(a.marked="keyword",P(Ke)):b&&"this"==e?P(me,Pe):D(ze,me,Pe)}function Ge(e,t){return("variable"==e?Ue:qe)(e,t)}function Ue(e,t){if("variable"==e)return H(t),P(qe)}function qe(e,t){return"<"==t?P(K(">"),he(Ne,">"),G,qe):"extends"==t||"implements"==t||b&&","==e?("implements"==t&&(a.marked="keyword"),P(b?be:$,qe)):"{"==e?P(K("}"),_e,G):void 0}function _e(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||b&&I(t))&&a.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(a.marked="keyword",P(_e)):"variable"==e||"keyword"==a.style?(a.marked="property",P($e,_e)):"number"==e||"string"==e?P($e,_e):"["==e?P($,me,U("]"),$e,_e):"*"==t?(a.marked="keyword",P(_e)):b&&"("==e?D(je,_e):";"==e||","==e?P(_e):"}"==e?P():"@"==t?P($,_e):void 0}function $e(e,t){if("!"==t)return P($e);if("?"==t)return P($e);if(":"==e)return P(be,Pe);if("="==t)return P(X);var n=a.state.lexical.prev;return D(n&&"interface"==n.info?je:Be)}function Xe(e,t){return"*"==t?(a.marked="keyword",P(tt,U(";"))):"default"==t?(a.marked="keyword",P($,U(";"))):"{"==e?P(he(Ye,"}"),tt,U(";")):D(q)}function Ye(e,t){return"as"==t?(a.marked="keyword",P(U("variable"))):"variable"==e?D(X,Ye):void 0}function Ze(e){return"string"==e?P():"("==e?D($):"."==e?D(J):D(Qe,Je,tt)}function Qe(e,t){return"{"==e?fe(Qe,"}"):("variable"==e&&H(t),"*"==t&&(a.marked="keyword"),P(et))}function Je(e){if(","==e)return P(Qe,Je)}function et(e,t){if("as"==t)return a.marked="keyword",P(Qe)}function tt(e,t){if("from"==t)return a.marked="keyword",P($)}function nt(e){return"]"==e?P():D(he(X,"]"))}function rt(){return D(K("form"),ze,U("{"),K("}"),he(it,"}"),G,G)}function it(){return D(ze,Pe)}function ot(e,t,n){return t.tokenize==L&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return c="([{}])",l={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"import":!0,"jsonld-keyword":!0},a={state:null,column:null,marked:null,cc:null},t=new R("this",new R("arguments",null)),G.lex=V.lex=!0,{startState:function(e){var t={tokenize:L,lastType:"sof",cc:[],lexical:new O((e||0)-p,0,"block",!1),localVars:u.localVars,context:u.localVars&&new F(null,null,!1),indented:e||0};return u.globalVars&&"object"==typeof u.globalVars&&(t.globalVars=u.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),A(e,t)),t.tokenize!=M&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",W(t,n,r,i,e))},indent:function(e,t){var n,r,i,o,l,a,s;if(e.tokenize==M||e.tokenize==N)return lt.Pass;if(e.tokenize!=L)return 0;if(n=t&&t.charAt(0),r=e.lexical,!/^\s*else\b/.test(t))for(o=e.cc.length-1;0<=o;--o)if((l=e.cc[o])==G)r=r.prev;else if(l!=He&&l!=V)break;for(;("stat"==r.type||"form"==r.type)&&("}"==n||(i=e.cc[e.cc.length-1])&&(i==J||i==ee)&&!/^[,\.=+\-*:?[\(]/.test(t));)r=r.prev;return m&&")"==r.type&&"stat"==r.prev.type&&(r=r.prev),s=n==(a=r.type),"vardef"==a?r.indented+("operator"==e.lastType||","==e.lastType?r.info.length+1:0):"form"==a&&"{"==n?r.indented:"form"==a?r.indented+p:"stat"==a?r.indented+(function c(e,t){return"operator"==e.lastType||","==e.lastType||k.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(e,t)?m||p:0):"switch"!=r.info||s||0==u.doubleIndentSwitch?r.align?r.column+(s?0:1):r.indented+(s?0:p):r.indented+(/^(?:case|default)\b/.test(t)?p:2*p)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:y?null:"/*",blockCommentEnd:y?null:"*/",blockCommentContinue:y?null:" * ",lineComment:y?null:"//",fold:"brace",
+closeBrackets:"()[]{}''\"\"``",helperType:y?"json":"javascript",jsonldMode:g,jsonMode:y,expressionAllowed:ot,skipExpression:function(e){W(e,"atom","atom","true",new lt.StringStream("",2,null))}}}),lt.registerHelper("wordChars","javascript",/[\w$]/),lt.defineMIME("text/javascript","javascript"),lt.defineMIME("text/ecmascript","javascript"),lt.defineMIME("application/javascript","javascript"),lt.defineMIME("application/x-javascript","javascript"),lt.defineMIME("application/ecmascript","javascript"),lt.defineMIME("application/json",{name:"javascript",json:!0}),lt.defineMIME("application/x-json",{name:"javascript",json:!0}),lt.defineMIME("application/manifest+json",{name:"javascript",json:!0}),lt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),lt.defineMIME("text/typescript",{name:"javascript",typescript:!0}),lt.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof u&&u.amd?u(["../../lib/codemirror"],a):a(n),s=function(z){"use strict";var e,t,n,r,i,o,l,a,s,c,u,d,h,f,p,m,g,y,v;function b(e){var t,n={};for(t=0;t*\/]/.test(r)?(v="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?v="qualifier":/[:;{}\[\]\(\)]/.test(r)?k(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=S),v="variable","variable callee"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),v="word","property"):v=null:/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),v="unit","number"):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),v=e.match(/^\s*:/,!1)?"variable-definition":"variable","variable-2"):e.match(/^\w+-/)?v="meta":void 0})(e,t);return n&&"object"==typeof n&&(v=n[1],n=n[0]),b=n,"comment"!=v&&(t.state=w[t.state](v,e,t)),b},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-o)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:n,fold:"brace"}}),t=b(e=["domain","regexp","url","url-prefix"]),r=b(n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),o=b(i=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"]),a=b(l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"]),c=b(s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start",
+"inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"]),d=b(u=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"]),h=b(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),f=b(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=b(p=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod",
+"darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),y=b(g=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only",
+"read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"]),v=e.concat(n).concat(i).concat(l).concat(s).concat(u).concat(p).concat(g),z.registerHelper("hintWords","css",v),z.defineMIME("text/css",{documentTypes:t,mediaTypes:r,mediaFeatures:o,mediaValueKeywords:a,propertyKeywords:c,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:f,colorKeywords:m,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css"}),z.defineMIME("text/x-scss",{mediaTypes:r,mediaFeatures:o,mediaValueKeywords:a,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:m,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),z.defineMIME("text/x-less",{mediaTypes:r,mediaFeatures:o,mediaValueKeywords:a,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:m,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),z.defineMIME("text/x-gss",{documentTypes:t,mediaTypes:r,mediaFeatures:o,propertyKeywords:c,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:f,colorKeywords:m,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof exports&&"object"==typeof module?s(require("../../lib/codemirror")):"function"==typeof u&&u.amd?u(["../../lib/codemirror"],s):s(n),e.namespace("M.atto_html").CodeMirror=n,window.CodeMirror=c},"@VERSION@",{requires:["moodle-atto_html-codemirror-skin"]});
\ No newline at end of file
diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js
index 01e30a71deb..798757ec868 100644
--- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js
+++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror.js
@@ -1315,6 +1315,7 @@ var define = null; // Remove require.js support in this context.
if (span.marker == marker) { return span }
} }
}
+
// Remove a span from an array, returning undefined if no spans are
// left (we don't store arrays for lines without spans).
function removeMarkedSpan(spans, span) {
@@ -1323,9 +1324,16 @@ var define = null; // Remove require.js support in this context.
{ if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }
return r
}
+
// Add a span to a line.
- function addMarkedSpan(line, span) {
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ function addMarkedSpan(line, span, op) {
+ var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));
+ if (inThisOp && inThisOp.has(line.markedSpans)) {
+ line.markedSpans.push(span);
+ } else {
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ if (inThisOp) { inThisOp.add(line.markedSpans); }
+ }
span.marker.attachLine(line);
}
@@ -2190,6 +2198,7 @@ var define = null; // Remove require.js support in this context.
if (cm.options.lineNumbers || markers) {
var wrap$1 = ensureLineWrapped(lineView);
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
+ gutterWrap.setAttribute("aria-hidden", "true");
cm.display.input.setUneditable(gutterWrap);
wrap$1.insertBefore(gutterWrap, lineView.text);
if (lineView.line.gutterClass)
@@ -2346,12 +2355,14 @@ var define = null; // Remove require.js support in this context.
function mapFromLineView(lineView, line, lineN) {
if (lineView.line == line)
{ return {map: lineView.measure.map, cache: lineView.measure.cache} }
- for (var i = 0; i < lineView.rest.length; i++)
- { if (lineView.rest[i] == line)
- { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
- for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
- { if (lineNo(lineView.rest[i$1]) > lineN)
- { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
+ if (lineView.rest) {
+ for (var i = 0; i < lineView.rest.length; i++)
+ { if (lineView.rest[i] == line)
+ { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
+ for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
+ { if (lineNo(lineView.rest[i$1]) > lineN)
+ { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
+ }
}
// Render a line into the hidden node display.externalMeasured. Used
@@ -3145,13 +3156,19 @@ var define = null; // Remove require.js support in this context.
var curFragment = result.cursors = document.createDocumentFragment();
var selFragment = result.selection = document.createDocumentFragment();
+ var customCursor = cm.options.$customCursor;
+ if (customCursor) { primary = true; }
for (var i = 0; i < doc.sel.ranges.length; i++) {
if (!primary && i == doc.sel.primIndex) { continue }
var range = doc.sel.ranges[i];
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
var collapsed = range.empty();
- if (collapsed || cm.options.showCursorWhenSelecting)
- { drawSelectionCursor(cm, range.head, curFragment); }
+ if (customCursor) {
+ var head = customCursor(cm, range);
+ if (head) { drawSelectionCursor(cm, head, curFragment); }
+ } else if (collapsed || cm.options.showCursorWhenSelecting) {
+ drawSelectionCursor(cm, range.head, curFragment);
+ }
if (!collapsed)
{ drawSelectionRange(cm, range, selFragment); }
}
@@ -3167,6 +3184,12 @@ var define = null; // Remove require.js support in this context.
cursor.style.top = pos.top + "px";
cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
+ if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
+ var charPos = charCoords(cm, head, "div", null, null);
+ var width = charPos.right - charPos.left;
+ cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px";
+ }
+
if (pos.other) {
// Secondary cursor, shown when on a 'jump' in bi-directional text
var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
@@ -3339,10 +3362,14 @@ var define = null; // Remove require.js support in this context.
function updateHeightsInViewport(cm) {
var display = cm.display;
var prevBottom = display.lineDiv.offsetTop;
+ var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);
+ var oldHeight = display.lineDiv.getBoundingClientRect().top;
+ var mustScroll = 0;
for (var i = 0; i < display.view.length; i++) {
var cur = display.view[i], wrapping = cm.options.lineWrapping;
var height = (void 0), width = 0;
if (cur.hidden) { continue }
+ oldHeight += cur.line.height;
if (ie && ie_version < 8) {
var bot = cur.node.offsetTop + cur.node.offsetHeight;
height = bot - prevBottom;
@@ -3357,6 +3384,7 @@ var define = null; // Remove require.js support in this context.
}
var diff = cur.line.height - height;
if (diff > .005 || diff < -.005) {
+ if (oldHeight < viewTop) { mustScroll -= diff; }
updateLineHeight(cur.line, height);
updateWidgetHeight(cur.line);
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
@@ -3371,6 +3399,7 @@ var define = null; // Remove require.js support in this context.
}
}
}
+ if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }
}
// Read and store the height of line widgets associated with the
@@ -3434,8 +3463,8 @@ var define = null; // Remove require.js support in this context.
// Set pos and end to the cursor positions around the character pos sticks to
// If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
// If pos == Pos(_, 0, "before"), pos and end are unchanged
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos;
+ pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
}
for (var limit = 0; limit < 5; limit++) {
var changed = false;
@@ -3631,6 +3660,7 @@ var define = null; // Remove require.js support in this context.
this.vert.firstChild.style.height =
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
} else {
+ this.vert.scrollTop = 0;
this.vert.style.display = "";
this.vert.firstChild.style.height = "0";
}
@@ -3786,7 +3816,8 @@ var define = null; // Remove require.js support in this context.
scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
scrollToPos: null, // Used to scroll to a specific position
focus: false,
- id: ++nextOpId // Unique ID
+ id: ++nextOpId, // Unique ID
+ markArrays: null // Used by addMarkedSpan
};
pushOperation(cm.curOp);
}
@@ -4239,6 +4270,8 @@ var define = null; // Remove require.js support in this context.
function updateGutterSpace(display) {
var width = display.gutters.offsetWidth;
display.sizer.style.marginLeft = width + "px";
+ // Send an event to consumers responding to changes in gutter width.
+ signalLater(display, "gutterChanged", display);
}
function setDocumentHeight(cm, measure) {
@@ -4378,6 +4411,10 @@ var define = null; // Remove require.js support in this context.
// The element in which the editor lives.
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
+ // This attribute is respected by automatic translation systems such as Google Translate,
+ // and may also be respected by tools used by human translators.
+ d.wrapper.setAttribute('translate', 'no');
+
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
@@ -4475,6 +4512,12 @@ var define = null; // Remove require.js support in this context.
function onScrollWheel(cm, e) {
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
+ var pixelsPerUnit = wheelPixelsPerUnit;
+ if (e.deltaMode === 0) {
+ dx = e.deltaX;
+ dy = e.deltaY;
+ pixelsPerUnit = 1;
+ }
var display = cm.display, scroll = display.scroller;
// Quit if there's nothing to scroll here
@@ -4503,10 +4546,10 @@ var define = null; // Remove require.js support in this context.
// estimated pixels/delta value, we just handle horizontal
// scrolling entirely here. It'll be slightly off from native, but
// better than glitching out.
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
+ if (dx && !gecko && !presto && pixelsPerUnit != null) {
if (dy && canScrollY)
- { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }
- setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));
+ { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));
// Only prevent default scrolling if vertical scrolling is
// actually possible. Otherwise, it causes vertical scroll
// jitter on OSX trackpads when deltaX is small and deltaY
@@ -4519,15 +4562,15 @@ var define = null; // Remove require.js support in this context.
// 'Project' the visible viewport to cover the area that is being
// scrolled into view (if we know enough to estimate it).
- if (dy && wheelPixelsPerUnit != null) {
- var pixels = dy * wheelPixelsPerUnit;
+ if (dy && pixelsPerUnit != null) {
+ var pixels = dy * pixelsPerUnit;
var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
updateDisplaySimple(cm, {top: top, bottom: bot});
}
- if (wheelSamples < 20) {
+ if (wheelSamples < 20 && e.deltaMode !== 0) {
if (display.wheelStartX == null) {
display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
display.wheelDX = dx; display.wheelDY = dy;
@@ -4786,6 +4829,7 @@ var define = null; // Remove require.js support in this context.
estimateLineHeights(cm);
loadMode(cm);
setDirectionClass(cm);
+ cm.options.direction = doc.direction;
if (!cm.options.lineWrapping) { findMaxLine(cm); }
cm.options.mode = doc.modeOption;
regChange(cm);
@@ -5962,7 +6006,7 @@ var define = null; // Remove require.js support in this context.
if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }
addMarkedSpan(line, new MarkedSpan(marker,
curLine == from.line ? from.ch : null,
- curLine == to.line ? to.ch : null));
+ curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);
++curLine;
});
// lineIsHidden depends on the presence of the spans, so needs a second pass
@@ -6134,6 +6178,7 @@ var define = null; // Remove require.js support in this context.
getRange: function(from, to, lineSep) {
var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
if (lineSep === false) { return lines }
+ if (lineSep === '') { return lines.join('') }
return lines.join(lineSep || this.lineSeparator())
},
@@ -6185,7 +6230,7 @@ var define = null; // Remove require.js support in this context.
var out = [];
for (var i = 0; i < ranges.length; i++)
{ out[i] = new Range(clipPos(this, ranges[i].anchor),
- clipPos(this, ranges[i].head)); }
+ clipPos(this, ranges[i].head || ranges[i].anchor)); }
if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }
setSelection(this, normalizeSelection(this.cm, out, primary), options);
}),
@@ -6688,10 +6733,9 @@ var define = null; // Remove require.js support in this context.
// Very basic readline/emacs-style bindings, which are standard on Mac.
keyMap.emacsy = {
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
- "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
- "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
- "Ctrl-O": "openLine"
+ "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
+ "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
+ "Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
};
keyMap.macDefault = {
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
@@ -8203,7 +8247,7 @@ var define = null; // Remove require.js support in this context.
}
function hiddenTextarea() {
- var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
+ var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
// The textarea is kept positioned near the cursor to prevent the
// fact that it'll be scrolled into view on input from scrolling
@@ -8770,6 +8814,7 @@ var define = null; // Remove require.js support in this context.
var input = this, cm = input.cm;
var div = input.div = display.lineDiv;
+ div.contentEditable = true;
disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);
function belongsToInput(e) {
@@ -8836,7 +8881,7 @@ var define = null; // Remove require.js support in this context.
var kludge = hiddenTextarea(), te = kludge.firstChild;
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
te.value = lastCopied.text.join("\n");
- var hadFocus = document.activeElement;
+ var hadFocus = activeElt();
selectInput(te);
setTimeout(function () {
cm.display.lineSpace.removeChild(kludge);
@@ -8859,7 +8904,7 @@ var define = null; // Remove require.js support in this context.
ContentEditableInput.prototype.prepareSelection = function () {
var result = prepareSelection(this.cm, false);
- result.focus = document.activeElement == this.div;
+ result.focus = activeElt() == this.div;
return result
};
@@ -8955,7 +9000,7 @@ var define = null; // Remove require.js support in this context.
ContentEditableInput.prototype.focus = function () {
if (this.cm.options.readOnly != "nocursor") {
- if (!this.selectionInEditor() || document.activeElement != this.div)
+ if (!this.selectionInEditor() || activeElt() != this.div)
{ this.showSelection(this.prepareSelection(), true); }
this.div.focus();
}
@@ -8966,9 +9011,11 @@ var define = null; // Remove require.js support in this context.
ContentEditableInput.prototype.supportsTouch = function () { return true };
ContentEditableInput.prototype.receivedFocus = function () {
+ var this$1 = this;
+
var input = this;
if (this.selectionInEditor())
- { this.pollSelection(); }
+ { setTimeout(function () { return this$1.pollSelection(); }, 20); }
else
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }
@@ -9797,7 +9844,7 @@ var define = null; // Remove require.js support in this context.
addLegacyProps(CodeMirror);
- CodeMirror.version = "5.59.4";
+ CodeMirror.version = "5.65.0";
return CodeMirror;
@@ -10145,6 +10192,10 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
};
}
+ function lower(tagName) {
+ return tagName && tagName.toLowerCase();
+ }
+
function Context(state, tagName, startOfLine) {
this.prev = state.context;
this.tagName = tagName || "";
@@ -10163,8 +10214,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
return;
}
parentTagName = state.context.tagName;
- if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
- !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
+ if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||
+ !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {
return;
}
popContext(state);
@@ -10198,7 +10249,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (type == "word") {
var tagName = stream.current();
if (state.context && state.context.tagName != tagName &&
- config.implicitlyClosed.hasOwnProperty(state.context.tagName))
+ config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))
popContext(state);
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
setStyle = "tag";
@@ -10237,7 +10288,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
var tagName = state.tagName, tagStart = state.tagStart;
state.tagName = state.tagStart = null;
if (type == "selfcloseTag" ||
- config.autoSelfClosers.hasOwnProperty(tagName)) {
+ config.autoSelfClosers.hasOwnProperty(lower(tagName))) {
maybePopContext(state, tagName);
} else {
maybePopContext(state, tagName);
@@ -10317,7 +10368,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
- } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
+ } else if (config.implicitlyClosed.hasOwnProperty(lower(context.tagName))) {
context = context.prev;
} else {
break;
@@ -10325,8 +10376,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
- var grabbers = config.contextGrabbers[context.tagName];
- if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
+ var grabbers = config.contextGrabbers[lower(context.tagName)];
+ if (grabbers && grabbers.hasOwnProperty(lower(tagAfter[2])))
context = context.prev;
else
break;
@@ -10387,6 +10438,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var statementIndent = parserConfig.statementIndent;
var jsonldMode = parserConfig.jsonld;
var jsonMode = parserConfig.json || jsonldMode;
+ var trackScope = parserConfig.trackScope !== false
var isTS = parserConfig.typescript;
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
@@ -10589,7 +10641,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
// Parser
- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true,
+ "regexp": true, "this": true, "import": true, "jsonld-keyword": true};
function JSLexical(indented, column, type, align, prev, info) {
this.indented = indented;
@@ -10601,6 +10654,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function inScope(state, varname) {
+ if (!trackScope) return false
for (var v = state.localVars; v; v = v.next)
if (v.name == varname) return true;
for (var cx = state.context; cx; cx = cx.prev) {
@@ -10647,6 +10701,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function register(varname) {
var state = cx.state;
cx.marked = "def";
+ if (!trackScope) return
if (state.context) {
if (state.lexical.info == "var" && state.context && state.context.block) {
// FIXME function decls are also not block scoped
@@ -10746,7 +10801,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
}
if (type == "function") return cont(functiondef);
- if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
+ if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
if (type == "class" || (isTS && value == "interface")) {
cx.marked = "keyword"
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
@@ -10812,7 +10867,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
if (type == "quasi") return pass(quasi, maybeop);
if (type == "new") return cont(maybeTarget(noComma));
- if (type == "import") return cont(expression);
return cont();
}
function maybeexpression(type) {
@@ -10850,7 +10904,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function quasi(type, value) {
if (type != "quasi") return pass();
if (value.slice(value.length - 2) != "${") return cont(quasi);
- return cont(expression, continueQuasi);
+ return cont(maybeexpression, continueQuasi);
}
function continueQuasi(type) {
if (type == "}") {
@@ -10976,7 +11030,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
}
function typeexpr(type, value) {
- if (value == "keyof" || value == "typeof" || value == "infer") {
+ if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
cx.marked = "keyword"
return cont(value == "typeof" ? expressionNoComma : typeexpr)
}
@@ -10990,6 +11044,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType)
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
+ if (type == "quasi") { return pass(quasiType, afterType); }
}
function maybeReturnType(type) {
if (type == "=>") return cont(typeexpr)
@@ -11015,6 +11070,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont()
}
}
+ function quasiType(type, value) {
+ if (type != "quasi") return pass();
+ if (value.slice(value.length - 2) != "${") return cont(quasiType);
+ return cont(typeexpr, continueQuasiType);
+ }
+ function continueQuasiType(type) {
+ if (type == "}") {
+ cx.marked = "string-2";
+ cx.state.tokenize = tokenQuasi;
+ return cont(quasiType);
+ }
+ }
function typearg(type, value) {
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
if (type == ":") return cont(typeexpr)
@@ -11154,6 +11221,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "@") return cont(expression, classBody)
}
function classfield(type, value) {
+ if (value == "!") return cont(classfield)
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma)
@@ -11173,6 +11241,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function afterImport(type) {
if (type == "string") return cont();
if (type == "(") return pass(expression);
+ if (type == ".") return pass(maybeoperatorComma);
return pass(importSpec, maybeMoreImports, maybeFrom);
}
function importSpec(type, value) {
@@ -11253,7 +11322,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
var c = state.cc[i];
if (c == poplex) lexical = lexical.prev;
- else if (c != maybeelse) break;
+ else if (c != maybeelse && c != popcontext) break;
}
while ((lexical.type == "stat" || lexical.type == "form") &&
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
@@ -11290,8 +11359,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
expressionAllowed: expressionAllowed,
skipExpression: function(state) {
- var top = state.cc[state.cc.length - 1]
- if (top == expression || top == expressionNoComma) state.cc.pop()
+ parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null))
}
};
});
@@ -11756,13 +11824,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"monochrome", "min-monochrome", "max-monochrome", "resolution",
"min-resolution", "max-resolution", "scan", "grid", "orientation",
"device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
- "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme"
+ "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme",
+ "dynamic-range", "video-dynamic-range"
], mediaFeatures = keySet(mediaFeatures_);
var mediaValueKeywords_ = [
"landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
"interlace", "progressive",
- "dark", "light"
+ "dark", "light",
+ "standard", "high"
], mediaValueKeywords = keySet(mediaValueKeywords_);
var propertyKeywords_ = [
@@ -11795,7 +11865,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"cue-before", "cursor", "direction", "display", "dominant-baseline",
"drop-initial-after-adjust", "drop-initial-after-align",
"drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
- "drop-initial-value", "elevation", "empty-cells", "fit", "fit-position",
+ "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position",
"flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
"flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
"font", "font-family", "font-feature-settings", "font-kerning",
@@ -11877,7 +11947,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
], propertyKeywords = keySet(propertyKeywords_);
var nonStandardPropertyKeywords_ = [
- "border-block", "border-block-color", "border-block-end",
+ "accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end",
"border-block-end-color", "border-block-end-style", "border-block-end-width",
"border-block-start", "border-block-start-color", "border-block-start-style",
"border-block-start-width", "border-block-style", "border-block-width",
@@ -11885,9 +11955,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"border-inline-end-color", "border-inline-end-style",
"border-inline-end-width", "border-inline-start", "border-inline-start-color",
"border-inline-start-style", "border-inline-start-width",
- "border-inline-style", "border-inline-width", "margin-block",
+ "border-inline-style", "border-inline-width", "content-visibility", "margin-block",
"margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
- "margin-inline-start", "padding-block", "padding-block-end",
+ "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end",
"padding-block-start", "padding-inline", "padding-inline-end",
"padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
@@ -11911,16 +11981,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
- "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
+ "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen",
"darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
- "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
- "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
+ "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet",
+ "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
"floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
"gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
"hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
- "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
- "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey",
"lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
"mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
@@ -11930,7 +12000,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
"purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
"salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
- "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
+ "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan",
"teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
"whitesmoke", "yellow", "yellowgreen"
], colorKeywords = keySet(colorKeywords_);
@@ -11941,21 +12011,21 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
"arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
"avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary",
- "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
- "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
+ "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box",
+ "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "button-bevel",
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
"compact", "condensed", "contain", "content", "contents",
- "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
- "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
+ "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop",
+ "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
"dot-dash", "dot-dot-dash",
- "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
+ "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
@@ -11965,10 +12035,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
"extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
- "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
+ "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove",
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
"inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
@@ -12002,11 +12072,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
- "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
+ "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
- "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
+ "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama",
"simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js b/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js
index e4bc4a0e645..c23b52c44c2 100644
--- a/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js
+++ b/lib/editor/atto/plugins/html/yui/src/codemirror/js/codemirror.js
@@ -1311,6 +1311,7 @@
if (span.marker == marker) { return span }
} }
}
+
// Remove a span from an array, returning undefined if no spans are
// left (we don't store arrays for lines without spans).
function removeMarkedSpan(spans, span) {
@@ -1319,9 +1320,16 @@
{ if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }
return r
}
+
// Add a span to a line.
- function addMarkedSpan(line, span) {
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ function addMarkedSpan(line, span, op) {
+ var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));
+ if (inThisOp && inThisOp.has(line.markedSpans)) {
+ line.markedSpans.push(span);
+ } else {
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ if (inThisOp) { inThisOp.add(line.markedSpans); }
+ }
span.marker.attachLine(line);
}
@@ -2186,6 +2194,7 @@
if (cm.options.lineNumbers || markers) {
var wrap$1 = ensureLineWrapped(lineView);
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
+ gutterWrap.setAttribute("aria-hidden", "true");
cm.display.input.setUneditable(gutterWrap);
wrap$1.insertBefore(gutterWrap, lineView.text);
if (lineView.line.gutterClass)
@@ -2342,12 +2351,14 @@
function mapFromLineView(lineView, line, lineN) {
if (lineView.line == line)
{ return {map: lineView.measure.map, cache: lineView.measure.cache} }
- for (var i = 0; i < lineView.rest.length; i++)
- { if (lineView.rest[i] == line)
- { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
- for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
- { if (lineNo(lineView.rest[i$1]) > lineN)
- { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
+ if (lineView.rest) {
+ for (var i = 0; i < lineView.rest.length; i++)
+ { if (lineView.rest[i] == line)
+ { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
+ for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
+ { if (lineNo(lineView.rest[i$1]) > lineN)
+ { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
+ }
}
// Render a line into the hidden node display.externalMeasured. Used
@@ -3141,13 +3152,19 @@
var curFragment = result.cursors = document.createDocumentFragment();
var selFragment = result.selection = document.createDocumentFragment();
+ var customCursor = cm.options.$customCursor;
+ if (customCursor) { primary = true; }
for (var i = 0; i < doc.sel.ranges.length; i++) {
if (!primary && i == doc.sel.primIndex) { continue }
var range = doc.sel.ranges[i];
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
var collapsed = range.empty();
- if (collapsed || cm.options.showCursorWhenSelecting)
- { drawSelectionCursor(cm, range.head, curFragment); }
+ if (customCursor) {
+ var head = customCursor(cm, range);
+ if (head) { drawSelectionCursor(cm, head, curFragment); }
+ } else if (collapsed || cm.options.showCursorWhenSelecting) {
+ drawSelectionCursor(cm, range.head, curFragment);
+ }
if (!collapsed)
{ drawSelectionRange(cm, range, selFragment); }
}
@@ -3163,6 +3180,12 @@
cursor.style.top = pos.top + "px";
cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
+ if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
+ var charPos = charCoords(cm, head, "div", null, null);
+ var width = charPos.right - charPos.left;
+ cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px";
+ }
+
if (pos.other) {
// Secondary cursor, shown when on a 'jump' in bi-directional text
var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
@@ -3335,10 +3358,14 @@
function updateHeightsInViewport(cm) {
var display = cm.display;
var prevBottom = display.lineDiv.offsetTop;
+ var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);
+ var oldHeight = display.lineDiv.getBoundingClientRect().top;
+ var mustScroll = 0;
for (var i = 0; i < display.view.length; i++) {
var cur = display.view[i], wrapping = cm.options.lineWrapping;
var height = (void 0), width = 0;
if (cur.hidden) { continue }
+ oldHeight += cur.line.height;
if (ie && ie_version < 8) {
var bot = cur.node.offsetTop + cur.node.offsetHeight;
height = bot - prevBottom;
@@ -3353,6 +3380,7 @@
}
var diff = cur.line.height - height;
if (diff > .005 || diff < -.005) {
+ if (oldHeight < viewTop) { mustScroll -= diff; }
updateLineHeight(cur.line, height);
updateWidgetHeight(cur.line);
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
@@ -3367,6 +3395,7 @@
}
}
}
+ if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }
}
// Read and store the height of line widgets associated with the
@@ -3430,8 +3459,8 @@
// Set pos and end to the cursor positions around the character pos sticks to
// If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
// If pos == Pos(_, 0, "before"), pos and end are unchanged
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos;
+ pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
}
for (var limit = 0; limit < 5; limit++) {
var changed = false;
@@ -3627,6 +3656,7 @@
this.vert.firstChild.style.height =
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
} else {
+ this.vert.scrollTop = 0;
this.vert.style.display = "";
this.vert.firstChild.style.height = "0";
}
@@ -3782,7 +3812,8 @@
scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
scrollToPos: null, // Used to scroll to a specific position
focus: false,
- id: ++nextOpId // Unique ID
+ id: ++nextOpId, // Unique ID
+ markArrays: null // Used by addMarkedSpan
};
pushOperation(cm.curOp);
}
@@ -4235,6 +4266,8 @@
function updateGutterSpace(display) {
var width = display.gutters.offsetWidth;
display.sizer.style.marginLeft = width + "px";
+ // Send an event to consumers responding to changes in gutter width.
+ signalLater(display, "gutterChanged", display);
}
function setDocumentHeight(cm, measure) {
@@ -4374,6 +4407,10 @@
// The element in which the editor lives.
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
+ // This attribute is respected by automatic translation systems such as Google Translate,
+ // and may also be respected by tools used by human translators.
+ d.wrapper.setAttribute('translate', 'no');
+
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
@@ -4471,6 +4508,12 @@
function onScrollWheel(cm, e) {
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
+ var pixelsPerUnit = wheelPixelsPerUnit;
+ if (e.deltaMode === 0) {
+ dx = e.deltaX;
+ dy = e.deltaY;
+ pixelsPerUnit = 1;
+ }
var display = cm.display, scroll = display.scroller;
// Quit if there's nothing to scroll here
@@ -4499,10 +4542,10 @@
// estimated pixels/delta value, we just handle horizontal
// scrolling entirely here. It'll be slightly off from native, but
// better than glitching out.
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
+ if (dx && !gecko && !presto && pixelsPerUnit != null) {
if (dy && canScrollY)
- { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }
- setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));
+ { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));
// Only prevent default scrolling if vertical scrolling is
// actually possible. Otherwise, it causes vertical scroll
// jitter on OSX trackpads when deltaX is small and deltaY
@@ -4515,15 +4558,15 @@
// 'Project' the visible viewport to cover the area that is being
// scrolled into view (if we know enough to estimate it).
- if (dy && wheelPixelsPerUnit != null) {
- var pixels = dy * wheelPixelsPerUnit;
+ if (dy && pixelsPerUnit != null) {
+ var pixels = dy * pixelsPerUnit;
var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
updateDisplaySimple(cm, {top: top, bottom: bot});
}
- if (wheelSamples < 20) {
+ if (wheelSamples < 20 && e.deltaMode !== 0) {
if (display.wheelStartX == null) {
display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
display.wheelDX = dx; display.wheelDY = dy;
@@ -4782,6 +4825,7 @@
estimateLineHeights(cm);
loadMode(cm);
setDirectionClass(cm);
+ cm.options.direction = doc.direction;
if (!cm.options.lineWrapping) { findMaxLine(cm); }
cm.options.mode = doc.modeOption;
regChange(cm);
@@ -5958,7 +6002,7 @@
if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }
addMarkedSpan(line, new MarkedSpan(marker,
curLine == from.line ? from.ch : null,
- curLine == to.line ? to.ch : null));
+ curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);
++curLine;
});
// lineIsHidden depends on the presence of the spans, so needs a second pass
@@ -6130,6 +6174,7 @@
getRange: function(from, to, lineSep) {
var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
if (lineSep === false) { return lines }
+ if (lineSep === '') { return lines.join('') }
return lines.join(lineSep || this.lineSeparator())
},
@@ -6181,7 +6226,7 @@
var out = [];
for (var i = 0; i < ranges.length; i++)
{ out[i] = new Range(clipPos(this, ranges[i].anchor),
- clipPos(this, ranges[i].head)); }
+ clipPos(this, ranges[i].head || ranges[i].anchor)); }
if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }
setSelection(this, normalizeSelection(this.cm, out, primary), options);
}),
@@ -6684,10 +6729,9 @@
// Very basic readline/emacs-style bindings, which are standard on Mac.
keyMap.emacsy = {
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
- "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
- "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
- "Ctrl-O": "openLine"
+ "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
+ "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
+ "Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
};
keyMap.macDefault = {
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
@@ -8199,7 +8243,7 @@
}
function hiddenTextarea() {
- var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
+ var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
// The textarea is kept positioned near the cursor to prevent the
// fact that it'll be scrolled into view on input from scrolling
@@ -8766,6 +8810,7 @@
var input = this, cm = input.cm;
var div = input.div = display.lineDiv;
+ div.contentEditable = true;
disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);
function belongsToInput(e) {
@@ -8832,7 +8877,7 @@
var kludge = hiddenTextarea(), te = kludge.firstChild;
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
te.value = lastCopied.text.join("\n");
- var hadFocus = document.activeElement;
+ var hadFocus = activeElt();
selectInput(te);
setTimeout(function () {
cm.display.lineSpace.removeChild(kludge);
@@ -8855,7 +8900,7 @@
ContentEditableInput.prototype.prepareSelection = function () {
var result = prepareSelection(this.cm, false);
- result.focus = document.activeElement == this.div;
+ result.focus = activeElt() == this.div;
return result
};
@@ -8951,7 +8996,7 @@
ContentEditableInput.prototype.focus = function () {
if (this.cm.options.readOnly != "nocursor") {
- if (!this.selectionInEditor() || document.activeElement != this.div)
+ if (!this.selectionInEditor() || activeElt() != this.div)
{ this.showSelection(this.prepareSelection(), true); }
this.div.focus();
}
@@ -8962,9 +9007,11 @@
ContentEditableInput.prototype.supportsTouch = function () { return true };
ContentEditableInput.prototype.receivedFocus = function () {
+ var this$1 = this;
+
var input = this;
if (this.selectionInEditor())
- { this.pollSelection(); }
+ { setTimeout(function () { return this$1.pollSelection(); }, 20); }
else
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }
@@ -9793,7 +9840,7 @@
addLegacyProps(CodeMirror);
- CodeMirror.version = "5.59.4";
+ CodeMirror.version = "5.65.0";
return CodeMirror;
diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/js/css.js b/lib/editor/atto/plugins/html/yui/src/codemirror/js/css.js
index 88a869bfeac..880b58ef7af 100644
--- a/lib/editor/atto/plugins/html/yui/src/codemirror/js/css.js
+++ b/lib/editor/atto/plugins/html/yui/src/codemirror/js/css.js
@@ -443,13 +443,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"monochrome", "min-monochrome", "max-monochrome", "resolution",
"min-resolution", "max-resolution", "scan", "grid", "orientation",
"device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
- "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme"
+ "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme",
+ "dynamic-range", "video-dynamic-range"
], mediaFeatures = keySet(mediaFeatures_);
var mediaValueKeywords_ = [
"landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
"interlace", "progressive",
- "dark", "light"
+ "dark", "light",
+ "standard", "high"
], mediaValueKeywords = keySet(mediaValueKeywords_);
var propertyKeywords_ = [
@@ -482,7 +484,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"cue-before", "cursor", "direction", "display", "dominant-baseline",
"drop-initial-after-adjust", "drop-initial-after-align",
"drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
- "drop-initial-value", "elevation", "empty-cells", "fit", "fit-position",
+ "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position",
"flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
"flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
"font", "font-family", "font-feature-settings", "font-kerning",
@@ -564,7 +566,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
], propertyKeywords = keySet(propertyKeywords_);
var nonStandardPropertyKeywords_ = [
- "border-block", "border-block-color", "border-block-end",
+ "accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end",
"border-block-end-color", "border-block-end-style", "border-block-end-width",
"border-block-start", "border-block-start-color", "border-block-start-style",
"border-block-start-width", "border-block-style", "border-block-width",
@@ -572,9 +574,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"border-inline-end-color", "border-inline-end-style",
"border-inline-end-width", "border-inline-start", "border-inline-start-color",
"border-inline-start-style", "border-inline-start-width",
- "border-inline-style", "border-inline-width", "margin-block",
+ "border-inline-style", "border-inline-width", "content-visibility", "margin-block",
"margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
- "margin-inline-start", "padding-block", "padding-block-end",
+ "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end",
"padding-block-start", "padding-inline", "padding-inline-end",
"padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
@@ -598,16 +600,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
- "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
+ "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen",
"darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
- "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
- "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
+ "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet",
+ "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
"floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
"gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
"hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
- "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
- "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey",
"lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
"mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
@@ -617,7 +619,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
"purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
"salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
- "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
+ "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan",
"teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
"whitesmoke", "yellow", "yellowgreen"
], colorKeywords = keySet(colorKeywords_);
@@ -628,21 +630,21 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
"arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
"avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary",
- "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
- "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
+ "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box",
+ "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "button-bevel",
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
"compact", "condensed", "contain", "content", "contents",
- "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
- "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
+ "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop",
+ "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
"dot-dash", "dot-dot-dash",
- "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
+ "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
@@ -652,10 +654,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
"extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
- "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
+ "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove",
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
"inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
@@ -689,11 +691,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
- "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
+ "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
- "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
+ "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama",
"simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/js/javascript.js b/lib/editor/atto/plugins/html/yui/src/codemirror/js/javascript.js
index 047395622eb..95cbbd8533a 100644
--- a/lib/editor/atto/plugins/html/yui/src/codemirror/js/javascript.js
+++ b/lib/editor/atto/plugins/html/yui/src/codemirror/js/javascript.js
@@ -16,6 +16,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var statementIndent = parserConfig.statementIndent;
var jsonldMode = parserConfig.jsonld;
var jsonMode = parserConfig.json || jsonldMode;
+ var trackScope = parserConfig.trackScope !== false
var isTS = parserConfig.typescript;
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
@@ -218,7 +219,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
// Parser
- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true,
+ "regexp": true, "this": true, "import": true, "jsonld-keyword": true};
function JSLexical(indented, column, type, align, prev, info) {
this.indented = indented;
@@ -230,6 +232,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function inScope(state, varname) {
+ if (!trackScope) return false
for (var v = state.localVars; v; v = v.next)
if (v.name == varname) return true;
for (var cx = state.context; cx; cx = cx.prev) {
@@ -276,6 +279,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function register(varname) {
var state = cx.state;
cx.marked = "def";
+ if (!trackScope) return
if (state.context) {
if (state.lexical.info == "var" && state.context && state.context.block) {
// FIXME function decls are also not block scoped
@@ -375,7 +379,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
}
if (type == "function") return cont(functiondef);
- if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
+ if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
if (type == "class" || (isTS && value == "interface")) {
cx.marked = "keyword"
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
@@ -441,7 +445,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
if (type == "quasi") return pass(quasi, maybeop);
if (type == "new") return cont(maybeTarget(noComma));
- if (type == "import") return cont(expression);
return cont();
}
function maybeexpression(type) {
@@ -479,7 +482,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function quasi(type, value) {
if (type != "quasi") return pass();
if (value.slice(value.length - 2) != "${") return cont(quasi);
- return cont(expression, continueQuasi);
+ return cont(maybeexpression, continueQuasi);
}
function continueQuasi(type) {
if (type == "}") {
@@ -605,7 +608,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
}
function typeexpr(type, value) {
- if (value == "keyof" || value == "typeof" || value == "infer") {
+ if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
cx.marked = "keyword"
return cont(value == "typeof" ? expressionNoComma : typeexpr)
}
@@ -619,6 +622,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType)
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
+ if (type == "quasi") { return pass(quasiType, afterType); }
}
function maybeReturnType(type) {
if (type == "=>") return cont(typeexpr)
@@ -644,6 +648,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont()
}
}
+ function quasiType(type, value) {
+ if (type != "quasi") return pass();
+ if (value.slice(value.length - 2) != "${") return cont(quasiType);
+ return cont(typeexpr, continueQuasiType);
+ }
+ function continueQuasiType(type) {
+ if (type == "}") {
+ cx.marked = "string-2";
+ cx.state.tokenize = tokenQuasi;
+ return cont(quasiType);
+ }
+ }
function typearg(type, value) {
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
if (type == ":") return cont(typeexpr)
@@ -783,6 +799,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "@") return cont(expression, classBody)
}
function classfield(type, value) {
+ if (value == "!") return cont(classfield)
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma)
@@ -802,6 +819,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function afterImport(type) {
if (type == "string") return cont();
if (type == "(") return pass(expression);
+ if (type == ".") return pass(maybeoperatorComma);
return pass(importSpec, maybeMoreImports, maybeFrom);
}
function importSpec(type, value) {
@@ -882,7 +900,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
var c = state.cc[i];
if (c == poplex) lexical = lexical.prev;
- else if (c != maybeelse) break;
+ else if (c != maybeelse && c != popcontext) break;
}
while ((lexical.type == "stat" || lexical.type == "form") &&
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
@@ -919,8 +937,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
expressionAllowed: expressionAllowed,
skipExpression: function(state) {
- var top = state.cc[state.cc.length - 1]
- if (top == expression || top == expressionNoComma) state.cc.pop()
+ parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null))
}
};
});
diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/js/xml.js b/lib/editor/atto/plugins/html/yui/src/codemirror/js/xml.js
index 46806ac4256..4e36106b492 100644
--- a/lib/editor/atto/plugins/html/yui/src/codemirror/js/xml.js
+++ b/lib/editor/atto/plugins/html/yui/src/codemirror/js/xml.js
@@ -187,6 +187,10 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
};
}
+ function lower(tagName) {
+ return tagName && tagName.toLowerCase();
+ }
+
function Context(state, tagName, startOfLine) {
this.prev = state.context;
this.tagName = tagName || "";
@@ -205,8 +209,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
return;
}
parentTagName = state.context.tagName;
- if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
- !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
+ if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||
+ !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {
return;
}
popContext(state);
@@ -240,7 +244,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (type == "word") {
var tagName = stream.current();
if (state.context && state.context.tagName != tagName &&
- config.implicitlyClosed.hasOwnProperty(state.context.tagName))
+ config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))
popContext(state);
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
setStyle = "tag";
@@ -279,7 +283,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
var tagName = state.tagName, tagStart = state.tagStart;
state.tagName = state.tagStart = null;
if (type == "selfcloseTag" ||
- config.autoSelfClosers.hasOwnProperty(tagName)) {
+ config.autoSelfClosers.hasOwnProperty(lower(tagName))) {
maybePopContext(state, tagName);
} else {
maybePopContext(state, tagName);
@@ -359,7 +363,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
- } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
+ } else if (config.implicitlyClosed.hasOwnProperty(lower(context.tagName))) {
context = context.prev;
} else {
break;
@@ -367,8 +371,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
- var grabbers = config.contextGrabbers[context.tagName];
- if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
+ var grabbers = config.contextGrabbers[lower(context.tagName)];
+ if (grabbers && grabbers.hasOwnProperty(lower(tagAfter[2])))
context = context.prev;
else
break;
diff --git a/lib/editor/atto/plugins/html/yui/src/codemirror/readme_moodle.txt b/lib/editor/atto/plugins/html/yui/src/codemirror/readme_moodle.txt
index 3bfc5274a84..a9a720088c2 100644
--- a/lib/editor/atto/plugins/html/yui/src/codemirror/readme_moodle.txt
+++ b/lib/editor/atto/plugins/html/yui/src/codemirror/readme_moodle.txt
@@ -1,6 +1,6 @@
Description of importing the codemirror library into Moodle.
-NOTE 2: To make it more readable, in this explanation [LIBRARYPATH] means:
+NOTE: To make it more readable, in this explanation [LIBRARYPATH] means:
[PATH TO YOUR MOODLE]/lib/editor/atto/plugins/html/yui/src/codemirror
1 Download the latest codemirror code somewhere (example /tmp/cm) using: npm install codemirror
@@ -14,11 +14,9 @@ cp node_modules/codemirror/mode/htmlmixed/htmlmixed.js [LIBRARYPATH]/js
cp node_modules/codemirror/mode/javascript/javascript.js [LIBRARYPATH]/js
cp node_modules/codemirror/mode/xml/xml.js [LIBRARYPATH]/js
-3 Update the verison number in:
- [PATH TO YOUR MOODLE]/var/www/html/m/master2/lib/editor/atto/plugins/html/thirdpartylibs.xml
-
-3 rebuild the module by:
+3 Rebuild the module by:
cd [PATH TO YOUR MOODLE]/lib/editor/atto/plugins/html/yui/src/
grunt shifter
-
+4 Update the version number in (using the version noted down in #1):
+ [PATH TO YOUR MOODLE]/lib/editor/atto/plugins/html/thirdpartylibs.xml