@notadd/graphql
Version:
notadd core none dependence
1 lines • 2.15 MB
JavaScript
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=795)}([function(e,t,n){"use strict";e.exports=n(313)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(90));var r=n(90);t.styled=r.default},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t,n,i){var o=r(e,t,n,i);return o.setAttribute("role","presentation"),o}function o(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function a(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function s(t,n){var r=t.className;e(n).test(r)||(t.className+=(r?" ":"")+n)}function u(t,n){for(var r=t.split(" "),i=0;i<r.length;i++)r[i]&&!e(r[i]).test(n)&&(n+=" "+r[i]);return n}function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function l(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function p(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}function f(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function d(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function h(e){for(;Qa.length<=e;)Qa.push(m(Qa)+" ");return Qa[e]}function m(e){return e[e.length-1]}function g(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function y(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function v(){}function b(e,t){var n;return Object.create?n=Object.create(e):(v.prototype=e,n=new v),t&&l(t,n),n}function x(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ka.test(e))}function C(e,t){return t?!!(t.source.indexOf("\\w")>-1&&x(e))||t.test(e):x(e)}function E(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function D(e){return e.charCodeAt(0)>=768&&Ja.test(e)}function w(e,t,n){for(;(n<0?t>0:t<e.length)&&D(e.charAt(t));)t+=n;return t}function S(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function k(e,t,n){var o=this;this.input=n,o.scrollbarFiller=r("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=r("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=r("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=r("div",null,"CodeMirror-cursors"),o.measure=r("div",null,"CodeMirror-measure"),o.lineMeasure=r("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=r("div",[a],null,"position: relative"),o.sizer=r("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=r("div",null,null,"position: absolute; height: "+Ga+"px; width: 1px;"),o.gutters=r("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=r("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=r("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),ba&&xa<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Ca||ma&&Oa||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function A(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function _(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function T(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function O(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function F(e){if(null==e.parent)return null;for(var t=e.parent,n=f(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function N(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],u=s.height;if(t<u)break;t-=u}return n+a}function I(e,t){return t>=e.first&&t<e.first+e.size}function L(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function P(e,t,n){if(void 0===n&&(n=null),!(this instanceof P))return new P(e,t,n);this.line=e,this.ch=t,this.sticky=n}function M(e,t){return e.line-t.line||e.ch-t.ch}function j(e,t){return e.sticky==t.sticky&&0==M(e,t)}function R(e){return P(e.line,e.ch)}function B(e,t){return M(e,t)<0?t:e}function $(e,t){return M(e,t)<0?e:t}function U(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function z(e,t){if(t.line<e.first)return P(e.first,0);var n=e.first+e.size-1;return t.line>n?P(n,A(e,n).text.length):G(t,A(e,t.line).text.length)}function G(e,t){var n=e.ch;return null==n||n>t?P(e.line,t):n<0?P(e.line,0):e}function V(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=z(e,t[r]);return n}function q(){Ya=!0}function H(){Xa=!0}function W(e,t,n){this.marker=e,this.from=t,this.to=n}function Q(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function K(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function J(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Y(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var u=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new W(a,o.from,u?null:o.to))}}return r}function X(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var u=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new W(a,u?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Z(e,t){if(t.full)return null;var n=I(e,t.from.line)&&A(e,t.from.line).markedSpans,r=I(e,t.to.line)&&A(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==M(t.from,t.to),s=Y(n,i,a),u=X(r,o,a),c=1==t.text.length,l=m(t.text).length+(c?i:0);if(s)for(var p=0;p<s.length;++p){var f=s[p];if(null==f.to){var d=Q(u,f.marker);d?c&&(f.to=null==d.to?null:d.to+l):f.to=i}}if(u)for(var h=0;h<u.length;++h){var g=u[h];if(null!=g.to&&(g.to+=l),null==g.from){var y=Q(s,g.marker);y||(g.from=l,c&&(s||(s=[])).push(g))}else g.from+=l,c&&(s||(s=[])).push(g)}s&&(s=ee(s)),u&&u!=s&&(u=ee(u));var v=[s];if(!c){var b,x=t.text.length-2;if(x>0&&s)for(var C=0;C<s.length;++C)null==s[C].to&&(b||(b=[])).push(new W(s[C].marker,null,null));for(var E=0;E<x;++E)v.push(b);v.push(u)}return v}function ee(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function te(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=f(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),u=0;u<i.length;++u){var c=i[u];if(!(M(c.to,s.from)<0||M(c.from,s.to)>0)){var l=[u,1],p=M(c.from,s.from),d=M(c.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&l.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&l.push({from:s.to,to:c.to}),i.splice.apply(i,l),u+=l.length-3}}return i}function ne(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function re(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function ae(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=M(r.from,i.from)||ie(e)-ie(t);if(o)return-o;var a=M(r.to,i.to)||oe(e)-oe(t);return a||t.id-e.id}function se(e,t){var n,r=Xa&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||ae(n,i.marker)<0)&&(n=i.marker);return n}function ue(e){return se(e,!0)}function ce(e){return se(e,!1)}function le(e,t){var n,r=Xa&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||ae(n,o.marker)<0)&&(n=o.marker)}return n}function pe(e,t,n,r,i){var o=A(e,t),a=Xa&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var u=a[s];if(u.marker.collapsed){var c=u.marker.find(0),l=M(c.from,n)||ie(u.marker)-ie(i),p=M(c.to,r)||oe(u.marker)-oe(i);if(!(l>=0&&p<=0||l<=0&&p>=0)&&(l<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?M(c.to,n)>=0:M(c.to,n)>0)||l>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?M(c.from,r)<=0:M(c.from,r)<0)))return!0}}}function fe(e){for(var t;t=ue(e);)e=t.find(-1,!0).line;return e}function de(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function he(e){for(var t,n;t=ce(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function me(e,t){var n=A(e,t),r=fe(n);return n==r?t:F(r)}function ge(e,t){if(t>e.lastLine())return t;var n,r=A(e,t);if(!ye(e,r))return t;for(;n=ce(r);)r=n.find(1,!0).line;return F(r)+1}function ye(e,t){var n=Xa&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ve(e,t,r))return!0}}function ve(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return ve(e,r.line,Q(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ve(e,t,i))return!0}function be(e){e=fe(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function xe(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=ue(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=ce(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function Ce(e){var t=e.display,n=e.doc;t.maxLine=A(n,n.first),t.maxLineLength=xe(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=xe(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function Ee(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}function De(e,t,n){var r;Za=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Za=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Za=i)}return null!=r?r:Za}function we(e,t){var n=e.order;return null==n&&(n=e.order=es(e.text,t)),n}function Se(e,t){return e._handlers&&e._handlers[t]||ts}function ke(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=f(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ae(e,t){var n=Se(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function _e(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,n||t.type,e,t),Le(t)||t.codemirrorIgnore}function Te(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==f(n,t[r])&&n.push(t[r])}function Oe(e,t){return Se(e,t).length>0}function Fe(e){e.prototype.on=function(e,t){ns(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Pe(e){Ne(e),Ie(e)}function Me(e){return e.target||e.srcElement}function je(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Fa&&e.ctrlKey&&1==t&&(t=3),t}function Re(e){if(null==Ua){var t=r("span","\u200b");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ua=t.offsetWidth<=1&&t.offsetHeight>2&&!(ba&&xa<8))}var i=Ua?r("span","\u200b"):r("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Be(e){if(null!=za)return za;var r=n(e,document.createTextNode("A\u062eA")),i=Pa(r,0,1).getBoundingClientRect(),o=Pa(r,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(za=o.right-i.right<3)}function $e(e){if(null!=ss)return ss;var t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=Pa(t,0,1).getBoundingClientRect();return ss=Math.abs(i.left-o.left)>1}function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),us[e]=t}function ze(e,t){cs[e]=t}function Ge(e){if("string"==typeof e&&cs.hasOwnProperty(e))e=cs[e];else if(e&&"string"==typeof e.name&&cs.hasOwnProperty(e.name)){var t=cs[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ge("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ge("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=Ge(t);var n=us[t.name];if(!n)return Ve(e,"text/plain");var r=n(e,t);if(ls.hasOwnProperty(t.name)){var i=ls[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}function qe(e,t){l(t,ls.hasOwnProperty(e)?ls[e]:ls[e]={})}function He(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function We(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Qe(e,t,n){return!e.startState||e.startState(t,n)}function Ke(e,t,n,r){var i=[e.state.modeGen],o={};rt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,s=0;s<e.state.overlays.length;++s)!function(r){n.baseTokens=i;var s=e.state.overlays[r],u=1,c=0;n.state=!0,rt(e,t.text,s.mode,n,function(e,t){for(var n=u;c<e;){var r=i[u];r>e&&i.splice(u,1,e,i[u+1],r),u+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;n<u;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1}(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Je(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ye(e,F(t)),i=t.text.length>e.options.maxHighlightLength&&He(e.doc.mode,r.state),o=Ke(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ye(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ds(r,!0,t);var o=it(e,t,n),a=o>r.first&&A(r,o-1).stateAfter,s=a?ds.fromSaved(r,a,o):new ds(r,Qe(r.mode),o);return r.iter(o,t,function(n){Xe(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Xe(e,t,n,r){var i=e.doc.mode,o=new ps(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&Ze(i,n.state);!o.eol();)et(i,o,n.state),o.start=o.pos}function Ze(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=We(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function et(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=We(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function tt(e,t,n,r){var i,o=e.doc,a=o.mode;t=z(o,t);var s,u=A(o,t.line),c=Ye(e,t.line,n),l=new ps(u.text,e.options.tabSize,c);for(r&&(s=[]);(r||l.pos<t.ch)&&!l.eol();)l.start=l.pos,i=et(a,l,c.state),r&&s.push(new hs(l,i,He(o.mode,c.state)));return r?s:new hs(l,i,c.state)}function nt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function rt(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var u,c=0,l=null,p=new ps(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&nt(Ze(n,r.state),o);!p.eol();){if(p.pos>e.options.maxHighlightLength?(s=!1,a&&Xe(e,t,r,p.pos),p.pos=t.length,u=null):u=nt(et(n,p,r.state,f),o),f){var d=f[0].name;d&&(u="m-"+(u?d+" "+u:d))}if(!s||l!=u){for(;c<p.start;)c=Math.min(p.start,c+5e3),i(c,l);l=u}p.start=p.pos}for(;c<p.pos;){var h=Math.min(p.pos,c+5e3);i(h,l),c=h}}function it(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var u=A(o,s-1),c=u.stateAfter;if(c&&(!n||s+(c instanceof fs?c.lookAhead:0)<=o.modeFrontier))return s;var l=p(u.text,null,e.options.tabSize);(null==i||r>l)&&(i=s-1,r=l)}return i}function ot(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=A(e,r).stateAfter;if(i&&(!(i instanceof fs)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}function at(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),ne(e),re(e,n);var i=r?r(e):1;i!=e.height&&O(e,i)}function st(e){e.parent=null,ne(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?vs:ys;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ct(e,t){var n=i("span",null,null,Ca?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(ba||Ca)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,s=void 0;r.pos=0,r.addToken=pt,Be(e.display.measure)&&(s=we(a,e.doc.direction))&&(r.addToken=dt(r.addToken,s)),r.map=[];mt(a,r,Je(e,a,t!=e.display.externalMeasured&&F(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=u(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=u(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Re(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Ca){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=u(r.pre.className,r.textClass||"")),r}function lt(e){var t=r("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,n,i,o,a,s){if(t){var u,c=e.splitSpaces?ft(t,e.trailingSpace):t,l=e.cm.state.specialChars,p=!1;if(l.test(t)){u=document.createDocumentFragment();for(var f=0;;){l.lastIndex=f;var d=l.exec(t),m=d?d.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));ba&&xa<9?u.appendChild(r("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!d)break;f+=m+1;var y=void 0;if("\t"==d[0]){var v=e.cm.options.tabSize,b=v-e.col%v;y=u.appendChild(r("span",h(b),"cm-tab")),y.setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b}else"\r"==d[0]||"\n"==d[0]?(y=u.appendChild(r("span","\r"==d[0]?"\u240d":"\u2424","cm-invalidchar")),y.setAttribute("cm-text",d[0]),e.col+=1):(y=e.cm.options.specialCharPlaceholder(d[0]),y.setAttribute("cm-text",d[0]),ba&&xa<9?u.appendChild(r("span",[y])):u.appendChild(y),e.col+=1);e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),ba&&xa<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||o||p||s){var x=n||"";i&&(x+=i),o&&(x+=o);var C=r("span",[u],x,s);return a&&(C.title=a),e.content.appendChild(C)}e.content.appendChild(u)}}function ft(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o="\xa0"),r+=o,n=" "==o}return r}function dt(e,t){return function(n,r,i,o,a,s,u){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,l=c+r.length;;){for(var p=void 0,f=0;f<t.length&&(p=t[f],!(p.to>c&&p.from<=c));f++);if(p.to>=l)return e(n,r,i,o,a,s,u);e(n,r.slice(0,p.to-c),i,o,null,s,u),o=null,r=r.slice(p.to-c),c=p.to}}}function ht(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function mt(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,u,c,l,p,f,d=i.length,h=0,m=1,g="",y=0;;){if(y==h){u=c=l=p=s="",f=null,y=1/0;for(var v=[],b=void 0,x=0;x<r.length;++x){var C=r[x],E=C.marker;"bookmark"==E.type&&C.from==h&&E.widgetNode?v.push(E):C.from<=h&&(null==C.to||C.to>h||E.collapsed&&C.to==h&&C.from==h)?(null!=C.to&&C.to!=h&&y>C.to&&(y=C.to,c=""),E.className&&(u+=" "+E.className),E.css&&(s=(s?s+";":"")+E.css),E.startStyle&&C.from==h&&(l+=" "+E.startStyle),E.endStyle&&C.to==y&&(b||(b=[])).push(E.endStyle,C.to),E.title&&!p&&(p=E.title),E.collapsed&&(!f||ae(f.marker,E)<0)&&(f=C)):C.from>h&&y>C.from&&(y=C.from)}if(b)for(var D=0;D<b.length;D+=2)b[D+1]==y&&(c+=" "+b[D]);if(!f||f.from==h)for(var w=0;w<v.length;++w)ht(t,0,v[w]);if(f&&(f.from||0)==h){if(ht(t,(null==f.to?d+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=d)break;for(var S=Math.min(d,y);;){if(g){var k=h+g.length;if(!f){var A=k>S?g.slice(0,S-h):g;t.addToken(t,A,a?a+u:u,l,h+A.length==y?c:"",p,s)}if(k>=S){g=g.slice(S-h),h=S;break}h=k,l=""}g=i.slice(o,o=n[m++]),a=ut(n[m++],t.cm.options)}}else for(var _=1;_<n.length;_+=2)t.addToken(t,i.slice(o,o=n[_]),ut(n[_+1],t.cm.options))}function gt(e,t,n){this.line=t,this.rest=he(t),this.size=this.rest?F(m(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ye(e,t)}function yt(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new gt(e.doc,A(e.doc,o),o);r=o+a.size,i.push(a)}return i}function vt(e){bs?bs.ops.push(e):e.ownsGroup=bs={ops:[e],delayedCallbacks:[]}}function bt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function xt(e,t){var n=e.ownsGroup;if(n)try{bt(n)}finally{bs=null,t(n)}}function Ct(e,t){var n=Se(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);bs?r=bs.delayedCallbacks:xs?r=xs:(r=xs=[],setTimeout(Et,0));for(var o=0;o<n.length;++o)!function(e){r.push(function(){return n[e].apply(null,i)})}(o)}}function Et(){var e=xs;xs=null;for(var t=0;t<e.length;++t)e[t]()}function Dt(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?At(e,t):"gutter"==o?Tt(e,t,n,r):"class"==o?_t(e,t):"widget"==o&&Ot(e,t,r)}t.changes=null}function wt(e){return e.node==e.text&&(e.node=r("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ba&&xa<8&&(e.node.style.zIndex=2)),e.node}function St(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=wt(t);t.background=i.insertBefore(r("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function kt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ct(e,t)}function At(e,t){var n=t.text.className,r=kt(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,_t(e,t)):n&&(t.text.className=n)}function _t(e,t){St(e,t),t.line.wrapClass?wt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Tt(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=wt(t);t.gutterBackground=r("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var s=wt(t),u=t.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(u),s.insertBefore(u,t.text),t.line.gutterClass&&(u.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=u.appendChild(r("div",L(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var l=e.options.gutters[c],p=a.hasOwnProperty(l)&&a[l];p&&u.appendChild(r("div",[p],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}function Ot(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);Nt(e,t,n)}function Ft(e,t,n,r){var i=kt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),_t(e,t),Tt(e,t,n,r),Nt(e,t,r),t.node}function Nt(e,t,n){if(It(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)It(e,t.rest[r],t,n,!1)}function It(e,t,n,i,o){if(t.widgets)for(var a=wt(n),s=0,u=t.widgets;s<u.length;++s){var c=u[s],l=r("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||l.setAttribute("cm-ignore-events","true"),Lt(c,l,n,i),e.display.input.setUneditable(l),o&&c.above?a.insertBefore(l,n.gutter||n.text):a.appendChild(l),Ct(c,"redraw")}}function Lt(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Pt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),n(t.display.measure,r("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Mt(e,t){for(var n=Me(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function jt(e){return e.lineSpace.offsetTop}function Rt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Bt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=n(e.measure,r("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function $t(e){return Ga-e.display.nativeBarWidth}function Ut(e){return e.display.scroller.clientWidth-$t(e)-e.display.barWidth}function zt(e){return e.display.scroller.clientHeight-$t(e)-e.display.barHeight}function Gt(e,t,n){var r=e.options.lineWrapping,i=r&&Ut(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var u=a[s],c=a[s+1];Math.abs(u.bottom-c.bottom)>2&&o.push((u.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Vt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(F(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function qt(e,t){t=fe(t);var r=F(t),i=e.display.externalMeasured=new gt(e.doc,t,r);i.lineN=r;var o=i.built=ct(e,i);return i.text=o.pre,n(e.display.lineMeasure,o.pre),i}function Ht(e,t,n,r){return Kt(e,Qt(e,t),n,r)}function Wt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[An(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Qt(e,t){var n=F(t),r=Wt(e,n);r&&!r.text?r=null:r&&r.changes&&(Dt(e,r,n,En(e)),e.curOp.forceUpdate=!0),r||(r=qt(e,t));var i=Vt(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Kt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Gt(e,t.view,t.rect),t.hasHeights=!0),o=Xt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Jt(e,t,n){for(var r,i,o,a,s,u,c=0;c<e.length;c+=3)if(s=e[c],u=e[c+1],t<s?(i=0,o=1,a="left"):t<u?(i=t-s,o=i+1):(c==e.length-3||t==u&&e[c+3]>t)&&(o=u-s,i=o-1,t>=u&&(a="right")),null!=i){if(r=e[c+2],s==u&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==u-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:u}}function Yt(e,t){var n=Cs;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Xt(e,t,n,r){var i,o=Jt(t.map,n,r),a=o.node,s=o.start,u=o.end,c=o.collapse;if(3==a.nodeType){for(var l=0;l<4;l++){for(;s&&D(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+u<o.coverEnd&&D(t.line.text.charAt(o.coverStart+u));)++u;if(i=ba&&xa<9&&0==s&&u==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Yt(Pa(a,s,u).getClientRects(),r),i.left||i.right||0==s)break;u=s,s-=1,c="right"}ba&&xa<11&&(i=Zt(e.display.measure,i))}else{s>0&&(c=r="right");var p;i=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p["right"==r?p.length-1:0]:a.getBoundingClientRect()}if(ba&&xa<9&&!s&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+Cn(e.display),top:f.top,bottom:f.bottom}:Cs}for(var d=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(d+h)/2,g=t.view.measure.heights,y=0;y<g.length-1&&!(m<g[y]);y++);var v=y?g[y-1]:0,b=g[y],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:b};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=d,x.rbottom=h),x}function Zt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!$e(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function en(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function tn(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)en(e.display.view[n])}function nn(e){tn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function rn(){return Da&&Ta?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function on(){return Da&&Ta?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function an(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Pt(e.widgets[n]));return t}function sn(e,t,n,r,i){if(!i){var o=an(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=be(t);if("local"==r?a+=jt(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:on());var u=s.left+("window"==r?0:rn());n.left+=u,n.right+=u}return n.top+=a,n.bottom+=a,n}function un(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=rn(),i-=on();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function cn(e,t,n,r,i){return r||(r=A(e.doc,t.line)),sn(e,r,Ht(e,r,t.ch,i),n)}function ln(e,t,n,r,i,o){function a(t,a){var s=Kt(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,sn(e,r,s,n)}function s(e,t,n){var r=u[t],i=1==r.level;return a(n?e-1:e,i!=n)}r=r||A(e.doc,t.line),i||(i=Qt(e,r));var u=we(r,e.doc.direction),c=t.ch,l=t.sticky;if(c>=r.text.length?(c=r.text.length,l="before"):c<=0&&(c=0,l="after"),!u)return a("before"==l?c-1:c,"before"==l);var p=De(u,c,l),f=Za,d=s(c,p,"before"==l);return null!=f&&(d.other=s(c,f,"before"!=l)),d}function pn(e,t){var n=0;t=z(e.doc,t),e.options.lineWrapping||(n=Cn(e.display)*t.ch);var r=A(e.doc,t.line),i=be(r)+jt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function fn(e,t,n,r,i){var o=P(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function dn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return fn(r.first,0,null,!0,-1);var i=N(r,n),o=r.first+r.size-1;if(i>o)return fn(r.first+r.size-1,A(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=A(r,i);;){var s=yn(e,a,i,t,n),u=le(a,s.ch+(s.xRel>0?1:0));if(!u)return s;var c=u.find(1);if(c.line==i)return c;a=A(r,i=c.line)}}function hn(e,t,n,r){r-=an(t);var i=t.text.length,o=S(function(t){return Kt(e,n,t-1).bottom<=r},i,0);return i=S(function(t){return Kt(e,n,t).top>r},o,i),{begin:o,end:i}}function mn(e,t,n,r){return n||(n=Qt(e,t)),hn(e,t,n,sn(e,t,Kt(e,n,r),"line").top)}function gn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function yn(e,t,n,r,i){i-=be(t);var o=Qt(e,t),a=an(t),s=0,u=t.text.length,c=!0,l=we(t,e.doc.direction);if(l){var p=(e.options.lineWrapping?bn:vn)(e,t,n,o,l,r,i);c=1!=p.level,s=c?p.from:p.to-1,u=c?p.to:p.from-1}var f,d,h=null,m=null,g=S(function(t){var n=Kt(e,o,t);return n.top+=a,n.bottom+=a,!!gn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)},s,u),y=!1;if(m){var v=r-m.left<m.right-r,b=v==c;g=h+(b?0:1),d=b?"after":"before",f=v?m.left:m.right}else{c||g!=u&&g!=s||g++,d=0==g?"after":g==t.text.length?"before":Kt(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var x=ln(e,P(n,g,d),"line",t,o);f=x.left,y=i<x.top||i>=x.bottom}return g=w(t.text,g,1),fn(n,g,d,y,r-f)}function vn(e,t,n,r,i,o,a){var s=S(function(s){var u=i[s],c=1!=u.level;return gn(ln(e,P(n,c?u.to:u.from,c?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),u=i[s];if(s>0){var c=1!=u.level,l=ln(e,P(n,c?u.from:u.to,c?"after":"before"),"line",t,r);gn(l,o,a,!0)&&l.top>a&&(u=i[s-1])}return u}function bn(e,t,n,r,i,o,a){var s=hn(e,t,r,a),u=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var l=null,p=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=c||d.to<=u)){var h=1!=d.level,m=Kt(e,r,h?Math.min(c,d.to)-1:Math.max(u,d.from)).right,g=m<o?o-m+1e9:m-o;(!l||p>g)&&(l=d,p=g)}}return l||(l=i[i.length-1]),l.from<u&&(l={from:u,to:l.to,level:l.level}),l.to>c&&(l={from:l.from,to:c,level:l.level}),l}function xn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==gs){gs=r("pre");for(var i=0;i<49;++i)gs.appendChild(document.createTextNode("x")),gs.appendChild(r("br"));gs.appendChild(document.createTextNode("x"))}n(e.measure,gs);var o=gs.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function Cn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=r("span","xxxxxxxxxx"),i=r("pre",[t]);n(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function En(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:Dn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Dn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wn(e){var t=xn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Cn(e.display)-3);return function(i){if(ye(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Sn(e){var t=e.doc,n=wn(e);t.iter(function(e){var t=n(e);t!=e.height&&O(e,t)})}function kn(e,t,n,r){var i=e.display;if(!n&&"true"==Me(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var u,c=dn(e,o,a);if(r&&1==c.xRel&&(u=A(e.doc,c.line).text).length==c.ch){var l=p(u,u.length,e.options.tabSize)-u.length;c=P(c.line,Math.max(0,Math.round((o-Bt(e.display).left)/Cn(e.display))-l))}return c}function An(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function _n(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Tn(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();(u||e.options.showCursorWhenSelecting)&&On(e,s.head,i),u||Nn(e,s,o)}}return r}function On(e,t,n){var i=ln(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(r("div","\xa0","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=n.appendChild(r("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Fn(e,t){return e.top-t.top||e.left-t.left}function Nn(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),u.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?p-e:n)+"px;\n height: "+(i-t)+"px"))}function o(t,n,r){function o(n,r){return cn(e,P(t,n),"div",d,r)}function a(t,n,r){var i=mn(e,d,null,t),a="ltr"==n==("after"==r)?"left":"right";return o("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),a)[a]}var u,c,d=A(s,t),h=d.text.length,m=we(d,s.direction);return Ee(m,n||0,null==r?h:r,function(e,t,s,d){var g="ltr"==s,y=o(e,g?"left":"right"),v=o(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==h,C=0==d,E=!m||d==m.length-1;if(v.top-y.top<=3){var D=(f?b:x)&&C,w=(f?x:b)&&E,S=D?l:(g?y:v).left,k=w?p:(g?v:y).right;i(S,y.top,k-S,y.bottom)}else{var A,_,T,O;g?(A=f&&b&&C?l:y.left,_=f?p:a(e,s,"before"),T=f?l:a(t,s,"after"),O=f&&x&&E?p:v.right):(A=f?a(e,s,"before"):l,_=!f&&b&&C?p:y.right,T=!f&&x&&E?l:v.left,O=f?a(t,s,"after"):p),i(A,y.top,_-A,y.bottom),y.bottom<v.top&&i(l,y.bottom,null,v.top),i(T,v.top,O-T,v.bottom)}(!u||Fn(y,u)<0)&&(u=y),Fn(v,u)<0&&(u=v),(!c||Fn(y,c)<0)&&(c=y),Fn(v,c)<0&&(c=v)}),{start:u,end:c}}var a=e.display,s=e.doc,u=document.createDocumentFragment(),c=Bt(e.display),l=c.left,p=Math.max(a.sizerWidth,Ut(e)-a.sizer.offsetLeft)-c.right,f="ltr"==s.direction,d=t.from(),h=t.to();if(d.line==h.line)o(d.line,d.ch,h.ch);else{var m=A(s,d.line),g=A(s,h.line),y=fe(m)==fe(g),v=o(d.line,d.ch,y?m.text.length+1:null).end,b=o(h.line,y?0:null,h.ch).start;y&&(v.top<b.top-2?(i(v.right,v.top,null,v.bottom),i(l,b.top,b.left,b.bottom)):i(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&i(l,v.bottom,null,b.top)}n.appendChild(u)}function In(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ln(e){e.state.focused||(e.display.input.focus(),Mn(e))}function Pn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,jn(e))},100)}function Mn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,s(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Ca&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),In(e))}function jn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,Ra(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Rn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=void 0;if(!i.hidden){if(ba&&xa<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-n,n=a}else{var s=i.node.getBoundingClientRect();o=s.bottom-s.top}var u=i.line.height-o;if(o<2&&(o=xn(t)),(u>.005||u<-.005)&&(O(i.line,o),Bn(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Bn(i.rest[c])}}}function Bn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function $n(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-jt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=N(t,r),a=N(t,i);if(n&&n.ensure){var s=n.ensure.from.line,u=n.ensure.to.line;s<o?(o=s,a=N(t,be(A(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=a&&(o=N(t,be(A(t,u))-e.wrapper.clientHeight),a=u)}return{from:o,to:Math.max(a,o+1)}}function Un(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Dn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var u=0;u<s.length;u++)s[u].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function zn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=L(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var o=i.measure.appendChild(r("div",[r("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,s=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ir(e),!0}return!1}function Gn(e,t){if(!_e(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Aa){var a=r("div","\u200b",null,"position: absolute;\n top: "+(t.top-n.viewOffset-jt(e.display))+"px;\n height: "+(t.bottom-t.top+$t(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Vn(e,t,n,r){null==r&&(r=0);var i;e.options.lineWrapping||t!=n||(t=t.ch?P(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?P(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=ln(e,t),u=n&&n!=t?ln(e,n):s;i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-r,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+r};var c=Hn(e,i),l=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=c.scrollTop&&(Zn(e,c.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(a=!0)),null!=c.scrollLeft&&(tr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function qn(e,t){var n=Hn(e,t);null!=n.scrollTop&&Zn(e,n.scrollTop),null!=n.scrollLeft&&tr(e,n.scrollLeft)}function Hn(e,t){var n=e.display,r=xn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=zt(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Rt(n),u=t.top<r,c=t.bottom>s-r;if(t.top<i)a.scrollTop=u?0:t.top;else if(t.bottom>i+o){var l=Math.min(t.top,(c?s:t.bottom)-o);l!=i&&(a.scrollTop=l)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Ut(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>f+p-3&&(a.scrollLeft=t.right+(d?0:10)-f),a}function Wn(e,t){null!=t&&(Yn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Qn(e){Yn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Kn(e,t,n){null==t&&null==n||Yn(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Jn(e,t){Yn(e),e.curOp.scrollToPos=t}function Yn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;Xn(e,pn(e,t.from),pn(e,t.to),t.margin)}}function Xn(e,t,n,r){var i=Hn(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});Kn(e,i.scrollLeft,i.scrollTop)}function Zn(e,t){Math.abs(e.doc.scrollTop-t)<2||(ma||Fr(e,{top:t}),er(e,t,!0),ma&&Fr(e),wr(e,100))}function er(e,t,n){t=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 tr(e,t,n,r){t=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,Un(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function nr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Rt(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+$t(e)+t.barHeight,nativeBarWidth:t.