|
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SimpleMDE=e()}}(function(){return function e(t,n,r){function i(a,l){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function o(e,t,n){for(var r,o=[],a=t;a<n;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(i(r));return o.join("")}n.byteLength=function(e){return 3*e.length/4-r(e)},n.toByteArray=function(e){var t,n,i,o,a,c,u=e.length;a=r(e),c=new s(3*u/4-a),i=a>0?u-4:u;var f=0;for(t=0,n=0;t<i;t+=4,n+=3)o=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],c[f++]=o>>16&255,c[f++]=o>>8&255,c[f++]=255&o;return 2===a?(o=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,c[f++]=255&o):1===a&&(o=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,c[f++]=o>>8&255,c[f++]=255&o),c},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i="",l=[],s=0,c=n-r;s<c;s+=16383)l.push(o(e,s,s+16383>c?c:s+16383));return 1===r?(t=e[n-1],i+=a[t>>2],i+=a[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=a[t>>10],i+=a[t>>4&63],i+=a[t<<2&63],i+="="),l.push(i),l.join("")};for(var a=[],l=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=c.length;u<f;++u)a[u]=c[u],l[c.charCodeAt(u)]=u;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){"use strict";function r(e){if(e>K)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return s(e)}return o(e,t,n)}function o(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?f(e,t,n):"string"==typeof e?c(e,t):h(e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t,n){return a(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}function s(e){return a(e),r(e<0?0:0|d(e))}function c(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,t),o=r(n),a=o.write(e,t);return a!==n&&(o=o.slice(0,a)),o}function u(e){for(var t=e.length<0?0:0|d(e.length),n=r(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function f(e,t,n){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),r.__proto__=i.prototype,r}function h(e){if(i.isBuffer(e)){var t=0|d(e.length),n=r(t);return 0===n.length?n:(e.copy(n,0,0,t),n)}if(e){if(q(e)||"length"in e)return"number"!=typeof e.length||G(e.length)?r(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(e){if(e>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return 0|e}function p(e,t){if(i.isBuffer(e))return e.length;if(q(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return L(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,G(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,s/=2,n/=2}var c;if(i){var u=-1;for(c=n;c<l;c++)if(o(e,c)===o(t,-1===u?0:c-u)){if(-1===u&&(u=c),c-u+1===s)return u*a}else-1!==u&&(c-=c-u),u=-1}else for(n+s>l&&(n=l-s),c=n;c>=0;c--){for(var f=!0,h=0;h<s;h++)if(o(e,c+h)!==o(t,h)){f=!1;break}if(f)return c}return-1}function x(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var l=parseInt(t.substr(2*a,2),16);if(G(l))return a;e[n+a]=l}return a}function b(e,t,n,r){return U(F(t,e.length-n),e,n,r)}function w(e,t,n,r){return U(z(t),e,n,r)}function k(e,t,n,r){return w(e,t,n,r)}function C(e,t,n,r){return U(j(t),e,n,r)}function S(e,t,n,r){return U(_(t,e.length-n),e,n,r)}function L(e,t,n){return 0===t&&n===e.length?$.fromByteArray(e):$.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o=e[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=n){var s,c,u,f;switch(l){case 1:o<128&&(a=o);break;case 2:128==(192&(s=e[i+1]))&&(f=(31&o)<<6|63&s)>127&&(a=f);break;case 3:s=e[i+1],c=e[i+2],128==(192&s)&&128==(192&c)&&(f=(15&o)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=e[i+1],c=e[i+2],u=e[i+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=l}return M(r)}function M(e){var t=e.length;if(t<=X)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=X));return n}function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function E(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=P(e[o]);return i}function O(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function H(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function W(e,t,n,r,i){return t=+t,n>>>=0,i||H(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),V.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return t=+t,n>>>=0,i||H(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),V.write(e,t,n,r,52,8),n+8}function R(e){if((e=e.trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function P(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function _(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}function j(e){return $.toByteArray(R(e))}function U(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function q(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function G(e){return e!==e}var $=e("base64-js"),V=e("ieee754");n.Buffer=i,n.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},n.INSPECT_MAX_BYTES=50;var K=2147483647;n.kMaxLength=K,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,n){return o(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return l(e,t,n)},i.allocUnsafe=function(e){return s(e)},i.allocUnsafeSlow=function(e){return s(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=i.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):m.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e,t,n,r,o){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var a=o-r,l=n-t,s=Math.min(a,l),c=this.slice(r,o),u=e.slice(t,n),f=0;f<s;++f)if(c[f]!==u[f]){a=c[f],l=u[f];break}return a<l?-1:l<a?1:0},i.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},i.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},i.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},i.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=i.prototype,r},i.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},i.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),V.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),V.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),V.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),V.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},i.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=0,a=1,l=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=n-1,a=1,l=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,n){return W(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return W(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},i.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var l=i.isBuffer(e)?e:new i(e,r),s=l.length;for(a=0;a<n-t;++a)this[a+t]=l[a%s]}return this};var Y=/[^+/0-9A-Za-z-_]/g},{"base64-js":1,ieee754:15}],4:[function(e,t,n){"use strict";function r(e){"function"==typeof(e=e||{}).codeMirrorInstance&&"function"==typeof e.codeMirrorInstance.defineMode?(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),e.codeMirrorInstance.defineMode("spell-checker",function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,2==++r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,2==++r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var a='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',l={token:function(e){var t=e.peek(),n="";if(a.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!a.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},s=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(s,l,!0)})):console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`")}var i=e("typo-js");r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,t.exports=r},{"typo-js":17}],5:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})})},{"../../lib/codemirror":10}],6:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})})},{"../../lib/codemirror":10}],7:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=!1!==c.list,f=0!==c.quote,h=i.getLine(s.line),d=t.exec(h);if(!o[l].empty()||!u&&!f||!d)return void i.execCommand("newlineAndIndent");if(n.test(h))/>\s*$/.test(h)||i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1}),a[l]="\n";else{var p=d[1],m=d[5],g=r.test(d[2])||d[2].indexOf(">")>=0?d[2].replace("x"," "):parseInt(d[3],10)+1+d[4];a[l]="\n"+p+g+m}}i.replaceSelections(a)}})},{"../../lib/codemirror":10}],8:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var i,o;return t.blankLine&&(i=t.blankLine(e.base)),n.blankLine&&(o=n.blankLine(e.overlay)),null==o?i:r&&null!=i?i+" "+o:o}}}})},{"../../lib/codemirror":10}],9:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}(function(e){"use strict";function t(e){e.state.markedSelection&&e.operation(function(){a(e)})}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){i(e)})}function r(e,t,n,r){if(0!=c(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=t.line;;){var u=a==t.line?t:s(a,0),f=a+l,h=f>=n.line,d=h?n:s(f,0),p=e.markText(u,d,{className:o});if(null==r?i.push(p):i.splice(r++,0,p),h)break;a=f}}function i(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function o(e){i(e);for(var t=e.listSelections(),n=0;n<t.length;n++)r(e,t[n].from(),t[n].to())}function a(e){if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),a=e.state.markedSelection;if(!a.length)return r(e,t,n);var s=a[0].find(),u=a[a.length-1].find();if(!s||!u||n.line-t.line<l||c(t,u.to)>=0||c(n,s.from)<=0)return o(e);for(;c(t,s.from)>0;)a.shift().clear(),s=a[0].find();for(c(t,s.from)<0&&(s.to.line-t.line<l?(a.shift().clear(),r(e,t,s.to,0)):r(e,t,s.from,0));c(n,u.to)<0;)a.pop().clear(),u=a[a.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<l?(a.pop().clear(),r(e,u.from,n)):r(e,u.to,n))}e.defineOption("styleSelectedText",!1,function(r,a,l){var s=l&&l!=e.Init;a&&!s?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof a?a:"CodeMirror-selectedtext",o(r),r.on("cursorActivity",t),r.on("change",n)):!a&&s&&(r.off("cursorActivity",t),r.off("change",n),i(r),r.state.markedSelection=r.state.markedSelectionStyle=null)});var l=8,s=e.Pos,c=e.cmpPos})},{"../../lib/codemirror":10}],10:[function(e,t,n){!function(e,r){"object"==typeof n&&void 0!==t?t.exports=r():e.CodeMirror=r()}(this,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 l(t,n){var r=t.className;e(n).test(r)||(t.className+=(r?" ":"")+n)}function s(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 u(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 f(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 l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}function h(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 p(e){for(;Ea.length<=e;)Ea.push(m(Ea)+" ");return Ea[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 v(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function y(){}function x(e,t){var n;return Object.create?n=Object.create(e):(y.prototype=e,n=new y),t&&u(t,n),n}function b(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Oa.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function k(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function C(e){return e.charCodeAt(0)>=768&&Ia.test(e)}function S(e,t,n){for(;(n<0?t>0:t<e.length)&&C(e.charAt(t));)t+=n;return t}function L(e,t,n){for(;;){if(Math.abs(t-n)<=1)return e(t)?t:n;var r=Math.floor((t+n)/2);e(r)?n=r:t=r}}function T(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: "+La+"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"),ta&&na<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),ra||Zo&&ha||(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 M(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 N(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 A(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function E(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function O(e){if(null==e.parent)return null;for(var t=e.parent,n=h(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 I(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 l=e.lines[a].height;if(t<l)break;t-=l}return n+a}function D(e,t){return t>=e.first&&t<e.first+e.size}function H(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function W(e,t,n){if(void 0===n&&(n=null),!(this instanceof W))return new W(e,t,n);this.line=e,this.ch=t,this.sticky=n}function B(e,t){return e.line-t.line||e.ch-t.ch}function R(e,t){return e.sticky==t.sticky&&0==B(e,t)}function P(e){return W(e.line,e.ch)}function F(e,t){return B(e,t)<0?t:e}function z(e,t){return B(e,t)<0?e:t}function _(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function j(e,t){if(t.line<e.first)return W(e.first,0);var n=e.first+e.size-1;return t.line>n?W(n,M(e,n).text.length):U(t,M(e,t.line).text.length)}function U(e,t){var n=e.ch;return null==n||n>t?W(e.line,t):n<0?W(e.line,0):e}function q(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=j(e,t[r]);return n}function G(){Da=!0}function $(){Ha=!0}function V(e,t,n){this.marker=e,this.from=t,this.to=n}function K(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function X(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Y(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Z(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new V(a,o.from,l?null:o.to))}}return r}function J(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new V(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Q(e,t){if(t.full)return null;var n=D(e,t.from.line)&&M(e,t.from.line).markedSpans,r=D(e,t.to.line)&&M(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==B(t.from,t.to),l=Z(n,i,a),s=J(r,o,a),c=1==t.text.length,u=m(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var h=l[f];if(null==h.to){var d=K(s,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p];null!=g.to&&(g.to+=u),null==g.from?K(l,g.marker)||(g.from=u,c&&(l||(l=[])).push(g)):(g.from+=u,c&&(l||(l=[])).push(g))}l&&(l=ee(l)),s&&s!=l&&(s=ee(s));var v=[l];if(!c){var y,x=t.text.length-2;if(x>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(y||(y=[])).push(new V(l[b].marker,null,null));for(var w=0;w<x;++w)v.push(y);v.push(s)}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!=h(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],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(B(c.to,l.from)<0||B(c.from,l.to)>0)){var u=[s,1],f=B(c.from,l.from),d=B(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.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=B(r.from,i.from)||ie(e)-ie(t);if(o)return-o;var a=B(r.to,i.to)||oe(e)-oe(t);return a||t.id-e.id}function le(e,t){var n,r=Ha&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||ae(n,i.marker)<0)&&(n=i.marker);return n}function se(e){return le(e,!0)}function ce(e){return le(e,!1)}function ue(e,t,n,r,i){var o=M(e,t),a=Ha&&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=B(c.from,n)||ie(s.marker)-ie(i),f=B(c.to,r)||oe(s.marker)-oe(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?B(c.to,n)>=0:B(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?B(c.from,r)<=0:B(c.from,r)<0)))return!0}}}function fe(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function he(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function de(e){for(var t,n;t=ce(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function pe(e,t){var n=M(e,t),r=fe(n);return n==r?t:O(r)}function me(e,t){if(t>e.lastLine())return t;var n,r=M(e,t);if(!ge(e,r))return t;for(;n=ce(r);)r=n.find(1,!0).line;return O(r)+1}function ge(e,t){var n=Ha&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).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,K(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]).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 ye(e){for(var t=0,n=(e=fe(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 l=o.children[a];if(l==n)break;t+=l.height}return t}function xe(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=se(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,n+=(r=o.to.line).text.length-o.to.ch}return n}function be(e){var t=e.display,n=e.doc;t.maxLine=M(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 we(e,t,n,r){if(!e)return r(t,n,"ltr");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"),i=!0)}i||r(t,n,"ltr")}function ke(e,t,n){var r;Wa=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:Wa=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Wa=i)}return null!=r?r:Wa}function Ce(e,t){var n=e.order;return null==n&&(n=e.order=Ba(e.text,t)),n}function Se(e,t,n){var r=S(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Le(e,t,n){var r=Se(e,t.ch,n);return null==r?null:new W(t.line,r,n<0?"after":"before")}function Te(e,t,n,r,i){if(e){var o=Ce(n,t.doc.direction);if(o){var a,l=i<0?m(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0){var c=Xt(t,n);a=i<0?n.text.length-1:0;var u=Yt(t,c,a).top;a=L(function(e){return Yt(t,c,e).top==u},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Se(n,a,1))}else a=i<0?l.to:l.from;return new W(r,a,s)}}return new W(r,i<0?n.text.length:0,i<0?"before":"after")}function Me(e,t,n,r){var i=Ce(t,e.doc.direction);if(!i)return Le(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ke(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Le(t,n,r);var l,s=function(e,n){return Se(t,e instanceof W?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(l=l||Xt(e,t),mn(e,t,l,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==r<0,h=s(n,f?1:-1);if(null!=h&&(f?h<=a.to&&h<=u.end:h>=a.from&&h>=u.begin)){var d=f?"before":"after";return new W(n.line,h,d)}}var p=function(e,t,r){for(var o=function(e,t){return t?new W(n.line,s(e,1),"before"):new W(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?r.begin:s(r.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),r.begin<=c&&c<r.end)return o(c,l)}},m=p(o+r,r,u);if(m)return m;var g=r>0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}function Ne(e,t){return e._handlers&&e._handlers[t]||Ra}function Ae(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=h(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ee(e,t){var n=Ne(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 Oe(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ee(e,n||t.type,e,t),Re(t)||t.codemirrorIgnore}function Ie(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==h(n,t[r])&&n.push(t[r])}function De(e,t){return Ne(e,t).length>0}function He(e){e.prototype.on=function(e,t){Pa(this,e,t)},e.prototype.off=function(e,t){Ae(this,e,t)}}function We(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Be(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Re(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Pe(e){We(e),Be(e)}function Fe(e){return e.target||e.srcElement}function ze(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),da&&e.ctrlKey&&1==t&&(t=3),t}function _e(e){if(null==Ca){var t=r("span","");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ca=t.offsetWidth<=1&&t.offsetHeight>2&&!(ta&&na<8))}var i=Ca?r("span",""):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function je(e){if(null!=Sa)return Sa;var r=n(e,document.createTextNode("AخA")),i=va(r,0,1).getBoundingClientRect(),o=va(r,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Sa=o.right-i.right<3)}function Ue(e){if(null!=Ua)return Ua;var t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=va(t,0,1).getBoundingClientRect();return Ua=Math.abs(i.left-o.left)>1}function qe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),qa[e]=t}function Ge(e){if("string"==typeof e&&Ga.hasOwnProperty(e))e=Ga[e];else if(e&&"string"==typeof e.name&&Ga.hasOwnProperty(e.name)){var t=Ga[e.name];"string"==typeof t&&(t={name:t}),(e=x(t,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 $e(e,t){t=Ge(t);var n=qa[t.name];if(!n)return $e(e,"text/plain");var r=n(e,t);if($a.hasOwnProperty(t.name)){var i=$a[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 Ve(e,t){u(t,$a.hasOwnProperty(e)?$a[e]:$a[e]={})}function Ke(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 Xe(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 Ye(e,t,n){return!e.startState||e.startState(t,n)}function Ze(e,t,n,r){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a)!function(n){var r=e.state.overlays[n],a=1,l=0;ot(e,t.text,r.mode,!0,function(e,t){for(var n=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(r.opaque)i.splice(n,a-n,e,"overlay "+t),a=n+2;else for(;n<a;n+=2){var s=i[n+1];i[n+1]=(s?s+" ":"")+"overlay "+t}},o)}(a);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=Qe(e,O(t)),i=Ze(e,t,t.text.length>e.options.maxHighlightLength?Ke(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Qe(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=at(e,t,n),a=o>r.first&&M(r,o-1).stateAfter;return a=a?Ke(r.mode,a):Ye(r.mode),r.iter(o,t,function(n){et(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?Ke(r.mode,a):null,++o}),n&&(r.frontier=o),a}function et(e,t,n,r){var i=e.doc.mode,o=new Va(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&tt(i,n);!o.eol();)nt(i,o,n),o.start=o.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Xe(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function nt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Xe(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 rt(e,t,n,r){var i,o=function(e){return{start:f.start,end:f.pos,string:f.current(),type:i||null,state:e?Ke(a.mode,u):u}},a=e.doc,l=a.mode;t=j(a,t);var s,c=M(a,t.line),u=Qe(e,t.line,n),f=new Va(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,i=nt(l,f,u),r&&s.push(o(!0));return r?s:o()}function it(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 ot(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new Va(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&it(tt(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&et(e,t,r,f.pos),f.pos=t.length,s=null):s=it(nt(n,f,r,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!l||u!=s){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=s}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}function at(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=M(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=f(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function lt(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&&E(e,i)}function st(e){e.parent=null,ne(e)}function ct(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Za:Ya;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ut(e,t){var n=i("span",null,null,ra?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(ta||ra)&&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,l=void 0;r.pos=0,r.addToken=ht,je(e.display.measure)&&(l=Ce(a,e.doc.direction))&&(r.addToken=pt(r.addToken,l)),r.map=[],gt(a,r,Je(e,a,t!=e.display.externalMeasured&&O(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=s(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=s(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(_e(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(ra){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 Ee(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=s(r.pre.className,r.textClass||"")),r}function ft(e){var t=r("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ht(e,t,n,i,o,a,l){if(t){var s,c=e.splitSpaces?dt(t,e.trailingSpace):t,u=e.cm.state.specialChars,f=!1;if(u.test(t)){s=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var d=u.exec(t),m=d?d.index-h:t.length-h;if(m){var g=document.createTextNode(c.slice(h,h+m));ta&&na<9?s.appendChild(r("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!d)break;h+=m+1;var v=void 0;if("\t"==d[0]){var y=e.cm.options.tabSize,x=y-e.col%y;(v=s.appendChild(r("span",p(x),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=x}else"\r"==d[0]||"\n"==d[0]?((v=s.appendChild(r("span","\r"==d[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",d[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),ta&&na<9?s.appendChild(r("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),ta&&na<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||o||f||l){var b=n||"";i&&(b+=i),o&&(b+=o);var w=r("span",[s],b,l);return a&&(w.title=a),e.content.appendChild(w)}e.content.appendChild(s)}}function dt(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=" "),r+=o,n=" "==o}return r}function pt(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,h=0;h<t.length&&!((f=t[h]).to>c&&f.from<=c);h++);if(f.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,f.to-c),i,o,null,l,s),o=null,r=r.slice(f.to-c),c=f.to}}}function mt(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 gt(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,h,d=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=f=l="",h=null,v=1/0;for(var y=[],x=void 0,b=0;b<r.length;++b){var w=r[b],k=w.marker;"bookmark"==k.type&&w.from==p&&k.widgetNode?y.push(k):w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(x||(x=[])).push(k.endStyle,w.to),k.title&&!f&&(f=k.title),k.collapsed&&(!h||ae(h.marker,k)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(x)for(var C=0;C<x.length;C+=2)x[C+1]==v&&(c+=" "+x[C]);if(!h||h.from==p)for(var S=0;S<y.length;++S)mt(t,0,y[S]);if(h&&(h.from||0)==p){if(mt(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var L=Math.min(d,v);;){if(g){var T=p+g.length;if(!h){var M=T>L?g.slice(0,L-p):g;t.addToken(t,M,a?a+s:s,u,p+M.length==v?c:"",f,l)}if(T>=L){g=g.slice(L-p),p=L;break}p=T,u=""}g=i.slice(o,o=n[m++]),a=ct(n[m++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,i.slice(o,o=n[N]),ct(n[N+1],t.cm.options))}function vt(e,t,n){this.line=t,this.rest=de(t),this.size=this.rest?O(m(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ge(e,t)}function yt(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new vt(e.doc,M(e.doc,o),o);r=o+a.size,i.push(a)}return i}function xt(e){Ja?Ja.ops.push(e):e.ownsGroup=Ja={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 wt(e,t){var n=e.ownsGroup;if(n)try{bt(n)}finally{Ja=null,t(n)}}function kt(e,t){var n=Ne(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Ja?r=Ja.delayedCallbacks:Qa?r=Qa:(r=Qa=[],setTimeout(Ct,0));for(var o=0;o<n.length;++o)!function(e){r.push(function(){return n[e].apply(null,i)})}(o)}}function Ct(){var e=Qa;Qa=null;for(var t=0;t<e.length;++t)e[t]()}function St(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Nt(e,t):"gutter"==o?Et(e,t,n,r):"class"==o?At(e,t):"widget"==o&&Ot(e,t,r)}t.changes=null}function Lt(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),ta&&na<8&&(e.node.style.zIndex=2)),e.node}function Tt(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=Lt(t);t.background=i.insertBefore(r("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function Mt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ut(e,t)}function Nt(e,t){var n=t.text.className,r=Mt(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,At(e,t)):n&&(t.text.className=n)}function At(e,t){Tt(e,t),t.line.wrapClass?Lt(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 Et(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=Lt(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 l=Lt(t),s=t.gutter=r("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(r("div",H(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 u=e.options.gutters[c],f=a.hasOwnProperty(u)&&a[u];f&&s.appendChild(r("div",[f],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"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);Dt(e,t,n)}function It(e,t,n,r){var i=Mt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),At(e,t),Et(e,t,n,r),Dt(e,t,r),t.node}function Dt(e,t,n){if(Ht(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Ht(e,t.rest[r],t,n,!1)}function Ht(e,t,n,i,o){if(t.widgets)for(var a=Lt(n),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=r("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Wt(c,u,n,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,n.gutter||n.text):a.appendChild(u),kt(c,"redraw")}}function Wt(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 Bt(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 Rt(e,t){for(var n=Fe(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 Pt(e){return e.lineSpace.offsetTop}function Ft(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function zt(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 La-e.display.nativeBarWidth}function jt(e){return e.display.scroller.clientWidth-_t(e)-e.display.barWidth}function Ut(e){return e.display.scroller.clientHeight-_t(e)-e.display.barHeight}function qt(e,t,n){var r=e.options.lineWrapping,i=r&&jt(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(),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-n.top)}}o.push(n.bottom-n.top)}}function Gt(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(O(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function $t(e,t){var r=O(t=fe(t)),i=e.display.externalMeasured=new vt(e.doc,t,r);i.lineN=r;var o=i.built=ut(e,i);return i.text=o.pre,n(e.display.lineMeasure,o.pre),i}function Vt(e,t,n,r){return Yt(e,Xt(e,t),n,r)}function Kt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sn(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Xt(e,t){var n=O(t),r=Kt(e,n);r&&!r.text?r=null:r&&r.changes&&(St(e,r,n,xn(e)),e.curOp.forceUpdate=!0),r||(r=$t(e,t));var i=Gt(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Yt(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||(qt(e,t.view,t.rect),t.hasHeights=!0),(o=Qt(e,t,n,r)).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,n){for(var r,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?o=(i=t-l)+1:(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(r=e[c+2],l==s&&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==s-l)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:l,coverEnd:s}}function Jt(e,t){var n=el;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 Qt(e,t,n,r){var i,o=Zt(t.map,n,r),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&&C(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&C(t.line.text.charAt(o.coverStart+s));)++s;if((i=ta&&na<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Jt(va(a,l,s).getClientRects(),r)).left||i.right||0==l)break;s=l,l-=1,c="right"}ta&&na<11&&(i=en(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(ta&&na<9&&!l&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+yn(e.display),top:h.top,bottom:h.bottom}:el}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(d+p)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,x=g[v],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:x};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=d,b.rbottom=p),b}function en(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ue(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 tn(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 nn(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)tn(e.display.view[n])}function rn(e){nn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function on(){return oa&&fa?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function an(){return oa&&fa?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ln(e,t,n,r,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=Bt(t.widgets[o]);n.top+=a,n.bottom+=a}if("line"==r)return n;r||(r="local");var l=ye(t);if("local"==r?l+=Pt(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==r?0:an());var c=s.left+("window"==r?0:on());n.left+=c,n.right+=c}return n.top+=l,n.bottom+=l,n}function sn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=on(),i-=an();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=M(e.doc,t.line)),ln(e,r,Vt(e,r,t.ch,i),n)}function un(e,t,n,r,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,ln(e,r,l,n)}function l(e,t,n){var r=s[t].level%2!=0;return a(n?e-1:e,r!=n)}r=r||M(e.doc,t.line),i||(i=Xt(e,r));var s=Ce(r,e.doc.direction),c=t.ch,u=t.sticky;if(c>=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var f=ke(s,c,u),h=Wa,d=l(c,f,"before"==u);return null!=h&&(d.other=l(c,h,"before"!=u)),d}function fn(e,t){var n=0;t=j(e.doc,t),e.options.lineWrapping||(n=yn(e.display)*t.ch);var r=M(e.doc,t.line),i=ye(r)+Pt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function hn(e,t,n,r,i){var o=W(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 hn(r.first,0,null,!0,-1);var i=I(r,n),o=r.first+r.size-1;if(i>o)return hn(r.first+r.size-1,M(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=M(r,i);;){var l=gn(e,a,i,t,n),s=ce(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=O(a=c.to.line)}}function pn(e,t,n,r){var i=function(r){return ln(e,t,Yt(e,n,r),"line")},o=t.text.length,a=L(function(e){return i(e-1).bottom<=r},o,0);return o=L(function(e){return i(e).top>r},a,o),{begin:a,end:o}}function mn(e,t,n,r){return pn(e,t,n,ln(e,t,Yt(e,n,r),"line").top)}function gn(e,t,n,r,i){i-=ye(t);var o,a=0,l=t.text.length,s=Xt(e,t);if(Ce(t,e.doc.direction)){if(e.options.lineWrapping){var c;a=(c=pn(e,t,s,i)).begin,l=c.end}o=new W(n,a);var u,f,h=un(e,o,"line",t,s).left,d=h<r?1:-1,p=h-r;do{if(u=p,f=o,null==(o=Me(e,t,o,d))||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=f;break}p=un(e,o,"line",t,s).left-r}while(d<0!=p<0&&Math.abs(p)<=Math.abs(u));if(Math.abs(p)>Math.abs(u)){if(p<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=f}}else{var m=L(function(n){var o=ln(e,t,Yt(e,s,n),"line");return o.top>i?(l=Math.min(n,l),!0):!(o.bottom<=i)&&(o.left>r||!(o.right<r)&&r-o.left<o.right-r)},a,l);o=new W(n,m=S(t.text,m,1),m==l?"before":"after")}var g=un(e,o,"line",t,s);return(i<g.top||g.bottom<i)&&(o.outside=!0),o.xRel=r<g.left?-1:r>g.right?1:0,o}function vn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Xa){Xa=r("pre");for(var i=0;i<49;++i)Xa.appendChild(document.createTextNode("x")),Xa.appendChild(r("br"));Xa.appendChild(document.createTextNode("x"))}n(e.measure,Xa);var o=Xa.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function yn(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 xn(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:bn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function bn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wn(e){var t=vn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/yn(e.display)-3);return function(i){if(ge(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 kn(e){var t=e.doc,n=wn(e);t.iter(function(e){var t=n(e);t!=e.height&&E(e,t)})}function Cn(e,t,n,r){var i=e.display;if(!n&&"true"==Fe(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(t){return null}var s,c=dn(e,o,a);if(r&&1==c.xRel&&(s=M(e.doc,c.line).text).length==c.ch){var u=f(s,s.length,e.options.tabSize)-s.length;c=W(c.line,Math.max(0,Math.round((o-zt(e.display).left)/yn(e.display))-u))}return c}function Sn(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 Ln(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Tn(e,t){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(!1!==t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Mn(e,l.head,i),s||Nn(e,l,o)}}return r}function Mn(e,t,n){var i=un(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(r("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=n.appendChild(r("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 Nn(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?f-e:n)+"px;\n height: "+(i-t)+"px"))}function o(t,n,r){function o(n,r){return cn(e,W(t,n),"div",c,r)}var a,s,c=M(l,t),h=c.text.length;return we(Ce(c,l.direction),n||0,null==r?h:r,function(e,t,l){var c,d,p,m=o(e,"left");if(e==t)c=m,d=p=m.left;else{if(c=o(t-1,"right"),"rtl"==l){var g=m;m=c,c=g}d=m.left,p=c.right}null==n&&0==e&&(d=u),c.top-m.top>3&&(i(d,m.top,null,m.bottom),d=u,m.bottom<c.top&&i(d,m.bottom,null,c.top)),null==r&&t==h&&(p=f),(!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),d<u+1&&(d=u),i(d,c.top,p-d,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=zt(e.display),u=c.left,f=Math.max(a.sizerWidth,jt(e)-a.sizer.offsetLeft)-c.right,h=t.from(),d=t.to();if(h.line==d.line)o(h.line,h.ch,d.ch);else{var p=M(l,h.line),m=M(l,d.line),g=fe(p)==fe(m),v=o(h.line,h.ch,g?p.text.length+1:null).end,y=o(d.line,g?0:null,d.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)}n.appendChild(s)}function An(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 En(e){e.state.focused||(e.display.input.focus(),In(e))}function On(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Dn(e))},100)}function In(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ee(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),ra&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),An(e))}function Dn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ee(e,"blur",e,t),e.state.focused=!1,ba(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Hn(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(ta&&na<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-n,n=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=vn(t)),(s>.001||s<-.001)&&(E(i.line,o),Wn(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Wn(i.rest[c])}}}function Wn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Bn(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Pt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=I(t,r),a=I(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=I(t,ye(M(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=I(t,ye(M(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Rn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=bn(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 l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Pn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=H(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,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?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ar(e),!0}return!1}function Fn(e,t){if(!Oe(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&&!ca){var a=r("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Pt(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 zn(e,t,n,r){null==r&&(r=0);for(var i,o=0;o<5;o++){var a=!1,l=un(e,t),s=n&&n!=t?un(e,n):l,c=jn(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(Xn(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Zn(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}function _n(e,t){var n=jn(e,t);null!=n.scrollTop&&Xn(e,n.scrollTop),null!=n.scrollLeft&&Zn(e,n.scrollLeft)}function jn(e,t){var n=e.display,r=vn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Ut(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ft(n),s=t.top<r,c=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,h=jt(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>h+f-3&&(a.scrollLeft=t.right+(d?0:10)-h),a}function Un(e,t){null!=t&&(Vn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function qn(e){Vn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?W(t.line,t.ch-1):t,r=W(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin}}function Gn(e,t,n){null==t&&null==n||Vn(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function $n(e,t){Vn(e),e.curOp.scrollToPos=t}function Vn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Kn(e,fn(e,t.from),fn(e,t.to),t.margin))}function Kn(e,t,n,r){var i=jn(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});Gn(e,i.scrollLeft,i.scrollTop)}function Xn(e,t){Math.abs(e.doc.scrollTop-t)<2||(Zo||Mr(e,{top:t}),Yn(e,t,!0),Zo&&Mr(e),br(e,100))}function Yn(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 Zn(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,Rn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Jn(e){var t=e.display,n=t.gutters.offsetWidth,r=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?n:0,docHeight:r,scrollHeight:r+_t(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Qn(e,t){t||(t=Jn(e));var n=e.display.barWidth,r=e.display.barHeight;er(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Hn(e),er(e,Jn(e)),n=e.display.barWidth,r=e.display.barHeight}function er(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function tr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ba(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new rl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pa(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Zn(e,t):Xn(e,t)},e),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)}function nr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++il},xt(e.curOp)}function rr(e){wt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ir(e)})}function ir(e){for(var t=e.ops,n=0;n<t.length;n++)or(t[n]);for(var r=0;r<t.length;r++)ar(t[r]);for(var i=0;i<t.length;i++)lr(t[i]);for(var o=0;o<t.length;o++)sr(t[o]);for(var a=0;a<t.length;a++)cr(t[a])}function or(e){var t=e.cm,n=t.display;kr(t),e.updateMaxLine&&be(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ol(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ar(e){e.updatedDisplay=e.mustUpdate&&Lr(e.cm,e.update)}function lr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Hn(t),e.barMeasure=Jn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Vt(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+_t(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-jt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function sr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Zn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==a()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Qn(t,e.barMeasure),e.updatedDisplay&&Er(t,e.barMeasure),e.selectionChanged&&An(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&En(e.cm)}function cr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Tr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Yn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Zn(t,e.scrollLeft,!0,!0),e.scrollToPos&&Fn(t,zn(t,j(r,e.scrollToPos.from),j(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||Ee(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Ee(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ee(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ur(e,t){if(e.curOp)return t();nr(e);try{return t()}finally{rr(e)}}function fr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);nr(e);try{return t.apply(e,arguments)}finally{rr(e)}}}function hr(e){return function(){if(this.curOp)return e.apply(this,arguments);nr(this);try{return e.apply(this,arguments)}finally{rr(this)}}}function dr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);nr(t);try{return e.apply(this,arguments)}finally{rr(t)}}}function pr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ha&&pe(e.doc,t)<i.viewTo&&gr(e);else if(n<=i.viewFrom)Ha&&me(e.doc,n+r)>i.viewFrom?gr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)gr(e);else if(t<=i.viewFrom){var o=vr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):gr(e)}else if(n>=i.viewTo){var a=vr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):gr(e)}else{var l=vr(e,t,t,-1),s=vr(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(yt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):gr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function mr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Sn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==h(a,n)&&a.push(n)}}}function gr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vr(e,t,n,r){var i,o=Sn(e,t),a=e.display.view;if(!Ha||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;pe(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function yr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=yt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=yt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Sn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(yt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Sn(e,n)))),r.viewTo=n}function xr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function br(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,c(wr,e))}function wr(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ke(t.mode,Qe(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Ze(e,o,l?Ke(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(t.frontier),o.stateAfter=l?r:Ke(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&et(e,o.text,r),o.stateAfter=t.frontier%5==0?Ke(t.mode,r):null;if(++t.frontier,+new Date>n)return br(e,e.options.workDelay),!0}),i.length&&ur(e,function(){for(var t=0;t<i.length;t++)mr(e,i[t],"text")})}}function kr(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=_t(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=_t(e)+"px",t.scrollbarsClipped=!0)}function Cr(e){if(e.hasFocus())return null;var t=a();if(!t||!o(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&o(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Sr(e){if(e&&e.activeElt&&e.activeElt!=a()&&(e.activeElt.focus(),e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Lr(e,n){var r=e.display,i=e.doc;if(n.editorIsHidden)return gr(e),!1;if(!n.force&&n.visible.from>=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==xr(e))return!1;Pn(e)&&(gr(e),n.dims=xn(e));var o=i.first+i.size,a=Math.max(n.visible.from-e.options.viewportMargin,i.first),l=Math.min(o,n.visible.to+e.options.viewportMargin);r.viewFrom<a&&a-r.viewFrom<20&&(a=Math.max(i.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(o,r.viewTo)),Ha&&(a=pe(e.doc,a),l=me(e.doc,l));var s=a!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;yr(e,a,l),r.viewOffset=ye(M(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=xr(e);if(!s&&0==c&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Cr(e);return c>4&&(r.lineDiv.style.display="none"),Nr(e,r.updateLineNumbers,n.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Sr(u),t(r.cursorDiv),t(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,br(e,400)),r.updateLineNumbers=null,!0}function Tr(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=jt(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ft(e.display)-Ut(e),n.top)}),t.visible=Bn(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Lr(e,t);r=!1){Hn(e);var i=Jn(e);Ln(e),Qn(e,i),Er(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Mr(e,t){var n=new ol(e,t);if(Lr(e,n)){Hn(e),Tr(e,n);var r=Jn(e);Ln(e),Qn(e,r),Er(e,r),n.finish()}}function Nr(e,n,r){function i(t){var n=t.nextSibling;return ra&&da&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,f=0;f<c.length;f++){var d=c[f];if(d.hidden);else if(d.node&&d.node.parentNode==l){for(;s!=d.node;)s=i(s);var p=a&&null!=n&&n<=u&&d.lineNumber;d.changes&&(h(d.changes,"gutter")>-1&&(p=!1),St(e,d,u,r)),p&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(H(e.options,u)))),s=d.node.nextSibling}else{var m=It(e,d,u,r);l.insertBefore(m,s)}u+=d.size}for(;s;)s=i(s)}function Ar(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Er(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+_t(e)+"px"}function Or(e){var n=e.display.gutters,i=e.options.gutters;t(n);for(var o=0;o<i.length;++o){var a=i[o],l=n.appendChild(r("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}n.style.display=o?"":"none",Ar(e)}function Ir(e){var t=h(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Dr(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Hr(e){var t=Dr(e);return t.x*=ll,t.y*=ll,t}function Wr(e,t){var n=Dr(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&l||i&&s){if(i&&da&&ra)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f<u.length;f++)if(u[f].node==c){e.display.currentWheelTarget=c;break e}if(r&&!Zo&&!aa&&null!=ll)return i&&s&&Xn(e,Math.max(0,a.scrollTop+i*ll)),Zn(e,Math.max(0,a.scrollLeft+r*ll)),(!i||i&&s)&&We(t),void(o.wheelStartX=null);if(i&&null!=ll){var h=i*ll,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;h<0?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),Mr(e,{top:d,bottom:p})}al<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(ll=(ll*al+n)/(al+1),++al)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function Br(e,t){var n=e[t];e.sort(function(e,t){return B(e.from(),t.from())}),t=h(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(B(o.to(),i.from())>=0){var a=z(o.from(),i.from()),l=F(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new cl(s?l:a,s?a:l))}}return new sl(e,t)}function Rr(e,t){return new sl([new cl(e,t||e)],0)}function Pr(e){return e.text?W(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Fr(e,t){if(B(e,t.from)<0)return e;if(B(e,t.to)<=0)return Pr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Pr(t).ch-t.to.ch),W(n,r)}function zr(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new cl(Fr(i.anchor,t),Fr(i.head,t)))}return Br(n,e.sel.primIndex)}function _r(e,t,n){return e.line==t.line?W(n.line,e.ch-t.ch+n.ch):W(n.line+(e.line-t.line),e.ch)}function jr(e,t,n){for(var r=[],i=W(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=_r(l.from,i,o),c=_r(Pr(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=B(u.head,u.anchor)<0;r[a]=new cl(f?c:s,f?s:c)}else r[a]=new cl(s,s)}return new sl(r,e.sel.primIndex)}function Ur(e){e.doc.mode=$e(e.options,e.doc.modeOption),qr(e)}function qr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,br(e,100),e.state.modeGen++,e.curOp&&pr(e)}function Gr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==m(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function $r(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){lt(e,n,i,r),kt(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Ka(c[o],i(o),r));return n}var l=t.from,s=t.to,c=t.text,u=M(e,l.line),f=M(e,s.line),h=m(c),d=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,t)){var g=a(0,c.length-1);o(f,f.text,d),p&&e.remove(l.line,p),g.length&&e.insert(l.line,g)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+h+u.text.slice(s.ch),d);else{var v=a(1,c.length-1);v.push(new Ka(h+u.text.slice(s.ch),d,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,h+f.text.slice(s.ch),d);var y=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,y)}kt(e,"change",e,t)}function Vr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Kr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,kn(e),Ur(e),Xr(e),e.options.lineWrapping||be(e),e.options.mode=t.modeOption,pr(e)}function Xr(e){("rtl"==e.doc.direction?l:ba)(e.display.lineDiv,"CodeMirror-rtl")}function Yr(e){ur(e,function(){Xr(e),pr(e)})}function Zr(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Jr(e,t){var n={from:P(t.from),to:Pr(t),text:N(e,t.from,t.to)};return oi(e,n,t.from.line,t.to.line+1),Vr(e,function(e){return oi(e,n,t.from.line,t.to.line+1)},!0),n}function Qr(e){for(;e.length&&m(e).ranges;)e.pop()}function ei(e,t){return t?(Qr(e.done),m(e.done)):e.done.length&&!m(e.done).ranges?m(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}function ti(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ei(i,i.lastOp==r)))a=m(o.changes),0==B(t.from,t.to)&&0==B(t.from,a.to)?a.to=Pr(t):o.changes.push(Jr(e,t));else{var s=m(i.done);for(s&&s.ranges||ii(e.sel,i.done),o={changes:[Jr(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ee(e,"historyAdded")}function ni(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ri(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ni(e,o,m(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Qr(i.undone)}function ii(e,t){var n=m(t);n&&n.ranges&&n.equals(e)||t.push(e)}function oi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function ai(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function li(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(ai(n[i]));return r}function si(e,t){var n=li(e,t),r=Q(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function ci(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?sl.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&h(t,Number(u[1]))>-1&&(m(l)[f]=c[f],delete c[f])}}}return r}function ui(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=B(n,i)<0;o!=B(r,i)<0?(i=n,n=r):o!=B(n,r)<0&&(n=r)}return new cl(i,n)}return new cl(r||n,n)}function fi(e,t,n,r){vi(e,new sl([ui(e,e.sel.primary(),t,n)],0),r)}function hi(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=ui(e,e.sel.ranges[i],t[i],null);vi(e,Br(r,e.sel.primIndex),n)}function di(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,vi(e,Br(i,e.sel.primIndex),r)}function pi(e,t,n,r){vi(e,Rr(t,n),r)}function mi(e,t,n){var r={ranges:t.ranges,update:function(t){var n=this;this.ranges=[];for(var r=0;r<t.length;r++)n.ranges[r]=new cl(j(e,t[r].anchor),j(e,t[r].head))},origin:n&&n.origin};return Ee(e,"beforeSelectionChange",e,r),e.cm&&Ee(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Br(r.ranges,r.ranges.length-1):t}function gi(e,t,n){var r=e.history.done,i=m(r);i&&i.ranges?(r[r.length-1]=t,yi(e,t,n)):vi(e,t,n)}function vi(e,t,n){yi(e,t,n),ri(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function yi(e,t,n){(De(e,"beforeSelectionChange")||e.cm&&De(e.cm,"beforeSelectionChange"))&&(t=mi(e,t,n)),xi(e,wi(e,t,n&&n.bias||(B(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),n&&!1===n.scroll||!e.cm||qn(e.cm)}function xi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ie(e.cm)),kt(e,"cursorActivity",e))}function bi(e){xi(e,wi(e,e.sel,null,!1))}function wi(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ci(e,a.anchor,l&&l.anchor,n,r),c=Ci(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new cl(s,c))}return i?Br(i,t.primIndex):t}function ki(e,t,n,r,i){var o=M(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Ee(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),u=void 0;if((r<0?s.inclusiveRight:s.inclusiveLeft)&&(c=Si(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=B(c,n))&&(r<0?u<0:u>0))return ki(e,c,t,r,i)}var f=s.find(r<0?-1:1);return(r<0?s.inclusiveLeft:s.inclusiveRight)&&(f=Si(e,f,r,f.line==t.line?o:null)),f?ki(e,f,t,r,i):null}}return t}function Ci(e,t,n,r,i){var o=r||1,a=ki(e,t,n,o,i)||!i&&ki(e,t,n,o,!0)||ki(e,t,n,-o,i)||!i&&ki(e,t,n,-o,!0);return a||(e.cantEdit=!0,W(e.first,0))}function Si(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?j(e,W(t.line-1)):null:n>0&&t.ch==(r||M(e,t.line)).text.length?t.line<e.first+e.size-1?W(t.line+1,0):null:new W(t.line,t.ch+n)}function Li(e){e.setSelection(W(e.firstLine(),0),W(e.lastLine()),Ma)}function Ti(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=j(e,t)),n&&(r.to=j(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),Ee(e,"beforeChange",e,r),e.cm&&Ee(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Mi(e,t,n){if(e.cm){if(!e.cm.curOp)return fr(e.cm,Mi)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"))||(t=Ti(e,t,!0))){var r=Da&&!n&&te(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Ni(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Ni(e,t)}}function Ni(e,t){if(1!=t.text.length||""!=t.text[0]||0!=B(t.from,t.to)){var n=zr(e,t);ti(e,t,n,e.cm?e.cm.curOp.id:NaN),Oi(e,t,n,Q(e,t));var r=[];Vr(e,function(e,n){n||-1!=h(r,e.history)||(Bi(e.history,t),r.push(e.history)),Oi(e,t,null,Q(e,t))})}}function Ai(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;(r=a.pop()).ranges;){if(ii(r,l),n&&!r.equals(e.sel))return void vi(e,r,{clearRedo:!1});o=r}var c=[];ii(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"),f=r.changes.length-1;f>=0;--f){var d=function(n){var i=r.changes[n];if(i.origin=t,u&&!Ti(e,i,!1))return a.length=0,{};c.push(Jr(e,i));var o=n?zr(e,i):m(a);Oi(e,i,o,si(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Pr(i)});var l=[];Vr(e,function(e,t){t||-1!=h(l,e.history)||(Bi(e.history,i),l.push(e.history)),Oi(e,i,null,si(e,i))})}(f);if(d)return d.v}}}}function Ei(e,t){if(0!=t&&(e.first+=t,e.sel=new sl(g(e.sel.ranges,function(e){return new cl(W(e.anchor.line+t,e.anchor.ch),W(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)mr(e.cm,r,"gutter")}}function Oi(e,t,n,r){if(e.cm&&!e.cm.curOp)return fr(e.cm,Oi)(e,t,n,r);if(t.to.line<e.first)Ei(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ei(e,i),t={from:W(e.first,0),to:W(t.to.line+i,t.to.ch),text:[m(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:W(o,M(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=N(e,t.from,t.to),n||(n=zr(e,t)),e.cm?Ii(e.cm,t,r):$r(e,t,r),yi(e,n,Ma)}}function Ii(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=O(fe(M(r,o.line))),r.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ie(e),$r(r,t,n,wn(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(e){var t=xe(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,o.line),br(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pr(e):o.line!=a.line||1!=t.text.length||Gr(e.doc,t)?pr(e,o.line,a.line+1,c):mr(e,o.line,"text");var u=De(e,"changes"),f=De(e,"change");if(f||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&kt(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Di(e,t,n,r,i){if(r||(r=n),B(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Mi(e,{from:n,to:r,text:t,origin:i})}function Hi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Wi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)Hi(o.ranges[l].anchor,t,n,r),Hi(o.ranges[l].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=W(c.from.line+r,c.from.ch),c.to=W(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Bi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Wi(e.done,n,r,i),Wi(e.undone,n,r,i)}function Ri(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=M(e,_(e,t)):i=O(t),null==i?null:(r(o,i)&&e.cm&&mr(e.cm,i,n),o)}function Pi(e,t,n){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Un(e,n)}function Fi(e,t,n,r){var i=new hl(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ri(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ge(e,t)){var r=ye(t)<e.scrollTop;E(t,t.height+Bt(i)),r&&Un(o,i.height),o.curOp.forceUpdate=!0}return!0}),kt(o,"lineWidgetAdded",o,i,"number"==typeof t?t:O(t)),i}function zi(e,t,n,r,o){if(r&&r.shared)return _i(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return fr(e.cm,zi)(e,t,n,r,o);var a=new pl(e,o),l=B(t,n);if(r&&u(r,a,!1),l>0||0==l&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ue(e,t.line,t,n,a)||t.line!=n.line&&ue(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");$()}a.addToHistory&&ti(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,c=t.line,f=e.cm;if(e.iter(c,n.line+1,function(e){f&&a.collapsed&&!f.options.lineWrapping&&fe(e)==f.display.maxLine&&(s=!0),a.collapsed&&c!=t.line&&E(e,0),Y(e,new V(a,c==t.line?t.ch:null,c==n.line?n.ch:null)),++c}),a.collapsed&&e.iter(t.line,n.line+1,function(t){ge(e,t)&&E(t,0)}),a.clearOnEnter&&Pa(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(G(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++dl,a.atomic=!0),f){if(s&&(f.curOp.updateMaxLine=!0),a.collapsed)pr(f,t.line,n.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var h=t.line;h<=n.line;h++)mr(f,h,"text");a.atomic&&bi(f.doc),kt(f,"markerAdded",f,a)}return a}function _i(e,t,n,r,i){(r=u(r)).shared=!1;var o=[zi(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Vr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(zi(e,j(e,t),j(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=m(o)}),new ml(o,a)}function ji(e){return e.findMarks(W(e.first,0),e.clipPos(W(e.lastLine())),function(e){return e.parent})}function Ui(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(B(o,a)){var l=zi(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function qi(e){for(var t=0;t<e.length;t++)!function(t){var n=e[t],r=[n.primary.doc];Vr(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==h(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}(t)}function Gi(e){var t=this;if(Ki(t),!Oe(t,e)&&!Rt(t.display,e)){We(e),ta&&(yl=+new Date);var n=Cn(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=0;l<i;++l)!function(e,r){if(!t.options.allowDropFileTypes||-1!=h(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=fr(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){var s={from:n=j(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Mi(t.doc,s),gi(t.doc,Rr(n,Pr(s)))}}),l.readAsText(e)}}(r[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var s=e.dataTransfer.getData("Text");if(s){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),yi(t.doc,Rr(n,n)),c)for(var u=0;u<c.length;++u)Di(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function $i(e,t){if(ta&&(!e.state.draggingText||+new Date-yl<100))Pe(t);else if(!Oe(e,t)&&!Rt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!la)){var n=r("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",aa&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),aa&&n.parentNode.removeChild(n)}}function Vi(e,t){var i=Cn(e,t);if(i){var o=document.createDocumentFragment();Mn(e,i,o),e.display.dragCursor||(e.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),n(e.display.dragCursor,o)}}function Ki(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Xi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Yi(){xl||(Zi(),xl=!0)}function Zi(){var e;Pa(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Xi(Ji)},100))}),Pa(window,"blur",function(){return Xi(Dn)})}function Ji(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Qi(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function eo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=g(n.split(" "),Qi),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function to(e,t,n,r){var i=(t=io(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return to(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=to(e,t.fallthrough[o],n,r);if(a)return a}}}function no(e){var t="string"==typeof e?e:bl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function ro(e,t){if(aa&&34==e.keyCode&&e.char)return!1;var n=bl[e.keyCode],r=n;return null!=r&&!e.altGraphKey&&(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(ya?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(ya?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)}function io(e){return"string"==typeof e?Sl[e]:e}function oo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&B(o.from,m(r).to)<=0;){var a=r.pop();if(B(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ur(e,function(){for(var t=r.length-1;t>=0;t--)Di(e.doc,"",r[t].from,r[t].to,"+delete");qn(e)})}function ao(e,t){var n=M(e.doc,t),r=fe(n);return r!=n&&(t=O(r)),Te(!0,e,r,t,1)}function lo(e,t){var n=M(e.doc,t),r=he(n);return r!=n&&(t=O(r)),Te(!0,e,n,t,-1)}function so(e,t){var n=ao(e,t.line),r=M(e.doc,n.line),i=Ce(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return W(n.line,a?0:o,n.sticky)}return n}function co(e,t,n){if("string"==typeof t&&!(t=Ml[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ta}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function uo(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=to(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&to(t,e.options.extraKeys,n,e)||to(t,e.options.keyMap,n,e)}function fo(e,t,n,r){var i=e.state.keySeq;if(i){if(no(t))return"handled";Nl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=uo(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&kt(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(We(n),An(e)),i&&!o&&/\'$/.test(t)?(We(n),!0):!!o}function ho(e,t){var n=ro(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?fo(e,"Shift-"+n,t,function(t){return co(e,t,!0)})||fo(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return co(e,t)}):fo(e,n,t,function(t){return co(e,t)}))}function po(e,t,n){return fo(e,"'"+n+"'",t,function(t){return co(e,t,!0)})}function mo(e){var t=this;if(t.curOp.focus=a(),!Oe(t,e)){ta&&na<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=ho(t,e);aa&&(Al=r?n:null,!r&&88==n&&!ja&&(da?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||go(t)}}function go(e){function t(e){18!=e.keyCode&&e.altKey||(ba(n,"CodeMirror-crosshair"),Ae(document,"keyup",t),Ae(document,"mouseover",t))}var n=e.display.lineDiv;l(n,"CodeMirror-crosshair"),Pa(document,"keyup",t),Pa(document,"mouseover",t)}function vo(e){16==e.keyCode&&(this.doc.sel.shift=!1),Oe(this,e)}function yo(e){var t=this;if(!(Rt(t.display,e)||Oe(t,e)||e.ctrlKey&&!e.altKey||da&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(aa&&n==Al)return Al=null,void We(e);if(!aa||e.which&&!(e.which<10)||!ho(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(po(t,e,i)||t.display.input.onKeyPress(e))}}}function xo(e){var t=this,n=t.display;if(!(Oe(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Rt(n,e))ra||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!So(t,e)){var r=Cn(t,e);switch(window.focus(),ze(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?bo(t,e,r):Fe(e)==n.scroller&&We(e);break;case 2:ra&&(t.state.lastMiddleDown=+new Date),r&&fi(t.doc,r),setTimeout(function(){return n.input.focus()},20),We(e);break;case 3:xa?Lo(t,e):On(t)}}}function bo(e,t,n){ta?setTimeout(c(En,e),0):e.curOp.focus=a();var r,i=+new Date;Tl&&Tl.time>i-400&&0==B(Tl.pos,n)?r="triple":Ll&&Ll.time>i-400&&0==B(Ll.pos,n)?(r="double",Tl={time:i,pos:n}):(r="single",Ll={time:i,pos:n});var o,l=e.doc.sel,s=da?t.metaKey:t.ctrlKey;e.options.dragDrop&&Fa&&!e.isReadOnly()&&"single"==r&&(o=l.contains(n))>-1&&(B((o=l.ranges[o]).from(),n)<0||n.xRel>0)&&(B(o.to(),n)>0||n.xRel<0)?wo(e,t,n,s):ko(e,t,n,r,s)}function wo(e,t,n,r){var i=e.display,o=!1,a=fr(e,function(t){ra&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ae(document,"mouseup",a),Ae(document,"mousemove",l),Ae(i.scroller,"dragstart",s),Ae(i.scroller,"drop",a),o||(We(t),r||fi(e.doc,n),ra||ta&&9==na?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),l=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return o=!0};ra&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=da?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Pa(document,"mouseup",a),Pa(document,"mousemove",l),Pa(i.scroller,"dragstart",s),Pa(i.scroller,"drop",a),On(e),setTimeout(function(){return i.input.focus()},20)}function ko(e,t,n,r,i){function o(t){if(0!=B(x,t))if(x=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=f(M(u,n.line).text,n.ch,o),l=f(M(u,t.line).text,t.ch,o),s=Math.min(a,l),c=Math.max(a,l),g=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=v;g++){var y=M(u,g).text,b=d(y,s,o);s==c?i.push(new cl(W(g,b),W(g,b))):y.length>b&&i.push(new cl(W(g,b),W(g,d(y,c,o))))}i.length||i.push(new cl(n,n)),vi(u,Br(m.ranges.slice(0,p).concat(i),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var w=h,k=w.anchor,C=t;if("single"!=r){var S;B((S="double"==r?e.findWordAt(t):new cl(W(t.line,0),j(u,W(t.line+1,0)))).anchor,k)>0?(C=S.head,k=z(w.from(),S.anchor)):(C=S.anchor,k=F(w.to(),S.head))}var L=m.ranges.slice(0);L[p]=new cl(j(u,k),C),vi(u,Br(L,p),Na)}}function l(t){var n=++w,i=Cn(e,t,!0,"rect"==r);if(i)if(0!=B(i,x)){e.curOp.focus=a(),o(i);var s=Bn(c,u);(i.line>=s.to||i.line<s.from)&&setTimeout(fr(e,function(){w==n&&l(t)}),150)}else{var f=t.clientY<b.top?-20:t.clientY>b.bottom?20:0;f&&setTimeout(fr(e,function(){w==n&&(c.scroller.scrollTop+=f,l(t))}),50)}}function s(t){e.state.selectingText=!1,w=1/0,We(t),c.input.focus(),Ae(document,"mousemove",k),Ae(document,"mouseup",C),u.history.lastSelOrigin=null}var c=e.display,u=e.doc;We(t);var h,p,m=u.sel,g=m.ranges;if(i&&!t.shiftKey?(p=u.sel.contains(n),h=p>-1?g[p]:new cl(n,n)):(h=u.sel.primary(),p=u.sel.primIndex),pa?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(h=new cl(n,n)),n=Cn(e,t,!0,!0),p=-1;else if("double"==r){var v=e.findWordAt(n);h=e.display.shift||u.extend?ui(u,h,v.anchor,v.head):v}else if("triple"==r){var y=new cl(W(n.line,0),j(u,W(n.line+1,0)));h=e.display.shift||u.extend?ui(u,h,y.anchor,y.head):y}else h=ui(u,h,n);i?-1==p?(p=g.length,vi(u,Br(g.concat([h]),p),{scroll:!1,origin:"*mouse"})):g.length>1&&g[p].empty()&&"single"==r&&!t.shiftKey?(vi(u,Br(g.slice(0,p).concat(g.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):di(u,p,h,Na):(p=0,vi(u,new sl([h],0),Na),m=u.sel);var x=n,b=c.wrapper.getBoundingClientRect(),w=0,k=fr(e,function(e){ze(e)?l(e):s(e)}),C=fr(e,s);e.state.selectingText=C,Pa(document,"mousemove",k),Pa(document,"mouseup",C)}function Co(e,t,n,r){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&We(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!De(e,n))return Re(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return Ee(e,n,e,I(e.doc,o),e.options.gutters[s],t),Re(t)}}function So(e,t){return Co(e,t,"gutterClick",!0)}function Lo(e,t){Rt(e.display,t)||To(e,t)||Oe(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function To(e,t){return!!De(e,"gutterContextMenu")&&Co(e,t,"gutterContextMenu",!1)}function Mo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),rn(e)}function No(e){Or(e),pr(e),Rn(e)}function Ao(e,t,n){if(!t!=!(n&&n!=El)){var r=e.display.dragFunctions,i=t?Pa:Ae;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Eo(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ba(e.display.wrapper,"CodeMirror-wrap"),be(e)),kn(e),pr(e),rn(e),setTimeout(function(){return Qn(e)},100)}function Oo(e,t){var n=this;if(!(this instanceof Oo))return new Oo(e,t);this.options=t=t?u(t):{},u(Ol,t,!1),Ir(t);var r=t.value;"string"==typeof r&&(r=new vl(r,t.mode,null,t.lineSeparator,t.direction)),this.doc=r;var i=new Oo.inputStyles[t.inputStyle](this),o=this.display=new T(e,r,i);o.wrapper.CodeMirror=this,Or(this),Mo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),tr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new ka,keySeq:null,specialChars:null},t.autofocus&&!ha&&o.input.focus(),ta&&na<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Io(this),Yi(),nr(this),this.curOp.forceUpdate=!0,Kr(this,r),t.autofocus&&!ha||this.hasFocus()?setTimeout(c(In,this),20):Dn(this);for(var a in Il)Il.hasOwnProperty(a)&&Il[a](n,t[a],El);Pn(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Dl.length;++l)Dl[l](n);rr(this),ra&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Io(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),(a=i.activeTouch).end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;Pa(i.scroller,"mousedown",fr(e,xo)),ta&&na<11?Pa(i.scroller,"dblclick",fr(e,function(t){if(!Oe(e,t)){var n=Cn(e,t);if(n&&!So(e,t)&&!Rt(e.display,t)){We(t);var r=e.findWordAt(n);fi(e.doc,r.anchor,r.head)}}})):Pa(i.scroller,"dblclick",function(t){return Oe(e,t)||We(t)}),xa||Pa(i.scroller,"contextmenu",function(t){return Lo(e,t)});var o,a={end:0};Pa(i.scroller,"touchstart",function(t){if(!Oe(e,t)&&!n(t)){i.input.ensurePolled(),clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Pa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Pa(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Rt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new cl(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new cl(W(l.line,0),j(e.doc,W(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),We(n)}t()}),Pa(i.scroller,"touchcancel",t),Pa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Xn(e,i.scroller.scrollTop),Zn(e,i.scroller.scrollLeft,!0),Ee(e,"scroll",e))}),Pa(i.scroller,"mousewheel",function(t){return Wr(e,t)}),Pa(i.scroller,"DOMMouseScroll",function(t){return Wr(e,t)}),Pa(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Oe(e,t)||Pe(t)},over:function(t){Oe(e,t)||(Vi(e,t),Pe(t))},start:function(t){return $i(e,t)},drop:fr(e,Gi),leave:function(t){Oe(e,t)||Ki(e)}};var l=i.input.getField();Pa(l,"keyup",function(t){return vo.call(e,t)}),Pa(l,"keydown",fr(e,mo)),Pa(l,"keypress",fr(e,yo)),Pa(l,"focus",function(t){return In(e,t)}),Pa(l,"blur",function(t){return Dn(e,t)})}function Do(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Qe(e,t):n="prev");var a=e.options.tabSize,l=M(o,t),s=f(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==Ta||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?f(M(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)d+=a,h+="\t";if(d<c&&(h+=p(c-d)),h!=u)return Di(o,h,W(t,0),W(t,u.length),"+input"),l.stateAfter=null,!0;for(var g=0;g<o.sel.ranges.length;g++){var v=o.sel.ranges[g];if(v.head.line==t&&v.head.ch<u.length){var y=W(t,u.length);di(o,g,new cl(y,y));break}}}function Ho(e){Hl=e}function Wo(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=za(t),s=null;if(a&&r.ranges.length>1)if(Hl&&Hl.text.join("\n")==t){if(r.ranges.length%Hl.text.length==0){s=[];for(var c=0;c<Hl.text.length;c++)s.push(o.splitLines(Hl.text[c]))}}else l.length==r.ranges.length&&(s=g(l,function(e){return[e]}));for(var u,f=r.ranges.length-1;f>=0;f--){var h=r.ranges[f],d=h.from(),p=h.to();h.empty()&&(n&&n>0?d=W(d.line,d.ch-n):e.state.overwrite&&!a?p=W(p.line,Math.min(M(o,p.line).text.length,p.ch+m(l).length)):Hl&&Hl.lineWise&&Hl.text.join("\n")==t&&(d=p=W(d.line,0))),u=e.curOp.updateInput;var v={from:d,to:p,text:s?s[f%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Mi(e.doc,v),kt(e,"inputRead",e,v)}t&&!a&&Ro(e,t),qn(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Bo(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ur(t,function(){return Wo(t,n,0,null,"paste")}),!0}function Ro(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Do(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Do(e,i.head.line,"smart"));a&&kt(e,"electricInput",e,i.head.line)}}}function Po(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:W(i,0),head:W(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Fo(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function zo(){var e=r("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=r("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ra?e.style.width="1000px":e.setAttribute("wrap","off"),ua&&(e.style.border="1px solid black"),Fo(e),t}function _o(e,t,n,r,i){function o(){var r=t.line+n;return!(r<e.first||r>=e.first+e.size)&&(t=new W(r,t.ch,t.sticky),c=M(e,r))}function a(r){var a;if(null==(a=i?Me(e.cm,c,t,n):Le(c,t,n))){if(r||!o())return!1;t=Te(i,e.cm,c,t.line,n)}else t=a;return!0}var l=t,s=n,c=M(e,t.line);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||a(!d);d=!1){var p=c.text.charAt(t.ch)||"\n",m=w(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||m||(m="s"),u&&u!=m){n<0&&(n=1,a(),t.sticky="after");break}if(m&&(u=m),n>0&&!a(!d))break}var g=Ci(e,t,l,s,!0);return R(l,g)&&(g.hitSide=!0),g}function jo(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*vn(e.display),3);i=(n>0?t.bottom:t.top)+n*s}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(var c;(c=dn(e,a,i)).outside;){if(n<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*n}return c}function Uo(e,t){var n=Kt(e,t.line);if(!n||n.hidden)return null;var r=M(e.doc,t.line),i=Gt(n,r,t.line),o=Ce(r,e.doc.direction),a="left";o&&(a=ke(o,t.ch)%2?"right":"left");var l=Zt(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function qo(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Go(e,t){return t&&(e.bad=!0),e}function $o(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(){u&&(c+=f,u=!1)}function l(e){e&&(a(),c+=e)}function s(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return void l(n||t.textContent.replace(/\u200b/g,""));var c,h=t.getAttribute("cm-marker");if(h){var d=e.findMarks(W(r,0),W(i+1,0),o(+h));return void(d.length&&(c=d[0].find())&&l(N(e.doc,c.from,c.to).join(f)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&a();for(var m=0;m<t.childNodes.length;m++)s(t.childNodes[m]);p&&(u=!0)}else 3==t.nodeType&&l(t.nodeValue)}for(var c="",u=!1,f=e.doc.lineSeparator();s(t),t!=n;)t=t.nextSibling;return c}function Vo(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Go(e.clipPos(W(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ko(o,t,n)}}function Ko(e,t,n){function r(t,n,r){for(var i=-1;i<(f?f.length:0);i++)for(var o=i<0?u.map:f[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=O(i<0?e.line:e.rest[i]),c=o[a]+r;return(r<0||l!=t)&&(c=o[a+(r?1:0)]),W(s,c)}}}var i=e.text.firstChild,a=!1;if(!t||!o(i,t))return Go(W(O(e.line),0),!0);if(t==i&&(a=!0,t=i.childNodes[n],n=0,!t)){var l=e.rest?m(e.rest):e.line;return Go(W(O(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=e.measure,f=u.maps,h=r(s,c,n);if(h)return Go(h,a);for(var d=c.nextSibling,p=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(h=r(d,d.firstChild,0))return Go(W(h.line,h.ch-p),a);p+=d.textContent.length}for(var g=c.previousSibling,v=n;g;g=g.previousSibling){if(h=r(g,g.firstChild,-1))return Go(W(h.line,h.ch+v),a);v+=g.textContent.length}}var Xo=navigator.userAgent,Yo=navigator.platform,Zo=/gecko\/\d/i.test(Xo),Jo=/MSIE \d/.test(Xo),Qo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xo),ea=/Edge\/(\d+)/.exec(Xo),ta=Jo||Qo||ea,na=ta&&(Jo?document.documentMode||6:+(ea||Qo)[1]),ra=!ea&&/WebKit\//.test(Xo),ia=ra&&/Qt\/\d+\.\d+/.test(Xo),oa=!ea&&/Chrome\//.test(Xo),aa=/Opera\//.test(Xo),la=/Apple Computer/.test(navigator.vendor),sa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Xo),ca=/PhantomJS/.test(Xo),ua=!ea&&/AppleWebKit/.test(Xo)&&/Mobile\/\w+/.test(Xo),fa=/Android/.test(Xo),ha=ua||fa||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Xo),da=ua||/Mac/.test(Yo),pa=/\bCrOS\b/.test(Xo),ma=/win/i.test(Yo),ga=aa&&Xo.match(/Version\/(\d*\.\d*)/);ga&&(ga=Number(ga[1])),ga&&ga>=15&&(aa=!1,ra=!0);var va,ya=da&&(ia||aa&&(null==ga||ga<12.11)),xa=Zo||ta&&na>=9,ba=function(t,n){var r=t.className,i=e(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);t.className=r.slice(0,i.index)+(o?i[1]+o:"")}};va=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var wa=function(e){e.select()};ua?wa=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ta&&(wa=function(e){try{e.select()}catch(e){}});var ka=function(){this.id=null};ka.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Ca,Sa,La=30,Ta={toString:function(){return"CodeMirror.Pass"}},Ma={scroll:!1},Na={origin:"*mouse"},Aa={origin:"+move"},Ea=[""],Oa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ia=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Da=!1,Ha=!1,Wa=null,Ba=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?r.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;return function(n,r){var c="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!i.test(n))return!1;for(var u=n.length,f=[],h=0;h<u;++h)f.push(e(n.charCodeAt(h)));for(var d=0,p=c;d<u;++d){var g=f[d];"m"==g?f[d]=p:p=g}for(var v=0,y=c;v<u;++v){var x=f[v];"1"==x&&"r"==y?f[v]="n":a.test(x)&&(y=x,"r"==x&&(f[v]="R"))}for(var b=1,w=f[0];b<u-1;++b){var k=f[b];"+"==k&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=k||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=k}for(var C=0;C<u;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<u&&"%"==f[L];++L);for(var T=C&&"!"==f[C-1]||L<u&&"1"==f[L]?"1":"N",M=C;M<L;++M)f[M]=T;C=L-1}}for(var N=0,A=c;N<u;++N){var E=f[N];"L"==A&&"1"==E?f[N]="L":a.test(E)&&(A=E)}for(var O=0;O<u;++O)if(o.test(f[O])){var I=void 0;for(I=O+1;I<u&&o.test(f[I]);++I);for(var D="L"==(O?f[O-1]:c),H=D==("L"==(I<u?f[I]:c))?D?"L":"R":c,W=O;W<I;++W)f[W]=H;O=I-1}for(var B,R=[],P=0;P<u;)if(l.test(f[P])){var F=P;for(++P;P<u&&l.test(f[P]);++P);R.push(new t(0,F,P))}else{var z=P,_=R.length;for(++P;P<u&&"L"!=f[P];++P);for(var j=z;j<P;)if(s.test(f[j])){z<j&&R.splice(_,0,new t(1,z,j));var U=j;for(++j;j<P&&s.test(f[j]);++j);R.splice(_,0,new t(2,U,j)),z=j}else++j;z<P&&R.splice(_,0,new t(1,z,P))}return 1==R[0].level&&(B=n.match(/^\s+/))&&(R[0].from=B[0].length,R.unshift(new t(0,0,B[0].length))),1==m(R).level&&(B=n.match(/\s+$/))&&(m(R).to-=B[0].length,R.push(new t(0,u-B[0].length,u))),"rtl"==r?R.reverse():R}}(),Ra=[],Pa=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ra).concat(n)}},Fa=function(){if(ta&&na<9)return!1;var e=r("div");return"draggable"in e||"dragDrop"in e}(),za=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},_a=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},ja=function(){var e=r("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ua=null,qa={},Ga={},$a={},Va=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Va.prototype.eol=function(){return this.pos>=this.string.length},Va.prototype.sol=function(){return this.pos==this.lineStart},Va.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Va.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Va.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Va.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Va.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Va.prototype.skipToEnd=function(){this.pos=this.string.length},Va.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Va.prototype.backUp=function(e){this.pos-=e},Va.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=f(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?f(this.string,this.lineStart,this.tabSize):0)},Va.prototype.indentation=function(){return f(this.string,null,this.tabSize)-(this.lineStart?f(this.string,this.lineStart,this.tabSize):0)},Va.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Va.prototype.current=function(){return this.string.slice(this.start,this.pos)},Va.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var Ka=function(e,t,n){this.text=e,re(this,t),this.height=n?n(this):1};Ka.prototype.lineNo=function(){return O(this)},He(Ka);var Xa,Ya={},Za={},Ja=null,Qa=null,el={left:0,right:0,top:0,bottom:0},tl=function(e,t,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Pa(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Pa(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ta&&na<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};tl.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},tl.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},tl.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},tl.prototype.zeroWidthHack=function(){var e=da&&!sa?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ka,this.disableVert=new ka},tl.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},tl.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var nl=function(){};nl.prototype.update=function(){return{bottom:0,right:0}},nl.prototype.setScrollLeft=function(){},nl.prototype.setScrollTop=function(){},nl.prototype.clear=function(){};var rl={native:tl,null:nl},il=0,ol=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Bn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=jt(e),this.force=n,this.dims=xn(e),this.events=[]};ol.prototype.signal=function(e,t){De(e,t)&&this.events.push(arguments)},ol.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Ee.apply(null,e.events[t])};var al=0,ll=null;ta?ll=-.53:Zo?ll=15:oa?ll=-.7:la&&(ll=-1/3);var sl=function(e,t){this.ranges=e,this.primIndex=t};sl.prototype.primary=function(){return this.ranges[this.primIndex]},sl.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var r=t.ranges[n],i=e.ranges[n];if(!R(r.anchor,i.anchor)||!R(r.head,i.head))return!1}return!0},sl.prototype.deepCopy=function(){for(var e=this,t=[],n=0;n<this.ranges.length;n++)t[n]=new cl(P(e.ranges[n].anchor),P(e.ranges[n].head));return new sl(t,this.primIndex)},sl.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},sl.prototype.contains=function(e,t){var n=this;t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=n.ranges[r];if(B(t,i.from())>=0&&B(e,i.to())<=0)return r}return-1};var cl=function(e,t){this.anchor=e,this.head=t};cl.prototype.from=function(){return z(this.anchor,this.head)},cl.prototype.to=function(){return F(this.anchor,this.head)},cl.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var ul=function(e){var t=this;this.lines=e,this.parent=null;for(var n=0,r=0;r<e.length;++r)e[r].parent=t,n+=e[r].height;this.height=n};ul.prototype.chunkSize=function(){return this.lines.length},ul.prototype.removeInner=function(e,t){for(var n=this,r=e,i=e+t;r<i;++r){var o=n.lines[r];n.height-=o.height,st(o),kt(o,"delete")}this.lines.splice(e,t)},ul.prototype.collapse=function(e){e.push.apply(e,this.lines)},ul.prototype.insertInner=function(e,t,n){var r=this;this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=r},ul.prototype.iterN=function(e,t,n){for(var r=this,i=e+t;e<i;++e)if(n(r.lines[e]))return!0};var fl=function(e){var t=this;this.children=e;for(var n=0,r=0,i=0;i<e.length;++i){var o=e[i];n+=o.chunkSize(),r+=o.height,o.parent=t}this.size=n,this.height=r,this.parent=null};fl.prototype.chunkSize=function(){return this.size},fl.prototype.removeInner=function(e,t){var n=this;this.size-=t;for(var r=0;r<this.children.length;++r){var i=n.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),n.height-=l-i.height,o==a&&(n.children.splice(r--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ul))){var s=[];this.collapse(s),this.children=[new ul(s)],this.children[0].parent=this}},fl.prototype.collapse=function(e){for(var t=this,n=0;n<this.children.length;++n)t.children[n].collapse(e)},fl.prototype.insertInner=function(e,t,n){var r=this;this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var o=r.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new ul(o.lines.slice(s,s+=25));o.height-=c.height,r.children.splice(++i,0,c),c.parent=r}o.lines=o.lines.slice(0,l),r.maybeSpill()}break}e-=a}},fl.prototype.maybeSpill=function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new fl(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=h(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new fl(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},fl.prototype.iterN=function(e,t,n){for(var r=this,i=0;i<this.children.length;++i){var o=r.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=a}};var hl=function(e,t,n){var r=this;if(n)for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);this.doc=e,this.node=t};hl.prototype.clear=function(){var e=this,t=this.doc.cm,n=this.line.widgets,r=this.line,i=O(r);if(null!=i&&n){for(var o=0;o<n.length;++o)n[o]==e&&n.splice(o--,1);n.length||(r.widgets=null);var a=Bt(this);E(r,Math.max(0,r.height-a)),t&&(ur(t,function(){Pi(t,r,-a),mr(t,i,"widget")}),kt(t,"lineWidgetCleared",t,this,i))}},hl.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Bt(this)-t;i&&(E(r,r.height+i),n&&ur(n,function(){n.curOp.forceUpdate=!0,Pi(n,r,i),kt(n,"lineWidgetChanged",n,e,O(r))}))},He(hl);var dl=0,pl=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++dl};pl.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,n=t&&!t.curOp;if(n&&nr(t),De(this,"clear")){var r=this.find();r&&kt(this,"clear",r.from,r.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=K(l.markedSpans,e);t&&!e.collapsed?mr(t,O(l),"text"):t&&(null!=s.to&&(o=O(l)),null!=s.from&&(i=O(l))),l.markedSpans=X(l.markedSpans,s),null==s.from&&e.collapsed&&!ge(e.doc,l)&&t&&E(l,vn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=fe(e.lines[c]),f=xe(u);f>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pr(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&bi(t.doc)),t&&kt(t,"markerCleared",t,this,i,o),n&&rr(t),this.parent&&this.parent.clear()}},pl.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var r,i,o=0;o<this.lines.length;++o){var a=n.lines[o],l=K(a.markedSpans,n);if(null!=l.from&&(r=W(t?a:O(a),l.from),-1==e))return r;if(null!=l.to&&(i=W(t?a:O(a),l.to),1==e))return i}return r&&{from:r,to:i}},pl.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&ur(r,function(){var i=t.line,o=O(t.line),a=Kt(r,o);if(a&&(tn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ge(n.doc,i)&&null!=n.height){var l=n.height;n.height=null;var s=Bt(n)-l;s&&E(i,i.height+s)}kt(r,"markerChanged",r,e)})},pl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=h(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},pl.prototype.detachLine=function(e){if(this.lines.splice(h(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},He(pl);var ml=function(e,t){var n=this;this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=n};ml.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();kt(this,"clear")}},ml.prototype.find=function(e,t){return this.primary.find(e,t)},He(ml);var gl=0,vl=function(e,t,n,r,i){if(!(this instanceof vl))return new vl(e,t,n,r,i);null==n&&(n=0),fl.call(this,[new ul([new Ka("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var o=W(n,0);this.sel=Rr(o),this.history=new Zr(null),this.id=++gl,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),$r(this,{from:o,to:o,text:e}),vi(this,Rr(o),Ma)};vl.prototype=x(fl.prototype,{constructor:vl,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=A(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:dr(function(e){var t=W(this.first,0),n=this.first+this.size-1;Mi(this,{from:t,to:W(n,M(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Gn(this.cm,0,0),vi(this,Rr(t),Ma)}),replaceRange:function(e,t,n,r){Di(this,e,t=j(this,t),n=n?j(this,n):t,r)},getRange:function(e,t,n){var r=N(this,j(this,e),j(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(D(this,e))return M(this,e)},getLineNumber:function(e){return O(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=M(this,e)),fe(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return j(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:dr(function(e,t,n){pi(this,j(this,"number"==typeof e?W(e,t||0):e),null,n)}),setSelection:dr(function(e,t,n){pi(this,j(this,e),j(this,t||e),n)}),extendSelection:dr(function(e,t,n){fi(this,j(this,e),t&&j(this,t),n)}),extendSelections:dr(function(e,t){hi(this,q(this,e),t)}),extendSelectionsBy:dr(function(e,t){hi(this,q(this,g(this.sel.ranges,e)),t)}),setSelections:dr(function(e,t,n){var r=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new cl(j(r,e[o].anchor),j(r,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),vi(this,Br(i,t),n)}}),addSelection:dr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new cl(j(this,e),j(this,t||e))),vi(this,Br(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this,r=this.sel.ranges,i=0;i<r.length;i++){var o=N(n,r[i].from(),r[i].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,n=[],r=this.sel.ranges,i=0;i<r.length;i++){var o=N(t,r[i].from(),r[i].to());!1!==e&&(o=o.join(e||t.lineSeparator())),n[i]=o}return n},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:dr(function(e,t,n){for(var r=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:r.splitLines(e[a]),origin:n}}for(var s=t&&"end"!=t&&jr(this,i,t),c=i.length-1;c>=0;c--)Mi(r,i[c]);s?gi(this,s):this.cm&&qn(this.cm)}),undo:dr(function(){Ai(this,"undo")}),redo:dr(function(){Ai(this,"redo")}),undoSelection:dr(function(){Ai(this,"undo",!0)}),redoSelection:dr(function(){Ai(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Zr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ci(this.history.done),undone:ci(this.history.undone)}},setHistory:function(e){var t=this.history=new Zr(this.history.maxGeneration);t.done=ci(e.done.slice(0),null,!0),t.undone=ci(e.undone.slice(0),null,!0)},setGutterMarker:dr(function(e,t,n){return Ri(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&k(r)&&(e.gutterMarkers=null),!0})}),clearGutter:dr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Ri(t,n,"gutter",function(){return n.gutterMarkers[e]=null,k(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!D(this,e))return null;if(t=e,!(e=M(this,e)))return null}else if(null==(t=O(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:dr(function(t,n,r){return Ri(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(t[i]){if(e(r).test(t[i]))return!1;t[i]+=" "+r}else t[i]=r;return!0})}),removeLineClass:dr(function(t,n,r){return Ri(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==r)t[i]=null;else{var a=o.match(e(r));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:dr(function(e,t,n){return Fi(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return zi(this,j(this,e),j(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=j(this,e),zi(this,e,e,n,"bookmark")},findMarksAt:function(e){var t=[],n=M(this,(e=j(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=j(this,e),t=j(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),j(this,W(n,t))},indexFromPos:function(e){var t=(e=j(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new vl(A(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new vl(A(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ui(r,ji(this)),r},unlinkDoc:function(e){var t=this;if(e instanceof Oo&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n)if(t.linked[n].doc==e){t.linked.splice(n,1),e.unlinkDoc(t),qi(ji(t));break}if(e.history==this.history){var r=[e.id];Vr(e,function(e){return r.push(e.id)},!0),e.history=new Zr(null),e.history.done=ci(this.history.done,r),e.history.undone=ci(this.history.undone,r)}},iterLinkedDocs:function(e){Vr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):za(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:dr(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Yr(this.cm))})}),vl.prototype.eachLine=vl.prototype.iter;for(var yl=0,xl=!1,bl={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},wl=0;wl<10;wl++)bl[wl+48]=bl[wl+96]=String(wl);for(var kl=65;kl<=90;kl++)bl[kl]=String.fromCharCode(kl);for(var Cl=1;Cl<=12;Cl++)bl[Cl+111]=bl[Cl+63235]="F"+Cl;var Sl={};Sl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Sl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Sl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Sl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Sl.default=da?Sl.macDefault:Sl.pcDefault;var Ll,Tl,Ml={selectAll:Li,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ma)},killLine:function(e){return oo(e,function(t){if(t.empty()){var n=M(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:W(t.head.line+1,0)}:{from:t.head,to:W(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return oo(e,function(t){return{from:W(t.from().line,0),to:j(e.doc,W(t.to().line+1,0))}})},delLineLeft:function(e){return oo(e,function(e){return{from:W(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return oo(e,function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}})},delWrappedLineRight:function(e){return oo(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(W(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(W(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ao(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return so(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return lo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Aa)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Aa)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?so(e,t.head):r},Aa)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=f(e.getLine(o.line),o.ch,r);t.push(p(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ur(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=M(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new W(i.line,i.ch-1)),i.ch>0)i=new W(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),W(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=M(e.doc,i.line-1).text;a&&(i=new W(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),W(i.line-1,a.length-1),i,"+transpose"))}n.push(new cl(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return ur(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);qn(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Nl=new ka,Al=null,El={toString:function(){return"CodeMirror.Init"}},Ol={},Il={};Oo.defaults=Ol,Oo.optionHandlers=Il;var Dl=[];Oo.defineInitHook=function(e){return Dl.push(e)};var Hl=null,Wl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ka,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Wl.prototype.init=function(e){function t(e){if(!Oe(i,e)){if(i.somethingSelected())Ho({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Po(i);Ho({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ma),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var n=Hl.text.join("\n");if(e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)return void e.preventDefault()}var a=zo(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Hl.text.join("\n");var s=document.activeElement;wa(l),setTimeout(function(){i.display.lineSpace.removeChild(a),s.focus(),s==o&&r.showPrimarySelection()},50)}}var n=this,r=this,i=r.cm,o=r.div=e.lineDiv;Fo(o,i.options.spellcheck),Pa(o,"paste",function(e){Oe(i,e)||Bo(e,i)||na<=11&&setTimeout(fr(i,function(){return n.updateFromDOM()}),20)}),Pa(o,"compositionstart",function(e){n.composing={data:e.data,done:!1}}),Pa(o,"compositionupdate",function(e){n.composing||(n.composing={data:e.data,done:!1})}),Pa(o,"compositionend",function(e){n.composing&&(e.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Pa(o,"touchstart",function(){return r.forceCompositionEnd()}),Pa(o,"input",function(){n.composing||n.readFromDOMSoon()}),Pa(o,"copy",t),Pa(o,"cut",t)},Wl.prototype.prepareSelection=function(){var e=Tn(this.cm,!1);return e.focus=this.cm.state.focused,e},Wl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Wl.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Vo(t,e.anchorNode,e.anchorOffset),a=Vo(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=B(z(o,a),r)||0!=B(F(o,a),i)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Uo(t,r)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Uo(t,i);if(!c){var u=l[l.length-1].measure,f=u.maps?u.maps[u.maps.length-1]:u.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(s&&c){var h,d=e.rangeCount&&e.getRangeAt(0);try{h=va(s.node,s.offset,c.offset,c.node)}catch(e){}h&&(!Zo&&t.state.focused?(e.collapse(s.node,s.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),d&&null==e.anchorNode?e.addRange(d):Zo&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Wl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Wl.prototype.showMultipleSelections=function(e){n(this.cm.display.cursorDiv,e.cursors),n(this.cm.display.selectionDiv,e.selection)},Wl.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Wl.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},Wl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Wl.prototype.blur=function(){this.div.blur()},Wl.prototype.getField=function(){return this.div},Wl.prototype.supportsTouch=function(){return!0},Wl.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():ur(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Wl.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Wl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(fa&&oa&&this.cm.options.gutters.length&&qo(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Vo(t,e.anchorNode,e.anchorOffset),r=Vo(t,e.focusNode,e.focusOffset);n&&r&&ur(t,function(){vi(t.doc,Rr(n,r),Ma),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Wl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(0==r.ch&&r.line>e.firstLine()&&(r=W(r.line-1,M(e.doc,r.line-1).length)),i.ch==M(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=W(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||0==(o=Sn(e,r.line))?(a=O(t.view[0].line),l=t.view[0].node):(a=O(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Sn(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=O(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var f=e.doc.splitLines($o(e,l,c,a,s)),h=N(e.doc,W(a,0),W(s,M(e.doc,s).text.length));f.length>1&&h.length>1;)if(m(f)==m(h))f.pop(),h.pop(),s--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),a++}for(var d=0,p=0,g=f[0],v=h[0],y=Math.min(g.length,v.length);d<y&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var x=m(f),b=m(h),w=Math.min(x.length-(1==f.length?d:0),b.length-(1==h.length?d:0));p<w&&x.charCodeAt(x.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==h.length&&a==r.line)for(;d&&d>r.ch&&x.charCodeAt(x.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;f[f.length-1]=x.slice(0,x.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var k=W(a,d),C=W(s,h.length?m(h).length-p:0);return f.length>1||f[0]||B(k,C)?(Di(e.doc,f,k,C,"+input"),!0):void 0},Wl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wl.prototype.reset=function(){this.forceCompositionEnd()},Wl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Wl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ur(this.cm,function(){return pr(e.cm)})},Wl.prototype.setUneditable=function(e){e.contentEditable="false"},Wl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||fr(this.cm,Wo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Wl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Wl.prototype.onContextMenu=function(){},Wl.prototype.resetPosition=function(){},Wl.prototype.needsContentAttribute=!0;var Bl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ka,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Bl.prototype.init=function(e){function t(e){if(!Oe(i,e)){if(i.somethingSelected())Ho({lineWise:!1,text:i.getSelections()}),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,a.value=Hl.text.join("\n"),wa(a));else{if(!i.options.lineWiseCopyCut)return;var t=Po(i);Ho({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ma):(r.prevInput="",a.value=t.text.join("\n"),wa(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var n=this,r=this,i=this.cm,o=this.wrapper=zo(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),ua&&(a.style.width="0px"),Pa(a,"input",function(){ta&&na>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),Pa(a,"paste",function(e){Oe(i,e)||Bo(e,i)||(i.state.pasteIncoming=!0,r.fastPoll())}),Pa(a,"cut",t),Pa(a,"copy",t),Pa(e.scroller,"paste",function(t){Rt(e,t)||Oe(i,t)||(i.state.pasteIncoming=!0,r.focus())}),Pa(e.lineSpace,"selectstart",function(t){Rt(e,t)||We(t)}),Pa(a,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Pa(a,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Bl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Tn(e);if(e.options.moveInputWithCursor){var i=un(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Bl.prototype.showSelection=function(e){var t=this.cm.display;n(t.cursorDiv,e.cursors),n(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Bl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary(),a=(t=ja&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3))?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&wa(this.textarea),ta&&na>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",ta&&na>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Bl.prototype.getField=function(){return this.textarea},Bl.prototype.supportsTouch=function(){return!1},Bl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!ha||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},Bl.prototype.blur=function(){this.textarea.blur()},Bl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Bl.prototype.receivedFocus=function(){this.slowPoll()},Bl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Bl.prototype.fastPoll=function(){function e(){n.poll()||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},Bl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||_a(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(ta&&na>=9&&this.hasSelection===i||da&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return ur(t,function(){Wo(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Bl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Bl.prototype.onKeyPress=function(){ta&&na>=9&&(this.hasSelection=null),this.fastPoll()},Bl.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t=""+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=u,a.style.cssText=c,ta&&na<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!ta||ta&&na<9)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&""==r.prevInput?fr(i,Li)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Cn(i,e),s=o.scroller.scrollTop;if(l&&!aa){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(l)&&fr(i,vi)(i.doc,Rr(l),Ma);var c=a.style.cssText,u=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var f=r.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(ta?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(ra&&(h=window.scrollY),o.input.focus(),ra&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),ta&&na>=9&&t(),xa){Pe(e);var d=function(){Ae(window,"mouseup",d),setTimeout(n,20)};Pa(window,"mouseup",d)}else setTimeout(n,50)}},Bl.prototype.readOnlyChanged=function(e){e||this.reset()},Bl.prototype.setUneditable=function(){},Bl.prototype.needsContentAttribute=!1,function(e){function t(t,r,i,o){e.defaults[t]=r,i&&(n[t]=o?function(e,t,n){n!=El&&i(e,t,n)}:i)}var n=e.optionHandlers;e.defineOption=t,e.Init=El,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Ur(e)},!0),t("indentUnit",2,Ur,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){qr(e),rn(e),pr(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(W(r,o))}r++});for(var i=n.length-1;i>=0;i--)Di(e.doc,t,n[i],W(n[i].line,n[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=El&&e.refresh()}),t("specialCharPlaceholder",ft,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",ha?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!ma),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Mo(e),No(e)},!0),t("keyMap","default",function(e,t,n){var r=io(t),i=n!=El&&io(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,Eo,!0),t("gutters",[],function(e){Ir(e.options),No(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?bn(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Qn(e)},!0),t("scrollbarStyle","native",function(e){tr(e),Qn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Ir(e.options),No(e)},!0),t("firstLineNumber",1,No,!0),t("lineNumberFormatter",function(e){return e},No,!0),t("showCursorWhenSelecting",!1,Ln,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Dn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Ao),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Ln,!0),t("singleCursorHeightPerLine",!0,Ln,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,qr,!0),t("addModeClass",!1,qr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,qr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Oo),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&fr(this,t[e])(this,n,i),Ee(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](io(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:hr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,pr(this)}),removeOverlay:hr(function(e){for(var t=this,n=this.state.overlays,r=0;r<n.length;++r){var i=n[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return n.splice(r,1),t.state.modeGen++,void pr(t)}}),indentLine:hr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),D(this.doc,e)&&Do(this,e,t,n)}),indentSelection:hr(function(e){for(var t=this,n=this.doc.sel.ranges,r=-1,i=0;i<n.length;i++){var o=n[i];if(o.empty())o.head.line>r&&(Do(t,o.head.line,e,!0),r=o.head.line,i==t.doc.sel.primIndex&&qn(t));else{var a=o.from(),l=o.to(),s=Math.max(r,a.line);r=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<r;++c)Do(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&n.length==u.length&&u[i].from().ch>0&&di(t.doc,i,new cl(a,u[i].to()),Ma)}}}),getTokenAt:function(e,t){return rt(this,e,t)},getLineTokens:function(e,t){return rt(this,W(e),t,!0)},getTokenTypeAt:function(e){e=j(this.doc,e);var t,n=Je(this,M(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=this,i=[];if(!n.hasOwnProperty(t))return i;var o=n[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,r)&&-1==h(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(e,t){var n=this.doc;return e=_(n,null==e?n.first+n.size-1:e),Qe(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?j(this.doc,e):e?r.from():r.to(),un(this,n,t||"page")},charCoords:function(e,t){return cn(this,j(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sn(this,e,t||"page"),dn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sn(this,{top:e,left:0},t||"page").top,I(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=M(this.doc,e)}else r=e;return ln(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-ye(r):0)},defaultTextHeight:function(){return vn(this.display)},defaultCharWidth:function(){return yn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=un(this,j(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&_n(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:hr(mo),triggerOnKeyPress:hr(yo),triggerOnKeyUp:vo,execCommand:function(e){if(Ml.hasOwnProperty(e))return Ml[e].call(null,this)},triggerElectric:hr(function(e){Ro(this,e)}),findPosH:function(e,t,n,r){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=j(this.doc,e),l=0;l<t&&!(a=_o(i.doc,a,o,n,r)).hitSide;++l);return a},moveH:hr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?_o(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},Aa)}),deleteH:hr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):oo(this,function(n){var i=_o(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=this,o=1,a=r;t<0&&(o=-1,t=-t);for(var l=j(this.doc,e),s=0;s<t;++s){var c=un(i,l,"div");if(null==a?a=c.left:c.left=a,(l=jo(i,c,o,n)).hitSide)break}return l},moveV:hr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=un(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=jo(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Un(n,cn(n,s,"div").top-l.top),s},Aa),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=M(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=w(o,i)?function(e){return w(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!w(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new cl(W(e.line,n),W(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?l(this.display.cursorDiv,"CodeMirror-overwrite"):ba(this.display.cursorDiv,"CodeMirror-overwrite"),Ee(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==a()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:hr(function(e,t){Gn(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-_t(this)-this.display.barHeight,width:e.scrollWidth-_t(this)-this.display.barWidth,clientHeight:Ut(this),clientWidth:jt(this)}},scrollIntoView:hr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:W(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?$n(this,e):Kn(this,e.from,e.to,e.margin)}),setSize:hr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&nn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ee(this,"refresh",this)}),operation:function(e){return ur(this,e)},refresh:hr(function(){var e=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,rn(this),Gn(this,this.doc.scrollLeft,this.doc.scrollTop),Ar(this),(null==e||Math.abs(e-vn(this.display))>.5)&&kn(this),Ee(this,"refresh",this)}),swapDoc:hr(function(e){var t=this.doc;return t.cm=null,Kr(this,e),rn(this),this.display.input.reset(),Gn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,kt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},He(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Oo);var Rl="iter insert remove copy getEditor constructor".split(" ");for(var Pl in vl.prototype)vl.prototype.hasOwnProperty(Pl)&&h(Rl,Pl)<0&&(Oo.prototype[Pl]=function(e){return function(){return e.apply(this.doc,arguments)}}(vl.prototype[Pl]));return He(vl),Oo.inputStyles={textarea:Bl,contenteditable:Wl},Oo.defineMode=function(e){Oo.defaults.mode||"null"==e||(Oo.defaults.mode=e),qe.apply(this,arguments)},Oo.defineMIME=function(e,t){Ga[e]=t},Oo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Oo.defineMIME("text/plain","null"),Oo.defineExtension=function(e,t){Oo.prototype[e]=t},Oo.defineDocExtension=function(e,t){vl.prototype[e]=t},Oo.fromTextArea=function(e,t){function n(){e.value=s.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=a();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}var i;if(e.form&&(Pa(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Ae(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Oo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},function(e){e.off=Ae,e.on=Pa,e.wheelEventPixels=Hr,e.Doc=vl,e.splitLines=za,e.countColumn=f,e.findColumn=d,e.isWordChar=b,e.Pass=Ta,e.signal=Ee,e.Line=Ka,e.changeEnd=Pr,e.scrollbarModel=rl,e.Pos=W,e.cmpPos=B,e.modes=qa,e.mimeModes=Ga,e.resolveMode=Ge,e.getMode=$e,e.modeExtensions=$a,e.extendMode=Ve,e.copyState=Ke,e.startState=Ye,e.innerMode=Xe,e.commands=Ml,e.keyMap=Sl,e.keyName=ro,e.isModifierKey=no,e.lookupKey=to,e.normalizeKeyMap=eo,e.StringStream=Va,e.SharedTextMarker=ml,e.TextMarker=pl,e.LineWidget=hl,e.e_preventDefault=We,e.e_stopPropagation=Be,e.e_stop=Pe,e.addClass=l,e.contains=o,e.rmClass=ba,e.keyNames=bl}(Oo),Oo.version="5.26.0",Oo})},{}],11:[function(e,t,n){!function(r){"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../markdown/markdown"),e("../../addon/mode/overlay")):r(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){var i=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var a=1+e.pos-o;return n.code?a===i&&(n.code=!1):(i=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,!1!==r.gitHubSpice)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},a={taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var l in r)a[l]=r[l];return a.name="markdown",e.overlayMode(e.getMode(n,a),o)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(e,t,n){!function(r){"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../xml/xml"),e("../meta")):r(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==c&&(e.f=d,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(t,o){var l=t.sol(),s=!1!==o.list,c=o.indentedCode;o.indentedCode=!1,s&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var h=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,k.code):null;if(t.eatSpace())return null;if((h=t.match(M))&&h[1].length<=6)return o.header=h[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,f(o);if(!(a(o.prevLine)||o.quote||s||c)&&(h=t.match(N)))return o.header="="==h[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,f(o);if(t.eat(">"))return o.quote=l?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),f(o);if("["===t.peek())return i(t,o,v);if(t.match(S,!0))return o.hr=!0,k.hr;if(h=t.match(L)){var d=h[1]?"ol":"ul";for(o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()<o.listStack[o.listStack.length-1];)o.listStack.pop();return o.listStack.push(o.indentation),n.taskLists&&t.match(T,!1)&&(o.taskList=!0),o.f=o.inline,n.highlightFormatting&&(o.formatting=["list","list-"+d]),f(o)}return n.fencedCodeBlocks&&(h=t.match(E,!0))?(o.fencedChars=h[1],o.localMode=r(h[2]),o.localMode&&(o.localState=e.startState(o.localMode)),o.f=o.block=u,n.highlightFormatting&&(o.formatting="code-block"),o.code=-1,f(o)):i(t,o,o.inline)}function c(t,n){var r=b.token(t,n.htmlState);if(!w){var i=e.innerMode(b,n.htmlState);("xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=d,n.block=s,n.htmlState=null)}return r}function u(e,t){if(t.fencedChars&&e.match(t.fencedChars)){n.highlightFormatting&&(t.formatting="code-block");var r=f(t);return t.localMode=t.localState=null,t.block=s,t.f=d,t.fencedChars=null,t.code=0,r}return t.fencedChars&&e.skipTo(t.fencedChars)?"comment":t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),k.code)}function f(e){var t=[];if(e.formatting){t.push(k.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(k.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(k.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(k.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(k.linkHref,"url"):(e.strong&&t.push(k.strong),e.em&&t.push(k.em),e.strikethrough&&t.push(k.strikethrough),e.linkText&&t.push(k.linkText),e.code&&t.push(k.code),e.image&&t.push(k.image),e.imageAltText&&t.push(k.imageAltText,"link"),e.imageMarker&&t.push(k.imageMarker)),e.header&&t.push(k.header,k.header+"-"+e.header),e.quote&&(t.push(k.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(k.quote+"-"+e.quote):t.push(k.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(k.list2):t.push(k.list3):t.push(k.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function h(e,t){if(e.match(A,!0))return f(t)}function d(t,r){var i=r.text(t,r);if(void 0!==i)return i;if(r.list)return r.list=null,f(r);if(r.taskList)return"x"!==t.match(T,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,f(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),f(r);var a=t.next();if(r.linkTitle){r.linkTitle=!1;var l=a;"("===a&&(l=")");var s="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(s),!0))return k.linkHref}if("`"===a){var u=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0==r.code)return r.code=h,f(r);if(h==r.code){E=f(r);return r.code=0,E}return r.formatting=u,f(r)}if(r.code)return f(r);if("\\"===a&&(t.next(),n.highlightFormatting)){var g=f(r),v=k.formatting+"-escape";return g?g+" "+v:v}if("!"===a&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),f(r);if("["===a&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),f(r);if("]"===a&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");g=f(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=m,g}if("["===a&&!r.image)return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),f(r);if("]"===a&&r.linkText){n.highlightFormatting&&(r.formatting="link");g=f(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?m:d,g}if("<"===a&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link"),(g=f(r))?g+=" ":g="",g+k.linkInline;if("<"===a&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link"),(g=f(r))?g+=" ":g="",g+k.linkEmail;if("<"===a&&t.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var x=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(b),o(t,r,c)}if("<"===a&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===a||"_"===a){for(var w=1,C=1==t.pos?" ":t.string.charAt(t.pos-2);w<3&&t.eat(a);)w++;var S=t.peek()||" ",L=!/\s/.test(S)&&(!O.test(S)||/\s/.test(C)||O.test(C)),M=!/\s/.test(C)&&(!O.test(C)||/\s/.test(S)||O.test(S)),N=null,A=null;if(w%2&&(r.em||!L||"*"!==a&&M&&!O.test(C)?r.em!=a||!M||"*"!==a&&L&&!O.test(S)||(N=!1):N=!0),w>1&&(r.strong||!L||"*"!==a&&M&&!O.test(C)?r.strong!=a||!M||"*"!==a&&L&&!O.test(S)||(A=!1):A=!0),null!=A||null!=N){n.highlightFormatting&&(r.formatting=null==N?"strong":null==A?"em":"strong em"),!0===N&&(r.em=a),!0===A&&(r.strong=a);E=f(r);return!1===N&&(r.em=!1),!1===A&&(r.strong=!1),E}}else if(" "===a&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return f(r);t.backUp(1)}if(n.strikethrough)if("~"===a&&t.eatWhile(a)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var E=f(r);return r.strikethrough=!1,E}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),f(r)}else if(" "===a&&t.match(/^~~/,!0)){if(" "===t.peek())return f(r);t.backUp(2)}return" "===a&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),f(r)}function p(e,t){if(">"===e.next()){t.f=t.inline=d,n.highlightFormatting&&(t.formatting="link");var r=f(t);return r?r+=" ":r="",r+k.linkInline}return e.match(/^[^>]+/,!0),k.linkInline}function m(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=g("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function g(e){return function(t,r){if(t.next()===e){r.f=r.inline=d,n.highlightFormatting&&(r.formatting="link-string");var i=f(r);return r.linkHref=!1,i}return t.match(I[e]),r.linkHref=!0,f(r)}}function v(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=y,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):i(e,t,d)}function y(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=x,n.highlightFormatting&&(t.formatting="link");var r=f(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function x(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=d,k.linkHref+" url")}var b=e.getMode(t,"text/html"),w="null"==b.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var k={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in k)k.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(k[C]=n.tokenTypeOverrides[C]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,T=/^\[(x| )\](?=\s)/,M=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,N=/^ *(?:\={1,}|-{1,})\s*$/,A=/^[^#!\[\]*_\\<>` "'(~]+/,E=new RegExp("^("+(!0===n.fencedCodeBlocks?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),O=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/,I={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/},D={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:d,text:h,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(b,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(l(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:b}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:D}},blankLine:l,getType:f,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return D},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../lib/codemirror"):CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}})},{"../lib/codemirror":10}],14:[function(e,t,n){!function(r){r("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=d,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!C.contextGrabbers.hasOwnProperty(n)||!C.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:d}function p(e,t,n){return"word"==e?(n.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&C.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||!1===C.matchClosing?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,n){return"endTag"!=e?(M="error",g):(f(n),d)}function v(e,t,n){return M="error",g(e,t,n)}function y(e,t,n){if("word"==e)return M="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),d}return M="error",y}function x(e,t,n){return"equals"==e?b:(C.allowMissing||(M="error"),y(e,t,n))}function b(e,t,n){return"string"==e?w:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var k=r.indentUnit,C={},S=i.htmlMode?t:n;for(var L in S)C[L]=S[L];for(var L in i)C[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:d,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(M=null,t.state=t.state(T||n,e,t),M&&(n="error"==M?n+" error":M)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==C.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=C.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,c=s>>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=l;u>0;o=256*o+e[t+f],f+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,l,s,c=8*o-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?h/s:h*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*s-1)*Math.pow(2,i),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&l,d+=p,l/=256,i-=8);for(a=a<<i|l,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},{}],16:[function(e,t,n){(function(e){(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||f.defaults,this.rules=h.normal,this.options.gfm&&(this.options.tables?this.rules=h.tables:this.rules=h.gfm)}function r(e,t){if(this.options=t||f.defaults,this.links=e,this.rules=d.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=d.breaks:this.rules=d.gfm:this.options.pedantic&&(this.rules=d.pedantic)}function i(e){this.options=e||{}}function o(e){this.tokens=[],this.token=null,this.options=e||f.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function s(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function c(){}function u(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function f(t,n,r){if(r||"function"==typeof n){r||(r=n,n=null);var i,l,s=(n=u({},f.defaults,n||{})).highlight,c=0;try{i=e.lex(t,n)}catch(e){return r(e)}l=i.length;var h=function(e){if(e)return n.highlight=s,r(e);var t;try{t=o.parse(i,n)}catch(t){e=t}return n.highlight=s,e?r(e):r(null,t)};if(!s||s.length<3)return h();if(delete n.highlight,!l)return h();for(;c<i.length;c++)!function(e){"code"!==e.type?--l||h():s(e.text,e.lang,function(t,n){return t?h(t):null==n||n===e.text?--l||h():(e.text=n,e.escaped=!0,void(--l||h()))})}(i[c])}else try{return n&&(n=u({},f.defaults,n)),o.parse(e.lex(t,n),n)}catch(e){if(e.message+="\nPlease report this to https://github.com/chjj/marked.",(n||f.defaults).silent)return"<p>An error occured:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}var h={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:c,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:c,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:c,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};h.bullet=/(?:[*+-]|\d+\.)/,h.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,h.item=s(h.item,"gm")(/bull/g,h.bullet)(),h.list=s(h.list)(/bull/g,h.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+h.def.source+")")(),h.blockquote=s(h.blockquote)("def",h.def)(),h._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",h.html=s(h.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,h._tag)(),h.paragraph=s(h.paragraph)("hr",h.hr)("heading",h.heading)("lheading",h.lheading)("blockquote",h.blockquote)("tag","<"+h._tag)("def",h.def)(),h.normal=u({},h),h.gfm=u({},h.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),h.gfm.paragraph=s(h.paragraph)("(?!","(?!"+h.gfm.fences.source.replace("\\1","\\2")+"|"+h.list.source.replace("\\1","\\3")+"|")(),h.tables=u({},h.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=h,e.lex=function(t,n){return new e(n).lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,i,o,a,l,s,c,u,f,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].split(/ *\| */);this.tokens.push(s)}else if(o=this.rules.lheading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),r=!1,f=(o=o[0].match(this.rules.item)).length,u=0;u<f;u++)c=(s=o[u]).length,~(s=s.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(c-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==f-1&&(a===(l=h.bullet.exec(o[u+1])[0])||a.length>1&&l.length>1||(e=o.slice(u+1).join("\n")+e,u=f-1)),i=r||/\n\n(?!\s*$)/.test(s),u!==f-1&&(r="\n"===s.charAt(s.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(s)}else if(t&&(o=this.rules.paragraph.exec(e)))e=e.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var d={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:c,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:c,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};d._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,d._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,d.link=s(d.link)("inside",d._inside)("href",d._href)(),d.reflink=s(d.reflink)("inside",d._inside)(),d.normal=u({},d),d.pedantic=u({},d.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),d.gfm=u({},d.normal,{escape:s(d.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(d.text)("]|","~]|")("|","|https?://|")()}),d.breaks=u({},d.gfm,{br:s(d.br)("{2,}","*")(),text:s(d.gfm.text)("{2,}","*")()}),r.rules=d,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):r=n=a(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):a(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(a(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(a(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=a(i[1]),o+=this.renderer.link(r,null,n);return o},r.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(l(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>"},i.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},o.parse=function(e,t,n){return new o(t,n).parse(e)},o.prototype.parse=function(e){this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",o="";for(n="",e=0;e<this.token.header.length;e++)({header:!0,align:this.token.align[e]}),n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});o+=this.renderer.tablerow(n)}return this.renderer.table(i,o);case"blockquote_start":for(o="";"blockquote_end"!==this.next().type;)o+=this.tok();return this.renderer.blockquote(o);case"list_start":for(var o="",a=this.token.ordered;"list_end"!==this.next().type;)o+=this.tok();return this.renderer.list(o,a);case"list_item_start":for(o="";"list_item_end"!==this.next().type;)o+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(o);case"loose_item_start":for(o="";"list_item_end"!==this.next().type;)o+=this.tok();return this.renderer.listitem(o);case"html":var l=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(l);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},c.exec=c,f.options=f.setOptions=function(e){return u(f.defaults,e),f},f.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1},f.Parser=o,f.parser=o.parse,f.Renderer=i,f.Lexer=e,f.lexer=e.lex,f.InlineLexer=r,f.inlineLexer=r.output,f.parse=f,void 0!==t&&"object"==typeof n?t.exports=f:this.marked=f}).call(function(){return this||("undefined"!=typeof window?window:e)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],17:[function(e,t,n){(function(n,r){var i;!function(){"use strict";(i=function(e,t,n,i){function o(e,t){var n=p._readFile(e,null,i.asyncLoad);i.asyncLoad?n.then(function(e){t(e)}):t(n)}function a(e){t=e,n&&s()}function l(e){n=e,t&&s()}function s(){for(p.rules=p._parseAFF(t),p.compoundRuleCodes={},u=0,h=p.compoundRules.length;u<h;u++){var e=p.compoundRules[u];for(f=0,d=e.length;f<d;f++)p.compoundRuleCodes[e[f]]=[]}"ONLYINCOMPOUND"in p.flags&&(p.compoundRuleCodes[p.flags.ONLYINCOMPOUND]=[]),p.dictionaryTable=p._parseDIC(n);for(u in p.compoundRuleCodes)0===p.compoundRuleCodes[u].length&&delete p.compoundRuleCodes[u];for(u=0,h=p.compoundRules.length;u<h;u++){var r=p.compoundRules[u],o="";for(f=0,d=r.length;f<d;f++){var a=r[f];a in p.compoundRuleCodes?o+="("+p.compoundRuleCodes[a].join("|")+")":o+=a}p.compoundRules[u]=new RegExp(o,"i")}p.loaded=!0,i.asyncLoad&&i.loadedCallback&&i.loadedCallback(p)}i=i||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=i.flags||{},this.memoized={},this.loaded=!1;var c,u,f,h,d,p=this;return e&&(p.dictionary=e,t&&n?s():"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(c=i.dictionaryPath?i.dictionaryPath:"typo/dictionaries",t||o(chrome.extension.getURL(c+"/"+e+"/"+e+".aff"),a),n||o(chrome.extension.getURL(c+"/"+e+"/"+e+".dic"),l)):(c=i.dictionaryPath?i.dictionaryPath:void 0!==r?r+"/dictionaries":"./dictionaries",t||o(c+"/"+e+"/"+e+".aff",a),n||o(c+"/"+e+"/"+e+".dic",l))),this}).prototype={load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);return this},_readFile:function(t,r,i){if(r=r||"utf8","undefined"!=typeof XMLHttpRequest){var o,a=new XMLHttpRequest;return a.open("GET",t,i),i&&(o=new Promise(function(e,t){a.onload=function(){200===a.status?e(a.responseText):t(a.statusText)},a.onerror=function(){t(a.statusText)}})),a.overrideMimeType&&a.overrideMimeType("text/plain; charset="+r),a.send(null),i?o:a.responseText}if(void 0!==e){var l=e("fs");try{if(l.existsSync(t)){var s=l.statSync(t),c=l.openSync(t,"r"),u=new n(s.size);return l.readSync(c,u,0,u.length,null),u.toString(r,0,u.length)}console.log("Path "+t+" does not exist.")}catch(e){return console.log(e),""}}},_parseAFF:function(e){var t,n,r,i,o,a,l,s,c={},u=(e=this._removeAffixComments(e)).split("\n");for(o=0,l=u.length;o<l;o++){var f=(t=u[o]).split(/\s+/),h=f[0];if("PFX"==h||"SFX"==h){var d=f[1],p=f[2],m=[];for(a=o+1,s=o+1+(r=parseInt(f[3],10));a<s;a++){var g=(i=(n=u[a]).split(/\s+/))[2],v=i[3].split("/"),y=v[0];"0"===y&&(y="");var x=this.parseRuleCodes(v[1]),b=i[4],w={};w.add=y,x.length>0&&(w.continuationClasses=x),"."!==b&&(w.match="SFX"===h?new RegExp(b+"$"):new RegExp("^"+b)),"0"!=g&&(w.remove="SFX"===h?new RegExp(g+"$"):g),m.push(w)}c[d]={type:h,combineable:"Y"==p,entries:m},o+=r}else if("COMPOUNDRULE"===h){for(a=o+1,s=o+1+(r=parseInt(f[1],10));a<s;a++)i=(t=u[a]).split(/\s+/),this.compoundRules.push(i[1]);o+=r}else"REP"===h?3===(i=t.split(/\s+/)).length&&this.replacementTable.push([i[1],i[2]]):this.flags[h]=f[1]}return c},_removeAffixComments:function(e){return e=e.replace(/^\s*#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){r.hasOwnProperty(e)||(r[e]=null),t.length>0&&(null===r[e]&&(r[e]=[]),r[e].push(t))}for(var n=(e=this._removeDicComments(e)).split("\n"),r={},i=1,o=n.length;i<o;i++){var a=n[i].split("/",2),l=a[0];if(a.length>1){var s=this.parseRuleCodes(a[1]);"NEEDAFFIX"in this.flags&&-1!=s.indexOf(this.flags.NEEDAFFIX)||t(l,s);for(var c=0,u=s.length;c<u;c++){var f=s[c],h=this.rules[f];if(h)for(var d=this._applyRule(l,h),p=0,m=d.length;p<m;p++){var g=d[p];if(t(g,[]),h.combineable)for(var v=c+1;v<u;v++){var y=s[v],x=this.rules[y];if(x&&x.combineable&&h.type!=x.type)for(var b=this._applyRule(g,x),w=0,k=b.length;w<k;w++)t(b[w],[])}}f in this.compoundRuleCodes&&this.compoundRuleCodes[f].push(l)}}else t(l.trim(),[])}return r},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,r=e.length;n<r;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?e.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;i<o;i++){var a=n[i];if(!a.match||e.match(a.match)){var l=e;if(a.remove&&(l=l.replace(a.remove,"")),"SFX"===t.type?l+=a.add:l=a.add+l,r.push(l),"continuationClasses"in a)for(var s=0,c=a.continuationClasses.length;s<c;s++){var u=this.rules[a.continuationClasses[s]];u&&(r=r.concat(this._applyRule(l,u)))}}}return r},check:function(e){if(!this.loaded)throw"Dictionary not loaded.";var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var r=t.toLowerCase();if(r!==t){if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){if(!this.loaded)throw"Dictionary not loaded.";var t,n,r=this.dictionaryTable[e];if(void 0===r){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(t=0,n=this.compoundRules.length;t<n;t++)if(e.match(this.compoundRules[t]))return!0}else{if(null===r)return!0;if("object"==typeof r)for(t=0,n=r.length;t<n;t++)if(!this.hasFlag(e,"ONLYINCOMPOUND",r[t]))return!0}return!1},hasFlag:function(e,t,n){if(!this.loaded)throw"Dictionary not loaded.";return!!(t in this.flags&&(void 0===n&&(n=Array.prototype.concat.apply([],this.dictionaryTable[e])),n&&-1!==n.indexOf(this.flags[t])))},alphabet:"",suggest:function(e,t){function n(e){var t,n,r,i,o,a,l=[];for(t=0,i=e.length;t<i;t++){var s=e[t];for(n=0,o=s.length+1;n<o;n++){var u=[s.substring(0,n),s.substring(n)];if(u[1]&&l.push(u[0]+u[1].substring(1)),u[1].length>1&&u[1][1]!==u[1][0]&&l.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2)),u[1])for(r=0,a=c.alphabet.length;r<a;r++)c.alphabet[r]!=u[1].substring(0,1)&&l.push(u[0]+c.alphabet[r]+u[1].substring(1));if(u[1])for(r=0,a=c.alphabet.length;r<a;r++)l.push(u[0]+c.alphabet[r]+u[1])}}return l}function r(e){for(var t=[],n=0,r=e.length;n<r;n++)c.check(e[n])&&t.push(e[n]);return t}if(!this.loaded)throw"Dictionary not loaded.";if(t=t||5,this.memoized.hasOwnProperty(e)){var i=this.memoized[e].limit;if(t<=i||this.memoized[e].suggestions.length<i)return this.memoized[e].suggestions.slice(0,t)}if(this.check(e))return[];for(var o=0,a=this.replacementTable.length;o<a;o++){var l=this.replacementTable[o];if(-1!==e.indexOf(l[0])){var s=e.replace(l[0],l[1]);if(this.check(s))return[s]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",this.memoized[e]={suggestions:function(e){var i,o,a=n([e]),l=n(a),s=r(a.concat(l)),u={};for(i=0,o=s.length;i<o;i++)s[i]in u?u[s[i]]+=1:u[s[i]]=1;var f=[];for(i in u)u.hasOwnProperty(i)&&f.push([i,u[i]]);f.sort(function(e,t){return e[1]<t[1]?-1:1}).reverse();var h=[],d="lowercase";for(e.toUpperCase()===e?d="uppercase":e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase()===e&&(d="capitalized"),i=0,o=Math.min(t,f.length);i<o;i++)"uppercase"===d?f[i][0]=f[i][0].toUpperCase():"capitalized"===d&&(f[i][0]=f[i][0].substr(0,1).toUpperCase()+f[i][0].substr(1)),c.hasFlag(f[i][0],"NOSUGGEST")||h.push(f[i][0]);return h}(e),limit:t},this.memoized[e].suggestions}}}(),void 0!==t&&(t.exports=i)}).call(this,e("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],18:[function(e,t,n){var r=e("codemirror");r.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections()[0].head;if(!1!==e.getStateAfter(t.line).list)e.execCommand("indentMore");else if(e.options.indentWithTabs)e.execCommand("insertTab");else{var n=Array(e.options.tabSize+1).join(" ");e.replaceSelection(n)}},r.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections()[0].head;if(!1!==e.getStateAfter(t.line).list)e.execCommand("indentLess");else if(e.options.indentWithTabs)e.execCommand("insertTab");else{var n=Array(e.options.tabSize+1).join(" ");e.replaceSelection(n)}}},{codemirror:10}],19:[function(e,t,n){"use strict";function r(e){return e=U?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function i(e,t,n){e=e||{};var r=document.createElement("a");return t=void 0==t||t,e.title&&t&&(r.title=a(e.title,e.action,n),U&&(r.title=r.title.replace("Ctrl","⌘"),r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=e.className,r}function o(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function a(e,t,n){var i,o=e;return t&&n[i=$(t)]&&(o+=" ("+r(n[i])+")"),o}function l(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),a={},l=0;l<o.length;l++)"strong"===(r=o[l])?a.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===r?a.quote=!0:"em"===r?a.italic=!0:"quote"===r?a.quote=!0:"strikethrough"===r?a.strikethrough=!0:"comment"===r?a.code=!0:"link"===r?a.link=!0:"tag"===r?a.image=!0:r.match(/^header(\-[1-6])?$/)&&(a[r.replace("header","heading")]=!0);return a}function s(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(K=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=K;var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen";var r=e.toolbarElements.fullscreen;/active/.test(r.className)?r.className=r.className.replace(/\s*active\s*/g,""):r.className+=" active";var i=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(i.className)&&N(e)}function c(e){D(e,"bold",e.options.blockStyles.bold)}function u(e){D(e,"italic",e.options.blockStyles.italic)}function f(e){D(e,"strikethrough","~~")}function h(e){function t(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function n(e){return e.state.base.base||e.state.base}function r(e,r,i,o,a){i=i||e.getLineHandle(r),o=o||e.getTokenAt({line:r,ch:1}),a=a||!!i.text&&e.getTokenAt({line:r,ch:i.text.length-1});var l=o.type?o.type.split(" "):[];return a&&n(a).indentedCode?"indented":-1!==l.indexOf("comment")&&(n(o).fencedChars||n(a).fencedChars||t(i)?"fenced":"single")}var i,o,a,l=e.options.blockStyles.code,s=e.codemirror,c=s.getCursor("start"),u=s.getCursor("end"),f=s.getTokenAt({line:c.line,ch:c.ch||1}),h=s.getLineHandle(c.line),d=r(s,c.line,h,f);if("single"===d){var p=h.text.slice(0,c.ch).replace("`",""),m=h.text.slice(c.ch).replace("`","");s.replaceRange(p+m,{line:c.line,ch:0},{line:c.line,ch:99999999999999}),c.ch--,c!==u&&u.ch--,s.setSelection(c,u),s.focus()}else if("fenced"===d)if(c.line!==u.line||c.ch!==u.ch){for(i=c.line;i>=0&&(h=s.getLineHandle(i),!t(h));i--);var g,v,y,x,b=n(s.getTokenAt({line:i,ch:1})).fencedChars;t(s.getLineHandle(c.line))?(g="",v=c.line):t(s.getLineHandle(c.line-1))?(g="",v=c.line-1):(g=b+"\n",v=c.line),t(s.getLineHandle(u.line))?(y="",x=u.line,0===u.ch&&(x+=1)):0!==u.ch&&t(s.getLineHandle(u.line+1))?(y="",x=u.line+1):(y=b+"\n",x=u.line+1),0===u.ch&&(x-=1),s.operation(function(){s.replaceRange(y,{line:x,ch:0},{line:x+(y?0:1),ch:0}),s.replaceRange(g,{line:v,ch:0},{line:v+(g?0:1),ch:0})}),s.setSelection({line:v+(g?1:0),ch:0},{line:x+(g?1:-1),ch:0}),s.focus()}else{var w=c.line;if(t(s.getLineHandle(c.line))&&("fenced"===r(s,c.line+1)?(i=c.line,w=c.line+1):(o=c.line,w=c.line-1)),void 0===i)for(i=w;i>=0&&(h=s.getLineHandle(i),!t(h));i--);if(void 0===o)for(a=s.lineCount(),o=w;o<a&&(h=s.getLineHandle(o),!t(h));o++);s.operation(function(){s.replaceRange("",{line:i,ch:0},{line:i+1,ch:0}),s.replaceRange("",{line:o-1,ch:0},{line:o,ch:0})}),s.focus()}else if("indented"===d){if(c.line!==u.line||c.ch!==u.ch)i=c.line,o=u.line,0===u.ch&&o--;else{for(i=c.line;i>=0;i--)if(!(h=s.getLineHandle(i)).text.match(/^\s*$/)&&"indented"!==r(s,i,h)){i+=1;break}for(a=s.lineCount(),o=c.line;o<a;o++)if(!(h=s.getLineHandle(o)).text.match(/^\s*$/)&&"indented"!==r(s,o,h)){o-=1;break}}var k=s.getLineHandle(o+1),C=k&&s.getTokenAt({line:o+1,ch:k.text.length-1});C&&n(C).indentedCode&&s.replaceRange("\n",{line:o+1,ch:0});for(var S=i;S<=o;S++)s.indentLine(S,"subtract");s.focus()}else{var L=c.line===u.line&&c.ch===u.ch&&0===c.ch,T=c.line!==u.line;L||T?function(e,t,n,r){var i=t.line+1,o=n.line+1,a=t.line!==n.line,l=r+"\n",s="\n"+r;a&&o++,a&&0===n.ch&&(s=r+"\n",o--),E(e,!1,[l,s]),e.setSelection({line:i,ch:0},{line:o,ch:0})}(s,c,u,l):E(s,!1,["`","`"])}}function d(e){I(e.codemirror,"quote")}function p(e){O(e.codemirror,"smaller")}function m(e){O(e.codemirror,"bigger")}function g(e){O(e.codemirror,void 0,1)}function v(e){O(e.codemirror,void 0,2)}function y(e){O(e.codemirror,void 0,3)}function x(e){I(e.codemirror,"unordered-list")}function b(e){I(e.codemirror,"ordered-list")}function w(e){H(e.codemirror)}function k(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";if(r.promptURLs&&!(i=prompt(r.promptTexts.link)))return!1;E(t,n.link,r.insertTexts.link,i)}function C(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";if(r.imageURLFn?i=r.imageURLFn():r.promptURLs&&(i=prompt(r.promptTexts.image)),!i)return!1;E(t,n.image,r.insertTexts.image,i)}function S(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.table,r.insertTexts.table)}function L(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.image,r.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function M(e){var t=e.codemirror;t.redo(),t.focus()}function N(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||s(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,c=n.previousSibling;l.className=l.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){r.innerHTML=e.options.previewRender(e.value(),r)}),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function A(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild;o&&/editor-preview/.test(o.className)||((o=document.createElement("div")).className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&N(e)}function E(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],a=n[1],l=e.getCursor("start"),s=e.getCursor("end");r&&(a=a.replace("#url#",r)),t?(o=(i=e.getLine(l.line)).slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function O(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/);i=void 0!==t?o<=0?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?o<=0?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?o<=0?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):o<=0?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o);e.focus()}}function I(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=l(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)!function(r){var i=e.getLine(r);i=n[t]?i.replace(o[t],"$1"):a[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(s);e.focus()}}function D(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r=void 0===r?n:r;var i,o=e.codemirror,a=l(o),s=n,c=r,u=o.getCursor("start"),f=o.getCursor("end");a[t]?(s=(i=o.getLine(u.line)).slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==f&&(f.ch-=2)):"italic"==t&&(u.ch-=1,u!==f&&(f.ch-=1))):(i=o.getSelection(),"bold"==t?i=(i=i.split("**").join("")).split("__").join(""):"italic"==t?i=(i=i.split("*").join("")).split("_").join(""):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,f.ch=u.ch+i.length),o.setSelection(u,f),o.focus()}}function H(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=(t=e.getLine(i)).replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}function W(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=W(e[n]||{},t[n]):e[n]=t[n]);return e}function B(e){for(var t=1;t<arguments.length;t++)e=W(e,arguments[t]);return e}function R(e){var t=/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),r=0;if(null===n)return r;for(var i=0;i<n.length;i++)n[i].charCodeAt(0)>=19968?r+=n[i].length:r+=1;return r}function P(e){(e=e||{}).parent=this;var t=!0;if(!1===e.autoDownloadFontAwesome&&(t=!1),!0!==e.autoDownloadFontAwesome)for(var n=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar){e.toolbar=[];for(var o in X)X.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(!0===X[o].default||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=B({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=B({},Y,e.insertTexts||{}),e.promptTexts=Z,e.blockStyles=B({},J,e.blockStyles||{}),e.shortcuts=B({},G,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&!0===this.options.autosave.foundSavedValue||this.value(e.initialValue)}function F(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var z=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var _=e("codemirror-spell-checker"),j=e("marked"),U=/Mac/.test(navigator.platform),q={toggleBold:c,toggleItalic:u,drawLink:k,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:C,toggleBlockquote:d,toggleOrderedList:b,toggleUnorderedList:x,toggleCodeBlock:h,togglePreview:A,toggleStrikethrough:f,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:S,drawHorizontalRule:L,undo:T,redo:M,toggleSideBySide:N,toggleFullScreen:s},G={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},$=function(e){for(var t in q)if(q[t]===e)return t;return null},V=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},K="",X={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold",default:!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:f,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:d,className:"fa fa-quote-left",title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:x,className:"fa fa-list-ul",title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:b,className:"fa fa-list-ol",title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:k,className:"fa fa-link",title:"Create Link",default:!0},image:{name:"image",action:C,className:"fa fa-picture-o",title:"Insert Image",default:!0},table:{name:"table",action:S,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:L,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:A,className:"fa fa-eye no-disable",title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:N,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:s,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:M,className:"fa fa-repeat no-disable",title:"Redo"}},Y={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Z={link:"URL for the link:",image:"URL of the image:"},J={bold:"**",code:"```",italic:"*"};P.prototype.markdown=function(e){if(j){var t={};return this.options&&this.options.renderingConfig&&!1===this.options.renderingConfig.singleLineBreaks?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&!0===this.options.renderingConfig.codeSyntaxHighlighting&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),j.setOptions(t),j(e)}},P.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,i={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==q[o]&&function(e){i[r(t.shortcuts[e])]=function(){q[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(e){e.getOption("fullScreen")&&s(n)},document.addEventListener("keydown",function(e){27==(e=e||window.event).keyCode&&n.codemirror.getOption("fullScreen")&&s(n)},!1);var a,l;if(!1!==t.spellChecker?(a="spell-checker",(l=t.parsingConfig).name="gfm",l.gitHubSpice=!1,_({codeMirrorInstance:z})):((a=t.parsingConfig).name="gfm",a.gitHubSpice=!1),this.codemirror=z.fromTextArea(e,{mode:a,backdrop:l,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:!1!==t.indentWithTabs,lineNumbers:!1,autofocus:!0===t.autofocus,extraKeys:i,lineWrapping:!1!==t.lineWrapping,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:void 0==t.styleSelectedText||t.styleSelectedText}),this.codemirror.changeEnd=z.changeEnd,!0===t.forceSync){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},!1!==t.toolbar&&(this.gui.toolbar=this.createToolbar()),!1!==t.status&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&!0===t.autosave.enabled&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var u=this.codemirror;setTimeout(function(){u.refresh()}.bind(u),0)}},P.prototype.autosave=function(){if(F()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),!0!==this.options.autosave.loaded&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",a=r;a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=i<10?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},P.prototype.clearAutosavedValue=function(){if(F()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},P.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||((n=document.createElement("div")).className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var r=!1,i=!1;return e.on("scroll",function(e){if(r)r=!1;else{i=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,a=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=a}}),n.onscroll=function(){if(i)i=!1;else{r=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,a=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,a)}},n},P.prototype.createToolbar=function(e){if((e=e||this.options.toolbar)&&0!==e.length){var t;for(t=0;t<e.length;t++)void 0!=X[e[t]]&&(e[t]=X[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var r=this,a={};for(r.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||!1!==r.options.toolbarGuideIcon)&&!(r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&V())){if("|"===e[t]){for(var s=!1,c=t+1;c<e.length;c++)"|"===e[c]||r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[c].name)||(s=!0);if(!s)continue}!function(e){var t;t="|"===e?o():i(e,r.options.toolbarTips,r.options.shortcuts),e.action&&("function"==typeof e.action?t.onclick=function(t){t.preventDefault(),e.action(r)}:"string"==typeof e.action&&(t.href=e.action,t.target="_blank")),a[e.name||e]=t,n.appendChild(t)}(e[t])}r.toolbarElements=a;var u=this.codemirror;u.on("cursorActivity",function(){var e=l(u);for(var t in a)!function(t){var n=a[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)});var f=u.getWrapperElement();return f.parentNode.insertBefore(n,f),n}},P.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var r,i,o,a=[];for(r=0;r<e.length;r++)if(i=void 0,o=void 0,"object"==typeof e[r])a.push({className:e[r].className,defaultValue:e[r].defaultValue,onUpdate:e[r].onUpdate});else{var l=e[r];"words"===l?(o=function(e){e.innerHTML=R(n.getValue())},i=function(e){e.innerHTML=R(n.getValue())}):"lines"===l?(o=function(e){e.innerHTML=n.lineCount()},i=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(o=function(e){e.innerHTML="0:0"},i=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===l&&(o=function(e){void 0!=t.autosave&&!0===t.autosave.enabled&&e.setAttribute("id","autosaved")}),a.push({className:l,defaultValue:o,onUpdate:i})}var s=document.createElement("div");for(s.className="editor-statusbar",r=0;r<a.length;r++){var c=a[r],u=document.createElement("span");u.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(u),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(u,c)),s.appendChild(u)}var f=this.codemirror.getWrapperElement();return f.parentNode.insertBefore(s,f.nextSibling),s}},P.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},P.toggleBold=c,P.toggleItalic=u,P.toggleStrikethrough=f,P.toggleBlockquote=d,P.toggleHeadingSmaller=p,P.toggleHeadingBigger=m,P.toggleHeading1=g,P.toggleHeading2=v,P.toggleHeading3=y,P.toggleCodeBlock=h,P.toggleUnorderedList=x,P.toggleOrderedList=b,P.cleanBlock=w,P.drawLink=k,P.drawImage=C,P.drawTable=S,P.drawHorizontalRule=L,P.undo=T,P.redo=M,P.togglePreview=A,P.toggleSideBySide=N,P.toggleFullScreen=s,P.prototype.toggleBold=function(){c(this)},P.prototype.toggleItalic=function(){u(this)},P.prototype.toggleStrikethrough=function(){f(this)},P.prototype.toggleBlockquote=function(){d(this)},P.prototype.toggleHeadingSmaller=function(){p(this)},P.prototype.toggleHeadingBigger=function(){m(this)},P.prototype.toggleHeading1=function(){g(this)},P.prototype.toggleHeading2=function(){v(this)},P.prototype.toggleHeading3=function(){y(this)},P.prototype.toggleCodeBlock=function(){h(this)},P.prototype.toggleUnorderedList=function(){x(this)},P.prototype.toggleOrderedList=function(){b(this)},P.prototype.cleanBlock=function(){w(this)},P.prototype.drawLink=function(){k(this)},P.prototype.drawImage=function(){C(this)},P.prototype.drawTable=function(){S(this)},P.prototype.drawHorizontalRule=function(){L(this)},P.prototype.undo=function(){T(this)},P.prototype.redo=function(){M(this)},P.prototype.togglePreview=function(){A(this)},P.prototype.toggleSideBySide=function(){N(this)},P.prototype.toggleFullScreen=function(){s(this)},P.prototype.isPreviewActive=function(){var e=this.codemirror.getWrapperElement().lastChild;return/editor-preview-active/.test(e.className)},P.prototype.isSideBySideActive=function(){var e=this.codemirror.getWrapperElement().nextSibling;return/editor-preview-active-side/.test(e.className)},P.prototype.isFullscreenActive=function(){return this.codemirror.getOption("fullScreen")},P.prototype.getState=function(){return l(this.codemirror)},P.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement();t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=P},{"./codemirror/tablist":18,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,marked:16}]},{},[19])(19)}); |