antelope-ui
Version:
A Component Library for Vue.js.
2 lines • 267 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue/dist/vue.common")):"function"==typeof define&&define.amd?define(["exports","vue/dist/vue.common"],t):t(e.Vuep=e.Vuep||{},e.Vue)}(this,function(e,t){"use strict";function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e,t){var r=/(^|\})\s*([^{]+)/g;return e.trim().replace(r,function(e,r,n){return r?r+" "+t+" "+n:t+" "+n})}function i(){var e=document.querySelectorAll('link[rel="stylesheet"]'),t=document.querySelectorAll("style");return Array.from(e).concat(Array.from(t))}function o(e){if(v.test(e))return a(e)}function a(e){var t=new XMLHttpRequest;if(y[e])return y[e];t.open("GET",e,!1),t.send();var r=t.responseText;return y[e]=l(r),y[e]}function l(e,t){if(void 0===t&&(t={}),"undefined"!=typeof Babel){var r=[];window["babel-plugin-transform-vue-jsx"]&&(Babel.availablePlugins["transform-vue-jsx"]||Babel.registerPlugin("transform-vue-jsx",window["babel-plugin-transform-vue-jsx"]),r.push("transform-vue-jsx")),e=Babel.transform(e,{presets:[["es2015",{loose:!0}],"stage-2"],plugins:r,comments:!1}).code}var n="";for(var i in t)t.hasOwnProperty(i)&&(n+="var "+i+" = __vuep['"+i+"'];");e="(function(exports){var module={};module.exports=exports;"+n+";"+e+";return module.exports.__esModule?module.exports.default:module.exports;})({})";var o=new Function("__vuep","return "+e)(t)||{};return o}function s(e,t){w.config(t),e.component(w.name,w)}t="default"in t?t.default:t;var c="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},u=r(function(e,t){!function(r,n){"object"==typeof t&&"undefined"!=typeof e?e.exports=n():r.CodeMirror=n()}(c,function(){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 r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"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){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 o(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function a(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function l(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function s(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function c(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function u(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function d(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function f(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Sa.length<=e;)Sa.push(h(Sa)+" ");return Sa[e]}function h(e){return e[e.length-1]}function m(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function g(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function v(){}function y(e,t){var r;return Object.create?r=Object.create(e):(v.prototype=e,r=new v),t&&c(t,r),r}function b(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ma.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function k(e){return e.charCodeAt(0)>=768&&La.test(e)}function C(e,t,r){for(;(r<0?t>0:t<e.length)&&k(e.charAt(t));)t+=r;return t}function S(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function M(e,t,r){var i=this;this.input=r,i.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=n("div",null,"CodeMirror-code"),i.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=n("div",null,"CodeMirror-cursors"),i.measure=n("div",null,"CodeMirror-measure"),i.lineMeasure=n("div",null,"CodeMirror-measure"),i.lineSpace=n("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=n("div",[n("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=n("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=n("div",null,null,"position: absolute; height: "+ba+"px; width: 1px;"),i.gutters=n("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=n("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=n("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),Yo&&Zo<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),Qo||Ko&&aa||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function L(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function T(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function A(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function z(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function N(e){if(null==e.parent)return null;for(var t=e.parent,r=d(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function O(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function W(e,t){return t>=e.first&&t<e.first+e.size}function P(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function E(e,t,r){return void 0===r&&(r=null),this instanceof E?(this.line=e,this.ch=t,void(this.sticky=r)):new E(e,t,r)}function j(e,t){return e.line-t.line||e.ch-t.ch}function D(e,t){return e.sticky==t.sticky&&0==j(e,t)}function H(e){return E(e.line,e.ch)}function I(e,t){return j(e,t)<0?t:e}function F(e,t){return j(e,t)<0?e:t}function B(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function R(e,t){if(t.line<e.first)return E(e.first,0);var r=e.first+e.size-1;return t.line>r?E(r,L(e,r).text.length):$(t,L(e,t.line).text.length)}function $(e,t){var r=e.ch;return null==r||r>t?E(e.line,t):r<0?E(e.line,0):e}function q(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=R(e,t[n]);return r}function V(){Ta=!0}function U(){Aa=!0}function K(e,t,r){this.marker=e,this.from=t,this.to=r}function G(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function _(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function X(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Y(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new K(a,o.from,s?null:o.to))}}return n}function Z(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new K(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Q(e,t){if(t.full)return null;var r=W(e,t.from.line)&&L(e,t.from.line).markedSpans,n=W(e,t.to.line)&&L(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==j(t.from,t.to),l=Y(r,i,a),s=Z(n,o,a),c=1==t.text.length,u=h(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var p=G(s,f.marker);p?c&&(f.to=null==p.to?null:p.to+u):f.to=i}}if(s)for(var m=0;m<s.length;++m){var g=s[m];if(null!=g.to&&(g.to+=u),null==g.from){var v=G(l,g.marker);v||(g.from=u,c&&(l||(l=[])).push(g))}else g.from+=u,c&&(l||(l=[])).push(g)}l&&(l=J(l)),s&&s!=l&&(s=J(s));var y=[l];if(!c){var b,w=t.text.length-2;if(w>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(b||(b=[])).push(new K(l[x].marker,null,null));for(var k=0;k<w;++k)y.push(b);y.push(s)}return y}function J(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ee(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&d(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(j(c.to,l.from)<0||j(c.from,l.to)>0)){var u=[s,1],f=j(c.from,l.from),p=j(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function te(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function re(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ne(e){return e.inclusiveLeft?-1:0}function ie(e){return e.inclusiveRight?1:0}function oe(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=j(n.from,i.from)||ne(e)-ne(t);if(o)return-o;var a=j(n.to,i.to)||ie(e)-ie(t);return a?a:t.id-e.id}function ae(e,t){var r,n=Aa&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||oe(r,i.marker)<0)&&(r=i.marker);return r}function le(e){return ae(e,!0)}function se(e){return ae(e,!1)}function ce(e,t,r,n,i){var o=L(e,t),a=Aa&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=j(c.from,r)||ne(s.marker)-ne(i),d=j(c.to,n)||ie(s.marker)-ie(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?j(c.to,r)>=0:j(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?j(c.from,n)<=0:j(c.from,n)<0)))return!0}}}function ue(e){for(var t;t=le(e);)e=t.find(-1,!0).line;return e}function de(e){for(var t;t=se(e);)e=t.find(1,!0).line;return e}function fe(e){for(var t,r;t=se(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=L(e,t),n=ue(r);return r==n?t:N(n)}function he(e,t){if(t>e.lastLine())return t;var r,n=L(e,t);if(!me(e,n))return t;for(;r=se(n);)n=r.find(1,!0).line;return N(n)+1}function me(e,t){var r=Aa&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ge(e,t,n))return!0}}function ge(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ge(e,n.line,G(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.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==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ge(e,t,i))return!0}function ve(e){e=ue(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function ye(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=le(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=se(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function be(e){var t=e.display,r=e.doc;t.maxLine=L(r,r.first),t.maxLineLength=ye(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=ye(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function xe(e,t,r){var n;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"==r?n=i:za=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:za=i)}return null!=n?n:za}function ke(e){var t=e.order;return null==t&&(t=e.order=Na(e.text)),t}function Ce(e,t,r){var n=C(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Se(e,t,r){var n=Ce(e,t.ch,r);return null==n?null:new E(t.line,n,r<0?"after":"before")}function Me(e,t,r,n,i){if(e){var o=ke(r);if(o){var a,l=i<0?h(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Xt(t,r);a=i<0?r.text.length-1:0;var d=Yt(t,u,a).top;a=S(function(e){return Yt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Ce(r,a,1,!0))}else a=i<0?l.to:l.from;return new E(n,a,c)}}return new E(n,i<0?r.text.length:0,i<0?"before":"after")}function Le(e,t,r,n){var i=ke(t);if(!i)return Se(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=xe(i,r.ch,r.sticky),a=i[o];if(a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Se(t,r,n);var l,s=function(e,r){return Ce(t,e instanceof E?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||Xt(e,t),hr(e,t,l,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?s(r,-1):r.ch);if(a.level%2==1){var d=s(r,-n);if(null!=d&&(n>0?d>=a.from&&d>=u.begin:d<=a.to&&d<=u.end)){var f=n<0?"before":"after";return new E(r.line,d,f)}}var p=function(e,t,n){for(var o=function(e,t){return t?new E(r.line,s(e,1),"before"):new E(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},h=p(o+n,n,u);if(h)return h;var m=n>0?u.end:s(u.begin,-1);return null==m||n>0&&m==t.text.length||!(h=p(n>0?0:i.length-1,n,c(m)))?null:h}function Te(e,t){return e._handlers&&e._handlers[t]||Oa}function Ae(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=d(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ze(e,t){var r=Te(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ne(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ze(e,r||t.type,e,t),De(t)||t.codemirrorIgnore}function Oe(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)d(r,t[n])==-1&&r.push(t[n])}function We(e,t){return Te(e,t).length>0}function Pe(e){e.prototype.on=function(e,t){Wa(this,e,t)},e.prototype.off=function(e,t){Ae(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function je(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function He(e){Ee(e),je(e)}function Ie(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),la&&e.ctrlKey&&1==t&&(t=3),t}function Be(e){if(null==va){var t=n("span","");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(va=t.offsetWidth<=1&&t.offsetHeight>2&&!(Yo&&Zo<8))}var i=va?n("span",""):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Re(e){if(null!=ya)return ya;var n=r(e,document.createTextNode("AخA")),i=da(n,0,1).getBoundingClientRect(),o=da(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(ya=o.right-i.right<3)}function $e(e){if(null!=Ha)return Ha;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=da(t,0,1).getBoundingClientRect();return Ha=Math.abs(i.left-o.left)>1}function qe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ia[e]=t}function Ve(e,t){Fa[e]=t}function Ue(e){if("string"==typeof e&&Fa.hasOwnProperty(e))e=Fa[e];else if(e&&"string"==typeof e.name&&Fa.hasOwnProperty(e.name)){var t=Fa[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ke(e,t){t=Ue(t);var r=Ia[t.name];if(!r)return Ke(e,"text/plain");var n=r(e,t);if(Ba.hasOwnProperty(t.name)){var i=Ba[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function Ge(e,t){var r=Ba.hasOwnProperty(e)?Ba[e]:Ba[e]={};c(t,r)}function _e(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ye(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;ot(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)},l=0;l<e.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Je(e,N(t)),i=Ze(e,t,t.text.length>e.options.maxHighlightLength?_e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Je(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=at(e,t,r),a=o>n.first&&L(n,o-1).stateAfter;return a=a?_e(n.mode,a):Ye(n.mode),n.iter(o,t,function(r){et(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?_e(n.mode,a):null,++o}),r&&(n.frontier=o),a}function et(e,t,r,n){var i=e.doc.mode,o=new Ra(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&tt(i,r);!o.eol();)rt(i,o,r),o.start=o.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Xe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function rt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Xe(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function nt(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?_e(a.mode,u):u}},a=e.doc,l=a.mode;t=R(a,t);var s,c=L(a,t.line),u=Je(e,t.line,r),d=new Ra(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=rt(l,d,u),n&&s.push(o(!0));return n?s:o()}function it(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function ot(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Ra(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&it(tt(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&et(e,t,n,d.pos),d.pos=t.length,s=null):s=it(rt(r,d,n,f),o),f){var p=f[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);i(h,u),c=h}}function at(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=L(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=u(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function lt(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),te(e),re(e,r);var i=n?n(e):1;i!=e.height&&z(e,i)}function st(e){e.parent=null,te(e)}function ct(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Ua:Va;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ut(e,t){var r=n("span",null,null,Qo?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Yo||Qo)&&e.getOption("lineWrapping")};r.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),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;i.pos=0,i.addToken=ft,Re(e.display.measure)&&(s=ke(a))&&(i.addToken=ht(i.addToken,s)),i.map=[];var c=t!=e.display.externalMeasured&&N(a);gt(a,i,Qe(e,a,c)),a.styleClasses&&(a.styleClasses.bgClass&&(i.bgClass=l(a.styleClasses.bgClass,i.bgClass||"")),a.styleClasses.textClass&&(i.textClass=l(a.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Be(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Qo){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=l(i.pre.className,i.textClass||"")),i}function dt(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ft(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var h=u.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));Yo&&Zo<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",p(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=s.appendChild(n("span","\r"==h[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),Yo&&Zo<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),Yo&&Zo<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function ht(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function mt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function gt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;"bookmark"==k.type&&x.from==h&&k.widgetNode?y.push(k):x.from<=h&&(null==x.to||x.to>h||k.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==h&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||oe(f.marker,k)<0)&&(f=x)):x.from>h&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==h)for(var S=0;S<y.length;++S)mt(t,0,y[S]);if(f&&(f.from||0)==h){if(mt(t,(null==f.to?p+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=p)break;for(var M=Math.min(p,v);;){if(g){var L=h+g.length;if(!f){var T=L>M?g.slice(0,M-h):g;t.addToken(t,T,a?a+s:s,u,h+T.length==v?c:"",d,l)}if(L>=M){g=g.slice(M-h),h=M;break}h=L,u=""}g=i.slice(o,o=r[m++]),a=ct(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),ct(r[A+1],t.cm.options))}function vt(e,t,r){this.line=t,this.rest=fe(t),this.size=this.rest?N(h(this.rest))-r+1:1,this.node=this.text=null,this.hidden=me(e,t)}function yt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new vt(e.doc,L(e.doc,o),o);n=o+a.size,i.push(a)}return i}function bt(e){Ka?Ka.ops.push(e):e.ownsGroup=Ka={ops:[e],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function xt(e,t){var r=e.ownsGroup;if(r)try{wt(r)}finally{Ka=null,t(r)}}function kt(e,t){var r=Te(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Ka?n=Ka.delayedCallbacks:Ga?n=Ga:(n=Ga=[],setTimeout(Ct,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function Ct(){var e=Ga;Ga=null;for(var t=0;t<e.length;++t)e[t]()}function St(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?At(e,t):"gutter"==o?Nt(e,t,r,n):"class"==o?zt(t):"widget"==o&&Ot(e,t,n)}t.changes=null}function Mt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Yo&&Zo<8&&(e.node.style.zIndex=2)),e.node}function Lt(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=Mt(e);e.background=r.insertBefore(n("div",null,t),r.firstChild)}}function Tt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ut(e,t)}function At(e,t){var r=t.text.className,n=Tt(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,zt(t)):r&&(t.text.className=r)}function zt(e){Lt(e),e.line.wrapClass?Mt(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Nt(e,t,r,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=Mt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Mt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",P(e.options,r),"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 u=e.options.gutters[c],d=a.hasOwnProperty(u)&&a[u];d&&s.appendChild(n("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Ot(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);Pt(e,t,r)}function Wt(e,t,r,n){var i=Tt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),zt(t),Nt(e,t,r,n),Pt(e,t,n),t.node}function Pt(e,t,r){if(Et(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Et(e,t.rest[n],t,r,!1)}function Et(e,t,r,i,o){if(t.widgets)for(var a=Mt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),jt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),kt(c,"redraw")}}function jt(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Dt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!i(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function Ht(e,t){for(var r=Ie(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function It(e){return e.lineSpace.offsetTop}function Ft(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Bt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("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 Rt(e){return ba-e.display.nativeBarWidth}function $t(e){return e.display.scroller.clientWidth-Rt(e)-e.display.barWidth}
function qt(e){return e.display.scroller.clientHeight-Rt(e)-e.display.barHeight}function Vt(e,t,r){var n=e.options.lineWrapping,i=n&&$t(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Ut(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(N(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Kt(e,t){t=ue(t);var n=N(t),i=e.display.externalMeasured=new vt(e.doc,t,n);i.lineN=n;var o=i.built=ut(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Gt(e,t,r,n){return Yt(e,Xt(e,t),r,n)}function _t(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Cr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Xt(e,t){var r=N(t),n=_t(e,r);n&&!n.text?n=null:n&&n.changes&&(St(e,n,r,yr(e)),e.curOp.forceUpdate=!0),n||(n=Kt(e,t));var i=Ut(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Yt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Vt(e,t.view,t.rect),t.hasHeights=!0),o=Jt(e,t,r,n),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 Zt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Qt(e,t){var r=_a;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Jt(e,t,r,n){var i,o=Zt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&k(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&k(t.line.text.charAt(o.coverStart+s));)++s;if(i=Yo&&Zo<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Qt(da(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}Yo&&Zo<11&&(i=er(e.display.measure,i))}else{l>0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(Yo&&Zo<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+vr(e.display),top:f.top,bottom:f.bottom}:_a}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,b=g[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=p,w.rbottom=h),w}function er(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!$e(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function tr(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 rr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)tr(e.display.view[r])}function nr(e){rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ir(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function or(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ar(e,t,r,n,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=Dt(t.widgets[o]);r.top+=a,r.bottom+=a}if("line"==n)return r;n||(n="local");var l=ve(t);if("local"==n?l+=It(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:or());var c=s.left+("window"==n?0:ir());r.left+=c,r.right+=c}return r.top+=l,r.bottom+=l,r}function lr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=ir(),i-=or();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function sr(e,t,r,n,i){return n||(n=L(e.doc,t.line)),ar(e,n,Gt(e,n,t.ch,i),r)}function cr(e,t,r,n,i,o){function a(t,a){var l=Yt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,ar(e,n,l,r)}function l(e,t,r){var n=s[t],i=n.level%2!=0;return a(r?e-1:e,i!=r)}n=n||L(e.doc,t.line),i||(i=Xt(e,n));var s=ke(n),c=t.ch,u=t.sticky;if(c>=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var d=xe(s,c,u),f=za,p=l(c,d,"before"==u);return null!=f&&(p.other=l(c,f,"before"!=u)),p}function ur(e,t){var r=0;t=R(e.doc,t),e.options.lineWrapping||(r=vr(e.display)*t.ch);var n=L(e.doc,t.line),i=ve(n)+It(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function dr(e,t,r,n,i){var o=E(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function fr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return dr(n.first,0,null,!0,-1);var i=O(n,r),o=n.first+n.size-1;if(i>o)return dr(n.first+n.size-1,L(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=L(n,i);;){var l=mr(e,a,i,t,r),s=se(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=N(a=c.to.line)}}function pr(e,t,r,n){var i=function(n){return ar(e,t,Yt(e,r,n),"line")},o=t.text.length,a=S(function(e){return i(e-1).bottom<=n},o,0);return o=S(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function hr(e,t,r,n){var i=ar(e,t,Yt(e,r,n),"line").top;return pr(e,t,r,i)}function mr(e,t,r,n,i){i-=ve(t);var o,a=0,l=t.text.length,s=Xt(e,t),c=ke(t);if(c){if(e.options.lineWrapping){var u;u=pr(e,t,s,i),a=u.begin,l=u.end,u}o=new E(r,a);var d,f,p=cr(e,o,"line",t,s).left,h=p<n?1:-1,m=p-n;do{if(d=m,f=o,o=Le(e,t,o,h),null==o||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=f;break}m=cr(e,o,"line",t,s).left-n}while(h<0!=m<0&&Math.abs(m)<=Math.abs(d));if(Math.abs(m)>Math.abs(d)){if(m<0==d<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=f}}else{var g=S(function(r){var o=ar(e,t,Yt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.right<n)&&n-o.left<o.right-n)},a,l);g=C(t.text,g,1),o=new E(r,g,g==l?"before":"after")}var v=cr(e,o,"line",t,s);return(i<v.top||v.bottom<i)&&(o.outside=!0),o.xRel=n<v.left?-1:n>v.right?1:0,o}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==qa){qa=n("pre");for(var i=0;i<49;++i)qa.appendChild(document.createTextNode("x")),qa.appendChild(n("br"));qa.appendChild(document.createTextNode("x"))}r(e.measure,qa);var o=qa.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function vr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function yr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/vr(e.display)-3);return function(i){if(me(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 r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function xr(e){var t=e.doc,r=wr(e);t.iter(function(e){var t=r(e);t!=e.height&&z(e,t)})}function kr(e,t,r,n){var i=e.display;if(!r&&"true"==Ie(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,c=fr(e,o,a);if(n&&1==c.xRel&&(s=L(e.doc,c.line).text).length==c.ch){var d=u(s,s.length,e.options.tabSize)-s.length;c=E(c.line,Math.max(0,Math.round((o-Bt(e.display).left)/vr(e.display))-d))}return c}function Cr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Sr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t!==!1||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Lr(e,l.head,i),s||Tr(e,l,o)}}return n}function Lr(e,t,r){var i=cr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","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=r.appendChild(n("div"," ","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 Tr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?d-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return sr(e,E(t,r),"div",c,n)}var a,s,c=L(l,t),f=c.text.length;return we(ke(c),r||0,null==n?f:n,function(e,t,l){var c,p,h,m=o(e,"left");if(e==t)c=m,p=h=m.left;else{if(c=o(t-1,"right"),"rtl"==l){var g=m;m=c,c=g}p=m.left,h=c.right}null==r&&0==e&&(p=u),c.top-m.top>3&&(i(p,m.top,null,m.bottom),p=u,m.bottom<c.top&&i(p,m.bottom,null,c.top)),null==n&&t==f&&(h=d),(!a||m.top<a.top||m.top==a.top&&m.left<a.left)&&(a=m),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),p<u+1&&(p=u),i(p,c.top,h-p,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=Bt(e.display),u=c.left,d=Math.max(a.sizerWidth,$t(e)-a.sizer.offsetLeft)-c.right,f=t.from(),p=t.to();if(f.line==p.line)o(f.line,f.ch,p.ch);else{var h=L(l,f.line),m=L(l,p.line),g=ue(h)==ue(m),v=o(f.line,f.ch,g?h.text.length+1:null).end,y=o(p.line,g?0:null,p.ch).start;g&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function Ar(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function zr(e){e.state.focused||(e.display.input.focus(),Or(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Wr(e))},100)}function Or(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ze(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Qo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ar(e))}function Wr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,ha(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Er(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=P(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ln(e),!0}return!1}function jr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(Yo&&Zo<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=gr(t)),(s>.001||s<-.001)&&(z(i.line,o),Dr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Dr(i.rest[c])}}}function Dr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Hr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-It(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=O(t,n),a=O(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=O(t,ve(L(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=O(t,ve(L(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Ir(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Ko||Sn(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Ko&&Sn(e),bn(e,100))}function Fr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Pr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Rr(e){var t=Br(e);return t.x*=Ya,t.y*=Ya,t}function $r(e,t){var r=Br(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&la&&Qo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!Ko&&!ta&&null!=Ya)return i&&s&&Ir(e,Math.max(0,Math.min(a.scrollTop+i*Ya,a.scrollHeight-a.clientHeight))),Fr(e,Math.max(0,Math.min(a.scrollLeft+n*Ya,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&Ee(t),void(o.wheelStartX=null);if(i&&null!=Ya){var f=i*Ya,p=e.doc.scrollTop,h=p+o.wrapper.clientHeight;f<0?p=Math.max(0,p+f-50):h=Math.min(e.doc.height,h+f+50),Sn(e,{top:p,bottom:h})}Xa<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Ya=(Ya*Xa+r)/(Xa+1),++Xa)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function qr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ft(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?r:0,docHeight:n,scrollHeight:n+Rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Vr(e,t){t||(t=qr(e));var r=e.display.barWidth,n=e.display.barHeight;Ur(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&jr(e),Ur(e,qr(e)),r=e.display.barWidth,n=e.display.barHeight}function Ur(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function Kr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ha(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ja[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Wa(t,"mousedown",function(){e.state.focused&&setTimeout(fun