From 80b5de66c93071c02e26bc0a0790cdc8e378f016 Mon Sep 17 00:00:00 2001 From: oldj Date: Wed, 16 Aug 2017 20:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=90=9C=E7=B4=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E3=80=82=20#148=20#213?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app-ui/content/Editor.jsx | 112 ++++++++++++++++++++++++++++++++------ app-ui/libs/search.js | 56 +++++++++++++++++++ app/lang/cn.js | 1 + app/lang/en.js | 1 + app/ui/bundle.js | 2 +- 5 files changed, 153 insertions(+), 19 deletions(-) create mode 100644 app-ui/libs/search.js diff --git a/app-ui/content/Editor.jsx b/app-ui/content/Editor.jsx index d296f01ef..4309318e5 100644 --- a/app-ui/content/Editor.jsx +++ b/app-ui/content/Editor.jsx @@ -12,6 +12,7 @@ import 'codemirror/addon/comment/comment' import classnames from 'classnames' import m_kw from './kw' import Agent from '../Agent' +import * as func from '../libs/search' import 'codemirror/lib/codemirror.css' import styles from './Editor.less' @@ -25,28 +26,54 @@ export default class Editor extends React.Component { this.codemirror = null - this.marks = [] - this.kw = '' - - this.state = {} + this.state = { + marks: [], + pos: [], + search_kw: '' + } - Agent.on('search:kw', kw => { - this.kw = kw - this.highlightKeyword() - }) } - highlightKeyword () { - while (this.marks.length > 0) { - this.marks.shift().clear() + //highlightKeyword () { + // while (this.marks.length > 0) { + // this.marks.shift().clear() + // } + // + // let code = this.props.code + // let pos = m_kw.findPositions(this.kw, code) || [] + // // this.codemirror.markText({line: 6, ch: 16}, {line: 6, ch: 22}, {className: 'cm-hl'}); + // + // pos.map((p) => { + // this.marks.push(this.codemirror.markText(p[0], p[1], {className: 'cm-hl'})) + // }) + //} + + doSearch () { + let {marks, search_kw} = this.state + while (marks.length > 0) { + marks.shift().clear() + } + let pos = [] + + let {code} = this.props + if (search_kw && code) { + pos = m_kw.findPositions(search_kw, code) + pos.map(p => { + marks.push(this.codemirror.markText(p[0], p[1], {className: 'cm-hl'})) + }) } - let code = this.props.code - let pos = m_kw.findPositions(this.kw, code) || [] - // this.codemirror.markText({line: 6, ch: 16}, {line: 6, ch: 22}, {className: 'cm-hl'}); - - pos.map((p) => { - this.marks.push(this.codemirror.markText(p[0], p[1], {className: 'cm-hl'})) + let doc = this.codemirror.getDoc() + let cursor = doc.getCursor() + + this.setState({marks, pos}, () => { + Agent.emit('search:state', { + count: marks.length, + pos: pos.slice(0), + has_next: !!this.getNext(), + has_previous: !!this.getPrevious(), + cursor + }) }) } @@ -68,6 +95,45 @@ export default class Editor extends React.Component { }) } + getNext () { + let doc = this.codemirror.getDoc() + let cursor = doc.getCursor() + let {pos} = this.state + let next_pos = func.getNextPos(pos, cursor) + //console.log(next_pos) + return next_pos + } + + gotoNext () { + this.docSelect(this.getNext()) + } + + getPrevious () { + let doc = this.codemirror.getDoc() + let cursor = doc.getCursor() + let {pos} = this.state + let prev_pos = func.getPreviousPos(pos, cursor) + //console.log(next_pos) + return prev_pos + } + + gotoPrevious () { + this.docSelect(this.getPrevious()) + } + + docSelect (pos) { + console.log(pos) + if (!pos || !Array.isArray(pos)) return + let doc = this.codemirror.getDoc() + doc.setCursor(pos[1]) + doc.setSelection(pos[0], pos[1]) + + Agent.emit('search:state', { + has_next: !!this.getNext(), + has_previous: !!this.getPrevious() + }) + } + componentDidMount () { // console.log(this.cnt_node, this.cnt_node.value); this.codemirror = CodeMirror.fromTextArea(this.cnt_node, { @@ -108,6 +174,15 @@ export default class Editor extends React.Component { Agent.on('to_comment', () => { this.toComment() }) + + Agent.on('search:goto_previous', () => this.gotoPrevious()) + Agent.on('search:goto_next', () => this.gotoNext()) + Agent.on('editor:select', pos => this.docSelect(pos)) + + Agent.on('search:kw', kw => { + //this.highlightKeyword() + this.setState({search_kw: kw}, () => this.doSearch()) + }) } componentWillReceiveProps (next_props) { @@ -119,7 +194,8 @@ export default class Editor extends React.Component { } cm.setOption('readOnly', next_props.readonly) setTimeout(() => { - this.highlightKeyword() + //this.highlightKeyword() + this.doSearch() }, 100) } diff --git a/app-ui/libs/search.js b/app-ui/libs/search.js new file mode 100644 index 000000000..58eaeb16c --- /dev/null +++ b/app-ui/libs/search.js @@ -0,0 +1,56 @@ +/** + * search + * @author oldj + * @blog https://oldj.net + */ + +'use strict' + +export function getNextPos (pos, cursor) { + let {ch, line} = cursor + + let mm = 1e10 + let target_ch = mm + let target_line = mm + let target_pos = null + + pos.map(p => { + let p_ch = p[0].ch + let p_line = p[0].line + if (p_line < line) return + if (p_line === line && p_ch < ch) return + + if ((p_line < target_line) || (p_line === target_line && p_ch < target_ch)) { + target_line = p_line + target_ch = p_ch + + target_pos = p + } + }) + + return target_pos +} + +export function getPreviousPos (pos, cursor) { + let {ch, line} = cursor + + let target_ch = 0 + let target_line = 0 + let target_pos = null + + pos.map(p => { + let p_ch = p[1].ch + let p_line = p[1].line + if (p_line > line) return + if (p_line === line && p_ch >= ch) return + + if ((p_line > target_line) || (p_line === target_line && p_ch > target_ch)) { + target_line = p_line + target_ch = p_ch + + target_pos = p + } + }) + + return target_pos +} diff --git a/app/lang/cn.js b/app/lang/cn.js index 44049cc5f..675c1704a 100644 --- a/app/lang/cn.js +++ b/app/lang/cn.js @@ -46,6 +46,7 @@ exports.content = { , is_updated_title: '已是最新' , language: '语言' , last_refresh: '上次更新:' + , matches: '匹配' , menu_about: '关于' , menu_bringalltofront: '所有窗口移至最前' , menu_close: '关闭' diff --git a/app/lang/en.js b/app/lang/en.js index 1e56e8d5a..a2a1bdf15 100644 --- a/app/lang/en.js +++ b/app/lang/en.js @@ -46,6 +46,7 @@ exports.content = { , is_updated_title: 'You are up to date!' , language: 'Language' , last_refresh: 'Last refresh: ' + , matches: 'matches' , menu_about: 'About' , menu_bringalltofront: 'Bring All to Front' , menu_close: 'Close' diff --git a/app/ui/bundle.js b/app/ui/bundle.js index d3ecd2683..082bda46d 100644 --- a/app/ui/bundle.js +++ b/app/ui/bundle.js @@ -1,3 +1,3 @@ /*! SwitchHosts! bundle.js v3.3.7.5305, 2017-08-16 19:36:02 */ -!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=314)}([function(t,e,n){"use strict";var r=n(2),o=n(101);t.exports=function(t){return function e(n,a){switch(arguments.length){case 0:return e;case 1:return o(n)?e:r(function(e){return t(n,e)});default:return o(n)&&o(a)?e:o(n)?r(function(e){return t(e,a)}):o(a)?r(function(e){return t(n,e)}):t(n,a)}}}},function(t,e,n){"use strict";t.exports=n(55)},function(t,e,n){"use strict";var r=n(101);t.exports=function(t){return function e(n){return 0===arguments.length||r(n)?e:t.apply(this,arguments)}}},function(t,e,n){"use strict";var r=n(2),o=n(0),a=n(101);t.exports=function(t){return function e(n,i,l){switch(arguments.length){case 0:return e;case 1:return a(n)?e:o(function(e,r){return t(n,e,r)});case 2:return a(n)&&a(i)?e:a(n)?o(function(e,n){return t(e,i,n)}):a(i)?o(function(e,r){return t(n,e,r)}):r(function(e){return t(n,i,e)});default:return a(n)&&a(i)&&a(l)?e:a(n)&&a(i)?o(function(e,n){return t(e,n,l)}):a(n)&&a(l)?o(function(e,n){return t(e,i,n)}):a(i)&&a(l)?o(function(e,r){return t(n,e,r)}):a(n)?r(function(e){return t(e,i,l)}):a(i)?r(function(e){return t(n,e,l)}):a(l)?r(function(e){return t(n,i,e)}):t(n,i,l)}}}},function(t,e,n){"use strict";function r(t,e,n,r,a,i,l,s){if(o(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,i,l,s],d=0;c=new Error(e.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(t){};t.exports=r},function(t,e,n){"use strict";e.__esModule=!0;var r=n(407),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=o.default||function(t){for(var e=1;e1?e-1:0),r=1;r0&&"function"==typeof n[n.length-1]&&(a=n.pop()),"function"==typeof a&&l.once(o,function(t,e){return a.apply(null,e)}),l.send("x",{action:t,data:n,callback:o})}function o(t){for(var e=arguments.length,n=Array(e>1?e-1:0),o=1;o=0&&y.splice(e,1)}function l(t){var e=document.createElement("style");return t.attrs.type="text/css",c(e,t.attrs),a(t,e),e}function s(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",c(e,t.attrs),a(t,e),e}function c(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function u(t,e){var n,r,o;if(e.singleton){var a=v++;n=g||(g=l(e)),r=d.bind(null,n,a,!1),o=d.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(e),r=f.bind(null,n,e),o=function(){i(n),n.href&&URL.revokeObjectURL(n.href)}):(n=l(e),r=p.bind(null,n),o=function(){i(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}function d(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(e,o);else{var a=document.createTextNode(o),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(a,i[e]):t.appendChild(a)}}function p(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function f(t,e,n){var r=n.css,o=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||a)&&(r=x(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=t.href;t.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}var h={},m=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),b=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t.call(this,n)),e[n]}}(function(t){return document.querySelector(t)}),g=null,v=0,y=[],x=n(458);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},void 0===e.singleton&&(e.singleton=m()),void 0===e.insertInto&&(e.insertInto="head"),void 0===e.insertAt&&(e.insertAt="bottom");var n=o(t);return r(n,e),function(t){for(var a=[],i=0;i=0;)l=e[s],o(l,r)&&!i(c,l)&&(c[c.length]=l),s-=1;return c}:function(t){return Object(t)!==t?[]:Object.keys(t)})}()},function(t,e,n){"use strict";var r=n(3),o=n(29);t.exports=r(o)},function(t,e,n){"use strict";var r={current:null};t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){this.dispatchConfig=t,this._targetInst=e,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];l?this[a]=l(n):"target"===a?this.target=r:this[a]=n[a]}var s=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=s?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse,this}var o=n(15),a=n(46),i=n(28),l=(n(8),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),s={type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!=typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!=typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var t=this.constructor.Interface;for(var e in t)this[e]=null;for(var n=0;n=0&&"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";t.exports=function(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}},function(t,e,n){"use strict";var r=n(13),o=(n(4),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),a=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},i=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},l=function(t,e,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,t,e,n,r),a}return new o(t,e,n,r)},s=function(t){var e=this;t instanceof e||r("25"),t.destructor(),e.instancePool.length0;--e)t.removeChild(t.firstChild);return t}function n(t,n){return e(t).appendChild(n)}function r(t,e,n,r){var o=document.createElement(t);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof e)o.appendChild(document.createTextNode(e));else if(e)for(var a=0;a=e)return i+(e-a);i+=l-a,i+=n-i%n,a=l+1}}function f(t,e){for(var n=0;n=e)return r+Math.min(i,e-o);if(o+=a-r,o+=n-o%n,r=a+1,o>=e)return r}}function m(t){for(;Di.length<=t;)Di.push(b(Di)+" ");return Di[t]}function b(t){return t[t.length-1]}function g(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||Ii.test(t))}function k(t,e){return e?!!(e.source.indexOf("\\w")>-1&&w(t))||e.test(t):w(t)}function A(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function C(t){return t.charCodeAt(0)>=768&&zi.test(t)}function E(t,e,n){for(;(n<0?e>0:e=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var o=n.children[r],a=o.chunkSize();if(e=t.first&&en?L(n,S(t,n).text.length):V(e,S(t,e.line).text.length)}function V(t,e){var n=t.ch;return null==n||n>e?L(t.line,e):n<0?L(t.line,0):t}function K(t,e){for(var n=[],r=0;r=e:a.to>e);(r||(r=[])).push(new q(i,a.from,s?null:a.to))}}return r}function $(t,e,n){var r;if(t)for(var o=0;o=e:a.to>e);if(l||a.from==e&&"bookmark"==i.type&&(!n||a.marker.insertLeft)){var s=null==a.from||(i.inclusiveLeft?a.from<=e:a.from0&&l)for(var w=0;w0)){var u=[s,1],d=B(c.from,l.from),p=B(c.to,l.to);(d<0||!i.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(p>0||!i.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),o.splice.apply(o,u),s+=u.length-3}}return o}function rt(t){var e=t.markedSpans;if(e){for(var n=0;n=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?B(c.to,n)>=0:B(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?B(c.from,r)<=0:B(c.from,r)<0)))return!0}}}function pt(t){for(var e;e=ct(t);)t=e.find(-1,!0).line;return t}function ft(t){for(var e;e=ut(t);)t=e.find(1,!0).line;return t}function ht(t){for(var e,n;e=ut(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function mt(t,e){var n=S(t,e),r=pt(n);return n==r?e:P(r)}function bt(t,e){if(e>t.lastLine())return e;var n,r=S(t,e);if(!gt(t,r))return e;for(;n=ut(r);)r=n.find(1,!0).line;return P(r)+1}function gt(t,e){var n=Bi&&e.markedSpans;if(n)for(var r=void 0,o=0;oe.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}function kt(t,e,n,r){if(!t)return r(e,n,"ltr");for(var o=!1,a=0;ae||e==n&&i.to==e)&&(r(Math.max(i.from,e),Math.min(i.to,n),1==i.level?"rtl":"ltr"),o=!0)}o||r(e,n,"ltr")}function At(t,e,n){var r;ji=null;for(var o=0;oe)return o;a.to==e&&(a.from!=a.to&&"before"==n?r=o:ji=o),a.from==e&&(a.from!=a.to&&"before"!=n?r=o:ji=o)}return null!=r?r:ji}function Ct(t,e){var n=t.order;return null==n&&(n=t.order=Ri(t.text,e)),n}function Et(t,e,n){var r=E(t.text,e+n,n);return r<0||r>t.text.length?null:r}function _t(t,e,n){var r=Et(t,e.ch,n);return null==r?null:new L(e.line,r,n<0?"after":"before")}function Mt(t,e,n,r,o){if(t){var a=Ct(n,e.doc.direction);if(a){var i,l=o<0?b(a):a[0],s=o<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Qe(e,n);i=o<0?n.text.length-1:0;var d=Je(e,u,i).top;i=_(function(t){return Je(e,u,t).top==d},o<0==(1==l.level)?l.from:l.to-1,i),"before"==c&&(i=Et(n,i,1))}else i=o<0?l.to:l.from;return new L(r,i,c)}}return new L(r,o<0?n.text.length:0,o<0?"before":"after")}function St(t,e,n,r){var o=Ct(e,t.doc.direction);if(!o)return _t(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=At(o,n.ch,n.sticky),i=o[a];if("ltr"==t.doc.direction&&i.level%2==0&&(r>0?i.to>n.ch:i.from=i.from&&p>=u.begin)){var f=d?"before":"after";return new L(n.line,p,f)}}var h=function(t,e,r){for(var a=function(t,e){return e?new L(n.line,s(t,1),"before"):new L(n.line,t,"after")};t>=0&&t0==(1!=i.level),c=l?r.begin:s(r.end,-1);if(i.from<=c&&c0?u.end:s(u.begin,-1);return null==b||r>0&&b==e.text.length||!(m=h(r>0?0:o.length-1,r,c(b)))?null:m}function Ot(t,e){return t._handlers&&t._handlers[e]||Fi}function Tt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,o=r&&r[e];if(o){var a=f(o,n);a>-1&&(r[e]=o.slice(0,a).concat(o.slice(a+1)))}}}function Nt(t,e){var n=Ot(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function zt(t){t.prototype.on=function(t,e){Ui(this,t,e)},t.prototype.off=function(t,e){Tt(this,t,e)}}function Lt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Bt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function jt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Rt(t){Lt(t),Bt(t)}function Ft(t){return t.target||t.srcElement}function Ut(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),bi&&t.ctrlKey&&1==e&&(e=3),e}function Wt(t){if(null==_i){var e=r("span","​");n(t,r("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(_i=e.offsetWidth<=1&&e.offsetHeight>2&&!(oi&&ai<8))}var o=_i?r("span","​"):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}function Ht(t){if(null!=Mi)return Mi;var r=n(t,document.createTextNode("AخA")),o=xi(r,0,1).getBoundingClientRect(),a=xi(r,1,2).getBoundingClientRect();return e(t),!(!o||o.left==o.right)&&(Mi=a.right-o.right<3)}function Vt(t){if(null!=Yi)return Yi;var e=n(t,r("span","x")),o=e.getBoundingClientRect(),a=xi(e,0,1).getBoundingClientRect();return Yi=Math.abs(o.left-a.left)>1}function Kt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Xi[t]=e}function Yt(t,e){qi[t]=e}function Xt(t){if("string"==typeof t&&qi.hasOwnProperty(t))t=qi[t];else if(t&&"string"==typeof t.name&&qi.hasOwnProperty(t.name)){var e=qi[t.name];"string"==typeof e&&(e={name:e}),t=x(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Xt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Xt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function qt(t,e){e=Xt(e);var n=Xi[e.name];if(!n)return qt(t,"text/plain");var r=n(t,e);if(Gi.hasOwnProperty(e.name)){var o=Gi[e.name];for(var a in o)o.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=o[a])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var i in e.modeProps)r[i]=e.modeProps[i];return r}function Gt(t,e){d(e,Gi.hasOwnProperty(t)?Gi[t]:Gi[t]={})}function Zt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Qt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Jt(t,e,n){return!t.startState||t.startState(e,n)}function $t(t,e,n,r){var o=[t.state.modeGen],a={};le(t,e.text,t.doc.mode,n,function(t,e){return o.push(t,e)},a,r);for(var i=0;it&&o.splice(i,1,t,o[i+1],a),i+=2,l=Math.min(t,a)}if(e)if(r.opaque)o.splice(n,i-n,t,"overlay "+e),i=n+2;else for(;nt.options.maxHighlightLength?Zt(t.doc.mode,r):r);e.stateAfter=r,e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.frontier&&t.doc.frontier++}return e.styles}function ee(t,e,n){var r=t.doc,o=t.display;if(!r.mode.startState)return!0;var a=se(t,e,n),i=a>r.first&&S(r,a-1).stateAfter;return i=i?Zt(r.mode,i):Jt(r.mode),r.iter(a,e,function(n){ne(t,n.text,i);var l=a==e-1||a%5==0||a>=o.viewFrom&&ae.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function ae(t,e,n,r){var o,a=function(t){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:t?Zt(i.mode,u):u}},i=t.doc,l=i.mode;e=H(i,e);var s,c=S(i,e.line),u=ee(t,e.line,n),d=new Zi(c.text,t.options.tabSize);for(r&&(s=[]);(r||d.post.options.maxHighlightLength?(l=!1,i&&ne(t,e,r,d.pos),d.pos=e.length,s=null):s=ie(oe(n,d,r,p),a),p){var f=p[0].name;f&&(s="m-"+(s?f+" "+s:f))}if(!l||u!=s){for(;ci;--l){if(l<=a.first)return a.first;var s=S(a,l-1);if(s.stateAfter&&(!n||l<=a.frontier))return l;var c=p(s.text,null,t.options.tabSize);(null==o||r>c)&&(o=l-1,r=c)}return o}function ce(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),rt(t),ot(t,n);var o=r?r(t):1;o!=t.height&&N(t,o)}function ue(t){t.parent=null,rt(t)}function de(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?tl:$i;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function pe(t,e){var n=o("span",null,null,ii?"padding-right: .1px":null),r={pre:o("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:(oi||ii)&&t.getOption("lineWrapping")};e.measure={};for(var a=0;a<=(e.rest?e.rest.length:0);a++){var i=a?e.rest[a-1]:e.line,l=void 0;r.pos=0,r.addToken=he,Ht(t.display.measure)&&(l=Ct(i,t.doc.direction))&&(r.addToken=be(r.addToken,l)),r.map=[];ve(i,r,te(t,i,e!=t.display.externalMeasured&&P(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=c(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=c(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Wt(t.display.measure))),0==a?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(ii){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Nt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=c(r.pre.className,r.textClass||"")),r}function fe(t){var e=r("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function he(t,e,n,o,a,i,l){if(e){var s,c=t.splitSpaces?me(e,t.trailingSpace):e,u=t.cm.state.specialChars,d=!1;if(u.test(e)){s=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var f=u.exec(e),h=f?f.index-p:e.length-p;if(h){var b=document.createTextNode(c.slice(p,p+h));oi&&ai<9?s.appendChild(r("span",[b])):s.appendChild(b),t.map.push(t.pos,t.pos+h,b),t.col+=h,t.pos+=h}if(!f)break;p+=h+1;var g=void 0;if("\t"==f[0]){var v=t.cm.options.tabSize,y=v-t.col%v;g=s.appendChild(r("span",m(y),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),t.col+=y}else"\r"==f[0]||"\n"==f[0]?(g=s.appendChild(r("span","\r"==f[0]?"␍":"␤","cm-invalidchar")),g.setAttribute("cm-text",f[0]),t.col+=1):(g=t.cm.options.specialCharPlaceholder(f[0]),g.setAttribute("cm-text",f[0]),oi&&ai<9?s.appendChild(r("span",[g])):s.appendChild(g),t.col+=1);t.map.push(t.pos,t.pos+1,g),t.pos++}}else t.col+=e.length,s=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,s),oi&&ai<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),n||o||a||d||l){var x=n||"";o&&(x+=o),a&&(x+=a);var w=r("span",[s],x,l);return i&&(w.title=i),t.content.appendChild(w)}t.content.appendChild(s)}}function me(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",o=0;oc&&d.from<=c));p++);if(d.to>=u)return t(n,r,o,a,i,l,s);t(n,r.slice(0,d.to-c),o,a,null,l,s),a=null,r=r.slice(d.to-c),c=d.to}}}function ge(t,e,n,r){var o=!r&&n.widgetNode;o&&t.map.push(t.pos,t.pos+e,o),!r&&t.cm.display.input.needsContentAttribute&&(o||(o=t.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(t.cm.display.input.setUneditable(o),t.content.appendChild(o)),t.pos+=e,t.trailingSpace=!1}function ve(t,e,n){var r=t.markedSpans,o=t.text,a=0;if(r)for(var i,l,s,c,u,d,p,f=o.length,h=0,m=1,b="",g=0;;){if(g==h){s=c=u=d=l="",p=null,g=1/0;for(var v=[],y=void 0,x=0;xh||k.collapsed&&w.to==h&&w.from==h)?(null!=w.to&&w.to!=h&&g>w.to&&(g=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==h&&(u+=" "+k.startStyle),k.endStyle&&w.to==g&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!d&&(d=k.title),k.collapsed&&(!p||lt(p.marker,k)<0)&&(p=w)):w.from>h&&g>w.from&&(g=w.from)}if(y)for(var A=0;A=f)break;for(var E=Math.min(f,g);;){if(b){var _=h+b.length;if(!p){var M=_>E?b.slice(0,E-h):b;e.addToken(e,M,i?i+s:s,u,h+M.length==g?c:"",d,l)}if(_>=E){b=b.slice(E-h),h=E;break}h=_,u=""}b=o.slice(a,a=n[m++]),i=de(n[m++],e.cm.options)}}else for(var S=1;S2&&a.push((s.bottom+c.top)/2-n.top)}}a.push(n.bottom-n.top)}}function Xe(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;rn)return{map:t.measure.maps[o],cache:t.measure.caches[o],before:!0}}function qe(t,e){e=pt(e);var r=P(e),o=t.display.externalMeasured=new ye(t.doc,e,r);o.lineN=r;var a=o.built=pe(t,o);return o.text=a.pre,n(t.display.lineMeasure,a.pre),o}function Ge(t,e,n,r){return Je(t,Qe(t,e),n,r)}function Ze(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(a=s-l,o=a-1,e>=s&&(i="right")),null!=o){if(r=t[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(i=n),"left"==n&&0==o)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[2+(c-=3)],i="left";if("right"==n&&o==s-l)for(;c=0&&(n=t[o]).left==n.right;o--);return n}function en(t,e,n,r){var o,a=$e(e.map,n,r),i=a.node,l=a.start,s=a.end,c=a.collapse;if(3==i.nodeType){for(var u=0;u<4;u++){for(;l&&C(e.line.text.charAt(a.coverStart+l));)--l;for(;a.coverStart+s0&&(c=r="right");var d;o=t.options.lineWrapping&&(d=i.getClientRects()).length>1?d["right"==r?d.length-1:0]:i.getBoundingClientRect()}if(oi&&ai<9&&!l&&(!o||!o.left&&!o.right)){var p=i.parentNode.getClientRects()[0];o=p?{left:p.left,right:p.left+xn(t.display),top:p.top,bottom:p.bottom}:rl}for(var f=o.top-e.rect.top,h=o.bottom-e.rect.top,m=(f+h)/2,b=e.view.measure.heights,g=0;g=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return i("before"==u?c-1:c,"before"==u);var d=At(s,c,u),p=ji,f=l(c,d,"before"==u);return null!=p&&(f.other=l(c,p,"before"!=u)),f}function fn(t,e){var n=0;e=H(t.doc,e),t.options.lineWrapping||(n=xn(t.display)*e.ch);var r=S(t.doc,e.line),o=yt(r)+Fe(t.display);return{left:n,right:n,top:o,bottom:o+r.height}}function hn(t,e,n,r,o){var a=L(t,e,n);return a.xRel=o,r&&(a.outside=!0),a}function mn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return hn(r.first,0,null,!0,-1);var o=D(r,n),a=r.first+r.size-1;if(o>a)return hn(r.first+r.size-1,S(r,a).text.length,null,!0,1);e<0&&(e=0);for(var i=S(r,o);;){var l=vn(t,i,o,e,n),s=ut(i),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;o=P(i=c.to.line)}}function bn(t,e,n,r){var o=function(r){return cn(t,e,Je(t,n,r),"line")},a=e.text.length,i=_(function(t){return o(t-1).bottom<=r},a,0);return a=_(function(t){return o(t).top>r},i,a),{begin:i,end:a}}function gn(t,e,n,r){return bn(t,e,n,cn(t,e,Je(t,n,r),"line").top)}function vn(t,e,n,r,o){o-=yt(e);var a,i=0,l=e.text.length,s=Qe(t,e);if(Ct(e,t.doc.direction)){if(t.options.lineWrapping){var c;c=bn(t,e,s,o),i=c.begin,l=c.end}a=new L(n,i);var u,d,p=pn(t,a,"line",e,s).left,f=pMath.abs(u)){if(h<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");a=d}}else{var m=_(function(n){var a=cn(t,e,Je(t,s,n),"line");return a.top>o?(l=Math.min(n,l),!0):!(a.bottom<=o)&&(a.left>r||!(a.rightb.right?1:0,a}function yn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Ji){Ji=r("pre");for(var o=0;o<49;++o)Ji.appendChild(document.createTextNode("x")),Ji.appendChild(r("br"));Ji.appendChild(document.createTextNode("x"))}n(t.measure,Ji);var a=Ji.offsetHeight/50;return a>3&&(t.cachedTextHeight=a),e(t.measure),a||1}function xn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=r("span","xxxxxxxxxx"),o=r("pre",[e]);n(t.measure,o);var a=e.getBoundingClientRect(),i=(a.right-a.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function wn(t){for(var e=t.display,n={},r={},o=e.gutters.clientLeft,a=e.gutters.firstChild,i=0;a;a=a.nextSibling,++i)n[t.options.gutters[i]]=a.offsetLeft+a.clientLeft+o,r[t.options.gutters[i]]=a.clientWidth;return{fixedPos:kn(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function kn(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function An(t){var e=yn(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/xn(t.display)-3);return function(o){if(gt(t.doc,o))return 0;var a=0;if(o.widgets)for(var i=0;i=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;r=t.display.viewTo||l.to().line3&&(o(f,m.top,null,m.bottom),f=u,m.bottoms.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),f0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Pn(t){t.state.focused||(t.display.input.focus(),In(t))}function Dn(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,zn(t))},100)}function In(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(Nt(t,"focus",t,e),t.state.focused=!0,s(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),ii&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Nn(t))}function zn(t,e){t.state.delayingBlurEvent||(t.state.focused&&(Nt(t,"blur",t,e),t.state.focused=!1,Ai(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Ln(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.001||s<-.001)&&(N(o.line,a),Bn(o.line),o.rest))for(var c=0;c=i&&(a=D(e,yt(S(e,s))-t.wrapper.clientHeight),i=s)}return{from:a,to:Math.max(i,a+1)}}function Rn(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=kn(e)-e.scroller.scrollLeft+t.doc.scrollLeft,o=e.gutters.offsetWidth,a=r+"px",i=0;i(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null!=a&&!pi){var i=r("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Fe(t.display))+"px;\n height: "+(e.bottom-e.top+He(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(i),i.scrollIntoView(a),t.display.lineSpace.removeChild(i)}}}function Wn(t,e,n,r){null==r&&(r=0);for(var o,a=0;a<5;a++){var i=!1,l=pn(t,e),s=n&&n!=e?pn(t,n):l;o={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};var c=Vn(t,o),u=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=c.scrollTop&&(Qn(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(i=!0)),null!=c.scrollLeft&&($n(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(i=!0)),!i)break}return o}function Hn(t,e){var n=Vn(t,e);null!=n.scrollTop&&Qn(t,n.scrollTop),null!=n.scrollLeft&&$n(t,n.scrollLeft)}function Vn(t,e){var n=t.display,r=yn(t.display);e.top<0&&(e.top=0);var o=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,a=Ke(t),i={};e.bottom-e.top>a&&(e.bottom=e.top+a);var l=t.doc.height+Ue(n),s=e.topl-r;if(e.topo+a){var u=Math.min(e.top,(c?l:e.bottom)-a);u!=o&&(i.scrollTop=u)}var d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,p=Ve(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?i.scrollLeft=0:e.leftp+d-3&&(i.scrollLeft=e.right+(f?0:10)-p),i}function Kn(t,e){null!=e&&(Gn(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Yn(t){Gn(t);var e=t.getCursor(),n=e,r=e;t.options.lineWrapping||(n=e.ch?L(e.line,e.ch-1):e,r=L(e.line,e.ch+1)),t.curOp.scrollToPos={from:n,to:r,margin:t.options.cursorScrollMargin}}function Xn(t,e,n){null==e&&null==n||Gn(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function qn(t,e){Gn(t),t.curOp.scrollToPos=e}function Gn(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;Zn(t,fn(t,e.from),fn(t,e.to),e.margin)}}function Zn(t,e,n,r){var o=Vn(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Xn(t,o.scrollLeft,o.scrollTop)}function Qn(t,e){Math.abs(t.doc.scrollTop-e)<2||(ti||Or(t,{top:e}),Jn(t,e,!0),ti&&Or(t),kr(t,100))}function Jn(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function $n(t,e,n,r){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,Rn(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function tr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Ue(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+He(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function er(t,e){e||(e=tr(t));var n=t.display.barWidth,r=t.display.barHeight;nr(t,e);for(var o=0;o<4&&n!=t.display.barWidth||r!=t.display.barHeight;o++)n!=t.display.barWidth&&t.options.lineWrapping&&Ln(t),nr(t,tr(t)),n=t.display.barWidth,r=t.display.barHeight}function nr(t,e){var n=t.display,r=n.scrollbars.update(e);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&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}function rr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ai(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new il[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ui(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?$n(t,e):Qn(t,e)},t),t.display.scrollbars.addClass&&s(t.display.wrapper,t.display.scrollbars.addClass)}function or(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++ll},we(t.curOp)}function ar(t){Ae(t.curOp,function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new sl(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function sr(t){t.updatedDisplay=t.mustUpdate&&Mr(t.cm,t.update)}function cr(t){var e=t.cm,n=e.display;t.updatedDisplay&&Ln(e),t.barMeasure=tr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Ge(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+He(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Ve(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection(t.focus))}function ur(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLefte)&&(o.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=o.viewTo)Bi&&mt(t.doc,e)o.viewFrom?vr(t):(o.viewFrom+=r,o.viewTo+=r);else if(e<=o.viewFrom&&n>=o.viewTo)vr(t);else if(e<=o.viewFrom){var a=yr(t,n,n+r,1);a?(o.view=o.view.slice(a.index),o.viewFrom=a.lineN,o.viewTo+=r):vr(t)}else if(n>=o.viewTo){var i=yr(t,e,e,-1);i?(o.view=o.view.slice(0,i.index),o.viewTo=i.lineN):vr(t)}else{var l=yr(t,e,e,-1),s=yr(t,n,n+r,1);l&&s?(o.view=o.view.slice(0,l.index).concat(xe(t,l.lineN,s.lineN)).concat(o.view.slice(s.index)),o.viewTo+=r):vr(t)}var c=o.externalMeasured;c&&(n=o.lineN&&e=r.viewTo)){var a=r.view[_n(t,e)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==f(i,n)&&i.push(n)}}}function vr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function yr(t,e,n,r){var o,a=_n(t,e),i=t.display.view;if(!Bi||n==t.doc.first+t.doc.size)return{index:a,lineN:n};for(var l=t.display.viewFrom,s=0;s0){if(a==i.length-1)return null;o=l+i[a].size-e,a++}else o=l-e;e+=o,n+=o}for(;mt(t.doc,n)!=n;){if(a==(r<0?0:i.length-1))return null;n+=r*i[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function xr(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=xe(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=xe(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,_n(t,n)))),r.viewTo=n}function wr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Zt(e.mode,ee(t,e.frontier)),o=[];e.iter(e.frontier,Math.min(e.first+e.size,t.display.viewTo+500),function(a){if(e.frontier>=t.display.viewFrom){var i=a.styles,l=a.text.length>t.options.maxHighlightLength,s=$t(t,a,l?Zt(e.mode,r):r,!0);a.styles=s.styles;var c=a.styleClasses,u=s.classes;u?a.styleClasses=u:c&&(a.styleClasses=null);for(var d=!i||i.length!=a.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&pn)return kr(t,t.options.workDelay),!0}),o.length&&pr(t,function(){for(var e=0;e=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==wr(t))return!1;Fn(t)&&(vr(t),n.dims=wn(t));var a=o.first+o.size,i=Math.max(n.visible.from-t.options.viewportMargin,o.first),l=Math.min(a,n.visible.to+t.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(a,r.viewTo)),Bi&&(i=mt(t.doc,i),l=bt(t.doc,l));var s=i!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;xr(t,i,l),r.viewOffset=yt(S(t.doc,r.viewFrom)),t.display.mover.style.top=r.viewOffset+"px";var c=wr(t);if(!s&&0==c&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Er(t);return c>4&&(r.lineDiv.style.display="none"),Tr(t,r.updateLineNumbers,n.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,_r(u),e(r.cursorDiv),e(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,kr(t,400)),r.updateLineNumbers=null,!0}function Sr(t,e){for(var n=e.viewport,r=!0;(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Ve(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Ue(t.display)-Ke(t),n.top)}),e.visible=jn(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&Mr(t,e);r=!1){Ln(t);var o=tr(t);Mn(t),er(t,o),Pr(t,o)}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Or(t,e){var n=new sl(t,e);if(Mr(t,n)){Ln(t),Sr(t,n);var r=tr(t);Mn(t),er(t,r),Pr(t,r),n.finish()}}function Tr(t,n,r){function o(e){var n=e.nextSibling;return ii&&bi&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var a=t.display,i=t.options.lineNumbers,l=a.lineDiv,s=l.firstChild,c=a.view,u=a.viewFrom,d=0;d-1&&(h=!1),_e(t,p,u,r)),h&&(e(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(z(t.options,u)))),s=p.node.nextSibling}else{var m=Ie(t,p,u,r);l.insertBefore(m,s)}u+=p.size}for(;s;)s=o(s)}function Nr(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function Pr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+He(t)+"px"}function Dr(t){var n=t.display.gutters,o=t.options.gutters;e(n);for(var a=0;a-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}function zr(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Lr(t){var e=zr(t);return e.x*=ul,e.y*=ul,e}function Br(t,e){var n=zr(e),r=n.x,o=n.y,a=t.display,i=a.scroller,l=i.scrollWidth>i.clientWidth,s=i.scrollHeight>i.clientHeight;if(r&&l||o&&s){if(o&&bi&&ii)t:for(var c=e.target,u=a.view;c!=i;c=c.parentNode)for(var d=0;d=0){var i=U(a.from(),o.from()),l=F(a.to(),o.to()),s=a.empty()?o.from()==o.head:a.from()==a.head;r<=e&&--e,t.splice(--r,2,new pl(s?l:i,s?i:l))}}return new dl(t,e)}function Rr(t,e){return new dl([new pl(t,e||t)],0)}function Fr(t){return t.text?L(t.from.line+t.text.length-1,b(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Ur(t,e){if(B(t,e.from)<0)return t;if(B(t,e.to)<=0)return Fr(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Fr(e).ch-e.to.ch),L(n,r)}function Wr(t,e){for(var n=[],r=0;r1&&t.remove(l.line+1,h-1),t.insert(l.line+1,v)}Ce(t,"change",t,e)}function Gr(t,e,n){function r(t,o,a){if(t.linked)for(var i=0;i1&&!t.done[t.done.length-2].ranges?(t.done.pop(),b(t.done)):void 0}function ro(t,e,n,r){var o=t.history;o.undone.length=0;var a,i,l=+new Date;if((o.lastOp==r||o.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&o.lastModTime>l-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(a=no(o,o.lastOp==r)))i=b(a.changes),0==B(e.from,e.to)&&0==B(e.from,i.to)?i.to=Fr(e):a.changes.push(to(t,e));else{var s=b(o.done);for(s&&s.ranges||io(t.sel,o.done),a={changes:[to(t,e)],generation:o.generation},o.done.push(a);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=l,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=e.origin,i||Nt(t,"historyAdded")}function oo(t,e,n,r){var o=e.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function ao(t,e,n,r){var o=t.history,a=r&&r.origin;n==o.lastSelOp||a&&o.lastSelOrigin==a&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==a||oo(t,a,b(o.done),e))?o.done[o.done.length-1]=e:io(e,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=a,o.lastSelOp=n,r&&!1!==r.clearRedo&&eo(o.undone)}function io(t,e){var n=b(e);n&&n.ranges&&n.equals(t)||e.push(t)}function lo(t,e,n,r){var o=e["spans_"+t.id],a=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((o||(o=e["spans_"+t.id]={}))[a]=n.markedSpans),++a})}function so(t){if(!t)return null;for(var e,n=0;n-1&&(b(l)[d]=c[d],delete c[d])}}}return r}function fo(t,e,n,r){if(t.cm&&t.cm.display.shift||t.extend){var o=e.anchor;if(r){var a=B(n,o)<0;a!=B(r,o)<0?(o=n,n=r):a!=B(n,r)<0&&(n=r)}return new pl(o,n)}return new pl(r||n,n)}function ho(t,e,n,r){xo(t,new dl([fo(t,t.sel.primary(),e,n)],0),r)}function mo(t,e,n){for(var r=[],o=0;o=e.ch:l.to>e.ch))){if(o&&(Nt(s,"beforeCursorEnter"),s.explicitlyCleared)){if(a.markedSpans){--i;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=Mo(t,c,-r,c&&c.line==e.line?a:null)),c&&c.line==e.line&&(u=B(c,n))&&(r<0?u<0:u>0))return Eo(t,c,e,r,o)}var d=s.find(r<0?-1:1);return(r<0?s.inclusiveLeft:s.inclusiveRight)&&(d=Mo(t,d,r,d.line==e.line?a:null)),d?Eo(t,d,e,r,o):null}}return e}function _o(t,e,n,r,o){var a=r||1,i=Eo(t,e,n,a,o)||!o&&Eo(t,e,n,a,!0)||Eo(t,e,n,-a,o)||!o&&Eo(t,e,n,-a,!0);return i||(t.cantEdit=!0,L(t.first,0))}function Mo(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?H(t,L(e.line-1)):null:n>0&&e.ch==(r||S(t,e.line)).text.length?e.line=0;--o)No(t,{from:r[o].from,to:r[o].to,text:o?[""]:e.text});else No(t,e)}}function No(t,e){if(1!=e.text.length||""!=e.text[0]||0!=B(e.from,e.to)){var n=Wr(t,e);ro(t,e,n,t.cm?t.cm.curOp.id:NaN),Io(t,e,n,tt(t,e));var r=[];Gr(t,function(t,n){n||-1!=f(r,t.history)||(Ro(t.history,e),r.push(t.history)),Io(t,e,null,tt(t,e))})}}function Po(t,e,n){if(!t.cm||!t.cm.state.suppressEdits||n){for(var r,o=t.history,a=t.sel,i="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,s=0;s=0;--d){var p=function(n){var o=r.changes[n];if(o.origin=e,u&&!Oo(t,o,!1))return i.length=0,{};c.push(to(t,o));var a=n?Wr(t,o):b(i);Io(t,o,a,uo(t,o)),!n&&t.cm&&t.cm.scrollIntoView({from:o.from,to:Fr(o)});var l=[];Gr(t,function(t,e){e||-1!=f(l,t.history)||(Ro(t.history,o),l.push(t.history)),Io(t,o,null,uo(t,o))})}(d);if(p)return p.v}}}}function Do(t,e){if(0!=e&&(t.first+=e,t.sel=new dl(g(t.sel.ranges,function(t){return new pl(L(t.anchor.line+e,t.anchor.ch),L(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){br(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.linea&&(e={from:e.from,to:L(a,S(t,a).text.length),text:[e.text[0]],origin:e.origin}),e.removed=O(t,e.from,e.to),n||(n=Wr(t,e)),t.cm?zo(t.cm,e,r):qr(t,e,r),wo(t,n,Ti)}}function zo(t,e,n){var r=t.doc,o=t.display,a=e.from,i=e.to,l=!1,s=a.line;t.options.lineWrapping||(s=P(pt(S(r,a.line))),r.iter(s,i.line+1,function(t){if(t==o.maxLine)return l=!0,!0})),r.sel.contains(e.from,e.to)>-1&&Dt(t),qr(r,e,n,An(t)),t.options.lineWrapping||(r.iter(s,a.line+e.text.length,function(t){var e=xt(t);e>o.maxLineLength&&(o.maxLine=t,o.maxLineLength=e,o.maxLineChanged=!0,l=!1)}),l&&(t.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),kr(t,400);var c=e.text.length-(i.line-a.line)-1;e.full?br(t):a.line!=i.line||1!=e.text.length||Xr(t.doc,e)?br(t,a.line,i.line+1,c):gr(t,a.line,"text");var u=It(t,"changes"),d=It(t,"change");if(d||u){var p={from:a,to:i,text:e.text,removed:e.removed,origin:e.origin};d&&Ce(t,"change",t,p),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}function Lo(t,e,n,r,o){if(r||(r=n),B(r,n)<0){var a=r;r=n,n=a}"string"==typeof e&&(e=t.splitLines(e)),To(t,{from:n,to:r,text:e,origin:o})}function Bo(t,e,n,r){n0||0==l&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=o("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(dt(t,e.line,e,n,i)||e.line!=n.line&&dt(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");X()}i.addToHistory&&ro(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,c=e.line,u=t.cm;if(t.iter(c,n.line+1,function(t){u&&i.collapsed&&!u.options.lineWrapping&&pt(t)==u.display.maxLine&&(s=!0),i.collapsed&&c!=e.line&&N(t,0),Q(t,new q(i,c==e.line?e.ch:null,c==n.line?n.ch:null)),++c}),i.collapsed&&t.iter(e.line,n.line+1,function(e){gt(t,e)&&N(e,0)}),i.clearOnEnter&&Ui(i,"beforeCursorEnter",function(){return i.clear()}),i.readOnly&&(Y(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++bl,i.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),i.collapsed)br(u,e.line,n.line+1);else if(i.className||i.title||i.startStyle||i.endStyle||i.css)for(var p=e.line;p<=n.line;p++)gr(u,p,"text");i.atomic&&Ao(u.doc),Ce(u,"markerAdded",u,i)}return i}function Vo(t,e,n,r,o){r=d(r),r.shared=!1;var a=[Ho(t,e,n,r,o)],i=a[0],l=r.widgetNode;return Gr(t,function(t){l&&(r.widgetNode=l.cloneNode(!0)),a.push(Ho(t,H(t,e),H(t,n),r,o));for(var s=0;s-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var s=t.dataTransfer.getData("Text");if(s){var c;if(e.state.draggingText&&!e.state.draggingText.copy&&(c=e.listSelections()),wo(e.doc,Rr(n,n)),c)for(var u=0;u=0;e--)Lo(t.doc,"",r[e].from,r[e].to,"+delete");Yn(t)})}function ca(t,e){var n=S(t.doc,e),r=pt(n);return r!=n&&(e=P(r)),Mt(!0,t,r,e,1)}function ua(t,e){var n=S(t.doc,e),r=ft(n);return r!=n&&(e=P(r)),Mt(!0,t,n,e,-1)}function da(t,e){var n=ca(t,e.line),r=S(t.doc,n.line),o=Ct(r,t.doc.direction);if(!o||0==o[0].level){var a=Math.max(0,r.text.search(/\S/)),i=e.line==n.line&&e.ch<=a&&e.ch;return L(n.line,i?0:a,n.sticky)}return n}function pa(t,e,n){if("string"==typeof e&&!(e=Tl[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,o=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),o=e(t)!=Oi}finally{t.display.shift=r,t.state.suppressEdits=!1}return o}function fa(t,e,n){for(var r=0;ro-400&&0==B(Ol.pos,n)?r="triple":Sl&&Sl.time>o-400&&0==B(Sl.pos,n)?(r="double",Ol={time:o,pos:n}):(r="single",Sl={time:o,pos:n});var a,i=t.doc.sel,s=bi?e.metaKey:e.ctrlKey;t.options.dragDrop&&Wi&&!t.isReadOnly()&&"single"==r&&(a=i.contains(n))>-1&&(B((a=i.ranges[a]).from(),n)<0||n.xRel>0)&&(B(a.to(),n)>0||n.xRel<0)?Aa(t,e,n,s):Ca(t,e,n,r,s)}function Aa(t,e,n,r){var o=t.display,a=!1,i=fr(t,function(e){ii&&(o.scroller.draggable=!1),t.state.draggingText=!1,Tt(document,"mouseup",i),Tt(document,"mousemove",l),Tt(o.scroller,"dragstart",s),Tt(o.scroller,"drop",i),a||(Lt(e),r||ho(t.doc,n),ii||oi&&9==ai?setTimeout(function(){document.body.focus(),o.input.focus()},20):o.input.focus())}),l=function(t){a=a||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},s=function(){return a=!0};ii&&(o.scroller.draggable=!0),t.state.draggingText=i,i.copy=bi?e.altKey:e.ctrlKey,o.scroller.dragDrop&&o.scroller.dragDrop(),Ui(document,"mouseup",i),Ui(document,"mousemove",l),Ui(o.scroller,"dragstart",s),Ui(o.scroller,"drop",i),Dn(t),setTimeout(function(){return o.input.focus()},20)}function Ca(t,e,n,r,o){function a(e){if(0!=B(y,e))if(y=e,"rect"==r){for(var o=[],a=t.options.tabSize,i=p(S(u,n.line).text,n.ch,a),l=p(S(u,e.line).text,e.ch,a),s=Math.min(i,l),c=Math.max(i,l),b=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));b<=g;b++){var v=S(u,b).text,x=h(v,s,a);s==c?o.push(new pl(L(b,x),L(b,x))):v.length>x&&o.push(new pl(L(b,x),L(b,h(v,c,a))))}o.length||o.push(new pl(n,n)),xo(u,jr(m.ranges.slice(0,f).concat(o),f),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var w=d,k=w.anchor,A=e;if("single"!=r){var C;C="double"==r?t.findWordAt(e):new pl(L(e.line,0),H(u,L(e.line+1,0))),B(C.anchor,k)>0?(A=C.head,k=U(w.from(),C.anchor)):(A=C.anchor,k=F(w.to(),C.head))}var E=m.ranges.slice(0);E[f]=new pl(H(u,k),A),xo(u,jr(E,f),Ni)}}function i(e){var n=++w,o=En(t,e,!0,"rect"==r);if(o)if(0!=B(o,y)){t.curOp.focus=l(),a(o);var s=jn(c,u);(o.line>=s.to||o.linex.bottom?20:0;d&&setTimeout(fr(t,function(){w==n&&(c.scroller.scrollTop+=d,i(e))}),50)}}function s(e){t.state.selectingText=!1,w=1/0,Lt(e),c.input.focus(),Tt(document,"mousemove",k),Tt(document,"mouseup",A),u.history.lastSelOrigin=null}var c=t.display,u=t.doc;Lt(e);var d,f,m=u.sel,b=m.ranges;if(o&&!e.shiftKey?(f=u.sel.contains(n),d=f>-1?b[f]:new pl(n,n)):(d=u.sel.primary(),f=u.sel.primIndex),gi?e.shiftKey&&e.metaKey:e.altKey)r="rect",o||(d=new pl(n,n)),n=En(t,e,!0,!0),f=-1;else if("double"==r){var g=t.findWordAt(n);d=t.display.shift||u.extend?fo(u,d,g.anchor,g.head):g}else if("triple"==r){var v=new pl(L(n.line,0),H(u,L(n.line+1,0)));d=t.display.shift||u.extend?fo(u,d,v.anchor,v.head):v}else d=fo(u,d,n);o?-1==f?(f=b.length,xo(u,jr(b.concat([d]),f),{scroll:!1,origin:"*mouse"})):b.length>1&&b[f].empty()&&"single"==r&&!e.shiftKey?(xo(u,jr(b.slice(0,f).concat(b.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):bo(u,f,d,Ni):(f=0,xo(u,new dl([d],0),Ni),m=u.sel);var y=n,x=c.wrapper.getBoundingClientRect(),w=0,k=fr(t,function(t){Ut(t)?i(t):s(t)}),A=fr(t,s);t.state.selectingText=A,Ui(document,"mousemove",k),Ui(document,"mouseup",A)}function Ea(t,e,n,r){var o,a;try{o=e.clientX,a=e.clientY}catch(e){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&Lt(e);var i=t.display,l=i.lineDiv.getBoundingClientRect();if(a>l.bottom||!It(t,n))return jt(e);a-=l.top-i.viewOffset;for(var s=0;s=o){return Nt(t,n,t,D(t.doc,a),t.options.gutters[s],e),jt(e)}}}function _a(t,e){return Ea(t,e,"gutterClick",!0)}function Ma(t,e){Re(t.display,e)||Sa(t,e)||Pt(t,e,"contextmenu")||t.display.input.onContextMenu(e)}function Sa(t,e){return!!It(t,"gutterContextMenu")&&Ea(t,e,"gutterContextMenu",!1)}function Oa(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(t)}function Ta(t){Dr(t),br(t),Rn(t)}function Na(t,e,n){if(!e!=!(n&&n!=Dl)){var r=t.display.dragFunctions,o=e?Ui:Tt;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Pa(t){t.options.lineWrapping?(s(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(Ai(t.display.wrapper,"CodeMirror-wrap"),wt(t)),Cn(t),br(t),an(t),setTimeout(function(){return er(t)},100)}function Da(t,e){var n=this;if(!(this instanceof Da))return new Da(t,e);this.options=e=e?d(e):{},d(Il,e,!1),Ir(e);var r=e.value;"string"==typeof r&&(r=new xl(r,e.mode,null,e.lineSeparator,e.direction)),this.doc=r;var o=new Da.inputStyles[e.inputStyle](this),a=this.display=new M(t,r,o);a.wrapper.CodeMirror=this,Dr(this),Oa(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),rr(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 Ei,keySeq:null,specialChars:null},e.autofocus&&!mi&&a.input.focus(),oi&&ai<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ia(this),$o(),or(this),this.curOp.forceUpdate=!0,Zr(this,r),e.autofocus&&!mi||this.hasFocus()?setTimeout(u(In,this),20):zn(this);for(var i in zl)zl.hasOwnProperty(i)&&zl[i](n,e[i],Dl);Fn(this),e.finishInit&&e.finishInit(this);for(var l=0;l400}var o=t.display;Ui(o.scroller,"mousedown",fr(t,wa)),oi&&ai<11?Ui(o.scroller,"dblclick",fr(t,function(e){if(!Pt(t,e)){var n=En(t,e);if(n&&!_a(t,e)&&!Re(t.display,e)){Lt(e);var r=t.findWordAt(n);ho(t.doc,r.anchor,r.head)}}})):Ui(o.scroller,"dblclick",function(e){return Pt(t,e)||Lt(e)}),ki||Ui(o.scroller,"contextmenu",function(e){return Ma(t,e)});var a,i={end:0};Ui(o.scroller,"touchstart",function(e){if(!Pt(t,e)&&!n(e)){o.input.ensurePolled(),clearTimeout(a);var r=+new Date;o.activeTouch={start:r,moved:!1,prev:r-i.end<=300?i:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),Ui(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),Ui(o.scroller,"touchend",function(n){var a=o.activeTouch;if(a&&!Re(o,n)&&null!=a.left&&!a.moved&&new Date-a.start<300){var i,l=t.coordsChar(o.activeTouch,"page");i=!a.prev||r(a,a.prev)?new pl(l,l):!a.prev.prev||r(a,a.prev.prev)?t.findWordAt(l):new pl(L(l.line,0),H(t.doc,L(l.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),Lt(n)}e()}),Ui(o.scroller,"touchcancel",e),Ui(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Qn(t,o.scroller.scrollTop),$n(t,o.scroller.scrollLeft,!0),Nt(t,"scroll",t))}),Ui(o.scroller,"mousewheel",function(e){return Br(t,e)}),Ui(o.scroller,"DOMMouseScroll",function(e){return Br(t,e)}),Ui(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){Pt(t,e)||Rt(e)},over:function(e){Pt(t,e)||(Zo(t,e),Rt(e))},start:function(e){return Go(t,e)},drop:fr(t,qo),leave:function(e){Pt(t,e)||Qo(t)}};var l=o.input.getField();Ui(l,"keyup",function(e){return ya.call(t,e)}),Ui(l,"keydown",fr(t,ga)),Ui(l,"keypress",fr(t,xa)),Ui(l,"focus",function(e){return In(t,e)}),Ui(l,"blur",function(e){return zn(t,e)})}function za(t,e,n,r){var o,a=t.doc;null==n&&(n="add"),"smart"==n&&(a.mode.indent?o=ee(t,e):n="prev");var i=t.options.tabSize,l=S(a,e),s=p(l.text,null,i);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=a.mode.indent(o,l.text.slice(u.length),l.text))==Oi||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>a.first?p(S(a,e-1).text,null,i):0:"add"==n?c=s+t.options.indentUnit:"subtract"==n?c=s-t.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",f=0;if(t.options.indentWithTabs)for(var h=Math.floor(c/i);h;--h)f+=i,d+="\t";if(f1)if(Bl&&Bl.text.join("\n")==e){if(r.ranges.length%Bl.text.length==0){s=[];for(var c=0;c=0;d--){var p=r.ranges[d],f=p.from(),h=p.to();p.empty()&&(n&&n>0?f=L(f.line,f.ch-n):t.state.overwrite&&!i?h=L(h.line,Math.min(S(a,h.line).text.length,h.ch+b(l).length)):Bl&&Bl.lineWise&&Bl.text.join("\n")==e&&(f=h=L(f.line,0))),u=t.curOp.updateInput;var m={from:f,to:h,text:s?s[d%s.length]:l,origin:o||(i?"paste":t.state.cutIncoming?"cut":"+input")};To(t.doc,m),Ce(t,"inputRead",t,m)}e&&!i&&Ra(t,e),Yn(t),t.curOp.updateInput=u,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function ja(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||pr(e,function(){return Ba(e,n,0,null,"paste")}),!0}function Ra(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var a=t.getModeAt(o.head),i=!1;if(a.electricChars){for(var l=0;l-1){i=za(t,o.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(S(t.doc,o.head.line).text.slice(0,o.head.ch))&&(i=za(t,o.head.line,"smart"));i&&Ce(t,"electricInput",t,o.head.line)}}}function Fa(t){for(var e=[],n=[],r=0;r=t.first+t.size)&&(e=new L(r,e.ch,e.sticky),c=S(t,r))}function i(r){var i;if(null==(i=o?St(t.cm,c,e,n):_t(c,e,n))){if(r||!a())return!1;e=Mt(o,t.cm,c,e.line,n)}else e=i;return!0}var l=e,s=n,c=S(t,e.line);if("char"==r)i();else if("column"==r)i(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||i(!f);f=!1){var h=c.text.charAt(e.ch)||"\n",m=k(h,p)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||f||m||(m="s"),u&&u!=m){n<0&&(n=1,i(),e.sticky="after");break}if(m&&(u=m),n>0&&!i(!f))break}var b=_o(t,e,l,s,!0);return j(l,b)&&(b.hitSide=!0),b}function Va(t,e,n,r){var o,a=t.doc,i=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*yn(t.display),3);o=(n>0?e.bottom:e.top)+n*s}else"line"==r&&(o=n>0?e.bottom+3:e.top-3);for(var c;c=mn(t,i,o),c.outside;){if(n<0?o<=0:o>=a.height){c.hitSide=!0;break}o+=5*n}return c}function Ka(t,e){var n=Ze(t,e.line);if(!n||n.hidden)return null;var r=S(t.doc,e.line),o=Xe(n,r,e.line),a=Ct(r,t.doc.direction),i="left";if(a){i=At(a,e.ch)%2?"right":"left"}var l=$e(o.map,e.ch,i);return l.offset="right"==l.collapse?l.end:l.start,l}function Ya(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function Xa(t,e){return e&&(t.bad=!0),t}function qa(t,e,n,r,o){function a(t){return function(e){return e.id==t}}function i(){u&&(c+=d,u=!1)}function l(t){t&&(i(),c+=t)}function s(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(null!=n)return void l(n||e.textContent.replace(/\u200b/g,""));var c,p=e.getAttribute("cm-marker");if(p){var f=t.findMarks(L(r,0),L(o+1,0),a(+p));return void(f.length&&(c=f[0].find())&&l(O(t.doc,c.from,c.to).join(d)))}if("false"==e.getAttribute("contenteditable"))return;var h=/^(pre|div|p)$/i.test(e.nodeName);h&&i();for(var m=0;m=15&&(ci=!1,ii=!0);var xi,wi=bi&&(li||ci&&(null==yi||yi<12.11)),ki=ti||oi&&ai>=9,Ai=function(e,n){var r=e.className,o=t(n).exec(r);if(o){var a=r.slice(o.index+o[0].length);e.className=r.slice(0,o.index)+(a?o[1]+a:"")}};xi=document.createRange?function(t,e,n,r){var o=document.createRange();return o.setEnd(r||t,n),o.setStart(t,e),o}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var Ci=function(t){t.select()};fi?Ci=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:oi&&(Ci=function(t){try{t.select()}catch(t){}});var Ei=function(){this.id=null};Ei.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var _i,Mi,Si=30,Oi={toString:function(){return"CodeMirror.Pass"}},Ti={scroll:!1},Ni={origin:"*mouse"},Pi={origin:"+move"},Di=[""],Ii=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,zi=/[\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]/,Li=!1,Bi=!1,ji=null,Ri=function(){function t(t){return t<=247?n.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?r.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t,this.from=e,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,i=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;return function(n,r){var c="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!o.test(n))return!1;for(var u=n.length,d=[],p=0;p=this.string.length},Zi.prototype.sol=function(){return this.pos==this.lineStart},Zi.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Zi.prototype.next=function(){if(this.pose},Zi.prototype.eatSpace=function(){for(var t=this,e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++t.pos;return this.pos>e},Zi.prototype.skipToEnd=function(){this.pos=this.string.length},Zi.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Zi.prototype.backUp=function(t){this.pos-=t},Zi.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},Zi.prototype.current=function(){return this.string.slice(this.start,this.pos)},Zi.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}};var Qi=function(t,e,n){this.text=t,ot(this,e),this.height=n?n(this):1};Qi.prototype.lineNo=function(){return P(this)},zt(Qi);var Ji,$i={},tl={},el=null,nl=null,rl={left:0,right:0,top:0,bottom:0},ol=function(t,e,n){this.cm=n;var o=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(o),t(a),Ui(o,"scroll",function(){o.clientHeight&&e(o.scrollTop,"vertical")}),Ui(a,"scroll",function(){a.clientWidth&&e(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,oi&&ai<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ol.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var o=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var a=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},ol.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ol.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ol.prototype.zeroWidthHack=function(){var t=bi&&!di?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ei,this.disableVert=new Ei},ol.prototype.enableZeroWidthBar=function(t,e,n){function r(){var o=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}t.style.pointerEvents="auto",e.set(1e3,r)},ol.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var al=function(){};al.prototype.update=function(){return{bottom:0,right:0}},al.prototype.setScrollLeft=function(){},al.prototype.setScrollTop=function(){},al.prototype.clear=function(){};var il={native:ol,null:al},ll=0,sl=function(t,e,n){var r=t.display;this.viewport=e,this.visible=jn(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ve(t),this.force=n,this.dims=wn(t),this.events=[]};sl.prototype.signal=function(t,e){It(t,e)&&this.events.push(arguments)},sl.prototype.finish=function(){for(var t=this,e=0;e=0&&B(t,o.to())<=0)return r}return-1};var pl=function(t,e){this.anchor=t,this.head=e};pl.prototype.from=function(){return U(this.anchor,this.head)},pl.prototype.to=function(){return F(this.anchor,this.head)},pl.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var fl=function(t){var e=this;this.lines=t,this.parent=null;for(var n=0,r=0;r1||!(this.children[0]instanceof fl))){var s=[];this.collapse(s),this.children=[new fl(s)],this.children[0].parent=this}},hl.prototype.collapse=function(t){for(var e=this,n=0;n50){for(var l=a.lines.length%25+25,s=l;s10);t.parent.maybeSpill()}},hl.prototype.iterN=function(t,e,n){for(var r=this,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}null!=o&&e&&this.collapsed&&br(e,o,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ao(e.doc)),e&&Ce(e,"markerCleared",e,this,o,a),n&&ar(e),this.parent&&this.parent.clear()}},gl.prototype.find=function(t,e){var n=this;null==t&&"bookmark"==this.type&&(t=1);for(var r,o,a=0;a=0;c--)To(r,o[c]);s?yo(this,s):this.cm&&Yn(this.cm)}),undo:mr(function(){Po(this,"undo")}),redo:mr(function(){Po(this,"redo")}),undoSelection:mr(function(){Po(this,"undo",!0)}),redoSelection:mr(function(){Po(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(o.marker.parent||o.marker)}return e},findMarks:function(t,e,n){t=H(this,t),e=H(this,e);var r=[],o=t.line;return this.iter(t.line,e.line+1,function(a){var i=a.markedSpans;if(i)for(var l=0;l=s.to||null==s.from&&o!=t.line||null!=s.from&&o==e.line&&s.from>=e.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++o}),r},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=a,++n}),H(this,L(n,e))},indexFromPos:function(t){t=H(this,t);var e=t.ch;if(t.linee&&(e=t.from),null!=t.to&&t.to0)o=new L(o.line,o.ch+1),t.replaceRange(a.charAt(o.ch-1)+a.charAt(o.ch-2),L(o.line,o.ch-2),o,"+transpose");else if(o.line>t.doc.first){var i=S(t.doc,o.line-1).text;i&&(o=new L(o.line,1),t.replaceRange(a.charAt(0)+t.doc.lineSeparator()+i.charAt(i.length-1),L(o.line-1,i.length-1),o,"+transpose"))}n.push(new pl(o,o))}t.setSelections(n)})},newlineAndIndent:function(t){return pr(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r=e.display.viewTo||o.line=e.display.viewFrom&&Ka(e,r)||{node:l[0].measure.map[2],offset:0},c=o.linet.firstLine()&&(r=L(r.line-1,S(t.doc,r.line-1).length)),o.ch==S(t.doc,o.line).text.length&&o.linee.viewTo-1)return!1;var a,i,l;r.line==e.viewFrom||0==(a=_n(t,r.line))?(i=P(e.view[0].line),l=e.view[0].node):(i=P(e.view[a].line),l=e.view[a-1].node.nextSibling);var s,c,u=_n(t,o.line);if(u==e.view.length-1?(s=e.viewTo-1,c=e.lineDiv.lastChild):(s=P(e.view[u+1].line)-1,c=e.view[u+1].node.previousSibling),!l)return!1;for(var d=t.doc.splitLines(qa(t,l,c,i,s)),p=O(t.doc,L(i,0),L(s,S(t.doc,s).text.length));d.length>1&&p.length>1;)if(b(d)==b(p))d.pop(),p.pop(),s--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),i++}for(var f=0,h=0,m=d[0],g=p[0],v=Math.min(m.length,g.length);fr.ch&&y.charCodeAt(y.length-h-1)==x.charCodeAt(x.length-h-1);)f--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var k=L(i,f),A=L(s,p.length?b(p).length-h:0);return d.length>1||d[0]||B(k,A)?(Lo(t.doc,d,k,A,"+input"),!0):void 0},jl.prototype.ensurePolled=function(){this.forceCompositionEnd()},jl.prototype.reset=function(){this.forceCompositionEnd()},jl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},jl.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},jl.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||pr(this.cm,function(){return br(t.cm)})},jl.prototype.setUneditable=function(t){t.contentEditable="false"},jl.prototype.onKeyPress=function(t){0!=t.charCode&&(t.preventDefault(),this.cm.isReadOnly()||fr(this.cm,Ba)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},jl.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},jl.prototype.onContextMenu=function(){},jl.prototype.resetPosition=function(){},jl.prototype.needsContentAttribute=!0;var Rl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new Ei,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Rl.prototype.init=function(t){function e(t){if(!Pt(o,t)){if(o.somethingSelected())La({lineWise:!1,text:o.getSelections()}),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,i.value=Bl.text.join("\n"),Ci(i));else{if(!o.options.lineWiseCopyCut)return;var e=Fa(o);La({lineWise:!0,text:e.text}),"cut"==t.type?o.setSelections(e.ranges,null,Ti):(r.prevInput="",i.value=e.text.join("\n"),Ci(i))}"cut"==t.type&&(o.state.cutIncoming=!0)}}var n=this,r=this,o=this.cm,a=this.wrapper=Wa(),i=this.textarea=a.firstChild;t.wrapper.insertBefore(a,t.wrapper.firstChild),fi&&(i.style.width="0px"),Ui(i,"input",function(){oi&&ai>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),Ui(i,"paste",function(t){Pt(o,t)||ja(t,o)||(o.state.pasteIncoming=!0,r.fastPoll())}),Ui(i,"cut",e),Ui(i,"copy",e),Ui(t.scroller,"paste",function(e){Re(t,e)||Pt(o,e)||(o.state.pasteIncoming=!0,r.focus())}),Ui(t.lineSpace,"selectstart",function(e){Re(t,e)||Lt(e)}),Ui(i,"compositionstart",function(){var t=o.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:t,range:o.markText(t,o.getCursor("to"),{className:"CodeMirror-composing"})}}),Ui(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Rl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Sn(t);if(t.options.moveInputWithCursor){var o=pn(t,n.sel.primary().head,"div"),a=e.wrapper.getBoundingClientRect(),i=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,o.top+i.top-a.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,o.left+i.left-a.left))}return r},Rl.prototype.showSelection=function(t){var e=this.cm,r=e.display;n(r.cursorDiv,t.cursors),n(r.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Rl.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e,n,r=this.cm,o=r.doc;if(r.somethingSelected()){this.prevInput="";var a=o.sel.primary();e=Ki&&(a.to().line-a.from().line>100||(n=r.getSelection()).length>1e3);var i=e?"-":n||r.getSelection();this.textarea.value=i,r.state.focused&&Ci(this.textarea),oi&&ai>=9&&(this.hasSelection=i)}else t||(this.prevInput=this.textarea.value="",oi&&ai>=9&&(this.hasSelection=null));this.inaccurateSelection=e}},Rl.prototype.getField=function(){return this.textarea},Rl.prototype.supportsTouch=function(){return!1},Rl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!mi||l()!=this.textarea))try{this.textarea.focus()}catch(t){}},Rl.prototype.blur=function(){this.textarea.blur()},Rl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Rl.prototype.receivedFocus=function(){this.slowPoll()},Rl.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},Rl.prototype.fastPoll=function(){function t(){n.poll()||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},Rl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Vi(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var o=n.value;if(o==r&&!e.somethingSelected())return!1;if(oi&&ai>=9&&this.hasSelection===o||bi&&/[\uf700-\uf7ff]/.test(o))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var a=o.charCodeAt(0);if(8203!=a||r||(r="​"),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var i=0,l=Math.min(r.length,o.length);i1e3||o.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=o,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Rl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Rl.prototype.onKeyPress=function(){oi&&ai>=9&&(this.hasSelection=null),this.fastPoll()},Rl.prototype.onContextMenu=function(t){function e(){if(null!=i.selectionStart){var t=o.somethingSelected(),e="​"+(t?i.value:"");i.value="⇚",i.value=e,r.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=e.length,a.selForContextMenu=o.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=u,i.style.cssText=c,oi&&ai<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=s),null!=i.selectionStart){(!oi||oi&&ai<9)&&e();var t=0,n=function e(){a.selForContextMenu==o.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==r.prevInput?fr(o,So)(o):t++<10?a.detectingSelectAll=setTimeout(e,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(n,200)}}var r=this,o=r.cm,a=o.display,i=r.textarea,l=En(o,t),s=a.scroller.scrollTop;if(l&&!ci){o.options.resetSelectionOnContextMenu&&-1==o.doc.sel.contains(l)&&fr(o,xo)(o.doc,Rr(l),Ti);var c=i.style.cssText,u=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var d=r.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(oi?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var p;if(ii&&(p=window.scrollY),a.input.focus(),ii&&window.scrollTo(null,p),a.input.reset(),o.somethingSelected()||(i.value=r.prevInput=" "),r.contextMenuPending=!0,a.selForContextMenu=o.doc.sel,clearTimeout(a.detectingSelectAll),oi&&ai>=9&&e(),ki){Rt(t);var f=function t(){Tt(window,"mouseup",t),setTimeout(n,20)};Ui(window,"mouseup",f)}else setTimeout(n,50)}},Rl.prototype.readOnlyChanged=function(t){t||this.reset()},Rl.prototype.setUneditable=function(){},Rl.prototype.needsContentAttribute=!1,function(t){function e(e,r,o,a){t.defaults[e]=r,o&&(n[e]=a?function(t,e,n){n!=Dl&&o(t,e,n)}:o)}var n=t.optionHandlers;t.defineOption=e,t.Init=Dl,e("value","",function(t,e){return t.setValue(e)},!0),e("mode",null,function(t,e){t.doc.modeOption=e,Kr(t)},!0),e("indentUnit",2,Kr,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(t){Yr(t),an(t),br(t)},!0),e("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter(function(t){for(var o=0;;){var a=t.text.indexOf(e,o);if(-1==a)break;o=a+e.length,n.push(L(r,a))}r++});for(var o=n.length-1;o>=0;o--)Lo(t.doc,e,n[o],L(n[o].line,n[o].ch+e.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Dl&&t.refresh()}),e("specialCharPlaceholder",fe,function(t){return t.refresh()},!0),e("electricChars",!0),e("inputStyle",mi?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),e("rtlMoveVisually",!vi),e("wholeLineUpdateBefore",!0),e("theme","default",function(t){Oa(t),Ta(t)},!0),e("keyMap","default",function(t,e,n){var r=la(e),o=n!=Dl&&la(n);o&&o.detach&&o.detach(t,r),r.attach&&r.attach(t,o||null)}),e("extraKeys",null),e("lineWrapping",!1,Pa,!0),e("gutters",[],function(t){Ir(t.options),Ta(t)},!0),e("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?kn(t.display)+"px":"0",t.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(t){return er(t)},!0),e("scrollbarStyle","native",function(t){rr(t),er(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),e("lineNumbers",!1,function(t){Ir(t.options),Ta(t)},!0),e("firstLineNumber",1,Ta,!0),e("lineNumberFormatter",function(t){return t},Ta,!0),e("showCursorWhenSelecting",!1,Mn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("readOnly",!1,function(t,e){"nocursor"==e?(zn(t),t.display.input.blur(),t.display.disabled=!0):t.display.disabled=!1,t.display.input.readOnlyChanged(e)}),e("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),e("dragDrop",!0,Na),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,Mn,!0),e("singleCursorHeightPerLine",!0,Mn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Yr,!0),e("addModeClass",!1,Yr,!0),e("pollInterval",100),e("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),e("historyEventDelay",1250),e("viewportMargin",10,function(t){return t.refresh()},!0),e("maxHighlightLength",1e4,Yr,!0),e("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),e("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),e("autofocus",null),e("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0)}(Da),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,o=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&fr(this,e[t])(this,n,o),Nt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](la(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nr&&(za(e,a.head.line,t,!0),r=a.head.line,o==e.doc.sel.primIndex&&Yn(e));else{var i=a.from(),l=a.to(),s=Math.max(r,i.line);r=Math.min(e.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c0&&bo(e.doc,o,new pl(i,u[o].to()),Ti)}}}),getTokenAt:function(t,e){return ae(this,t,e)},getLineTokens:function(t,e){return ae(this,L(t),e,!0)},getTokenTypeAt:function(t){t=H(this.doc,t);var e,n=te(this,S(this.doc,t.line)),r=0,o=(n.length-1)/2,a=t.ch;if(0==a)e=n[2];else for(;;){var i=r+o>>1;if((i?n[2*i-1]:0)>=a)o=i;else{if(!(n[2*i+1]a&&(t=a,o=!0),r=S(this.doc,t)}else r=t;return cn(this,r,{top:0,left:0},e||"page",n||o).top+(o?this.doc.height-yt(r):0)},defaultTextHeight:function(){return yn(this.display)},defaultCharWidth:function(){return xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,o){var a=this.display;t=pn(this,H(this.doc,t));var i=t.bottom,l=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),a.sizer.appendChild(e),"over"==r)i=t.top;else if("above"==r||"near"==r){var s=Math.max(a.wrapper.clientHeight,this.doc.height),c=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>s)&&t.top>e.offsetHeight?i=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=s&&(i=t.bottom),l+e.offsetWidth>c&&(l=c-e.offsetWidth)}e.style.top=i+"px",e.style.left=e.style.right="","right"==o?(l=a.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==o?l=0:"middle"==o&&(l=(a.sizer.clientWidth-e.offsetWidth)/2),e.style.left=l+"px"),n&&Hn(this,{left:l,top:i,right:l+e.offsetWidth,bottom:i+e.offsetHeight})},triggerOnKeyDown:hr(ga),triggerOnKeyPress:hr(xa),triggerOnKeyUp:ya,execCommand:function(t){if(Tl.hasOwnProperty(t))return Tl[t].call(null,this)},triggerElectric:hr(function(t){Ra(this,t)}),findPosH:function(t,e,n,r){var o=this,a=1;e<0&&(a=-1,e=-e);for(var i=H(this.doc,t),l=0;l0&&l(n.charAt(r-1));)--r;for(;o.5)&&Cn(this),Nt(this,"refresh",this)}),swapDoc:hr(function(t){var e=this.doc;return e.cm=null,Zr(this,t),an(this),this.display.input.reset(),Xn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Ce(this,"swapDoc",this,e),e}),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}},zt(t),t.registerHelper=function(e,r,o){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=o},t.registerGlobalHelper=function(e,r,o,a){t.registerHelper(e,r,a),n[e]._global.push({pred:o,val:a})}}(Da);var Fl="iter insert remove copy getEditor constructor".split(" ");for(var Ul in xl.prototype)xl.prototype.hasOwnProperty(Ul)&&f(Fl,Ul)<0&&(Da.prototype[Ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(xl.prototype[Ul]));return zt(xl),Da.inputStyles={textarea:Rl,contenteditable:jl},Da.defineMode=function(t){Da.defaults.mode||"null"==t||(Da.defaults.mode=t),Kt.apply(this,arguments)},Da.defineMIME=Yt,Da.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Da.defineMIME("text/plain","null"),Da.defineExtension=function(t,e){Da.prototype[t]=e},Da.defineDocExtension=function(t,e){xl.prototype[t]=e},Da.fromTextArea=Qa,function(t){t.off=Tt,t.on=Ui,t.wheelEventPixels=Lr,t.Doc=xl,t.splitLines=Hi,t.countColumn=p,t.findColumn=h,t.isWordChar=w,t.Pass=Oi,t.signal=Nt,t.Line=Qi,t.changeEnd=Fr,t.scrollbarModel=il,t.Pos=L,t.cmpPos=B,t.modes=Xi,t.mimeModes=qi,t.resolveMode=Xt,t.getMode=qt,t.modeExtensions=Gi,t.extendMode=Gt,t.copyState=Zt,t.startState=Jt,t.innerMode=Qt,t.commands=Tl,t.keyMap=Ml,t.keyName=ia,t.isModifierKey=aa,t.lookupKey=oa,t.normalizeKeyMap=ra,t.StringStream=Zi,t.SharedTextMarker=vl,t.TextMarker=gl,t.LineWidget=ml,t.e_preventDefault=Lt,t.e_stopPropagation=Bt,t.e_stop=Rt,t.addClass=s,t.contains=i,t.rmClass=Ai,t.keyNames=Al}(Da),Da.version="5.26.0",Da})},function(t,e,n){"use strict";var r=n(81),o=n(3);t.exports=o(r("slice",function(t,e,n){return Array.prototype.slice.call(n,t,e)}))},function(t,e,n){"use strict";var r=n(277);t.exports=function(t,e){return r(e,t,0)>=0}},function(t,e,n){"use strict";var r=n(15),o=n(315),a=n(118),i=n(320),l=n(321),s=n(323),c=n(57),u=n(324),d=n(327),p=n(328),f=(n(8),c.createElement),h=c.createFactory,m=c.cloneElement,b=r,g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:a,PureComponent:i,createElement:f,cloneElement:m,isValidElement:c.isValidElement,PropTypes:u,createClass:l.createClass,createFactory:h,createMixin:function(t){return t},DOM:s,version:d,__spread:b};t.exports=g},function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r1){for(var h=Array(f),m=0;m1){for(var g=Array(b),v=0;vt?e:t})},function(t,e,n){"use strict";var r=n(16),o=function(t){return t&&t.__esModule?t:{default:t}}(r);t.exports=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r={list:e};return Promise.resolve().then(function(){var a=t.state.current;if(a&&a.is_sys)return o.default.pact("getSysHosts").then(function(t){r.sys_hosts=t,r.current=t});if(n)r.current=n;else if(a){var i=e.find(function(t){return t.id===a.id});i&&(r.current=i)}}).then(function(){t.setState(r,function(){n&&o.default.emit("select",n.id)})})}},function(t,e,n){"use strict";function r(t,e,n){var r=e.dispatchConfig.phasedRegistrationNames[n];return g(t,r)}function o(t,e,n){var o=r(t,n,e);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchInstances=m(n._dispatchInstances,t))}function a(t){t&&t.dispatchConfig.phasedRegistrationNames&&h.traverseTwoPhase(t._targetInst,o,t)}function i(t){if(t&&t.dispatchConfig.phasedRegistrationNames){var e=t._targetInst,n=e?h.getParentInstance(e):null;h.traverseTwoPhase(n,o,t)}}function l(t,e,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=g(t,r);o&&(n._dispatchListeners=m(n._dispatchListeners,o),n._dispatchInstances=m(n._dispatchInstances,t))}}function s(t){t&&t.dispatchConfig.registrationName&&l(t._targetInst,null,t)}function c(t){b(t,a)}function u(t){b(t,i)}function d(t,e,n,r){h.traverseEnterLeave(n,r,l,t,e)}function p(t){b(t,s)}var f=n(68),h=n(121),m=n(196),b=n(197),g=(n(8),f.getListener),v={accumulateTwoPhaseDispatches:c,accumulateTwoPhaseDispatchesSkipTarget:u,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:d};t.exports=v},function(t,e,n){"use strict";function r(t){return"button"===t||"input"===t||"select"===t||"textarea"===t}function o(t,e,n){switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(e));default:return!1}}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(13),l=n(120),s=n(121),c=n(122),u=n(196),d=n(197),p=(n(4),{}),f=null,h=function(t,e){t&&(s.executeDispatchesInOrder(t,e),t.isPersistent()||t.constructor.release(t))},m=function(t){return h(t,!0)},b=function(t){return h(t,!1)},g=function(t){return"."+t._rootNodeID},v={injection:{injectEventPluginOrder:l.injectEventPluginOrder,injectEventPluginsByName:l.injectEventPluginsByName},putListener:function(t,e,n){"function"!=typeof n&&i("94",e,void 0===n?"undefined":a(n));var r=g(t);(p[e]||(p[e]={}))[r]=n;var o=l.registrationNameModules[e];o&&o.didPutListener&&o.didPutListener(t,e,n)},getListener:function(t,e){var n=p[e];if(o(e,t._currentElement.type,t._currentElement.props))return null;var r=g(t);return n&&n[r]},deleteListener:function(t,e){var n=l.registrationNameModules[e];n&&n.willDeleteListener&&n.willDeleteListener(t,e);var r=p[e];if(r){delete r[g(t)]}},deleteAllListeners:function(t){var e=g(t);for(var n in p)if(p.hasOwnProperty(n)&&p[n][e]){var r=l.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(t,n),delete p[n][e]}},extractEvents:function(t,e,n,r){for(var o,a=l.plugins,i=0;i children");return y.default.createElement(C.default,{key:n.key,ref:function(e){return t.childrenRefs[n.key]=e},animation:e.animation,transitionName:e.transitionName,transitionEnter:e.transitionEnter,transitionAppear:e.transitionAppear,transitionLeave:e.transitionLeave},n)}));var o=e.component;if(o){var a=e;return"string"==typeof o&&(a=(0,l.default)({className:e.className,style:e.style},e.componentProps)),y.default.createElement(o,a,r)}return r[0]||null}}]),e}(y.default.Component);S.propTypes={component:w.default.any,componentProps:w.default.object,animation:w.default.object,transitionName:w.default.oneOfType([w.default.string,w.default.object]),transitionEnter:w.default.bool,transitionAppear:w.default.bool,exclusive:w.default.bool,transitionLeave:w.default.bool,onEnd:w.default.func,onEnter:w.default.func,onLeave:w.default.func,onAppear:w.default.func,showProp:w.default.string},S.defaultProps={animation:{},component:"span",componentProps:{},transitionEnter:!0,transitionLeave:!0,transitionAppear:!1,onEnd:a,onEnter:a,onLeave:a,onAppear:a};var O=function(){var t=this;this.performEnter=function(e){t.childrenRefs[e]&&(t.currentlyAnimatingKeys[e]=!0,t.childrenRefs[e].componentWillEnter(t.handleDoneAdding.bind(t,e,"enter")))},this.performAppear=function(e){t.childrenRefs[e]&&(t.currentlyAnimatingKeys[e]=!0,t.childrenRefs[e].componentWillAppear(t.handleDoneAdding.bind(t,e,"appear")))},this.handleDoneAdding=function(e,n){var r=t.props;if(delete t.currentlyAnimatingKeys[e],!r.exclusive||r===t.nextProps){var a=(0,k.toArrayChildren)(o(r));t.isValidChildByKey(a,e)?"appear"===n?_.default.allowAppearCallback(r)&&(r.onAppear(e),r.onEnd(e,!0)):_.default.allowEnterCallback(r)&&(r.onEnter(e),r.onEnd(e,!0)):t.performLeave(e)}},this.performLeave=function(e){t.childrenRefs[e]&&(t.currentlyAnimatingKeys[e]=!0,t.childrenRefs[e].componentWillLeave(t.handleDoneLeaving.bind(t,e)))},this.handleDoneLeaving=function(e){var n=t.props;if(delete t.currentlyAnimatingKeys[e],!n.exclusive||n===t.nextProps){var r=(0,k.toArrayChildren)(o(n));if(t.isValidChildByKey(r,e))t.performEnter(e);else{var a=function(){_.default.allowLeaveCallback(n)&&(n.onLeave(e),n.onEnd(e,!1))};(0,k.isSameChildren)(t.state.children,r,n.showProp)?a():t.setState({children:r},a)}}}};e.default=S},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(473),a=r(o),i=n(474),l=r(i);a.default.Group=l.default,e.default=a.default,t.exports=e.default},function(t,e,n){"use strict";function r(t,e){return t+e}function o(t,e,n){var r=n;{if("object"!==(void 0===e?"undefined":S(e)))return void 0!==r?("number"==typeof r&&(r+="px"),void(t.style[e]=r)):T(t,e);for(var a in e)e.hasOwnProperty(a)&&o(t,a,e[a])}}function a(t){var e=void 0,n=void 0,r=void 0,o=t.ownerDocument,a=o.body,i=o&&o.documentElement;return e=t.getBoundingClientRect(),n=e.left,r=e.top,n-=i.clientLeft||a.clientLeft||0,r-=i.clientTop||a.clientTop||0,{left:n,top:r}}function i(t,e){var n=t["page"+(e?"Y":"X")+"Offset"],r="scroll"+(e?"Top":"Left");if("number"!=typeof n){var o=t.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}function l(t){return i(t)}function s(t){return i(t,!0)}function c(t){var e=a(t),n=t.ownerDocument,r=n.defaultView||n.parentWindow;return e.left+=l(r),e.top+=s(r),e}function u(t){return null!==t&&void 0!==t&&t==t.window}function d(t){return u(t)?t.document:9===t.nodeType?t:t.ownerDocument}function p(t,e,n){var r=n,o="",a=d(t);return r=r||a.defaultView.getComputedStyle(t,null),r&&(o=r.getPropertyValue(e)||r[e]),o}function f(t,e){var n=t[D]&&t[D][e];if(N.test(n)&&!P.test(e)){var r=t.style,o=r[z],a=t[I][z];t[I][z]=t[D][z],r[z]="fontSize"===e?"1em":n||0,n=r.pixelLeft+L,r[z]=o,t[I][z]=a}return""===n?"auto":n}function h(t,e){return"left"===t?e.useCssRight?"right":t:e.useCssBottom?"bottom":t}function m(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"bottom"===t?"top":void 0}function b(t,e,n){"static"===o(t,"position")&&(t.style.position="relative");var a=-999,i=-999,l=h("left",n),s=h("top",n),u=m(l),d=m(s);"left"!==l&&(a=999),"top"!==s&&(i=999);var p="",f=c(t);("left"in e||"top"in e)&&(p=(0,M.getTransitionProperty)(t)||"",(0,M.setTransitionProperty)(t,"none")),"left"in e&&(t.style[u]="",t.style[l]=a+"px"),"top"in e&&(t.style[d]="",t.style[s]=i+"px");var b=c(t),g={};for(var v in e)if(e.hasOwnProperty(v)){var y=h(v,n),x="left"===v?a:i,w=f[v]-b[v];g[y]=y===v?x+w:x-w}o(t,g),r(t.offsetTop,t.offsetLeft),("left"in e||"top"in e)&&(0,M.setTransitionProperty)(t,p);var k={};for(var A in e)if(e.hasOwnProperty(A)){var C=h(A,n),E=e[A]-f[A];k[C]=A===C?g[C]+E:g[C]-E}o(t,k)}function g(t,e){var n=c(t),r=(0,M.getTransformXY)(t),o={x:r.x,y:r.y};"left"in e&&(o.x=r.x+e.left-n.left),"top"in e&&(o.y=r.y+e.top-n.top),(0,M.setTransformXY)(t,o)}function v(t,e,n){n.useCssRight||n.useCssBottom?b(t,e,n):n.useCssTransform&&(0,M.getTransformName)()in document.body.style?g(t,e,n):b(t,e,n)}function y(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null;return o.default.pact("saveHosts",e).then(function(e){return a(t,e,n)}).catch(function(t){console.log(t)})}},function(t,e,n){"use strict";var r=n(13),o=(n(4),{}),a={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(t,e,n,o,a,i,l,s){this.isInTransaction()&&r("27");var c,u;try{this._isInTransaction=!0,c=!0,this.initializeAll(0),u=t.call(e,n,o,a,i,l,s),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(t){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return u},initializeAll:function(t){for(var e=this.transactionWrappers,n=t;n]/,s=n(128),c=s(function(t,e){if(t.namespaceURI!==a.svg||"innerHTML"in t)t.innerHTML=e;else{r=r||document.createElement("div"),r.innerHTML=""+e+"";for(var n=r.firstChild;n.firstChild;)t.appendChild(n.firstChild)}});if(o.canUseDOM){var u=document.createElement("div");u.innerHTML=" ",""===u.innerHTML&&(c=function(t,e){if(t.parentNode&&t.parentNode.replaceChild(t,t),i.test(e)||"<"===e[0]&&l.test(e)){t.innerHTML=String.fromCharCode(65279)+e;var n=t.firstChild;1===n.data.length?t.removeChild(n):n.deleteData(0,1)}else t.innerHTML=e}),u=null}t.exports=c},function(t,e,n){"use strict";function r(t){var e=""+t,n=a.exec(e);if(!n)return e;var r,o="",i=0,l=0;for(i=n.index;i]/;t.exports=o},function(t,e,n){"use strict";function r(t){return Object.prototype.hasOwnProperty.call(t,m)||(t[m]=f++,d[t[m]]={}),d[t[m]]}var o,a=n(15),i=n(120),l=n(358),s=n(202),c=n(359),u=n(124),d={},p=!1,f=0,h={topAbort:"abort",topAnimationEnd:c("animationend")||"animationend",topAnimationIteration:c("animationiteration")||"animationiteration",topAnimationStart:c("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:c("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},m="_reactListenersID"+String(Math.random()).slice(2),b=a({},l,{ReactEventListener:null,injection:{injectReactEventListener:function(t){t.setHandleTopLevel(b.handleTopLevel),b.ReactEventListener=t}},setEnabled:function(t){b.ReactEventListener&&b.ReactEventListener.setEnabled(t)},isEnabled:function(){return!(!b.ReactEventListener||!b.ReactEventListener.isEnabled())},listenTo:function(t,e){for(var n=e,o=r(n),a=i.registrationNameDependencies[t],l=0;l=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}},function(t,e,n){"use strict";function r(t,e){for(var n=(0,a.default)({},t),r=0;r=r.F1&&e<=r.F12)return!1;switch(e){case r.ALT:case r.CAPS_LOCK:case r.CONTEXT_MENU:case r.CTRL:case r.DOWN:case r.END:case r.ESC:case r.HOME:case r.INSERT:case r.LEFT:case r.MAC_FF_META:case r.META:case r.NUMLOCK:case r.NUM_CENTER:case r.PAGE_DOWN:case r.PAGE_UP:case r.PAUSE:case r.PRINT_SCREEN:case r.RIGHT:case r.SHIFT:case r.UP:case r.WIN_KEY:case r.WIN_KEY_RIGHT:return!1;default:return!0}},r.isCharacterKey=function(t){if(t>=r.ZERO&&t<=r.NINE)return!0;if(t>=r.NUM_ZERO&&t<=r.NUM_MULTIPLY)return!0;if(t>=r.A&&t<=r.Z)return!0;if(-1!==window.navigation.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case r.SPACE:case r.QUESTION_MARK:case r.NUM_PLUS:case r.NUM_MINUS:case r.NUM_PERIOD:case r.NUM_DIVISION:case r.SEMICOLON:case r.DASH:case r.EQUALS:case r.COMMA:case r.PERIOD:case r.SLASH:case r.APOSTROPHE:case r.SINGLE_QUOTE:case r.OPEN_SQUARE_BRACKET:case r.BACKSLASH:case r.CLOSE_SQUARE_BRACKET:return!0;default:return!1}},e.default=r,t.exports=e.default},function(t,e,n){"use strict";function r(){}function o(t,e,n){var r=e||"";return t.key||r+"item_"+n}function a(t,e){var n=-1;s.default.Children.forEach(t,function(t){n++,t&&t.type&&t.type.isMenuItemGroup?s.default.Children.forEach(t.props.children,function(t){n++,e(t,n)}):e(t,n)})}function i(t,e,n){t&&!n.find&&s.default.Children.forEach(t,function(t){if(!n.find&&t){var r=t.type;if(!r||!(r.isSubMenu||r.isMenuItem||r.isMenuItemGroup))return;-1!==e.indexOf(t.key)?n.find=!0:t.props.children&&i(t.props.children,e,n)}})}Object.defineProperty(e,"__esModule",{value:!0}),e.noop=r,e.getKeyFromChildrenIndex=o,e.loopMenuItem=a,e.loopMenuItemRecusively=i;var l=n(1),s=function(t){return t&&t.__esModule?t:{default:t}}(l)},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t,e,n,o){var a=n?n.call(o,t,e):void 0;if(void 0!==a)return!!a;if(t===e)return!0;if("object"!==(void 0===t?"undefined":r(t))||!t||"object"!==(void 0===e?"undefined":r(e))||!e)return!1;var i=Object.keys(t),l=Object.keys(e);if(i.length!==l.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),c=0;c=arguments.length)?u=n[c]:(u=arguments[l],l+=1),i[c]=u,o(u)||(s-=1),c+=1}return s<=0?a.apply(this,i):r(s,t(e,i,a))}}},function(t,e,n){"use strict";t.exports=function(t,e){for(var n=0,r=e.length,o=Array(r);n0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))})},function(t,e,n){"use strict";var r=n(3);t.exports=r(function(t,e,n){var r={};for(var o in n)r[o]=n[o];return r[t]=e,r})},function(t,e,n){"use strict";var r=n(0);t.exports=r(function(t,e){switch(t){case 0:return function(){return e.call(this)};case 1:return function(t){return e.call(this,t)};case 2:return function(t,n){return e.call(this,t,n)};case 3:return function(t,n,r){return e.call(this,t,n,r)};case 4:return function(t,n,r,o){return e.call(this,t,n,r,o)};case 5:return function(t,n,r,o,a){return e.call(this,t,n,r,o,a)};case 6:return function(t,n,r,o,a,i){return e.call(this,t,n,r,o,a,i)};case 7:return function(t,n,r,o,a,i,l){return e.call(this,t,n,r,o,a,i,l)};case 8:return function(t,n,r,o,a,i,l,s){return e.call(this,t,n,r,o,a,i,l,s)};case 9:return function(t,n,r,o,a,i,l,s,c){return e.call(this,t,n,r,o,a,i,l,s,c)};case 10:return function(t,n,r,o,a,i,l,s,c,u){return e.call(this,t,n,r,o,a,i,l,s,c,u)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}})},function(t,e,n){"use strict";t.exports=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=n(2),o=n(269);t.exports=r(function(t){return o(t.length,t)})},function(t,e,n){"use strict";var r=n(2),o=n(23);t.exports=r(function(t){return o(t.length,t)})},function(t,e,n){"use strict";var r=n(2),o=n(80);t.exports=r(function(t){return o(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()})},function(t,e,n){"use strict";var r=n(279),o=n(0),a=n(168);t.exports=o(function(t,e){return a(r(t),e)})},function(t,e,n){"use strict";var r=n(103),o=n(18),a=n(26),i=n(29),l=n(627);t.exports=r(4,[],o([],l,function(t,e,n,r){return i(function(r,o){var i=n(o);return r[i]=t(a(i,r)?r[i]:e,o),r},{},r)}))},function(t,e,n){"use strict";t.exports=function(t,e,n){for(var r=0,o=n.length;r-1||i("96",t),!c.plugins[n]){e.extractEvents||i("97",t),c.plugins[n]=e;var r=e.eventTypes;for(var a in r)o(r[a],e,a)||i("98",a,t)}}}function o(t,e,n){c.eventNameDispatchConfigs.hasOwnProperty(n)&&i("99",n),c.eventNameDispatchConfigs[n]=t;var r=t.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var l=r[o];a(l,e,n)}return!0}return!!t.registrationName&&(a(t.registrationName,e,n),!0)}function a(t,e,n){c.registrationNameModules[t]&&i("100",t),c.registrationNameModules[t]=e,c.registrationNameDependencies[t]=e.eventTypes[n].dependencies}var i=n(13),l=(n(4),null),s={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(t){l&&i("101"),l=Array.prototype.slice.call(t),r()},injectEventPluginsByName:function(t){var e=!1;for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];s.hasOwnProperty(n)&&s[n]===o||(s[n]&&i("102",n),s[n]=o,e=!0)}e&&r()},getPluginModuleForEvent:function(t){var e=t.dispatchConfig;if(e.registrationName)return c.registrationNameModules[e.registrationName]||null;if(void 0!==e.phasedRegistrationNames){var n=e.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){l=null;for(var t in s)s.hasOwnProperty(t)&&delete s[t];c.plugins.length=0;var e=c.eventNameDispatchConfigs;for(var n in e)e.hasOwnProperty(n)&&delete e[n];var r=c.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=c},function(t,e,n){"use strict";function r(t){return"topMouseUp"===t||"topTouchEnd"===t||"topTouchCancel"===t}function o(t){return"topMouseMove"===t||"topTouchMove"===t}function a(t){return"topMouseDown"===t||"topTouchStart"===t}function i(t,e,n,r){var o=t.type||"unknown-event";t.currentTarget=g.getNodeFromInstance(r),e?m.invokeGuardedCallbackWithCatch(o,n,t):m.invokeGuardedCallback(o,n,t),t.currentTarget=null}function l(t,e){var n=t._dispatchListeners,r=t._dispatchInstances;if(Array.isArray(n))for(var o=0;o0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function a(t,e){var n=s.get(t);if(!n){return null}return n}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=n(13),s=(n(39),n(70)),c=(n(31),n(34)),u=(n(4),n(8),{isMounted:function(t){var e=s.get(t);return!!e&&!!e._renderedComponent},enqueueCallback:function(t,e,n){u.validateCallback(e,n);var o=a(t);if(!o)return null;o._pendingCallbacks?o._pendingCallbacks.push(e):o._pendingCallbacks=[e],r(o)},enqueueCallbackInternal:function(t,e){t._pendingCallbacks?t._pendingCallbacks.push(e):t._pendingCallbacks=[e],r(t)},enqueueForceUpdate:function(t){var e=a(t,"forceUpdate");e&&(e._pendingForceUpdate=!0,r(e))},enqueueReplaceState:function(t,e,n){var o=a(t,"replaceState");o&&(o._pendingStateQueue=[e],o._pendingReplaceState=!0,void 0!==n&&null!==n&&(u.validateCallback(n,"replaceState"),o._pendingCallbacks?o._pendingCallbacks.push(n):o._pendingCallbacks=[n]),r(o))},enqueueSetState:function(t,e){var n=a(t,"setState");if(n){(n._pendingStateQueue||(n._pendingStateQueue=[])).push(e),r(n)}},enqueueElementInternal:function(t,e,n){t._pendingElement=e,t._context=n,r(t)},validateCallback:function(t,e){t&&"function"!=typeof t&&l("122",e,o(t))}});t.exports=u},function(t,e,n){"use strict";var r=(n(15),n(28)),o=(n(8),r);t.exports=o},function(t,e,n){"use strict";function r(t){var e,n=t.keyCode;return"charCode"in t?0===(e=t.charCode)&&13===n&&(e=13):e=n,e>=32||13===e?e:0}t.exports=r},function(t,e,n){"use strict";var r=n(410);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(71);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){"use strict";var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,n){"use strict";t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:r)(t)}},function(t,e,n){"use strict";var r=n(143)("keys"),o=n(93);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){"use strict";var r=n(42),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){"use strict";t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(140);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";t.exports=!0},function(t,e,n){"use strict";var r=n(63),o=n(422),a=n(144),i=n(142)("IE_PROTO"),l=function(){},s=function(){var t,e=n(221)("iframe"),r=a.length;for(e.style.display="none",n(423).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("