diff --git a/CHANGELOG.md b/CHANGELOG.md
index abefa491e..1bdaa57c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 6.12.1 (2020-07-01)
+
+* build: updating dist files ([5f4cc3e](https://github.com/readmeio/api-explorer/commit/5f4cc3e))
+* fix: issue where application/x-www-form-urlencoded payloads weren't being handled properly (#807) ([82f8a61](https://github.com/readmeio/api-explorer/commit/82f8a61)), closes [#807](https://github.com/readmeio/api-explorer/issues/807) [/github.com/readmeio/api-explorer/blob/59a5d060997321936ae356f2ba3f36e34c81c520/packages/oas-to-har/src/index.js#L198](https://github.com//github.com/readmeio/api-explorer/blob/59a5d060997321936ae356f2ba3f36e34c81c520/packages/oas-to-har/src/index.js/issues/L198) [/github.com/Kong/httpsnippet/blob/633b825364ab050f02556cfa837148a1e136fd69/src/index.js#L126-L128](https://github.com//github.com/Kong/httpsnippet/blob/633b825364ab050f02556cfa837148a1e136fd69/src/index.js/issues/L126-L128)
+
+
+
## 6.12.0 (2020-06-26)
* build: updating dist files ([ff88109](https://github.com/readmeio/api-explorer/commit/ff88109))
diff --git a/lerna.json b/lerna.json
index 1f0ff0ad3..a789773ed 100644
--- a/lerna.json
+++ b/lerna.json
@@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
- "version": "6.12.0"
+ "version": "6.12.1"
}
diff --git a/packages/api-explorer/dist/index.js b/packages/api-explorer/dist/index.js
index 59a6b8272..a42a6adad 100644
--- a/packages/api-explorer/dist/index.js
+++ b/packages/api-explorer/dist/index.js
@@ -1,2 +1,2 @@
/*! For license information please see index.js.LICENSE.txt */
-module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=430)}([function(e,t,r){"use strict";e.exports=r(433)},function(e,t,r){e.exports=r(436)()},function(e,t,r){var n,o,i;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),s=n||o||i,l=s&&(n?document.documentMode||6:+(i||o)[1]),u=!i&&/WebKit\//.test(e),c=u&&/Qt\/\d+\.\d+/.test(e),f=!i&&/Chrome\//.test(e),p=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),y=/Android/.test(e),v=g||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),_=/\bCrOS\b/.test(e),E=/win/i.test(t),T=p&&e.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(p=!1,u=!0);var x=b&&(c||p&&(null==T||T<12.11)),k=r||s&&l>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,A=function(e,t){var r=e.className,n=w(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return O(e).appendChild(t)}function P(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i=t)return a+(t-i);a+=s-i,a+=r-a%r,i=s+1}}g?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(L=function(e){try{e.select()}catch(e){}});var U=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};function B(e,t){for(var r=0;r=t)return n+Math.min(a,t-o);if(o+=i-n,n=i+1,(o+=r-o%r)>=t)return n}}var K=[""];function V(e){for(;K.length<=e;)K.push(Y(K)+" ");return K[e]}function Y(e){return e[e.length-1]}function Q(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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]/;function oe(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var o=(t+r)/2,i=n<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:r;e(i)?r=i:t=i+n}}var se=null;function le(e,t,r){var n;se=null;for(var o=0;ot)return o;i.to==t&&(i.from!=i.to&&"before"==r?n=o:se=o),i.from==t&&(i.from!=i.to&&"before"!=r?n=o:se=o)}return null!=n?n:se}var ue=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,o=/[1n]/;function i(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u,c=a.length,f=[],p=0;p-1&&(n[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function me(e,t){var r=de(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o0}function be(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){_e(e),Ee(e)}function ke(e){return e.target||e.srcElement}function we(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Se,Ae,Oe=function(){if(s&&l<9)return!1;var e=P("div");return"draggable"in e||"dragDrop"in e}();function Ce(e){if(null==Se){var t=P("span","");C(e,P("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var r=Se?P("span",""):P("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Pe(e){if(null!=Ae)return Ae;var t=C(e,document.createTextNode("AخA")),r=S(t,0,1).getBoundingClientRect(),n=S(t,1,2).getBoundingClientRect();return O(e),!(!r||r.left==r.right)&&(Ae=n.right-r.right<3)}var Ne,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(r.push(i.slice(0,a)),t+=a+1):(r.push(i),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Ne=P("div"))||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy),Me=null,Le={},je={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Le[e]=t}function He(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return He("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return He("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=He(t);var r=Le[t.name];if(!r)return Ue(e,"text/plain");var n=r(e,t);if(Be.hasOwnProperty(t.name)){var o=Be[t.name];for(var i in o)o.hasOwnProperty(i)&&(n.hasOwnProperty(i)&&(n["_"+i]=n[i]),n[i]=o[i])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Be={};function qe(e,t){F(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function $e(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ge(e,t,r){return!e.startState||e.startState(t,r)}var We=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ke(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],i=o.chunkSize();if(t=e.first&&tr?tt(r,Ke(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?tt(e.line,t):r<0?tt(e.line,0):e}(t,Ke(e,t.line).text.length)}function ut(e,t){for(var r=[],n=0;n=this.string.length},We.prototype.sol=function(){return this.pos==this.lineStart},We.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},We.prototype.next=function(){if(this.post},We.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},We.prototype.skipToEnd=function(){this.pos=this.string.length},We.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},We.prototype.backUp=function(e){this.pos-=e},We.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return r?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},We.prototype.current=function(){return this.string.slice(this.start,this.pos)},We.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},We.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},We.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ft=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function pt(e,t,r,n){var o=[e.state.modeGen],i={};Et(e,t.text,e.doc.mode,r,(function(e,t){return o.push(e,t)}),i,n);for(var a=r.state,s=function(n){r.baseTokens=o;var s=e.state.overlays[n],l=1,u=0;r.state=!0,Et(e,t.text,s.mode,r,(function(e,t){for(var r=l;ue&&o.splice(l,1,e,o[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(s.opaque)o.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength&&ze(e.doc.mode,n.state),i=pt(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new ft(n,!0,t);var i=function(e,t,r){for(var n,o,i=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ke(i,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof ct?u.lookAhead:0)<=i.modeFrontier))return s;var c=H(l.text,null,e.options.tabSize);(null==o||n>c)&&(o=s-1,n=c)}return o}(e,t,r),a=i>n.first&&Ke(n,i-1).stateAfter,s=a?ft.fromSaved(n,a,i):new ft(n,Ge(n.mode),i);return n.iter(i,t,(function(r){mt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&nt.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ft.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ft.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ft.fromSaved=function(e,t,r){return t instanceof ct?new ft(e,ze(e.mode,t.state),r,t.lookAhead):new ft(e,ze(e.mode,t),r)},ft.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function bt(e,t,r,n){var o,i,a=e.doc,s=a.mode,l=Ke(a,(t=lt(a,t)).line),u=ht(e,t.line,r),c=new We(l.text,e.options.tabSize,u);for(n&&(i=[]);(n||c.pose.options.maxHighlightLength?(s=!1,a&&mt(e,t,n,f.pos),f.pos=t.length,l=null):l=_t(yt(r,f,n.state,p),i),p){var d=p[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u=t:i.to>t);(n||(n=[])).push(new kt(a,i.from,s?null:i.to))}}return n}(r,o,a),l=function(e,t,r){var n;if(e)for(var o=0;o=t:i.to>t)||i.from==t&&"bookmark"==a.type&&(!r||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from0&&s)for(var b=0;bt)&&(!r||Dt(r,i.marker)<0)&&(r=i.marker)}return r}function Ft(e,t,r,n,o){var i=Ke(e,t),a=xt&&i.markedSpans;if(a)for(var s=0;s=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?rt(u.to,r)>=0:rt(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?rt(u.from,n)<=0:rt(u.from,n)<0)))return!0}}}function Ht(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function Ut(e,t){var r=Ke(e,t),n=Ht(r);return r==n?t:Xe(n)}function Bt(e,t){if(t>e.lastLine())return t;var r,n=Ke(e,t);if(!qt(e,n))return t;for(;r=Lt(n);)n=r.find(1,!0).line;return Xe(n)+1}function qt(e,t){var r=xt&&t.markedSpans;if(r)for(var n=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Kt=function(e,t,r){this.text=e,Pt(this,t),this.height=r?r(this):1};function Vt(e){e.parent=null,Ct(e)}Kt.prototype.lineNo=function(){return Xe(this)},be(Kt);var Yt={},Qt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Qt:Yt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var r=N("span",null,null,u?"padding-right: .1px":null),n={pre:N("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;n.pos=0,n.addToken=er,Pe(e.display.measure)&&(a=ce(i,e.doc.direction))&&(n.addToken=tr(n.addToken,a)),n.map=[],nr(i,n,dt(e,i,t!=e.display.externalMeasured&&Xe(i))),i.styleClasses&&(i.styleClasses.bgClass&&(n.bgClass=M(i.styleClasses.bgClass,n.bgClass||"")),i.styleClasses.textClass&&(n.textClass=M(i.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ce(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=M(n.pre.className,n.textClass||"")),n}function Zt(e){var t=P("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function er(e,t,r,n,o,i,a){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",o=0;ou&&f.from<=u);p++);if(f.to>=c)return e(r,n,o,i,a,s,l);e(r,n.slice(0,f.to-u),o,i,null,s,l),i=null,n=n.slice(f.to-u),u=f.to}}}function rr(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function nr(e,t,r){var n=e.markedSpans,o=e.text,i=0;if(n)for(var a,s,l,u,c,f,p,d=o.length,h=0,m=1,g="",y=0;;){if(y==h){l=u=c=s="",p=null,f=null,y=1/0;for(var v=[],b=void 0,_=0;_h||T.collapsed&&E.to==h&&E.from==h)){if(null!=E.to&&E.to!=h&&y>E.to&&(y=E.to,u=""),T.className&&(l+=" "+T.className),T.css&&(s=(s?s+";":"")+T.css),T.startStyle&&E.from==h&&(c+=" "+T.startStyle),T.endStyle&&E.to==y&&(b||(b=[])).push(T.endStyle,E.to),T.title&&((p||(p={})).title=T.title),T.attributes)for(var x in T.attributes)(p||(p={}))[x]=T.attributes[x];T.collapsed&&(!f||Dt(f.marker,T)<0)&&(f=E)}else E.from>h&&y>E.from&&(y=E.from)}if(b)for(var k=0;k=d)break;for(var S=Math.min(d,y);;){if(g){var A=h+g.length;if(!f){var O=A>S?g.slice(0,S-h):g;t.addToken(t,O,a?a+l:l,c,h+O.length==y?u:"",s,p)}if(A>=S){g=g.slice(S-h),h=S;break}h=A,c=""}g=o.slice(i,i=r[m++]),a=Xt(r[m++],t.cm.options)}}else for(var C=1;Cr)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Pr(e,t,r,n){return Dr(e,Rr(e,t),r,n)}function Nr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&i.push((l.bottom+u.top)/2-r.top)}}i.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,r,n){var o,i=Lr(t.map,r,n),a=i.node,u=i.start,c=i.end,f=i.collapse;if(3==a.nodeType){for(var p=0;p<4;p++){for(;u&&oe(t.line.text.charAt(i.coverStart+u));)--u;for(;i.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,o))}else{var d;u>0&&(f=n="right"),o=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!u&&(!o||!o.left&&!o.right)){var h=a.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+on(e.display),top:h.top,bottom:h.bottom}:Mr}for(var m=o.top-t.rect.top,g=o.bottom-t.rect.top,y=(m+g)/2,v=t.view.measure.heights,b=0;bt)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(n=e[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==o)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left";if("right"==r&&o==l-s)for(;u=0&&(r=e[o]).left==r.right;o--);return r}function Fr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var f=le(s,l,u),p=se,d=c(l,f,"before"==u);return null!=p&&(d.other=c(l,p,"before"!=u)),d}function Vr(e,t){var r=0;t=lt(e.doc,t),e.options.lineWrapping||(r=on(e.display)*t.ch);var n=Ke(e.doc,t.line),o=$t(n)+xr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function Yr(e,t,r,n,o){var i=tt(e,t,r);return i.xRel=o,n&&(i.outside=n),i}function Qr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Yr(n.first,0,null,-1,-1);var o=Je(n,r),i=n.first+n.size-1;if(o>i)return Yr(n.first+n.size-1,Ke(n,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(n,o);;){var s=en(e,a,o,t,r),l=jt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==o)return u;a=Ke(n,o=u.line)}}function Xr(e,t,r,n){n-=zr(t);var o=t.text.length,i=ae((function(t){return Dr(e,r,t-1).bottom<=n}),o,0);return{begin:i,end:o=ae((function(t){return Dr(e,r,t).top>n}),i,o)}}function Jr(e,t,r,n){return r||(r=Rr(e,t)),Xr(e,t,r,$r(e,t,Dr(e,r,n),"line").top)}function Zr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function en(e,t,r,n,o){o-=$t(t);var i=Rr(e,t),a=zr(t),s=0,l=t.text.length,u=!0,c=ce(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?rn:tn)(e,t,r,i,c,n,o);s=(u=1!=f.level)?f.from:f.to-1,l=u?f.to:f.from-1}var p,d,h=null,m=null,g=ae((function(t){var r=Dr(e,i,t);return r.top+=a,r.bottom+=a,!!Zr(r,n,o,!1)&&(r.top<=o&&r.left<=n&&(h=t,m=r),!0)}),s,l),y=!1;if(m){var v=n-m.left=_.bottom?1:0}return Yr(r,g=ie(t.text,g,1),d,y,n-p)}function tn(e,t,r,n,o,i,a){var s=ae((function(s){var l=o[s],u=1!=l.level;return Zr(Kr(e,tt(r,u?l.to:l.from,u?"before":"after"),"line",t,n),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var u=1!=l.level,c=Kr(e,tt(r,u?l.from:l.to,u?"after":"before"),"line",t,n);Zr(c,i,a,!0)&&c.top>a&&(l=o[s-1])}return l}function rn(e,t,r,n,o,i,a){var s=Xr(e,t,n,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,p=0;p=u||d.to<=l)){var h=Dr(e,n,1!=d.level?Math.min(u,d.to)-1:Math.max(l,d.from)).right,m=hm)&&(c=d,f=m)}}return c||(c=o[o.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=P("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(P("br"));Ir.appendChild(document.createTextNode("x"))}C(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),O(e.measure),r||1}function on(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=P("span","xxxxxxxxxx"),r=P("pre",[t],"CodeMirror-line-like");C(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function an(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=i.offsetLeft+i.clientLeft+o,n[s]=i.clientWidth}return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ln(e){var t=nn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/on(e.display)-3);return function(o){if(qt(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a0&&(l=Ke(e.doc,u.line).text).length==u.ch){var c=H(l,l.length,e.options.tabSize)-l.length;u=tt(u.line,Math.max(0,Math.round((i-wr(e.display).left)/on(e.display))-c))}return u}function fn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;nt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)xt&&Ut(e.doc,t)o.viewFrom?hn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)hn(e);else if(t<=o.viewFrom){var i=mn(e,r,r+n,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=n):hn(e)}else if(r>=o.viewTo){var a=mn(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):hn(e)}else{var s=mn(e,t,t,-1),l=mn(e,r,r+n,1);s&&l?(o.view=o.view.slice(0,s.index).concat(ir(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=n):hn(e)}var u=o.externalMeasured;u&&(r=o.lineN&&t=n.viewTo)){var i=n.view[fn(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==B(a,r)&&a.push(r)}}}function hn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function mn(e,t,r,n){var o,i=fn(e,t),a=e.display.view;if(!xt||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,l=0;l0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,r+=o}for(;Ut(e.doc,r)!=r;){if(i==(n<0?0:a.length-1))return null;r+=n*a[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function gn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||s.to().linet||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",i),o=!0)}o||n(t,r,"ltr")}(m,r||0,null==n?p:n,(function(e,t,o,f){var g="ltr"==o,y=d(e,g?"left":"right"),v=d(t-1,g?"right":"left"),b=null==r&&0==e,_=null==n&&t==p,E=0==f,T=!m||f==m.length-1;if(v.top-y.top<=3){var x=(u?_:b)&&T,k=(u?b:_)&&E?s:(g?y:v).left,w=x?l:(g?v:y).right;c(k,y.top,w-k,y.bottom)}else{var S,A,O,C;g?(S=u&&b&&E?s:y.left,A=u?l:h(e,o,"before"),O=u?s:h(t,o,"after"),C=u&&_&&T?l:v.right):(S=u?h(e,o,"before"):s,A=!u&&b&&E?l:y.right,O=!u&&_&&T?s:v.left,C=u?h(t,o,"after"):l),c(S,y.top,A-S,y.bottom),y.bottom0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function xn(e){e.state.focused||(e.display.input.focus(),wn(e))}function kn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Sn(e))}),100)}function wn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Tn(e))}function Sn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function An(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||p<-.005)&&(Qe(o.line,a),On(o.line),o.rest))for(var d=0;de.display.sizerWidth){var h=Math.ceil(u/on(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}}function On(e){if(e.widgets)for(var t=0;t=a&&(i=Je(t,$t(Ke(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Pn(e,t){var r=e.display,n=nn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,i=Or(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+kr(r),l=t.tops-n;if(t.topo+i){var c=Math.min(t.top,(u?s:t.bottom)-i);c!=o&&(a.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=Ar(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>p;return d&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+f-3&&(a.scrollLeft=t.right+(d?0:10)-p),a}function Nn(e,t){null!=t&&(In(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Rn(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dn(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function In(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mn(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Mn(e,t,r,n){var o=Pn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Dn(e,o.scrollLeft,o.scrollTop)}function Ln(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||uo(e,{top:t}),jn(e,t,!0),r&&uo(e),oo(e,100))}function jn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,po(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Hn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Sr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Un=function(e,t,r){this.cm=r;var n=this.vert=P("div",[P("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=P("div",[P("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),pe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),pe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Un.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Un.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Un.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Un.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new U,this.disableVert=new U},Un.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var o=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Un.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Bn=function(){};function qn(e,t){t||(t=Hn(e));var r=e.display.barWidth,n=e.display.barHeight;zn(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&An(e),zn(e,Hn(e)),r=e.display.barWidth,n=e.display.barHeight}function zn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Bn.prototype.update=function(){return{bottom:0,right:0}},Bn.prototype.setScrollLeft=function(){},Bn.prototype.setScrollTop=function(){},Bn.prototype.clear=function(){};var $n={native:Un,null:Bn};function Gn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $n[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Fn(e,t):Ln(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Wn=0;function Kn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wn},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function Vn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ao(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qn(e){e.updatedDisplay=e.mustUpdate&&so(e.cm,e.update)}function Xn(e){var t=e.cm,r=t.display;e.updatedDisplay&&An(t),e.barMeasure=Hn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Sr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ar(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Jn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!m){var i=P("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-xr(e.display))+"px;\n height: "+(t.bottom-t.top+Sr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,r,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?tt(t.line,t.ch+1,"before"):t);for(var i=0;i<5;i++){var a=!1,s=Kr(e,t),l=r&&r!=t?Kr(e,r):s,u=Pn(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(Ln(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Fn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return o}(t,lt(n,e.scrollToPos.from),lt(n,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var a=0;a=e.display.viewTo)){var r=+new Date+e.options.workTime,n=ht(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(n.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?ze(t.mode,n.state):null,l=pt(e,i,n,!0);s&&(n.state=s),i.styles=l.styles;var u=i.styleClasses,c=l.classes;c?i.styleClasses=c:u&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!f&&pr)return oo(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&eo(e,(function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==gn(e))return!1;ho(e)&&(hn(e),t.dims=an(e));var o=n.first+n.size,i=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),xt&&(i=Ut(e.doc,i),a=Bt(e.doc,a));var s=i!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ir(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ir(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,fn(e,r)))),n.viewTo=r}(e,i,a),r.viewOffset=$t(Ke(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=gn(e);if(!s&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=D();if(!t||!R(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&R(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return l>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,o=e.options.lineNumbers,i=n.lineDiv,a=i.firstChild;function s(t){var r=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var l=n.view,c=n.viewFrom,f=0;f-1&&(d=!1),cr(e,p,c,r)),d&&(O(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(et(e.options,c)))),a=p.node.nextSibling}else{var h=yr(e,p,c,r);i.insertBefore(h,a)}c+=p.size}for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),O(r.cursorDiv),O(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,oo(e,400)),r.updateLineNumbers=null,!0}function lo(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ar(e))n&&(t.visible=Cn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Or(e),r.top)}),t.visible=Cn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!so(e,t))break;An(e);var o=Hn(e);yn(e),qn(e,o),fo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function uo(e,t){var r=new ao(e,t);if(so(e,r)){An(e),lo(e,r);var n=Hn(e);yn(e),qn(e,n),fo(e,n),r.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function fo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Sr(e)+"px"}function po(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=n+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(o&&l||i&&c){if(i&&b&&u)e:for(var f=t.target,d=a.view;f!=s;f=f.parentNode)for(var h=0;h=0&&rt(e,n.to())<=0)return r}return-1};var wo=function(e,t){this.anchor=e,this.head=t};function So(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort((function(e,t){return rt(e.from(),t.from())})),r=B(t,o);for(var i=1;i0:l>=0){var u=at(s.from(),a.from()),c=it(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;i<=r&&--r,t.splice(--i,2,new wo(f?c:u,f?u:c))}}return new ko(t,r)}function Ao(e,t){return new ko([new wo(e,t||e)],0)}function Oo(e){return e.text?tt(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Co(e,t){if(rt(e,t.from)<0)return e;if(rt(e,t.to)<=0)return Oo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Oo(t).ch-t.to.ch),tt(r,n)}function Po(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}lr(e,"change",e,t)}function Lo(e,t,r){!function e(n,o,i){if(n.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Bo(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(o,o.lastOp==n)))a=Y(i.changes),0==rt(t.from,t.to)&&0==rt(t.from,a.to)?a.to=Oo(t):i.changes.push(Uo(e,t));else{var l=Y(o.done);for(l&&l.ranges||$o(e.sel,o.done),i={changes:[Uo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,a||me(e,"historyAdded")}function zo(e,t,r,n){var o=e.history,i=n&&n.origin;r==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,r,n){var o=t.charAt(0);return"*"==o||"+"==o&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,Y(o.done),t))?o.done[o.done.length-1]=t:$o(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=r,n&&!1!==n.clearRedo&&Bo(o.undone)}function $o(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Go(e,t,r,n){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=r.markedSpans),++i}))}function Wo(e){if(!e)return null;for(var t,r=0;r-1&&(Y(s)[f]=u[f],delete u[f])}}}return n}function Yo(e,t,r,n){if(n){var o=e.anchor;if(r){var i=rt(t,o)<0;i!=rt(r,o)<0?(o=t,t=r):i!=rt(t,r)<0&&(t=r)}return new wo(o,t)}return new wo(r||t,t)}function Qo(e,t,r,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ti(e,new ko([Yo(e.sel.primary(),t,r,o)],0),n)}function Xo(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i=t.ch:s.to>t.ch))){if(o&&(me(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var f=l.find(n<0?1:-1),p=void 0;if((n<0?c:u)&&(f=li(e,f,-n,f&&f.line==t.line?i:null)),f&&f.line==t.line&&(p=rt(f,r))&&(n<0?p<0:p>0))return ai(e,f,t,n,o)}var d=l.find(n<0?-1:1);return(n<0?u:c)&&(d=li(e,d,n,d.line==t.line?i:null)),d?ai(e,d,t,n,o):null}}return t}function si(e,t,r,n,o){var i=n||1,a=ai(e,t,r,i,o)||!o&&ai(e,t,r,i,!0)||ai(e,t,r,-i,o)||!o&&ai(e,t,r,-i,!0);return a||(e.cantEdit=!0,tt(e.first,0))}function li(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:r>0&&t.ch==(n||Ke(e,t.line)).text.length?t.line0)){var c=[l,1],f=rt(u.from,s.from),p=rt(u.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&c.push({from:s.to,to:u.to}),o.splice.apply(o,c),l+=c.length-3}}return o}(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)pi(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else pi(e,t)}}function pi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=rt(t.from,t.to)){var r=Po(e,t);qo(e,t,r,e.cm?e.cm.curOp.id:NaN),mi(e,t,r,At(e,t));var n=[];Lo(e,(function(e,r){r||-1!=B(n,e.history)||(bi(e.history,t),n.push(e.history)),mi(e,t,null,At(e,t))}))}}function di(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,u=0;u=0;--d){var h=p(d);if(h)return h.v}}}}function hi(e,t){if(0!=t&&(e.first+=t,e.sel=new ko(Q(e.sel.ranges,(function(e){return new wo(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linei&&(t={from:t.from,to:tt(i,Ke(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),r||(r=Po(e,t)),e.cm?function(e,t,r){var n=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Xe(Ht(Ke(n,i.line))),n.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ye(e),Mo(n,t,r,ln(e)),e.options.lineWrapping||(n.iter(l,i.line+t.text.length,(function(e){var t=Gt(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var o=Ke(e,n).stateAfter;if(o&&(!(o instanceof ct)||n+o.lookAhead1||!(this.children[0]instanceof Ei))){var s=[];this.collapse(s),this.children=[new Ei(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=o.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=N("span",[i.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ft(e,t.line,t,r,i)||t.line!=r.line&&Ft(e,r.line,t,r,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");xt=!0}i.addToHistory&&qo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,r.line+1,(function(e){u&&i.collapsed&&!u.options.lineWrapping&&Ht(e)==u.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Qe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new kt(i,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l})),i.collapsed&&e.iter(t.line,r.line+1,(function(t){qt(e,t)&&Qe(t,0)})),i.clearOnEnter&&pe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++wi,i.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),i.collapsed)pn(u,t.line,r.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var c=t.line;c<=r.line;c++)dn(u,c,"text");i.atomic&&oi(u.doc),lr(u,"markerAdded",u,i)}return i}Si.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kn(e),ve(this,"clear")){var r=this.find();r&&lr(this,"clear",r.from,r.to)}for(var n=null,o=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&pn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&oi(e.doc)),e&&lr(e,"markerCleared",e,this,n,o),t&&Vn(e),this.parent&&this.parent.clear()}},Si.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;l--)fi(this,n[l]);s?ei(this,s):this.cm&&Rn(this.cm)})),undo:no((function(){di(this,"undo")})),redo:no((function(){di(this,"redo")})),undoSelection:no((function(){di(this,"undo",!0)})),redoSelection:no((function(){di(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=lt(this,e),t=lt(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++o})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=i,++r})),lt(this,tt(r,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ri(t.doc,Ao(r,r)),p)for(var d=0;d=0;t--)gi(e.doc,"",n[t].from,n[t].to,"+delete");Rn(e)}))}function Zi(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function ea(e,t,r){var n=Zi(e,t.ch,r);return null==n?null:new tt(t.line,n,r<0?"after":"before")}function ta(e,t,r,n,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(r,t.doc.direction);if(i){var a,s=o<0?Y(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Rr(t,r);a=o<0?r.text.length-1:0;var c=Dr(t,u,a).top;a=ae((function(e){return Dr(t,u,e).top==c}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Zi(r,a,1))}else a=o<0?s.to:s.from;return new tt(n,a,l)}}return new tt(n,o<0?r.text.length:0,o<0?"before":"after")}$i.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},$i.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},$i.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$i.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},$i.default=b?$i.macDefault:$i.pcDefault;var ra={selectAll:ui,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Ji(e,(function(t){if(t.empty()){var r=Ke(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)o=new tt(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),tt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ke(e.doc,o.line-1).text;a&&(o=new tt(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(o.line-1,a.length-1),o,"+transpose"))}r.push(new wo(o,o))}e.setSelections(r)}))},newlineAndIndent:function(e){return eo(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n-1&&(rt((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(rt(o.to(),t)>0||t.xRel<0)?function(e,t,r,n){var o=e.display,i=!1,a=to(e,(function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,he(o.wrapper.ownerDocument,"mouseup",a),he(o.wrapper.ownerDocument,"mousemove",c),he(o.scroller,"dragstart",f),he(o.scroller,"drop",a),i||(_e(t),n.addNew||Qo(e.doc,r,null,null,n.extend),u&&!d||s&&9==l?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),c=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};u&&(o.scroller.draggable=!0),e.state.draggingText=a,a.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),pe(o.wrapper.ownerDocument,"mouseup",a),pe(o.wrapper.ownerDocument,"mousemove",c),pe(o.scroller,"dragstart",f),pe(o.scroller,"drop",a),kn(e),setTimeout((function(){return o.input.focus()}),20)}(e,n,t,i):function(e,t,r,n){var o=e.display,i=e.doc;_e(t);var a,s,l=i.sel,u=l.ranges;if(n.addNew&&!n.extend?(s=i.sel.contains(r),a=s>-1?u[s]:new wo(r,r)):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==n.unit)n.addNew||(a=new wo(r,r)),r=cn(e,t,!0,!0),s=-1;else{var c=va(e,r,n.unit);a=n.extend?Yo(a,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,ti(i,So(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(ti(i,So(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=i.sel):Jo(i,s,a,$):(s=0,ti(i,new ko([a],0),$),l=i.sel);var f=r;function p(t){if(0!=rt(f,t))if(f=t,"rectangle"==n.unit){for(var o=[],u=e.options.tabSize,c=H(Ke(i,r.line).text,r.ch,u),p=H(Ke(i,t.line).text,t.ch,u),d=Math.min(c,p),h=Math.max(c,p),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var y=Ke(i,m).text,v=W(y,d,u);d==h?o.push(new wo(tt(m,v),tt(m,v))):y.length>v&&o.push(new wo(tt(m,v),tt(m,W(y,h,u))))}o.length||o.push(new wo(r,r)),ti(i,So(e,l.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,_=a,E=va(e,t,n.unit),T=_.anchor;rt(E.anchor,T)>0?(b=E.head,T=at(_.from(),E.anchor)):(b=E.anchor,T=it(_.to(),E.head));var x=l.ranges.slice(0);x[s]=function(e,t){var r=t.anchor,n=t.head,o=Ke(e.doc,r.line);if(0==rt(r,n)&&r.sticky==n.sticky)return t;var i=ce(o);if(!i)return t;var a=le(i,r.ch,r.sticky),s=i[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,u=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==i.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=le(i,n.ch,n.sticky),f=c-a||(n.ch-r.ch)*(1==s.level?-1:1);l=c==u-1||c==u?f<0:f>0}var p=i[u+(l?-1:0)],d=l==(1==p.level),h=d?p.from:p.to,m=d?"after":"before";return r.ch==h&&r.sticky==m?t:new wo(new tt(r.line,h,m),n)}(e,new wo(lt(i,T),b)),ti(i,So(e,x,s),$)}}var d=o.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,t&&(_e(t),o.input.focus()),he(o.wrapper.ownerDocument,"mousemove",g),he(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var g=to(e,(function(t){0!==t.buttons&&we(t)?function t(r){var a=++h,s=cn(e,r,!0,"rectangle"==n.unit);if(s)if(0!=rt(s,f)){e.curOp.focus=D(),p(s);var l=Cn(o,i);(s.line>=l.to||s.lined.bottom?20:0;u&&setTimeout(to(e,(function(){h==a&&(o.scroller.scrollTop+=u,t(r))})),50)}}(t):m(t)})),y=to(e,m);e.state.selectingText=y,pe(o.wrapper.ownerDocument,"mousemove",g),pe(o.wrapper.ownerDocument,"mouseup",y)}(e,n,t,i)}(t,n,i,e):ke(e)==r.scroller&&_e(e):2==o?(n&&Qo(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==o&&(k?t.display.input.onContextMenu(e):kn(t)))}}function va(e,t,r){if("char"==r)return new wo(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new wo(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var n=r(e,t);return new wo(n.from,n.to)}function ba(e,t,r,n){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ve(e,r))return Te(t);i-=s.top-a.viewOffset;for(var l=0;l=o)return me(e,r,e,Je(e.doc,i),e.display.gutterSpecs[l].className,t),Te(t)}}function _a(e,t){return ba(e,t,"gutterClick",!0)}function Ea(e,t){Tr(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ba(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ta(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ur(e)}ga.prototype.compare=function(e,t,r){return this.time+400>e&&0==rt(t,this.pos)&&r==this.button};var xa={toString:function(){return"CodeMirror.Init"}},ka={},wa={};function Sa(e,t,r){if(!t!=!(r&&r!=xa)){var n=e.display.dragFunctions,o=t?pe:he;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Aa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),Wt(e)),un(e),pn(e),Ur(e),setTimeout((function(){return qn(e)}),100)}function Oa(e,t){var r=this;if(!(this instanceof Oa))return new Oa(e,t);this.options=t=t?F(t):{},F(ka,t,!1);var n=t.value;"string"==typeof n?n=new Ri(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Oa.inputStyles[t.inputStyle](this),i=this.display=new vo(e,n,o,t);for(var a in i.wrapper.CodeMirror=this,Ta(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gn(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 U,keySeq:null,specialChars:null},t.autofocus&&!v&&i.input.focus(),s&&l<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;pe(t.scroller,"mousedown",to(e,ya)),pe(t.scroller,"dblclick",s&&l<11?to(e,(function(t){if(!ge(e,t)){var r=cn(e,t);if(r&&!_a(e,t)&&!Tr(e.display,t)){_e(t);var n=e.findWordAt(r);Qo(e.doc,n.anchor,n.head)}}})):function(t){return ge(e,t)||_e(t)}),pe(t.scroller,"contextmenu",(function(t){return Ea(e,t)})),pe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||Ea(e,r)}));var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}pe(t.scroller,"touchstart",(function(o){if(!ge(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!_a(e,o)){t.input.ensurePolled(),clearTimeout(r);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!Tr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!n.prev||i(n,n.prev)?new wo(s,s):!n.prev.prev||i(n,n.prev.prev)?e.findWordAt(s):new wo(tt(s.line,0),lt(e.doc,tt(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),_e(r)}o()})),pe(t.scroller,"touchcancel",o),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ln(e,t.scroller.scrollTop),Fn(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return xo(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return xo(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||xe(t)},over:function(t){ge(e,t)||(function(e,t){var r=cn(e,t);if(r){var n=document.createDocumentFragment();bn(e,r,n),e.display.dragCursor||(e.display.dragCursor=P("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,n)}}(e,t),xe(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Di<100))xe(t);else if(!ge(e,t)&&!Tr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var r=P("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),p&&r.parentNode.removeChild(r)}}(e,t)},drop:to(e,Ii),leave:function(t){ge(e,t)||Mi(e)}};var a=t.input.getField();pe(a,"keyup",(function(t){return pa.call(e,t)})),pe(a,"keydown",to(e,fa)),pe(a,"keypress",to(e,da)),pe(a,"focus",(function(t){return wn(e,t)})),pe(a,"blur",(function(t){return Sn(e,t)}))}(this),Fi(),Kn(this),this.curOp.forceUpdate=!0,jo(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(j(wn,this),20):Sn(this),wa)wa.hasOwnProperty(a)&&wa[a](this,t[a],xa);ho(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>i.first?H(Ke(i,t-1).text,null,a):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var f="",p=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d)p+=a,f+="\t";if(pa,l=Re(t),u=null;if(s&&n.ranges.length>1)if(Na&&Na.text.join("\n")==t){if(n.ranges.length%Na.text.length==0){u=[];for(var c=0;c=0;p--){var d=n.ranges[p],h=d.from(),m=d.to();d.empty()&&(r&&r>0?h=tt(h.line,h.ch-r):e.state.overwrite&&!s?m=tt(m.line,Math.min(Ke(i,m.line).text.length,m.ch+Y(l).length)):s&&Na&&Na.lineWise&&Na.text.join("\n")==t&&(h=m=tt(h.line,0)));var g={from:h,to:m,text:u?u[p%u.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};fi(e.doc,g),lr(e,"inputRead",e,g)}t&&!s&&Ma(e,t),Rn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||eo(t,(function(){return Da(t,r,0,null,"paste")})),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(!(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s-1){a=Pa(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ke(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Pa(e,o.head.line,"smart"));a&&lr(e,"electricInput",e,o.head.line)}}}function La(e){for(var t=[],r=[],n=0;n=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var i=le(o,r.ch,r.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&p>=c.begin)){var d=f?"before":"after";return new tt(r.line,p,d)}}var h=function(e,t,n){for(var i=function(e,t){return t?new tt(r.line,l(e,1),"before"):new tt(r.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?n.begin:l(n.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||n>0&&g==t.text.length||!(m=h(n>0?0:o.length-1,n,u(g)))?null:m}(e.cm,s,t,r):ea(s,t,r))){if(n||(a=t.line+l)=e.first+e.size||(t=new tt(a,t.ch,t.sticky),!(s=Ke(e,a))))return!1;t=ta(o,e.cm,s,t.line,l)}else t=i;return!0}if("char"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var h=s.text.charAt(t.ch)||"\n",m=te(h,p)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||d||m||(m="s"),c&&c!=m){r<0&&(r=1,u(),t.sticky="after");break}if(m&&(c=m),r>0&&!u(!d))break}var g=si(e,t,i,a,!0);return nt(i,g)&&(g.hitSide=!0),g}function Ua(e,t,r,n){var o,i,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*nn(e.display),3);o=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(i=Qr(e,s,o)).outside;){if(r<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*r}return i}var Ba=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new U,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function qa(e,t){var r=Nr(e,t.line);if(!r||r.hidden)return null;var n=Ke(e.doc,t.line),o=Cr(r,n,t.line),i=ce(n,e.doc.direction),a="left";i&&(a=le(i,t.ch)%2?"right":"left");var s=Lr(o.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function za(e,t){return t&&(e.bad=!0),e}function $a(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return za(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o=t.display.viewTo||i.line=t.display.viewFrom&&qa(t,o)||{node:l[0].measure.map[2],offset:0},c=i.linen.firstLine()&&(a=tt(a.line-1,Ke(n.doc,a.line-1).length)),s.ch==Ke(n.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;a.line==o.viewFrom||0==(e=fn(n,a.line))?(t=Xe(o.view[0].line),r=o.view[0].node):(t=Xe(o.view[e].line),r=o.view[e-1].node.nextSibling);var l,u,c=fn(n,s.line);if(c==o.view.length-1?(l=o.viewTo-1,u=o.lineDiv.lastChild):(l=Xe(o.view[c+1].line)-1,u=o.view[c+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(){a&&(i+=s,l&&(i+=s),a=l=!1)}function c(e){e&&(u(),i+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var i,p=t.getAttribute("cm-marker");if(p){var d=e.findMarks(tt(n,0),tt(o+1,0),(g=+p,function(e){return e.id==g}));return void(d.length&&(i=d[0].find(0))&&c(Ve(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&u();for(var m=0;m1&&p.length>1;)if(Y(f)==Y(p))f.pop(),p.pop(),l--;else{if(f[0]!=p[0])break;f.shift(),p.shift(),t++}for(var d=0,h=0,m=f[0],g=p[0],y=Math.min(m.length,g.length);da.ch&&v.charCodeAt(v.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;f[f.length-1]=v.slice(0,v.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var E=tt(t,d),T=tt(l,p.length?Y(p).length-h:0);return f.length>1||f[0]||rt(E,T)?(gi(n.doc,f,E,T,"+input"),!0):void 0},Ba.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ba.prototype.reset=function(){this.forceCompositionEnd()},Ba.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ba.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ba.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||eo(this.cm,(function(){return pn(e.cm)}))},Ba.prototype.setUneditable=function(e){e.contentEditable="false"},Ba.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||to(this.cm,Da)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ba.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ba.prototype.onContextMenu=function(){},Ba.prototype.resetPosition=function(){},Ba.prototype.needsContentAttribute=!0;var Wa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new U,this.hasSelection=!1,this.composing=null};Wa.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!ge(n,e)){if(n.somethingSelected())Ra({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=La(n);Ra({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,z):(r.prevInput="",o.value=t.text.join("\n"),L(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(o.style.width="0px"),pe(o,"input",(function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),pe(o,"paste",(function(e){ge(n,e)||Ia(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),pe(o,"cut",i),pe(o,"copy",i),pe(e.scroller,"paste",(function(t){if(!Tr(e,t)&&!ge(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),pe(e.lineSpace,"selectstart",(function(t){Tr(e,t)||_e(t)})),pe(o,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(o,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Wa.prototype.createField=function(e){this.wrapper=Fa(),this.textarea=this.wrapper.firstChild},Wa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Wa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=vn(e);if(e.options.moveInputWithCursor){var o=Kr(e,r.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return n},Wa.prototype.showSelection=function(e){var t=this.cm.display;C(t.cursorDiv,e.cursors),C(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&L(this.textarea),s&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Wa.prototype.getField=function(){return this.textarea},Wa.prototype.supportsTouch=function(){return!1},Wa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wa.prototype.blur=function(){this.textarea.blur()},Wa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wa.prototype.receivedFocus=function(){this.slowPoll()},Wa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Wa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},Wa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||n||(n=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(n.length,o.length);a1e3||o.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Wa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wa.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Wa.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cn(r,e),a=n.scroller.scrollTop;if(i&&!p){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(i)&&to(r,ti)(r.doc,Ao(i),z);var c,f=o.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(c=window.scrollY),n.input.focus(),u&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),s&&l>=9&&m(),k?(xe(e),pe(window,"mouseup",(function e(){he(window,"mouseup",e),setTimeout(g,20)}))):setTimeout(g,50)}function m(){if(null!=o.selectionStart){var e=r.somethingSelected(),i=""+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=i.length,n.selForContextMenu=r.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,o.style.cssText=f,s&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=a),null!=o.selectionStart)){(!s||s&&l<9)&&m();var e=0;n.detectingSelectAll=setTimeout((function i(){n.selForContextMenu==r.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==t.prevInput?to(r,ui)(r):e++<10?n.detectingSelectAll=setTimeout(i,500):(n.selForContextMenu=null,n.input.reset())}),200)}}},Wa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Wa.prototype.setUneditable=function(){},Wa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,o,i){e.defaults[r]=n,o&&(t[r]=i?function(e,t,r){r!=xa&&o(e,t,r)}:o)}e.defineOption=r,e.Init=xa,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Ro(e)}),!0),r("indentUnit",2,Ro,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Do(e),Ur(e),pn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,r.push(tt(n,i))}n++}));for(var o=r.length-1;o>=0;o--)gi(e.doc,t,r[o],tt(r[o].line,r[o].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=xa&&e.refresh()})),r("specialCharPlaceholder",Zt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!E),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Ta(e),yo(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Xi(t),o=r!=xa&&Xi(r);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Aa,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=mo(t,e.options.lineNumbers),yo(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return qn(e)}),!0),r("scrollbarStyle","native",(function(e){Gn(e),qn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=mo(e.options.gutters,t),yo(e)}),!0),r("firstLineNumber",1,yo,!0),r("lineNumberFormatter",(function(e){return e}),yo,!0),r("showCursorWhenSelecting",!1,yn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(Sn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Sa),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,yn,!0),r("singleCursorHeightPerLine",!0,yn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Do,!0),r("addModeClass",!1,Do,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Do,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Oa),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,o=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&to(this,t[e])(this,r,o),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Pa(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&Rn(this));else{var i=o.from(),a=o.to(),s=Math.max(r,i.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Jo(this.doc,n,new wo(i,u[n].to()),z)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,r=dt(this,Ke(this.doc,e.line)),n=0,o=(r.length-1)/2,i=e.ch;if(0==i)t=r[2];else for(;;){var a=n+o>>1;if((a?r[2*a-1]:0)>=i)o=a;else{if(!(r[2*a+1]i&&(e=i,o=!0),n=Ke(this.doc,e)}else n=e;return $r(this,n,{top:0,left:0},t||"page",r||o).top+(o?this.doc.height-$t(n):0)},defaultTextHeight:function(){return nn(this.display)},defaultCharWidth:function(){return on(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,o){var i,a,s,l=this.display,u=(e=Kr(this,lt(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(u=e.bottom),c+t.offsetWidth>p&&(c=p-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==o?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?c=0:"middle"==o&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(i=this,a={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Pn(i,a)).scrollTop&&Ln(i,s.scrollTop),null!=s.scrollLeft&&Fn(i,s.scrollLeft))},triggerOnKeyDown:ro(fa),triggerOnKeyPress:ro(da),triggerOnKeyUp:pa,triggerOnMouseDown:ro(ya),execCommand:function(e){if(ra.hasOwnProperty(e))return ra[e].call(null,this)},triggerElectric:ro((function(e){Ma(this,e)})),findPosH:function(e,t,r,n){var o=1;t<0&&(o=-1,t=-t);for(var i=lt(this.doc,e),a=0;a0&&a(t.charAt(r-1));)--r;for(;n.5||this.options.lineWrapping)&&un(this),me(this,"refresh",this)})),swapDoc:ro((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),jo(this,e),Ur(this),this.display.input.reset(),Dn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,lr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[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}},be(e),e.registerHelper=function(t,n,o){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=o},e.registerGlobalHelper=function(t,n,o,i){e.registerHelper(t,n,i),r[t]._global.push({pred:o,val:i})}}(Oa);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var Va in Ri.prototype)Ri.prototype.hasOwnProperty(Va)&&B(Ka,Va)<0&&(Oa.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ri.prototype[Va]));return be(Ri),Oa.inputStyles={textarea:Wa,contenteditable:Ba},Oa.defineMode=function(e){Oa.defaults.mode||"null"==e||(Oa.defaults.mode=e),Fe.apply(this,arguments)},Oa.defineMIME=function(e,t){je[e]=t},Oa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(e,t){Oa.prototype[e]=t},Oa.defineDocExtension=function(e,t){Ri.prototype[e]=t},Oa.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=D();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(pe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){n(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Oa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=he,e.on=pe,e.wheelEventPixels=To,e.Doc=Ri,e.splitLines=Re,e.countColumn=H,e.findColumn=W,e.isWordChar=ee,e.Pass=q,e.signal=me,e.Line=Kt,e.changeEnd=Oo,e.scrollbarModel=$n,e.Pos=tt,e.cmpPos=rt,e.modes=Le,e.mimeModes=je,e.resolveMode=He,e.getMode=Ue,e.modeExtensions=Be,e.extendMode=qe,e.copyState=ze,e.startState=Ge,e.innerMode=$e,e.commands=ra,e.keyMap=$i,e.keyName=Qi,e.isModifierKey=Vi,e.lookupKey=Ki,e.normalizeKeyMap=Wi,e.StringStream=We,e.SharedTextMarker=Oi,e.TextMarker=Si,e.LineWidget=xi,e.e_preventDefault=_e,e.e_stopPropagation=Ee,e.e_stop=xe,e.addClass=I,e.contains=R,e.rmClass=A,e.keyNames=Ui}(Oa),Oa.version="5.54.0",Oa},"object"===a(t)&&void 0!==e?e.exports=i():void 0===(o="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=o)},function(e,t,r){e.exports=r(676)},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(22),o=function(e,t){this.code=[],this.indentation=e,this.lineJoin=t||"\n"};o.prototype.buildLine=function(e,t){var r="",o=2;if("[object String]"===Object.prototype.toString.call(e))o=1,t=e,e=0;else if(null===e)return null;for(;e;)r+=this.indentation,e--;var i=Array.prototype.slice.call(arguments,o,arguments.length);return i.unshift(r+t),n.format.apply(this,i)},o.prototype.unshift=function(){return this.code.unshift(this.buildLine.apply(this,arguments)),this},o.prototype.push=function(){return this.code.push(this.buildLine.apply(this,arguments)),this},o.prototype.blank=function(){return this.code.push(null),this},o.prototype.join=function(){return this.code.join(this.lineJoin)},e.exports=o},function(e,t){var r=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(10),o=r(7),i=r(35),a=r(45),s=r(47),l=function e(t,r,l){var u,c,f,p=t&e.F,d=t&e.G,h=t&e.S,m=t&e.P,g=t&e.B,y=t&e.W,v=d?o:o[r]||(o[r]={}),b=v.prototype,_=d?n:h?n[r]:(n[r]||{}).prototype;for(u in d&&(l=r),l)(c=!p&&_&&void 0!==_[u])&&s(v,u)||(f=c?_[u]:l[u],v[u]=d&&"function"!=typeof _[u]?l[u]:g&&c?i(f,n):y&&_[u]==f?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):m&&"function"==typeof f?i(Function.call,f):f,m&&((v.virtual||(v.virtual={}))[u]=f,t&e.R&&b&&!b[u]&&a(b,u,f)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,r){var n=r(137);function o(){return e.exports=o=n||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};try{return O(e,t,r),!0}catch(e){if(e.message&&(e.message.startsWith("No widget")||e.message.startsWith("Unsupported widget")))return!1;throw e}},t.getDefaultFormState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!N(e))throw new Error("Invalid schema: "+e);var o=z(e,r,t),i=C(o,e.default,r,t,n);if(void 0===t)return i;if(N(t)||(0,d.default)(t))return P(i,t);if(0===t||!1===t||""===t)return t;return t||i},t.mergeDefaultsWithFormData=P,t.getUiOptions=function(e){return(0,p.default)(e).filter((function(e){return 0===e.indexOf("ui:")})).reduce((function(t,r){var n=e[r];return"ui:widget"===r&&N(n)?(console.warn("Setting options via ui:widget object is deprecated, use ui:options instead"),(0,g.default)({},t,n.options||{},{widget:n.component})):"ui:options"===r&&N(n)?(0,g.default)({},t,n):(0,g.default)({},t,(0,c.default)({},r.substring(3),n))}),{})},t.isObject=N,t.mergeObjects=R,t.asNumber=function(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;var t=Number(e),r="number"==typeof t&&!(0,u.default)(t);if(/\.\d*0$/.test(e))return e;return r?t:e},t.orderProperties=function(e,t){if(!(0,d.default)(t))return e;var r=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},n=r(e),o=t.filter((function(e){return"*"===e||n[e]})),i=r(o),a=e.filter((function(e){return!i[e]})),s=o.indexOf("*");if(-1===s){if(a.length)throw new Error("uiSchema order list does not contain ".concat((u=a).length>1?"properties '".concat(u.join("', '"),"'"):"property '".concat(u[0],"'")));return o}var u;if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var c=(0,l.default)(o);return c.splice.apply(c,[s,1].concat((0,l.default)(a))),c},t.isConstant=D,t.toConstant=I,t.isSelect=M,t.isMultiSelect=L,t.isFilesArray=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("files"===t["ui:widget"])return!0;if(e.items){var n=z(e.items,r);return"string"===n.type&&"data-url"===n.format}return!1},t.isFixedItems=j,t.allowAdditionalItems=function(e){!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported");return N(e.additionalItems)},t.optionsList=function(e){return e.enum?e.enum.map((function(t,r){return{label:e.enumNames&&e.enumNames[r]||String(t),value:t}})):(e.oneOf||e.anyOf).map((function(e,t){var r=I(e);return{label:e.title||String(r),value:r}}))},t.findSchemaDefinition=F,t.stubExistingAdditionalProperties=U,t.resolveSchema=B,t.retrieveSchema=z,t.mergeSchemas=K,t.deepEquals=Y,t.shouldRender=function(e,t,r){var n=e.props,o=e.state;return!Y(n,t)||!Y(o,r)},t.toIdSchema=function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"root",a={$id:r||i};if("$ref"in t||"dependencies"in t||"allOf"in t){var s=z(t,n,o);return e(s,r,n,o,i)}if("items"in t&&!t.items.$ref)return e(t.items,r,n,o,i);if("object"!==t.type)return a;for(var l in t.properties||{}){var u=t.properties[l],c=a.$id+"_"+l;a[l]=e(N(u)?u:{},c,n,(o||{})[l],i)}return a},t.toPathSchema=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={$name:r.replace(/^\./,"")};if("$ref"in t||"dependencies"in t||"allOf"in t){var a=z(t,n,o);return e(a,r,n,o)}if(t.hasOwnProperty("items")&&(0,d.default)(o))o.forEach((function(o,a){i[a]=e(t.items,"".concat(r,".").concat(a),n,o)}));else if(t.hasOwnProperty("properties"))for(var s in t.properties)i[s]=e(t.properties[s],"".concat(r,".").concat(s),n,(o||{})[s]);return i},t.parseDateString=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};var r=new Date(e);if((0,u.default)(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}},t.toDateString=function(e){var t=e.year,r=e.month,n=e.day,o=e.hour,i=void 0===o?0:o,a=e.minute,s=void 0===a?0:a,l=e.second,u=void 0===l?0:l,c=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],f=Date.UTC(t,r-1,n,i,s,u),p=new Date(f).toJSON();return c?p:p.slice(0,10)},t.pad=function(e,t){var r=String(e);for(;r.length2&&void 0!==arguments[2]?arguments[2]:{},n=A(e);function o(e){if(!e.MergedWidget){var t=e.defaultProps&&e.defaultProps.options||{};e.MergedWidget=function(r){var n=r.options,o=void 0===n?{}:n,i=(0,y.default)(r,["options"]);return v.default.createElement(e,(0,m.default)({options:(0,g.default)({},t,o)},i))}}return e.MergedWidget}if("function"==typeof t||b.isForwardRef(v.default.createElement(t))||b.isMemo(t))return o(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: ".concat((0,h.default)(t)));if(r.hasOwnProperty(t)){var i=r[t];return O(e,i,r)}if(!S.hasOwnProperty(n))throw new Error('No widget for type "'.concat(n,'"'));if(S[n].hasOwnProperty(t)){var a=r[S[n][t]];return O(e,a,r)}throw new Error('No widget "'.concat(t,'" for type "').concat(n,'"'))}function C(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=N(e)?e:{},a=N(n)?n:{},s=t;if(N(s)&&N(i.default))s=R(s,i.default);else if("default"in i)s=i.default;else{if("$ref"in i){var l=F(i.$ref,r);return C(l,s,r,a,o)}if("dependencies"in i){var u=$(i,r,a);return C(u,s,r,a,o)}j(i)?s=i.items.map((function(e,n){return C(e,(0,d.default)(t)?t[n]:void 0,r,a,o)})):"oneOf"in i?i=i.oneOf[Q(void 0,i.oneOf,r)]:"anyOf"in i&&(i=i.anyOf[Q(void 0,i.anyOf,r)])}switch(void 0===s&&(s=i.default),A(i)){case"object":return(0,p.default)(i.properties||{}).reduce((function(e,t){var n=C(i.properties[t],(s||{})[t],r,(a||{})[t],o);return(o||void 0!==n)&&(e[t]=n),e}),{});case"array":if((0,d.default)(s)&&(s=s.map((function(e,t){return C(i.items[t]||i.additionalItems||{},e,r)}))),(0,d.default)(n)&&(s=n.map((function(e,t){return C(i.items,(s||{})[t],r,e)}))),i.minItems){if(L(i,r))return s||[];var c=s?s.length:0;if(i.minItems>c){var f=s||[],h=(0,d.default)(i.items)?i.additionalItems:i.items,m=(0,E.default)(new Array(i.minItems-c),C(h,h.defaults,r));return f.concat(m)}}}return s}function P(e,t){if((0,d.default)(t))return(0,d.default)(e)||(e=[]),t.map((function(t,r){return e[r]?P(e[r],t):t}));if(N(t)){var r=(0,f.default)({},e);return(0,p.default)(t).reduce((function(r,n){return r[n]=P(e?e[n]:{},t[n]),r}),r)}return t}function N(e){return!("undefined"!=typeof File&&e instanceof File)&&("object"===(0,h.default)(e)&&null!==e&&!(0,d.default)(e))}function R(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=(0,f.default)({},e);return(0,p.default)(t).reduce((function(n,o){var i=e?e[o]:{},a=t[o];return e&&e.hasOwnProperty(o)&&N(a)?n[o]=R(i,a,r):r&&(0,d.default)(i)&&(0,d.default)(a)?n[o]=i.concat(a):n[o]=a,n}),n)}function D(e){return(0,d.default)(e.enum)&&1===e.enum.length||e.hasOwnProperty("const")}function I(e){if((0,d.default)(e.enum)&&1===e.enum.length)return e.enum[0];if(e.hasOwnProperty("const"))return e.const;throw new Error("schema cannot be inferred as a constant")}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=z(e,t),n=r.oneOf||r.anyOf;return!!(0,d.default)(r.enum)||!!(0,d.default)(n)&&n.every((function(e){return D(e)}))}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!(!e.uniqueItems||!e.items)&&M(e.items,t)}function j(e){return(0,d.default)(e.items)&&e.items.length>0&&e.items.every((function(e){return N(e)}))}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e;if(!e.startsWith("#"))throw new Error("Could not find a definition for ".concat(r,"."));e=decodeURIComponent(e.substring(1));var n=k.default.get(t,e);if(void 0===n)throw new Error("Could not find a definition for ".concat(r,"."));return n.hasOwnProperty("$ref")?F(n.$ref,t):n}var H=function(e){return(0,d.default)(e)?"array":"string"==typeof e?"string":null==e?"null":"boolean"==typeof e?"boolean":isNaN(e)?"object"===(0,h.default)(e)?"object":"string":"number"};function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=(0,g.default)({},e,{properties:(0,g.default)({},e.properties)}),(0,p.default)(r).forEach((function(n){var o;e.properties.hasOwnProperty(n)||(o=e.additionalProperties.hasOwnProperty("$ref")?z({$ref:e.additionalProperties.$ref},t,r):e.additionalProperties.hasOwnProperty("type")?(0,g.default)({},e.additionalProperties):{type:H(r[n])},e.properties[n]=o,e.properties[n].__additional_property=!0)})),e}function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.hasOwnProperty("$ref"))return q(e,t,r);if(e.hasOwnProperty("dependencies")){var n=$(e,t,r);return z(n,t,r)}return e.hasOwnProperty("allOf")?(0,g.default)({},e,{allOf:e.allOf.map((function(e){return z(e,t,r)}))}):e}function q(e,t,r){var n=F(e.$ref,t),o=(e.$ref,(0,y.default)(e,["$ref"]));return z((0,g.default)({},n,o),t,r)}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!N(e))return{};var n=B(e,t,r);if("allOf"in e)try{n=(0,_.default)((0,g.default)({},n,{allOf:n.allOf}),{resolvers:{example:function(e){return e[0]},format:function(e){return e[0]}}})}catch(e){console.warn("could not merge subschemas in allOf:\n"+e);var o=n,i=(o.allOf,(0,y.default)(o,["allOf"]));return i}var a=n.hasOwnProperty("additionalProperties")&&!1!==n.additionalProperties;return a?U(n,t,r):n}function $(e,t,r){var n=e.dependencies,o=void 0===n?{}:n,i=(0,y.default)(e,["dependencies"]);return"oneOf"in i?i=i.oneOf[Q(r,i.oneOf,t)]:"anyOf"in i&&(i=i.anyOf[Q(r,i.anyOf,t)]),function e(t,r,n,o){for(var i in t)if(void 0!==o[i]&&(!r.properties||i in r.properties)){var a=t[i],s=(0,y.default)(t,[i].map(w));return(0,d.default)(a)?r=G(r,a):N(a)&&(r=W(r,n,o,i,a)),e(s,r,n,o)}return r}(o,i,t,r)}function G(e,t){if(!t)return e;var r=(0,d.default)(e.required)?(0,s.default)(new a.default([].concat((0,l.default)(e.required),(0,l.default)(t)))):t;return(0,g.default)({},e,{required:r})}function W(e,t,r,n,o){var i=z(o,t,r),a=i.oneOf;if(e=K(e,(0,y.default)(i,["oneOf"])),void 0===a)return e;if(!(0,d.default)(a))throw new Error("invalid: it is some ".concat((0,h.default)(a)," instead of an array"));var s=a.map((function(e){return e.hasOwnProperty("$ref")?q(e,t,r):e}));return function(e,t,r,n,o){var i=o.filter((function(e){if(!e.properties)return!1;var t=e.properties[n];if(t){var o={type:"object",properties:(0,c.default)({},n,t)};return 0===(0,T.default)(r,o).errors.length}}));if(1!==i.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),e;var a=i[0],s=a.properties,l=(s[n],(0,y.default)(s,[n].map(w))),u=(0,g.default)({},a,{properties:l});return K(e,z(u,t,r))}(e,t,r,n,s)}function K(e,t){var r=(0,f.default)({},e);return(0,p.default)(t).reduce((function(r,n){var o=e?e[n]:{},i=t[n];return e&&e.hasOwnProperty(n)&&N(i)?r[n]=K(o,i):e&&t&&("object"===A(e)||"object"===A(t))&&"required"===n&&(0,d.default)(o)&&(0,d.default)(i)?r[n]=(0,x.default)(o,i):r[n]=i,r}),r)}function V(e){return"[object Arguments]"===Object.prototype.toString.call(e)}function Y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return!0;if("function"==typeof e||"function"==typeof t)return!0;if("object"!==(0,h.default)(e)||"object"!==(0,h.default)(t))return!1;if(null===e||null===t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(V(e)||V(t)){if(!V(e)||!V(t))return!1;var o=Array.prototype.slice;return Y(o.call(e),o.call(t),r,n)}if(e.constructor!==t.constructor)return!1;var i=(0,p.default)(e),a=(0,p.default)(t);if(0===i.length&&0===a.length)return!0;if(i.length!==a.length)return!1;for(var s,l=r.length;l--;)if(r[l]===e)return n[l]===t;r.push(e),n.push(t),i.sort(),a.sort();for(var u=i.length-1;u>=0;u--)if(i[u]!==a[u])return!1;for(var c=i.length-1;c>=0;c--)if(!Y(e[s=i[c]],t[s],r,n))return!1;return r.pop(),n.pop(),!0}function Q(e,t,r){for(var n=0;n1)for(var r=1;r=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return v(o)||(o=f(e,o,n)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(k(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return e.stylize(Date.prototype.toString.call(r),"date");if(x(r))return p(r)}var u,c="",E=!1,w=["{","}"];(h(r)&&(E=!0,w=["[","]"]),k(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(c=" "+RegExp.prototype.toString.call(r)),T(r)&&(c=" "+Date.prototype.toUTCString.call(r)),x(r)&&(c=" "+p(r)),0!==a.length||E&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,w)):w[0]+c+w[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,o,i){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),C(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(l.value)<0?(s=g(r)?f(e,l.value,null):f(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===w(e)}function E(e){return"object"===n(e)&&null!==e}function T(e){return E(e)&&"[object Date]"===w(e)}function x(e){return E(e)&&("[object Error]"===w(e)||e instanceof Error)}function k(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(b(a)&&(a=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(a)){var n=e.pid;s[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else s[r]=function(){};return s[r]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=v,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=b,t.isRegExp=_,t.isObject=E,t.isDate=T,t.isError=x,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(1016);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",O(),t.format.apply(t,arguments))},t.inherits=r(61),t._extend=function(e,t){if(!t||!E(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function N(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}},function(e,t,r){"use strict";function n(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return e?o().use(u).use(d.sanitize(i)).use(t.correctnewlines?function(){}:p).use(h.sanitize(i)).use(s,{allowDangerousHTML:!0}).use(l).use(c).use(f,{createElement:n.createElement,components:{"readme-variable":a,"readme-glossary-item":b,table:m(i),h1:g("h1",i),h2:g("h2",i),h3:g("h3",i),h4:g("h4",i),h5:g("h5",i),h6:g("h6",i),a:y(i),code:v(i),div:function(e){return n.createElement(n.Fragment,e)}}}).processSync(e).contents:null}},function(e,t,r){"use strict";e.exports=r(442)},function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t,r){var n=r(24),o=r(88);e.exports=r(26)?function(e,t,r){return n.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){e.exports=r(706)},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r2&&void 0!==arguments[2]?arguments[2]:{dark:!1,tokenizeVariables:!1};return n.createElement("span",{className:r.dark?"cm-s-tomorrow-night":"cm-s-neo"},o("string"==typeof e?e:"",t,r))},e.exports.uppercase=r(297)},function(e,t,r){var n;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var e=[],t=0;t=15&&(p=!1,u=!0);var x=b&&(c||p&&(null==T||T<12.11)),k=r||s&&l>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,A=function(e,t){var r=e.className,n=w(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return O(e).appendChild(t)}function P(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i=t)return a+(t-i);a+=s-i,a+=r-a%r,i=s+1}}g?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(L=function(e){try{e.select()}catch(e){}});var U=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};function B(e,t){for(var r=0;r=t)return n+Math.min(a,t-o);if(o+=i-n,n=i+1,(o+=r-o%r)>=t)return n}}var K=[""];function V(e){for(;K.length<=e;)K.push(Y(K)+" ");return K[e]}function Y(e){return e[e.length-1]}function Q(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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]/;function oe(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var o=(t+r)/2,i=n<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:r;e(i)?r=i:t=i+n}}var se=null;function le(e,t,r){var n;se=null;for(var o=0;ot)return o;i.to==t&&(i.from!=i.to&&"before"==r?n=o:se=o),i.from==t&&(i.from!=i.to&&"before"!=r?n=o:se=o)}return null!=n?n:se}var ue=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,o=/[1n]/;function i(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u,c=a.length,f=[],p=0;p-1&&(n[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function me(e,t){var r=de(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o0}function be(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){_e(e),Ee(e)}function ke(e){return e.target||e.srcElement}function we(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Se,Ae,Oe=function(){if(s&&l<9)return!1;var e=P("div");return"draggable"in e||"dragDrop"in e}();function Ce(e){if(null==Se){var t=P("span","");C(e,P("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var r=Se?P("span",""):P("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Pe(e){if(null!=Ae)return Ae;var t=C(e,document.createTextNode("AخA")),r=S(t,0,1).getBoundingClientRect(),n=S(t,1,2).getBoundingClientRect();return O(e),!(!r||r.left==r.right)&&(Ae=n.right-r.right<3)}var Ne,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(r.push(i.slice(0,a)),t+=a+1):(r.push(i),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Ne=P("div"))||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy),Me=null,Le={},je={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Le[e]=t}function He(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return He("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return He("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=He(t);var r=Le[t.name];if(!r)return Ue(e,"text/plain");var n=r(e,t);if(Be.hasOwnProperty(t.name)){var o=Be[t.name];for(var i in o)o.hasOwnProperty(i)&&(n.hasOwnProperty(i)&&(n["_"+i]=n[i]),n[i]=o[i])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Be={};function qe(e,t){F(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function $e(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ge(e,t,r){return!e.startState||e.startState(t,r)}var We=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ke(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],i=o.chunkSize();if(t=e.first&&tr?tt(r,Ke(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?tt(e.line,t):r<0?tt(e.line,0):e}(t,Ke(e,t.line).text.length)}function ut(e,t){for(var r=[],n=0;n=this.string.length},We.prototype.sol=function(){return this.pos==this.lineStart},We.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},We.prototype.next=function(){if(this.post},We.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},We.prototype.skipToEnd=function(){this.pos=this.string.length},We.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},We.prototype.backUp=function(e){this.pos-=e},We.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return r?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},We.prototype.current=function(){return this.string.slice(this.start,this.pos)},We.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},We.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},We.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ft=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function pt(e,t,r,n){var o=[e.state.modeGen],i={};Et(e,t.text,e.doc.mode,r,(function(e,t){return o.push(e,t)}),i,n);for(var a=r.state,s=function(n){r.baseTokens=o;var s=e.state.overlays[n],l=1,u=0;r.state=!0,Et(e,t.text,s.mode,r,(function(e,t){for(var r=l;ue&&o.splice(l,1,e,o[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(s.opaque)o.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength&&ze(e.doc.mode,n.state),i=pt(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new ft(n,!0,t);var i=function(e,t,r){for(var n,o,i=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ke(i,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof ct?u.lookAhead:0)<=i.modeFrontier))return s;var c=H(l.text,null,e.options.tabSize);(null==o||n>c)&&(o=s-1,n=c)}return o}(e,t,r),a=i>n.first&&Ke(n,i-1).stateAfter,s=a?ft.fromSaved(n,a,i):new ft(n,Ge(n.mode),i);return n.iter(i,t,(function(r){mt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&nt.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ft.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ft.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ft.fromSaved=function(e,t,r){return t instanceof ct?new ft(e,ze(e.mode,t.state),r,t.lookAhead):new ft(e,ze(e.mode,t),r)},ft.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function bt(e,t,r,n){var o,i,a=e.doc,s=a.mode,l=Ke(a,(t=lt(a,t)).line),u=ht(e,t.line,r),c=new We(l.text,e.options.tabSize,u);for(n&&(i=[]);(n||c.pose.options.maxHighlightLength?(s=!1,a&&mt(e,t,n,f.pos),f.pos=t.length,l=null):l=_t(yt(r,f,n.state,p),i),p){var d=p[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u=t:i.to>t);(n||(n=[])).push(new kt(a,i.from,s?null:i.to))}}return n}(r,o,a),l=function(e,t,r){var n;if(e)for(var o=0;o=t:i.to>t)||i.from==t&&"bookmark"==a.type&&(!r||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from0&&s)for(var b=0;bt)&&(!r||Dt(r,i.marker)<0)&&(r=i.marker)}return r}function Ft(e,t,r,n,o){var i=Ke(e,t),a=xt&&i.markedSpans;if(a)for(var s=0;s=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?rt(u.to,r)>=0:rt(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?rt(u.from,n)<=0:rt(u.from,n)<0)))return!0}}}function Ht(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function Ut(e,t){var r=Ke(e,t),n=Ht(r);return r==n?t:Xe(n)}function Bt(e,t){if(t>e.lastLine())return t;var r,n=Ke(e,t);if(!qt(e,n))return t;for(;r=Lt(n);)n=r.find(1,!0).line;return Xe(n)+1}function qt(e,t){var r=xt&&t.markedSpans;if(r)for(var n=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Kt=function(e,t,r){this.text=e,Pt(this,t),this.height=r?r(this):1};function Vt(e){e.parent=null,Ct(e)}Kt.prototype.lineNo=function(){return Xe(this)},be(Kt);var Yt={},Qt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Qt:Yt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var r=N("span",null,null,u?"padding-right: .1px":null),n={pre:N("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;n.pos=0,n.addToken=er,Pe(e.display.measure)&&(a=ce(i,e.doc.direction))&&(n.addToken=tr(n.addToken,a)),n.map=[],nr(i,n,dt(e,i,t!=e.display.externalMeasured&&Xe(i))),i.styleClasses&&(i.styleClasses.bgClass&&(n.bgClass=M(i.styleClasses.bgClass,n.bgClass||"")),i.styleClasses.textClass&&(n.textClass=M(i.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ce(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=M(n.pre.className,n.textClass||"")),n}function Zt(e){var t=P("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function er(e,t,r,n,o,i,a){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",o=0;ou&&f.from<=u);p++);if(f.to>=c)return e(r,n,o,i,a,s,l);e(r,n.slice(0,f.to-u),o,i,null,s,l),i=null,n=n.slice(f.to-u),u=f.to}}}function rr(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function nr(e,t,r){var n=e.markedSpans,o=e.text,i=0;if(n)for(var a,s,l,u,c,f,p,d=o.length,h=0,m=1,g="",y=0;;){if(y==h){l=u=c=s="",p=null,f=null,y=1/0;for(var v=[],b=void 0,_=0;_h||T.collapsed&&E.to==h&&E.from==h)){if(null!=E.to&&E.to!=h&&y>E.to&&(y=E.to,u=""),T.className&&(l+=" "+T.className),T.css&&(s=(s?s+";":"")+T.css),T.startStyle&&E.from==h&&(c+=" "+T.startStyle),T.endStyle&&E.to==y&&(b||(b=[])).push(T.endStyle,E.to),T.title&&((p||(p={})).title=T.title),T.attributes)for(var x in T.attributes)(p||(p={}))[x]=T.attributes[x];T.collapsed&&(!f||Dt(f.marker,T)<0)&&(f=E)}else E.from>h&&y>E.from&&(y=E.from)}if(b)for(var k=0;k=d)break;for(var S=Math.min(d,y);;){if(g){var A=h+g.length;if(!f){var O=A>S?g.slice(0,S-h):g;t.addToken(t,O,a?a+l:l,c,h+O.length==y?u:"",s,p)}if(A>=S){g=g.slice(S-h),h=S;break}h=A,c=""}g=o.slice(i,i=r[m++]),a=Xt(r[m++],t.cm.options)}}else for(var C=1;Cr)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Pr(e,t,r,n){return Dr(e,Rr(e,t),r,n)}function Nr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&i.push((l.bottom+u.top)/2-r.top)}}i.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,r,n){var o,i=Lr(t.map,r,n),a=i.node,u=i.start,c=i.end,f=i.collapse;if(3==a.nodeType){for(var p=0;p<4;p++){for(;u&&oe(t.line.text.charAt(i.coverStart+u));)--u;for(;i.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,o))}else{var d;u>0&&(f=n="right"),o=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!u&&(!o||!o.left&&!o.right)){var h=a.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+on(e.display),top:h.top,bottom:h.bottom}:Mr}for(var m=o.top-t.rect.top,g=o.bottom-t.rect.top,y=(m+g)/2,v=t.view.measure.heights,b=0;bt)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(n=e[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==o)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left";if("right"==r&&o==l-s)for(;u=0&&(r=e[o]).left==r.right;o--);return r}function Fr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var f=le(s,l,u),p=se,d=c(l,f,"before"==u);return null!=p&&(d.other=c(l,p,"before"!=u)),d}function Vr(e,t){var r=0;t=lt(e.doc,t),e.options.lineWrapping||(r=on(e.display)*t.ch);var n=Ke(e.doc,t.line),o=$t(n)+xr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function Yr(e,t,r,n,o){var i=tt(e,t,r);return i.xRel=o,n&&(i.outside=n),i}function Qr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Yr(n.first,0,null,-1,-1);var o=Je(n,r),i=n.first+n.size-1;if(o>i)return Yr(n.first+n.size-1,Ke(n,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(n,o);;){var s=en(e,a,o,t,r),l=jt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==o)return u;a=Ke(n,o=u.line)}}function Xr(e,t,r,n){n-=zr(t);var o=t.text.length,i=ae((function(t){return Dr(e,r,t-1).bottom<=n}),o,0);return{begin:i,end:o=ae((function(t){return Dr(e,r,t).top>n}),i,o)}}function Jr(e,t,r,n){return r||(r=Rr(e,t)),Xr(e,t,r,$r(e,t,Dr(e,r,n),"line").top)}function Zr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function en(e,t,r,n,o){o-=$t(t);var i=Rr(e,t),a=zr(t),s=0,l=t.text.length,u=!0,c=ce(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?rn:tn)(e,t,r,i,c,n,o);s=(u=1!=f.level)?f.from:f.to-1,l=u?f.to:f.from-1}var p,d,h=null,m=null,g=ae((function(t){var r=Dr(e,i,t);return r.top+=a,r.bottom+=a,!!Zr(r,n,o,!1)&&(r.top<=o&&r.left<=n&&(h=t,m=r),!0)}),s,l),y=!1;if(m){var v=n-m.left=_.bottom?1:0}return Yr(r,g=ie(t.text,g,1),d,y,n-p)}function tn(e,t,r,n,o,i,a){var s=ae((function(s){var l=o[s],u=1!=l.level;return Zr(Kr(e,tt(r,u?l.to:l.from,u?"before":"after"),"line",t,n),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var u=1!=l.level,c=Kr(e,tt(r,u?l.from:l.to,u?"after":"before"),"line",t,n);Zr(c,i,a,!0)&&c.top>a&&(l=o[s-1])}return l}function rn(e,t,r,n,o,i,a){var s=Xr(e,t,n,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,p=0;p=u||d.to<=l)){var h=Dr(e,n,1!=d.level?Math.min(u,d.to)-1:Math.max(l,d.from)).right,m=hm)&&(c=d,f=m)}}return c||(c=o[o.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=P("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(P("br"));Ir.appendChild(document.createTextNode("x"))}C(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),O(e.measure),r||1}function on(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=P("span","xxxxxxxxxx"),r=P("pre",[t],"CodeMirror-line-like");C(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function an(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=i.offsetLeft+i.clientLeft+o,n[s]=i.clientWidth}return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ln(e){var t=nn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/on(e.display)-3);return function(o){if(qt(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a0&&(l=Ke(e.doc,u.line).text).length==u.ch){var c=H(l,l.length,e.options.tabSize)-l.length;u=tt(u.line,Math.max(0,Math.round((i-wr(e.display).left)/on(e.display))-c))}return u}function fn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;nt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)xt&&Ut(e.doc,t)o.viewFrom?hn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)hn(e);else if(t<=o.viewFrom){var i=mn(e,r,r+n,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=n):hn(e)}else if(r>=o.viewTo){var a=mn(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):hn(e)}else{var s=mn(e,t,t,-1),l=mn(e,r,r+n,1);s&&l?(o.view=o.view.slice(0,s.index).concat(ir(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=n):hn(e)}var u=o.externalMeasured;u&&(r=o.lineN&&t=n.viewTo)){var i=n.view[fn(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==B(a,r)&&a.push(r)}}}function hn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function mn(e,t,r,n){var o,i=fn(e,t),a=e.display.view;if(!xt||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,l=0;l0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,r+=o}for(;Ut(e.doc,r)!=r;){if(i==(n<0?0:a.length-1))return null;r+=n*a[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function gn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||s.to().linet||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",i),o=!0)}o||n(t,r,"ltr")}(m,r||0,null==n?p:n,(function(e,t,o,f){var g="ltr"==o,y=d(e,g?"left":"right"),v=d(t-1,g?"right":"left"),b=null==r&&0==e,_=null==n&&t==p,E=0==f,T=!m||f==m.length-1;if(v.top-y.top<=3){var x=(u?_:b)&&T,k=(u?b:_)&&E?s:(g?y:v).left,w=x?l:(g?v:y).right;c(k,y.top,w-k,y.bottom)}else{var S,A,O,C;g?(S=u&&b&&E?s:y.left,A=u?l:h(e,o,"before"),O=u?s:h(t,o,"after"),C=u&&_&&T?l:v.right):(S=u?h(e,o,"before"):s,A=!u&&b&&E?l:y.right,O=!u&&_&&T?s:v.left,C=u?h(t,o,"after"):l),c(S,y.top,A-S,y.bottom),y.bottom0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function xn(e){e.state.focused||(e.display.input.focus(),wn(e))}function kn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Sn(e))}),100)}function wn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Tn(e))}function Sn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function An(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||p<-.005)&&(Qe(o.line,a),On(o.line),o.rest))for(var d=0;de.display.sizerWidth){var h=Math.ceil(u/on(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}}function On(e){if(e.widgets)for(var t=0;t=a&&(i=Je(t,$t(Ke(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Pn(e,t){var r=e.display,n=nn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,i=Or(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+kr(r),l=t.tops-n;if(t.topo+i){var c=Math.min(t.top,(u?s:t.bottom)-i);c!=o&&(a.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=Ar(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>p;return d&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+f-3&&(a.scrollLeft=t.right+(d?0:10)-p),a}function Nn(e,t){null!=t&&(In(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Rn(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dn(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function In(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mn(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Mn(e,t,r,n){var o=Pn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Dn(e,o.scrollLeft,o.scrollTop)}function Ln(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||uo(e,{top:t}),jn(e,t,!0),r&&uo(e),oo(e,100))}function jn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,po(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Hn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Sr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Un=function(e,t,r){this.cm=r;var n=this.vert=P("div",[P("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=P("div",[P("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),pe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),pe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Un.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Un.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Un.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Un.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new U,this.disableVert=new U},Un.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var o=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Un.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Bn=function(){};function qn(e,t){t||(t=Hn(e));var r=e.display.barWidth,n=e.display.barHeight;zn(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&An(e),zn(e,Hn(e)),r=e.display.barWidth,n=e.display.barHeight}function zn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Bn.prototype.update=function(){return{bottom:0,right:0}},Bn.prototype.setScrollLeft=function(){},Bn.prototype.setScrollTop=function(){},Bn.prototype.clear=function(){};var $n={native:Un,null:Bn};function Gn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $n[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Fn(e,t):Ln(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Wn=0;function Kn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wn},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function Vn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ao(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qn(e){e.updatedDisplay=e.mustUpdate&&so(e.cm,e.update)}function Xn(e){var t=e.cm,r=t.display;e.updatedDisplay&&An(t),e.barMeasure=Hn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Sr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ar(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Jn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!m){var i=P("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-xr(e.display))+"px;\n height: "+(t.bottom-t.top+Sr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,r,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?tt(t.line,t.ch+1,"before"):t);for(var i=0;i<5;i++){var a=!1,s=Kr(e,t),l=r&&r!=t?Kr(e,r):s,u=Pn(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(Ln(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Fn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return o}(t,lt(n,e.scrollToPos.from),lt(n,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var a=0;a=e.display.viewTo)){var r=+new Date+e.options.workTime,n=ht(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(n.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?ze(t.mode,n.state):null,l=pt(e,i,n,!0);s&&(n.state=s),i.styles=l.styles;var u=i.styleClasses,c=l.classes;c?i.styleClasses=c:u&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!f&&pr)return oo(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&eo(e,(function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==gn(e))return!1;ho(e)&&(hn(e),t.dims=an(e));var o=n.first+n.size,i=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),xt&&(i=Ut(e.doc,i),a=Bt(e.doc,a));var s=i!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ir(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ir(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,fn(e,r)))),n.viewTo=r}(e,i,a),r.viewOffset=$t(Ke(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=gn(e);if(!s&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=D();if(!t||!R(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&R(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return l>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,o=e.options.lineNumbers,i=n.lineDiv,a=i.firstChild;function s(t){var r=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var l=n.view,c=n.viewFrom,f=0;f-1&&(d=!1),cr(e,p,c,r)),d&&(O(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(et(e.options,c)))),a=p.node.nextSibling}else{var h=yr(e,p,c,r);i.insertBefore(h,a)}c+=p.size}for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),O(r.cursorDiv),O(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,oo(e,400)),r.updateLineNumbers=null,!0}function lo(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ar(e))n&&(t.visible=Cn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Or(e),r.top)}),t.visible=Cn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!so(e,t))break;An(e);var o=Hn(e);yn(e),qn(e,o),fo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function uo(e,t){var r=new ao(e,t);if(so(e,r)){An(e),lo(e,r);var n=Hn(e);yn(e),qn(e,n),fo(e,n),r.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function fo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Sr(e)+"px"}function po(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=n+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(o&&l||i&&c){if(i&&b&&u)e:for(var f=t.target,d=a.view;f!=s;f=f.parentNode)for(var h=0;h=0&&rt(e,n.to())<=0)return r}return-1};var wo=function(e,t){this.anchor=e,this.head=t};function So(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort((function(e,t){return rt(e.from(),t.from())})),r=B(t,o);for(var i=1;i0:l>=0){var u=at(s.from(),a.from()),c=it(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;i<=r&&--r,t.splice(--i,2,new wo(f?c:u,f?u:c))}}return new ko(t,r)}function Ao(e,t){return new ko([new wo(e,t||e)],0)}function Oo(e){return e.text?tt(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Co(e,t){if(rt(e,t.from)<0)return e;if(rt(e,t.to)<=0)return Oo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Oo(t).ch-t.to.ch),tt(r,n)}function Po(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}lr(e,"change",e,t)}function Lo(e,t,r){!function e(n,o,i){if(n.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Bo(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(o,o.lastOp==n)))a=Y(i.changes),0==rt(t.from,t.to)&&0==rt(t.from,a.to)?a.to=Oo(t):i.changes.push(Uo(e,t));else{var l=Y(o.done);for(l&&l.ranges||$o(e.sel,o.done),i={changes:[Uo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,a||me(e,"historyAdded")}function zo(e,t,r,n){var o=e.history,i=n&&n.origin;r==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,r,n){var o=t.charAt(0);return"*"==o||"+"==o&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,Y(o.done),t))?o.done[o.done.length-1]=t:$o(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=r,n&&!1!==n.clearRedo&&Bo(o.undone)}function $o(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Go(e,t,r,n){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=r.markedSpans),++i}))}function Wo(e){if(!e)return null;for(var t,r=0;r-1&&(Y(s)[f]=u[f],delete u[f])}}}return n}function Yo(e,t,r,n){if(n){var o=e.anchor;if(r){var i=rt(t,o)<0;i!=rt(r,o)<0?(o=t,t=r):i!=rt(t,r)<0&&(t=r)}return new wo(o,t)}return new wo(r||t,t)}function Qo(e,t,r,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ti(e,new ko([Yo(e.sel.primary(),t,r,o)],0),n)}function Xo(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i=t.ch:s.to>t.ch))){if(o&&(me(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var f=l.find(n<0?1:-1),p=void 0;if((n<0?c:u)&&(f=li(e,f,-n,f&&f.line==t.line?i:null)),f&&f.line==t.line&&(p=rt(f,r))&&(n<0?p<0:p>0))return ai(e,f,t,n,o)}var d=l.find(n<0?-1:1);return(n<0?u:c)&&(d=li(e,d,n,d.line==t.line?i:null)),d?ai(e,d,t,n,o):null}}return t}function si(e,t,r,n,o){var i=n||1,a=ai(e,t,r,i,o)||!o&&ai(e,t,r,i,!0)||ai(e,t,r,-i,o)||!o&&ai(e,t,r,-i,!0);return a||(e.cantEdit=!0,tt(e.first,0))}function li(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:r>0&&t.ch==(n||Ke(e,t.line)).text.length?t.line0)){var c=[l,1],f=rt(u.from,s.from),p=rt(u.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&c.push({from:s.to,to:u.to}),o.splice.apply(o,c),l+=c.length-3}}return o}(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)pi(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else pi(e,t)}}function pi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=rt(t.from,t.to)){var r=Po(e,t);qo(e,t,r,e.cm?e.cm.curOp.id:NaN),mi(e,t,r,At(e,t));var n=[];Lo(e,(function(e,r){r||-1!=B(n,e.history)||(bi(e.history,t),n.push(e.history)),mi(e,t,null,At(e,t))}))}}function di(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,u=0;u=0;--d){var h=p(d);if(h)return h.v}}}}function hi(e,t){if(0!=t&&(e.first+=t,e.sel=new ko(Q(e.sel.ranges,(function(e){return new wo(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linei&&(t={from:t.from,to:tt(i,Ke(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),r||(r=Po(e,t)),e.cm?function(e,t,r){var n=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Xe(Ht(Ke(n,i.line))),n.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&ye(e),Mo(n,t,r,ln(e)),e.options.lineWrapping||(n.iter(l,i.line+t.text.length,(function(e){var t=Gt(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var o=Ke(e,n).stateAfter;if(o&&(!(o instanceof ct)||n+o.lookAhead1||!(this.children[0]instanceof Ei))){var s=[];this.collapse(s),this.children=[new Ei(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=o.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=N("span",[i.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ft(e,t.line,t,r,i)||t.line!=r.line&&Ft(e,r.line,t,r,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");xt=!0}i.addToHistory&&qo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,r.line+1,(function(e){u&&i.collapsed&&!u.options.lineWrapping&&Ht(e)==u.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Qe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new kt(i,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l})),i.collapsed&&e.iter(t.line,r.line+1,(function(t){qt(e,t)&&Qe(t,0)})),i.clearOnEnter&&pe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++wi,i.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),i.collapsed)pn(u,t.line,r.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var c=t.line;c<=r.line;c++)dn(u,c,"text");i.atomic&&oi(u.doc),lr(u,"markerAdded",u,i)}return i}Si.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kn(e),ve(this,"clear")){var r=this.find();r&&lr(this,"clear",r.from,r.to)}for(var n=null,o=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&pn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&oi(e.doc)),e&&lr(e,"markerCleared",e,this,n,o),t&&Vn(e),this.parent&&this.parent.clear()}},Si.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;l--)fi(this,n[l]);s?ei(this,s):this.cm&&Rn(this.cm)})),undo:no((function(){di(this,"undo")})),redo:no((function(){di(this,"redo")})),undoSelection:no((function(){di(this,"undo",!0)})),redoSelection:no((function(){di(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=lt(this,e),t=lt(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++o})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=i,++r})),lt(this,tt(r,t))},indexFromPos:function(e){var t=(e=lt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ri(t.doc,Ao(r,r)),p)for(var d=0;d=0;t--)gi(e.doc,"",n[t].from,n[t].to,"+delete");Rn(e)}))}function Zi(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function ea(e,t,r){var n=Zi(e,t.ch,r);return null==n?null:new tt(t.line,n,r<0?"after":"before")}function ta(e,t,r,n,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(r,t.doc.direction);if(i){var a,s=o<0?Y(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Rr(t,r);a=o<0?r.text.length-1:0;var c=Dr(t,u,a).top;a=ae((function(e){return Dr(t,u,e).top==c}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Zi(r,a,1))}else a=o<0?s.to:s.from;return new tt(n,a,l)}}return new tt(n,o<0?r.text.length:0,o<0?"before":"after")}$i.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},$i.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},$i.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$i.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},$i.default=b?$i.macDefault:$i.pcDefault;var ra={selectAll:ui,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Ji(e,(function(t){if(t.empty()){var r=Ke(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)o=new tt(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),tt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ke(e.doc,o.line-1).text;a&&(o=new tt(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(o.line-1,a.length-1),o,"+transpose"))}r.push(new wo(o,o))}e.setSelections(r)}))},newlineAndIndent:function(e){return eo(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n-1&&(rt((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(rt(o.to(),t)>0||t.xRel<0)?function(e,t,r,n){var o=e.display,i=!1,a=to(e,(function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,he(o.wrapper.ownerDocument,"mouseup",a),he(o.wrapper.ownerDocument,"mousemove",c),he(o.scroller,"dragstart",f),he(o.scroller,"drop",a),i||(_e(t),n.addNew||Qo(e.doc,r,null,null,n.extend),u&&!d||s&&9==l?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),c=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};u&&(o.scroller.draggable=!0),e.state.draggingText=a,a.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),pe(o.wrapper.ownerDocument,"mouseup",a),pe(o.wrapper.ownerDocument,"mousemove",c),pe(o.scroller,"dragstart",f),pe(o.scroller,"drop",a),kn(e),setTimeout((function(){return o.input.focus()}),20)}(e,n,t,i):function(e,t,r,n){var o=e.display,i=e.doc;_e(t);var a,s,l=i.sel,u=l.ranges;if(n.addNew&&!n.extend?(s=i.sel.contains(r),a=s>-1?u[s]:new wo(r,r)):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==n.unit)n.addNew||(a=new wo(r,r)),r=cn(e,t,!0,!0),s=-1;else{var c=va(e,r,n.unit);a=n.extend?Yo(a,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,ti(i,So(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(ti(i,So(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=i.sel):Jo(i,s,a,$):(s=0,ti(i,new ko([a],0),$),l=i.sel);var f=r;function p(t){if(0!=rt(f,t))if(f=t,"rectangle"==n.unit){for(var o=[],u=e.options.tabSize,c=H(Ke(i,r.line).text,r.ch,u),p=H(Ke(i,t.line).text,t.ch,u),d=Math.min(c,p),h=Math.max(c,p),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var y=Ke(i,m).text,v=W(y,d,u);d==h?o.push(new wo(tt(m,v),tt(m,v))):y.length>v&&o.push(new wo(tt(m,v),tt(m,W(y,h,u))))}o.length||o.push(new wo(r,r)),ti(i,So(e,l.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,_=a,E=va(e,t,n.unit),T=_.anchor;rt(E.anchor,T)>0?(b=E.head,T=at(_.from(),E.anchor)):(b=E.anchor,T=it(_.to(),E.head));var x=l.ranges.slice(0);x[s]=function(e,t){var r=t.anchor,n=t.head,o=Ke(e.doc,r.line);if(0==rt(r,n)&&r.sticky==n.sticky)return t;var i=ce(o);if(!i)return t;var a=le(i,r.ch,r.sticky),s=i[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,u=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==i.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=le(i,n.ch,n.sticky),f=c-a||(n.ch-r.ch)*(1==s.level?-1:1);l=c==u-1||c==u?f<0:f>0}var p=i[u+(l?-1:0)],d=l==(1==p.level),h=d?p.from:p.to,m=d?"after":"before";return r.ch==h&&r.sticky==m?t:new wo(new tt(r.line,h,m),n)}(e,new wo(lt(i,T),b)),ti(i,So(e,x,s),$)}}var d=o.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,t&&(_e(t),o.input.focus()),he(o.wrapper.ownerDocument,"mousemove",g),he(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var g=to(e,(function(t){0!==t.buttons&&we(t)?function t(r){var a=++h,s=cn(e,r,!0,"rectangle"==n.unit);if(s)if(0!=rt(s,f)){e.curOp.focus=D(),p(s);var l=Cn(o,i);(s.line>=l.to||s.lined.bottom?20:0;u&&setTimeout(to(e,(function(){h==a&&(o.scroller.scrollTop+=u,t(r))})),50)}}(t):m(t)})),y=to(e,m);e.state.selectingText=y,pe(o.wrapper.ownerDocument,"mousemove",g),pe(o.wrapper.ownerDocument,"mouseup",y)}(e,n,t,i)}(t,n,i,e):ke(e)==r.scroller&&_e(e):2==o?(n&&Qo(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==o&&(k?t.display.input.onContextMenu(e):kn(t)))}}function va(e,t,r){if("char"==r)return new wo(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new wo(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var n=r(e,t);return new wo(n.from,n.to)}function ba(e,t,r,n){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ve(e,r))return Te(t);i-=s.top-a.viewOffset;for(var l=0;l=o)return me(e,r,e,Je(e.doc,i),e.display.gutterSpecs[l].className,t),Te(t)}}function _a(e,t){return ba(e,t,"gutterClick",!0)}function Ea(e,t){Tr(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ba(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ta(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ur(e)}ga.prototype.compare=function(e,t,r){return this.time+400>e&&0==rt(t,this.pos)&&r==this.button};var xa={toString:function(){return"CodeMirror.Init"}},ka={},wa={};function Sa(e,t,r){if(!t!=!(r&&r!=xa)){var n=e.display.dragFunctions,o=t?pe:he;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Aa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),Wt(e)),un(e),pn(e),Ur(e),setTimeout((function(){return qn(e)}),100)}function Oa(e,t){var r=this;if(!(this instanceof Oa))return new Oa(e,t);this.options=t=t?F(t):{},F(ka,t,!1);var n=t.value;"string"==typeof n?n=new Ri(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Oa.inputStyles[t.inputStyle](this),i=this.display=new vo(e,n,o,t);for(var a in i.wrapper.CodeMirror=this,Ta(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gn(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 U,keySeq:null,specialChars:null},t.autofocus&&!v&&i.input.focus(),s&&l<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;pe(t.scroller,"mousedown",to(e,ya)),pe(t.scroller,"dblclick",s&&l<11?to(e,(function(t){if(!ge(e,t)){var r=cn(e,t);if(r&&!_a(e,t)&&!Tr(e.display,t)){_e(t);var n=e.findWordAt(r);Qo(e.doc,n.anchor,n.head)}}})):function(t){return ge(e,t)||_e(t)}),pe(t.scroller,"contextmenu",(function(t){return Ea(e,t)})),pe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||Ea(e,r)}));var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}pe(t.scroller,"touchstart",(function(o){if(!ge(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!_a(e,o)){t.input.ensurePolled(),clearTimeout(r);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!Tr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!n.prev||i(n,n.prev)?new wo(s,s):!n.prev.prev||i(n,n.prev.prev)?e.findWordAt(s):new wo(tt(s.line,0),lt(e.doc,tt(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),_e(r)}o()})),pe(t.scroller,"touchcancel",o),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ln(e,t.scroller.scrollTop),Fn(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return xo(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return xo(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||xe(t)},over:function(t){ge(e,t)||(function(e,t){var r=cn(e,t);if(r){var n=document.createDocumentFragment();bn(e,r,n),e.display.dragCursor||(e.display.dragCursor=P("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,n)}}(e,t),xe(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Di<100))xe(t);else if(!ge(e,t)&&!Tr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var r=P("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),p&&r.parentNode.removeChild(r)}}(e,t)},drop:to(e,Ii),leave:function(t){ge(e,t)||Mi(e)}};var a=t.input.getField();pe(a,"keyup",(function(t){return pa.call(e,t)})),pe(a,"keydown",to(e,fa)),pe(a,"keypress",to(e,da)),pe(a,"focus",(function(t){return wn(e,t)})),pe(a,"blur",(function(t){return Sn(e,t)}))}(this),Fi(),Kn(this),this.curOp.forceUpdate=!0,jo(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(j(wn,this),20):Sn(this),wa)wa.hasOwnProperty(a)&&wa[a](this,t[a],xa);ho(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>i.first?H(Ke(i,t-1).text,null,a):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var f="",p=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d)p+=a,f+="\t";if(pa,l=Re(t),u=null;if(s&&n.ranges.length>1)if(Na&&Na.text.join("\n")==t){if(n.ranges.length%Na.text.length==0){u=[];for(var c=0;c=0;p--){var d=n.ranges[p],h=d.from(),m=d.to();d.empty()&&(r&&r>0?h=tt(h.line,h.ch-r):e.state.overwrite&&!s?m=tt(m.line,Math.min(Ke(i,m.line).text.length,m.ch+Y(l).length)):s&&Na&&Na.lineWise&&Na.text.join("\n")==t&&(h=m=tt(h.line,0)));var g={from:h,to:m,text:u?u[p%u.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};fi(e.doc,g),lr(e,"inputRead",e,g)}t&&!s&&Ma(e,t),Rn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||eo(t,(function(){return Da(t,r,0,null,"paste")})),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(!(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s-1){a=Pa(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ke(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Pa(e,o.head.line,"smart"));a&&lr(e,"electricInput",e,o.head.line)}}}function La(e){for(var t=[],r=[],n=0;n=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var i=le(o,r.ch,r.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&p>=c.begin)){var d=f?"before":"after";return new tt(r.line,p,d)}}var h=function(e,t,n){for(var i=function(e,t){return t?new tt(r.line,l(e,1),"before"):new tt(r.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?n.begin:l(n.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||n>0&&g==t.text.length||!(m=h(n>0?0:o.length-1,n,u(g)))?null:m}(e.cm,s,t,r):ea(s,t,r))){if(n||(a=t.line+l)=e.first+e.size||(t=new tt(a,t.ch,t.sticky),!(s=Ke(e,a))))return!1;t=ta(o,e.cm,s,t.line,l)}else t=i;return!0}if("char"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var h=s.text.charAt(t.ch)||"\n",m=te(h,p)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||d||m||(m="s"),c&&c!=m){r<0&&(r=1,u(),t.sticky="after");break}if(m&&(c=m),r>0&&!u(!d))break}var g=si(e,t,i,a,!0);return nt(i,g)&&(g.hitSide=!0),g}function Ua(e,t,r,n){var o,i,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*nn(e.display),3);o=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(i=Qr(e,s,o)).outside;){if(r<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*r}return i}var Ba=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new U,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function qa(e,t){var r=Nr(e,t.line);if(!r||r.hidden)return null;var n=Ke(e.doc,t.line),o=Cr(r,n,t.line),i=ce(n,e.doc.direction),a="left";i&&(a=le(i,t.ch)%2?"right":"left");var s=Lr(o.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function za(e,t){return t&&(e.bad=!0),e}function $a(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return za(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o=t.display.viewTo||i.line=t.display.viewFrom&&qa(t,o)||{node:l[0].measure.map[2],offset:0},c=i.linen.firstLine()&&(a=tt(a.line-1,Ke(n.doc,a.line-1).length)),s.ch==Ke(n.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;a.line==o.viewFrom||0==(e=fn(n,a.line))?(t=Xe(o.view[0].line),r=o.view[0].node):(t=Xe(o.view[e].line),r=o.view[e-1].node.nextSibling);var l,u,c=fn(n,s.line);if(c==o.view.length-1?(l=o.viewTo-1,u=o.lineDiv.lastChild):(l=Xe(o.view[c+1].line)-1,u=o.view[c+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(){a&&(i+=s,l&&(i+=s),a=l=!1)}function c(e){e&&(u(),i+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var i,p=t.getAttribute("cm-marker");if(p){var d=e.findMarks(tt(n,0),tt(o+1,0),(g=+p,function(e){return e.id==g}));return void(d.length&&(i=d[0].find(0))&&c(Ve(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&u();for(var m=0;m1&&p.length>1;)if(Y(f)==Y(p))f.pop(),p.pop(),l--;else{if(f[0]!=p[0])break;f.shift(),p.shift(),t++}for(var d=0,h=0,m=f[0],g=p[0],y=Math.min(m.length,g.length);da.ch&&v.charCodeAt(v.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;f[f.length-1]=v.slice(0,v.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var E=tt(t,d),T=tt(l,p.length?Y(p).length-h:0);return f.length>1||f[0]||rt(E,T)?(gi(n.doc,f,E,T,"+input"),!0):void 0},Ba.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ba.prototype.reset=function(){this.forceCompositionEnd()},Ba.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ba.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ba.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||eo(this.cm,(function(){return pn(e.cm)}))},Ba.prototype.setUneditable=function(e){e.contentEditable="false"},Ba.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||to(this.cm,Da)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ba.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ba.prototype.onContextMenu=function(){},Ba.prototype.resetPosition=function(){},Ba.prototype.needsContentAttribute=!0;var Wa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new U,this.hasSelection=!1,this.composing=null};Wa.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!ge(n,e)){if(n.somethingSelected())Ra({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=La(n);Ra({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,z):(r.prevInput="",o.value=t.text.join("\n"),L(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(o.style.width="0px"),pe(o,"input",(function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),pe(o,"paste",(function(e){ge(n,e)||Ia(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),pe(o,"cut",i),pe(o,"copy",i),pe(e.scroller,"paste",(function(t){if(!Tr(e,t)&&!ge(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),pe(e.lineSpace,"selectstart",(function(t){Tr(e,t)||_e(t)})),pe(o,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(o,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Wa.prototype.createField=function(e){this.wrapper=Fa(),this.textarea=this.wrapper.firstChild},Wa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Wa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=vn(e);if(e.options.moveInputWithCursor){var o=Kr(e,r.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return n},Wa.prototype.showSelection=function(e){var t=this.cm.display;C(t.cursorDiv,e.cursors),C(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&L(this.textarea),s&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Wa.prototype.getField=function(){return this.textarea},Wa.prototype.supportsTouch=function(){return!1},Wa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wa.prototype.blur=function(){this.textarea.blur()},Wa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wa.prototype.receivedFocus=function(){this.slowPoll()},Wa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Wa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},Wa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||n||(n=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(n.length,o.length);a1e3||o.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Wa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wa.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Wa.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cn(r,e),a=n.scroller.scrollTop;if(i&&!p){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(i)&&to(r,ti)(r.doc,Ao(i),z);var c,f=o.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(c=window.scrollY),n.input.focus(),u&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),s&&l>=9&&m(),k?(xe(e),pe(window,"mouseup",(function e(){he(window,"mouseup",e),setTimeout(g,20)}))):setTimeout(g,50)}function m(){if(null!=o.selectionStart){var e=r.somethingSelected(),i=""+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=i.length,n.selForContextMenu=r.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,o.style.cssText=f,s&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=a),null!=o.selectionStart)){(!s||s&&l<9)&&m();var e=0;n.detectingSelectAll=setTimeout((function i(){n.selForContextMenu==r.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==t.prevInput?to(r,ui)(r):e++<10?n.detectingSelectAll=setTimeout(i,500):(n.selForContextMenu=null,n.input.reset())}),200)}}},Wa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Wa.prototype.setUneditable=function(){},Wa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,o,i){e.defaults[r]=n,o&&(t[r]=i?function(e,t,r){r!=xa&&o(e,t,r)}:o)}e.defineOption=r,e.Init=xa,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Ro(e)}),!0),r("indentUnit",2,Ro,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Do(e),Ur(e),pn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,r.push(tt(n,i))}n++}));for(var o=r.length-1;o>=0;o--)gi(e.doc,t,r[o],tt(r[o].line,r[o].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=xa&&e.refresh()})),r("specialCharPlaceholder",Zt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!E),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Ta(e),yo(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Xi(t),o=r!=xa&&Xi(r);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Aa,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=mo(t,e.options.lineNumbers),yo(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return qn(e)}),!0),r("scrollbarStyle","native",(function(e){Gn(e),qn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=mo(e.options.gutters,t),yo(e)}),!0),r("firstLineNumber",1,yo,!0),r("lineNumberFormatter",(function(e){return e}),yo,!0),r("showCursorWhenSelecting",!1,yn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(Sn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Sa),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,yn,!0),r("singleCursorHeightPerLine",!0,yn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Do,!0),r("addModeClass",!1,Do,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Do,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Oa),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,o=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&to(this,t[e])(this,r,o),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Pa(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&Rn(this));else{var i=o.from(),a=o.to(),s=Math.max(r,i.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Jo(this.doc,n,new wo(i,u[n].to()),z)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,r=dt(this,Ke(this.doc,e.line)),n=0,o=(r.length-1)/2,i=e.ch;if(0==i)t=r[2];else for(;;){var a=n+o>>1;if((a?r[2*a-1]:0)>=i)o=a;else{if(!(r[2*a+1]i&&(e=i,o=!0),n=Ke(this.doc,e)}else n=e;return $r(this,n,{top:0,left:0},t||"page",r||o).top+(o?this.doc.height-$t(n):0)},defaultTextHeight:function(){return nn(this.display)},defaultCharWidth:function(){return on(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,o){var i,a,s,l=this.display,u=(e=Kr(this,lt(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(u=e.bottom),c+t.offsetWidth>p&&(c=p-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==o?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?c=0:"middle"==o&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(i=this,a={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Pn(i,a)).scrollTop&&Ln(i,s.scrollTop),null!=s.scrollLeft&&Fn(i,s.scrollLeft))},triggerOnKeyDown:ro(fa),triggerOnKeyPress:ro(da),triggerOnKeyUp:pa,triggerOnMouseDown:ro(ya),execCommand:function(e){if(ra.hasOwnProperty(e))return ra[e].call(null,this)},triggerElectric:ro((function(e){Ma(this,e)})),findPosH:function(e,t,r,n){var o=1;t<0&&(o=-1,t=-t);for(var i=lt(this.doc,e),a=0;a0&&a(t.charAt(r-1));)--r;for(;n.5||this.options.lineWrapping)&&un(this),me(this,"refresh",this)})),swapDoc:ro((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),jo(this,e),Ur(this),this.display.input.reset(),Dn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,lr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[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}},be(e),e.registerHelper=function(t,n,o){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=o},e.registerGlobalHelper=function(t,n,o,i){e.registerHelper(t,n,i),r[t]._global.push({pred:o,val:i})}}(Oa);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var Va in Ri.prototype)Ri.prototype.hasOwnProperty(Va)&&B(Ka,Va)<0&&(Oa.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ri.prototype[Va]));return be(Ri),Oa.inputStyles={textarea:Wa,contenteditable:Ba},Oa.defineMode=function(e){Oa.defaults.mode||"null"==e||(Oa.defaults.mode=e),Fe.apply(this,arguments)},Oa.defineMIME=function(e,t){je[e]=t},Oa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(e,t){Oa.prototype[e]=t},Oa.defineDocExtension=function(e,t){Ri.prototype[e]=t},Oa.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=D();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(pe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){n(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Oa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=he,e.on=pe,e.wheelEventPixels=To,e.Doc=Ri,e.splitLines=Re,e.countColumn=H,e.findColumn=W,e.isWordChar=ee,e.Pass=q,e.signal=me,e.Line=Kt,e.changeEnd=Oo,e.scrollbarModel=$n,e.Pos=tt,e.cmpPos=rt,e.modes=Le,e.mimeModes=je,e.resolveMode=He,e.getMode=Ue,e.modeExtensions=Be,e.extendMode=qe,e.copyState=ze,e.startState=Ge,e.innerMode=$e,e.commands=ra,e.keyMap=$i,e.keyName=Qi,e.isModifierKey=Vi,e.lookupKey=Ki,e.normalizeKeyMap=Wi,e.StringStream=We,e.SharedTextMarker=Oi,e.TextMarker=Si,e.LineWidget=xi,e.e_preventDefault=_e,e.e_stopPropagation=Ee,e.e_stop=xe,e.addClass=I,e.contains=R,e.rmClass=A,e.keyNames=Ui}(Oa),Oa.version="5.54.0",Oa}()},function(e,t){e.exports=function(){for(var e={},t=0;t=r)return o.substr(0,r);for(;r>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,r)}},function(e,t,r){"use strict";e.exports=function(e){return o.test("number"==typeof e?n(e):e.charAt(0))};var n=String.fromCharCode,o=/\s/},function(e,t,r){e.exports=r(327)()},function(e,t,r){"use strict";function n(e,t){for(var r=0;r=48&&t<=57}},function(e,t,r){"use strict";var n=r(53),o=r(55),i=r(58),a=r(59),s=r(62),l=r(192);e.exports=n([i,o,a,s,l])},function(e,t,r){"use strict";e.exports=function(e,t){var r=[],o=-1,i=e.length;t&&r.push(n("text","\n"));for(;++o4&&"data"===r.slice(0,4)&&a.test(t)&&("-"===t.charAt(4)?f=function(e){var t=e.slice(5).replace(s,c);return"data"+t.charAt(0).toUpperCase()+t.slice(1)}(t):t=function(e){var t=e.slice(4);if(s.test(t))return e;"-"!==(t=t.replace(l,u)).charAt(0)&&(t="-"+t);return"data"+t}(t),p=o);return new p(f,t)};var a=/^data[-a-z0-9.:_]+$/i,s=/-[a-z]/g,l=/[A-Z]/g;function u(e){return"-"+e.toLowerCase()}function c(e){return e.charAt(1).toUpperCase()}},function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e){e.exports=JSON.parse('{"html":"http://www.w3.org/1999/xhtml","mathml":"http://www.w3.org/1998/Math/MathML","svg":"http://www.w3.org/2000/svg","xlink":"http://www.w3.org/1999/xlink","xml":"http://www.w3.org/XML/1998/namespace","xmlns":"http://www.w3.org/2000/xmlns/"}')},function(e,t,r){"use strict";function o(e){if("string"==typeof e)return function(e){return function(t){return Boolean(t&&t.type===e)}}(e);if(null==e)return s;if("object"===n(e))return("length"in e?a:i)(e);if("function"==typeof e)return e;throw new Error("Expected function, string, or object as test")}function i(e){return function(t){var r;for(r in e)if(t[r]!==e[r])return!1;return!0}}function a(e){var t=function(e){for(var t=[],r=e.length,n=-1;++n=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1=56320&&l<=57343){c+=encodeURIComponent(e[i]+e[i+1]),i++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[i]);return c}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",e.exports=o},function(e,t,r){"use strict";function n(e,t){for(var r=0;r=l.DIGIT_0&&e<=l.DIGIT_9}function h(e){return e>=l.LATIN_CAPITAL_A&&e<=l.LATIN_CAPITAL_Z}function m(e){return e>=l.LATIN_SMALL_A&&e<=l.LATIN_SMALL_Z}function g(e){return m(e)||h(e)}function y(e){return g(e)||d(e)}function v(e){return e>=l.LATIN_CAPITAL_A&&e<=l.LATIN_CAPITAL_F}function b(e){return e>=l.LATIN_SMALL_A&&e<=l.LATIN_SMALL_F}function _(e){return e+32}function E(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function T(e){return String.fromCharCode(_(e))}function x(e,t){for(var r=a[++e],n=++e,o=n+r-1;n<=o;){var i=n+o>>>1,s=a[i];if(st))return a[i+r];o=i-1}}return-1}var k=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.preprocessor=new o,this.tokenQueue=[],this.allowCDATA=!1,this.state=f,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}var t,r,k;return t=e,(r=[{key:"_err",value:function(){}},{key:"_errOnNextCodePoint",value:function(e){this._consume(),this._err(e),this._unconsume()}},{key:"getNextToken",value:function(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;var e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}},{key:"write",value:function(e,t){this.active=!0,this.preprocessor.write(e,t)}},{key:"insertHtmlAtCurrentPos",value:function(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}},{key:"_ensureHibernation",value:function(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:e.HIBERNATION_TOKEN}),!0}return!1}},{key:"_consume",value:function(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}},{key:"_unconsume",value:function(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}},{key:"_reconsumeInState",value:function(e){this.state=e,this._unconsume()}},{key:"_consumeSequenceIfMatch",value:function(e,t,r){for(var n=0,o=!0,i=e.length,a=0,s=t,u=void 0;a0&&(s=this._consume(),n++),s===l.EOF){o=!1;break}if(s!==(u=e[a])&&(r||s!==_(u))){o=!1;break}}if(!o)for(;n--;)this._unconsume();return o}},{key:"_isTempBufferEqualToScriptString",value:function(){if(this.tempBuff.length!==u.SCRIPT_STRING.length)return!1;for(var e=0;e0&&this._err(s.endTagWithAttributes),t.selfClosing&&this._err(s.endTagWithTrailingSolidus)),this.tokenQueue.push(t)}},{key:"_emitCurrentCharacterToken",value:function(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}},{key:"_emitEOFToken",value:function(){this._createEOFToken(),this._emitCurrentToken()}},{key:"_appendCharToCurrentCharacterToken",value:function(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}},{key:"_emitCodePoint",value:function(t){var r=e.CHARACTER_TOKEN;p(t)?r=e.WHITESPACE_CHARACTER_TOKEN:t===l.NULL&&(r=e.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(r,E(t))}},{key:"_emitSeveralCodePoints",value:function(e){for(var t=0;t-1;){var o=a[n],i=o<7;i&&1&o&&(t=2&o?[a[++n],a[++n]]:[a[++n]],r=0);var s=this._consume();if(this.tempBuff.push(s),r++,s===l.EOF)break;n=i?4&o?x(n,s):-1:s===o?++n:-1}for(;r--;)this.tempBuff.pop(),this._unconsume();return t}},{key:"_isCharacterReferenceInAttribute",value:function(){return"ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_UNQUOTED_STATE"===this.returnState}},{key:"_isCharacterReferenceAttributeQuirk",value:function(e){if(!e&&this._isCharacterReferenceInAttribute()){var t=this._consume();return this._unconsume(),t===l.EQUALS_SIGN||y(t)}return!1}},{key:"_flushCodePointsConsumedAsCharacterReference",value:function(){if(this._isCharacterReferenceInAttribute())for(var e=0;e")):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitChars(i.REPLACEMENT_CHARACTER)):e===l.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitCodePoint(e))}},{key:"SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",value:function(e){e===l.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE"):g(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE")):(this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE"))}},{key:"SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",value:function(e){g(e)?(this._createEndTagToken(),this._reconsumeInState("SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE")):(this._emitChars(""),this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE"))}},{key:"SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",value:function(e){if(h(e))this.currentToken.tagName+=T(e),this.tempBuff.push(e);else if(m(e))this.currentToken.tagName+=E(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(p(e))return void(this.state="BEFORE_ATTRIBUTE_NAME_STATE");if(e===l.SOLIDUS)return void(this.state="SELF_CLOSING_START_TAG_STATE");if(e===l.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=f)}this._emitChars(""),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE")}}},{key:"SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",value:function(e){p(e)||e===l.SOLIDUS||e===l.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?"SCRIPT_DATA_DOUBLE_ESCAPED_STATE":"SCRIPT_DATA_ESCAPED_STATE",this._emitCodePoint(e)):h(e)?(this.tempBuff.push(_(e)),this._emitCodePoint(e)):m(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE")}},{key:"SCRIPT_DATA_DOUBLE_ESCAPED_STATE",value:function(e){e===l.HYPHEN_MINUS?(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",this._emitChars("-")):e===l.LESS_THAN_SIGN?(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",this._emitChars("<")):e===l.NULL?(this._err(s.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===l.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(e)}},{key:"SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",value:function(e){e===l.HYPHEN_MINUS?(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",this._emitChars("-")):e===l.LESS_THAN_SIGN?(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",this._emitChars("<")):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitChars(i.REPLACEMENT_CHARACTER)):e===l.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e))}},{key:"SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",value:function(e){e===l.HYPHEN_MINUS?this._emitChars("-"):e===l.LESS_THAN_SIGN?(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",this._emitChars("<")):e===l.GREATER_THAN_SIGN?(this.state="SCRIPT_DATA_STATE",this._emitChars(">")):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitChars(i.REPLACEMENT_CHARACTER)):e===l.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e))}},{key:"SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",value:function(e){e===l.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",this._emitChars("/")):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}},{key:"SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",value:function(e){p(e)||e===l.SOLIDUS||e===l.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?"SCRIPT_DATA_ESCAPED_STATE":"SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e)):h(e)?(this.tempBuff.push(_(e)),this._emitCodePoint(e)):m(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}},{key:"BEFORE_ATTRIBUTE_NAME_STATE",value:function(e){p(e)||(e===l.SOLIDUS||e===l.GREATER_THAN_SIGN||e===l.EOF?this._reconsumeInState("AFTER_ATTRIBUTE_NAME_STATE"):e===l.EQUALS_SIGN?(this._err(s.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state="ATTRIBUTE_NAME_STATE"):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}},{key:"ATTRIBUTE_NAME_STATE",value:function(e){p(e)||e===l.SOLIDUS||e===l.GREATER_THAN_SIGN||e===l.EOF?(this._leaveAttrName("AFTER_ATTRIBUTE_NAME_STATE"),this._unconsume()):e===l.EQUALS_SIGN?this._leaveAttrName("BEFORE_ATTRIBUTE_VALUE_STATE"):h(e)?this.currentAttr.name+=T(e):e===l.QUOTATION_MARK||e===l.APOSTROPHE||e===l.LESS_THAN_SIGN?(this._err(s.unexpectedCharacterInAttributeName),this.currentAttr.name+=E(e)):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.name+=i.REPLACEMENT_CHARACTER):this.currentAttr.name+=E(e)}},{key:"AFTER_ATTRIBUTE_NAME_STATE",value:function(e){p(e)||(e===l.SOLIDUS?this.state="SELF_CLOSING_START_TAG_STATE":e===l.EQUALS_SIGN?this.state="BEFORE_ATTRIBUTE_VALUE_STATE":e===l.GREATER_THAN_SIGN?(this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}},{key:"BEFORE_ATTRIBUTE_VALUE_STATE",value:function(e){p(e)||(e===l.QUOTATION_MARK?this.state="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE":e===l.APOSTROPHE?this.state="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE":e===l.GREATER_THAN_SIGN?(this._err(s.missingAttributeValue),this.state=f,this._emitCurrentToken()):this._reconsumeInState("ATTRIBUTE_VALUE_UNQUOTED_STATE"))}},{key:"ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",value:function(e){e===l.QUOTATION_MARK?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===l.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=E(e)}},{key:"ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",value:function(e){e===l.APOSTROPHE?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===l.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=E(e)}},{key:"ATTRIBUTE_VALUE_UNQUOTED_STATE",value:function(e){p(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===l.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_UNQUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===l.GREATER_THAN_SIGN?(this._leaveAttrValue(f),this._emitCurrentToken()):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===l.QUOTATION_MARK||e===l.APOSTROPHE||e===l.LESS_THAN_SIGN||e===l.EQUALS_SIGN||e===l.GRAVE_ACCENT?(this._err(s.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=E(e)):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=E(e)}},{key:"AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",value:function(e){p(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===l.SOLIDUS?this._leaveAttrValue("SELF_CLOSING_START_TAG_STATE"):e===l.GREATER_THAN_SIGN?(this._leaveAttrValue(f),this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._err(s.missingWhitespaceBetweenAttributes),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}},{key:"SELF_CLOSING_START_TAG_STATE",value:function(e){e===l.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._err(s.unexpectedSolidusInTag),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}},{key:"BOGUS_COMMENT_STATE",value:function(e){e===l.GREATER_THAN_SIGN?(this.state=f,this._emitCurrentToken()):e===l.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):this.currentToken.data+=E(e)}},{key:"MARKUP_DECLARATION_OPEN_STATE",value:function(e){this._consumeSequenceIfMatch(u.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state="COMMENT_START_STATE"):this._consumeSequenceIfMatch(u.DOCTYPE_STRING,e,!1)?this.state="DOCTYPE_STATE":this._consumeSequenceIfMatch(u.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state="CDATA_SECTION_STATE":(this._err(s.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state="BOGUS_COMMENT_STATE"):this._ensureHibernation()||(this._err(s.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState("BOGUS_COMMENT_STATE"))}},{key:"COMMENT_START_STATE",value:function(e){e===l.HYPHEN_MINUS?this.state="COMMENT_START_DASH_STATE":e===l.GREATER_THAN_SIGN?(this._err(s.abruptClosingOfEmptyComment),this.state=f,this._emitCurrentToken()):this._reconsumeInState("COMMENT_STATE")}},{key:"COMMENT_START_DASH_STATE",value:function(e){e===l.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===l.GREATER_THAN_SIGN?(this._err(s.abruptClosingOfEmptyComment),this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}},{key:"COMMENT_STATE",value:function(e){e===l.HYPHEN_MINUS?this.state="COMMENT_END_DASH_STATE":e===l.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state="COMMENT_LESS_THAN_SIGN_STATE"):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=E(e)}},{key:"COMMENT_LESS_THAN_SIGN_STATE",value:function(e){e===l.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state="COMMENT_LESS_THAN_SIGN_BANG_STATE"):e===l.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState("COMMENT_STATE")}},{key:"COMMENT_LESS_THAN_SIGN_BANG_STATE",value:function(e){e===l.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE":this._reconsumeInState("COMMENT_STATE")}},{key:"COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",value:function(e){e===l.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE":this._reconsumeInState("COMMENT_END_DASH_STATE")}},{key:"COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",value:function(e){e!==l.GREATER_THAN_SIGN&&e!==l.EOF&&this._err(s.nestedComment),this._reconsumeInState("COMMENT_END_STATE")}},{key:"COMMENT_END_DASH_STATE",value:function(e){e===l.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}},{key:"COMMENT_END_STATE",value:function(e){e===l.GREATER_THAN_SIGN?(this.state=f,this._emitCurrentToken()):e===l.EXCLAMATION_MARK?this.state="COMMENT_END_BANG_STATE":e===l.HYPHEN_MINUS?this.currentToken.data+="-":e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState("COMMENT_STATE"))}},{key:"COMMENT_END_BANG_STATE",value:function(e){e===l.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state="COMMENT_END_DASH_STATE"):e===l.GREATER_THAN_SIGN?(this._err(s.incorrectlyClosedComment),this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState("COMMENT_STATE"))}},{key:"DOCTYPE_STATE",value:function(e){p(e)?this.state="BEFORE_DOCTYPE_NAME_STATE":e===l.GREATER_THAN_SIGN?this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"):e===l.EOF?(this._err(s.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingWhitespaceBeforeDoctypeName),this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"))}},{key:"BEFORE_DOCTYPE_NAME_STATE",value:function(e){p(e)||(h(e)?(this._createDoctypeToken(T(e)),this.state="DOCTYPE_NAME_STATE"):e===l.NULL?(this._err(s.unexpectedNullCharacter),this._createDoctypeToken(i.REPLACEMENT_CHARACTER),this.state="DOCTYPE_NAME_STATE"):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=f):e===l.EOF?(this._err(s.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(E(e)),this.state="DOCTYPE_NAME_STATE"))}},{key:"DOCTYPE_NAME_STATE",value:function(e){p(e)?this.state="AFTER_DOCTYPE_NAME_STATE":e===l.GREATER_THAN_SIGN?(this.state=f,this._emitCurrentToken()):h(e)?this.currentToken.name+=T(e):e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.name+=i.REPLACEMENT_CHARACTER):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=E(e)}},{key:"AFTER_DOCTYPE_NAME_STATE",value:function(e){p(e)||(e===l.GREATER_THAN_SIGN?(this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(u.PUBLIC_STRING,e,!1)?this.state="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE":this._consumeSequenceIfMatch(u.SYSTEM_STRING,e,!1)?this.state="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE":this._ensureHibernation()||(this._err(s.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}},{key:"AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",value:function(e){p(e)?this.state="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===l.QUOTATION_MARK?(this._err(s.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===l.APOSTROPHE?(this._err(s.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}},{key:"BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",value:function(e){p(e)||(e===l.QUOTATION_MARK?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===l.APOSTROPHE?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}},{key:"DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",value:function(e){e===l.QUOTATION_MARK?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=f):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=E(e)}},{key:"DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",value:function(e){e===l.APOSTROPHE?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=f):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=E(e)}},{key:"AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",value:function(e){p(e)?this.state="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE":e===l.GREATER_THAN_SIGN?(this.state=f,this._emitCurrentToken()):e===l.QUOTATION_MARK?(this._err(s.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===l.APOSTROPHE?(this._err(s.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}},{key:"BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",value:function(e){p(e)||(e===l.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=f):e===l.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===l.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}},{key:"AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",value:function(e){p(e)?this.state="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===l.QUOTATION_MARK?(this._err(s.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===l.APOSTROPHE?(this._err(s.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}},{key:"BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",value:function(e){p(e)||(e===l.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===l.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===l.GREATER_THAN_SIGN?(this._err(s.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=f,this._emitCurrentToken()):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}},{key:"DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",value:function(e){e===l.QUOTATION_MARK?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=f):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=E(e)}},{key:"DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",value:function(e){e===l.APOSTROPHE?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===l.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===l.GREATER_THAN_SIGN?(this._err(s.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=f):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=E(e)}},{key:"AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",value:function(e){p(e)||(e===l.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=f):e===l.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}},{key:"BOGUS_DOCTYPE_STATE",value:function(e){e===l.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=f):e===l.NULL?this._err(s.unexpectedNullCharacter):e===l.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}},{key:"CDATA_SECTION_STATE",value:function(e){e===l.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_BRACKET_STATE":e===l.EOF?(this._err(s.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}},{key:"CDATA_SECTION_BRACKET_STATE",value:function(e){e===l.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_END_STATE":(this._emitChars("]"),this._reconsumeInState("CDATA_SECTION_STATE"))}},{key:"CDATA_SECTION_END_STATE",value:function(e){e===l.GREATER_THAN_SIGN?this.state=f:e===l.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState("CDATA_SECTION_STATE"))}},{key:"CHARACTER_REFERENCE_STATE",value:function(e){this.tempBuff=[l.AMPERSAND],e===l.NUMBER_SIGN?(this.tempBuff.push(e),this.state="NUMERIC_CHARACTER_REFERENCE_STATE"):y(e)?this._reconsumeInState("NAMED_CHARACTER_REFERENCE_STATE"):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}},{key:"NAMED_CHARACTER_REFERENCE_STATE",value:function(e){var t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[l.AMPERSAND];else if(t){var r=this.tempBuff[this.tempBuff.length-1]===l.SEMICOLON;this._isCharacterReferenceAttributeQuirk(r)||(r||this._errOnNextCodePoint(s.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state="AMBIGUOS_AMPERSAND_STATE"}},{key:"AMBIGUOS_AMPERSAND_STATE",value:function(e){y(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=E(e):this._emitCodePoint(e):(e===l.SEMICOLON&&this._err(s.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}},{key:"NUMERIC_CHARACTER_REFERENCE_STATE",value:function(e){this.charRefCode=0,e===l.LATIN_SMALL_X||e===l.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE"):this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_START_STATE")}},{key:"HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",value:function(e){!function(e){return d(e)||v(e)||b(e)}(e)?(this._err(s.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState("HEXADEMICAL_CHARACTER_REFERENCE_STATE")}},{key:"DECIMAL_CHARACTER_REFERENCE_START_STATE",value:function(e){d(e)?this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_STATE"):(this._err(s.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}},{key:"HEXADEMICAL_CHARACTER_REFERENCE_STATE",value:function(e){v(e)?this.charRefCode=16*this.charRefCode+e-55:b(e)?this.charRefCode=16*this.charRefCode+e-87:d(e)?this.charRefCode=16*this.charRefCode+e-48:e===l.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(s.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}},{key:"DECIMAL_CHARACTER_REFERENCE_STATE",value:function(e){d(e)?this.charRefCode=10*this.charRefCode+e-48:e===l.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(s.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}},{key:"NUMERIC_CHARACTER_REFERENCE_END_STATE",value:function(){if(this.charRefCode===l.NULL)this._err(s.nullCharacterReference),this.charRefCode=l.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(s.characterReferenceOutsideUnicodeRange),this.charRefCode=l.REPLACEMENT_CHARACTER;else if(i.isSurrogate(this.charRefCode))this._err(s.surrogateCharacterReference),this.charRefCode=l.REPLACEMENT_CHARACTER;else if(i.isUndefinedCodePoint(this.charRefCode))this._err(s.noncharacterCharacterReference);else if(i.isControlCodePoint(this.charRefCode)||this.charRefCode===l.CARRIAGE_RETURN){this._err(s.controlCharacterReference);var e=c[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}])&&n(t.prototype,r),k&&n(t,k),e}();k.CHARACTER_TOKEN="CHARACTER_TOKEN",k.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",k.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",k.START_TAG_TOKEN="START_TAG_TOKEN",k.END_TAG_TOKEN="END_TAG_TOKEN",k.COMMENT_TOKEN="COMMENT_TOKEN",k.DOCTYPE_TOKEN="DOCTYPE_TOKEN",k.EOF_TOKEN="EOF_TOKEN",k.HIBERNATION_TOKEN="HIBERNATION_TOKEN",k.MODE={DATA:f,RCDATA:"RCDATA_STATE",RAWTEXT:"RAWTEXT_STATE",SCRIPT_DATA:"SCRIPT_DATA_STATE",PLAINTEXT:"PLAINTEXT_STATE"},k.getTokenAttr=function(e,t){for(var r=e.attrs.length-1;r>=0;r--)if(e.attrs[r].name===t)return e.attrs[r].value;return null},e.exports=k},function(e,t,r){"use strict";var n=0;function o(){return Math.pow(2,++n)}t.boolean=o(),t.booleanish=o(),t.overloadedBoolean=o(),t.number=o(),t.spaceSeparated=o(),t.commaSeparated=o(),t.commaOrSpaceSeparated=o()},function(e,t,r){"use strict";t.parse=function(e){var t=String(e||"").trim();return""===t?[]:t.split(n)},t.stringify=function(e){return e.join(" ").trim()};var n=/[ \t\n\r\f]+/g},function(e,t,r){"use strict";t.parse=function(e){var t,r=[],n=String(e||""),o=n.indexOf(","),i=0,a=!1;for(;!a;)-1===o&&(o=n.length,a=!0),!(t=n.slice(i,o).trim())&&a||r.push(t),i=o+1,o=n.indexOf(",",i);return r},t.stringify=function(e,t){var r=t||{},n=!1===r.padLeft?"":" ",o=r.padRight?" ":"";""===e[e.length-1]&&(e=e.concat(""));return e.join(o+","+n).trim()}},function(e){e.exports=JSON.parse('{"AElig":"Æ","AMP":"&","Aacute":"Á","Acirc":"Â","Agrave":"À","Aring":"Å","Atilde":"Ã","Auml":"Ä","COPY":"©","Ccedil":"Ç","ETH":"Ð","Eacute":"É","Ecirc":"Ê","Egrave":"È","Euml":"Ë","GT":">","Iacute":"Í","Icirc":"Î","Igrave":"Ì","Iuml":"Ï","LT":"<","Ntilde":"Ñ","Oacute":"Ó","Ocirc":"Ô","Ograve":"Ò","Oslash":"Ø","Otilde":"Õ","Ouml":"Ö","QUOT":"\\"","REG":"®","THORN":"Þ","Uacute":"Ú","Ucirc":"Û","Ugrave":"Ù","Uuml":"Ü","Yacute":"Ý","aacute":"á","acirc":"â","acute":"´","aelig":"æ","agrave":"à","amp":"&","aring":"å","atilde":"ã","auml":"ä","brvbar":"¦","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","curren":"¤","deg":"°","divide":"÷","eacute":"é","ecirc":"ê","egrave":"è","eth":"ð","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","iacute":"í","icirc":"î","iexcl":"¡","igrave":"ì","iquest":"¿","iuml":"ï","laquo":"«","lt":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","ntilde":"ñ","oacute":"ó","ocirc":"ô","ograve":"ò","ordf":"ª","ordm":"º","oslash":"ø","otilde":"õ","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","raquo":"»","reg":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","thorn":"þ","times":"×","uacute":"ú","ucirc":"û","ugrave":"ù","uml":"¨","uuml":"ü","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(e,t,r){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}},function(e,t,r){"use strict";var n=r(71),o=r(9);e.exports=function(e){return n(e)||o(e)}},function(e,t,r){"use strict";e.exports=r(317)},function(e,t,r){"use strict";var n=a("start"),o=a("end");function i(e){return{start:n(e),end:o(e)}}function a(e){return t.displayName=e,t;function t(t){var r=t&&t.position&&t.position[e]||{};return{line:r.line||null,column:r.column||null,offset:isNaN(r.offset)?null:r.offset}}}e.exports=i,i.start=n,i.end=o},function(e,t,r){"use strict";var n=[65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];t.REPLACEMENT_CHARACTER="�",t.CODE_POINTS={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},t.CODE_POINT_SEQUENCES={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},t.isSurrogate=function(e){return e>=55296&&e<=57343},t.isSurrogatePair=function(e){return e>=56320&&e<=57343},t.getSurrogatePairCodePoint=function(e,t){return 1024*(e-55296)+9216+t},t.isControlCodePoint=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},t.isUndefinedCodePoint=function(e){return e>=64976&&e<=65007||n.indexOf(e)>-1}},function(e,t,r){"use strict";e.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r=55296&&X<=57343||X>1114111?(T(7,R),_=c(65533)):_ in o?(T(6,R),_=o[_]):(k="",v(_)&&T(6,R),_>65535&&(k+=c((_-=65536)>>>10|55296),_=56320|1023&_),_=k+c(_))):O!==d&&T(4,R)),_?(Z(),P=J(),G=D-1,K+=D-A+1,Q.push(_),(N=J()).offset++,j&&j.call(U,_,{start:P,end:N},e.slice(A-1,D)),P=N):(p=e.slice(A-1,D),Y+=p,K+=p.length,G=D-1)}else 10===b&&(V++,W++,K=0),b==b?(Y+=c(b),K++):Z();var X;return Q.join("");function J(){return{line:V,column:K,offset:G+(q.offset||0)}}function Z(){Y&&(Q.push(Y),L&&L.call(H,Y,{start:P,end:J()}),Y="")}}(e,a)};var u={}.hasOwnProperty,c=String.fromCharCode,f=Function.prototype,p={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},d="named",h="hexadecimal",m={hexadecimal:16,decimal:10},g={};g[d]=s,g.decimal=i,g[h]=a;var y={};function v(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)}y[1]="Named character references must be terminated by a semicolon",y[2]="Numeric character references must be terminated by a semicolon",y[3]="Named character references cannot be empty",y[4]="Numeric character references cannot be empty",y[5]="Named character references must be known",y[6]="Numeric character references cannot be disallowed",y[7]="Numeric character references cannot be outside the permissible Unicode range"},function(e,t,r){"use strict";e.exports=function(e,t,r,n){var o,i,a=e.length,s=-1;for(;++s";return e};var o=/\s/},function(e,t,r){"use strict";e.exports=function(e){var t=-1===e.indexOf('"')?'"':"'";return t+e+t}},function(e,t,r){"use strict";var n=r(88);function o(e){return function(t,r,o){var i,a=t&&t.children;if(r+=e,i=a&&a[r],!o)for(;i&&n(i);)i=a[r+=e];return i}}t.before=o(-1),t.after=o(1)},function(e,t,r){function n(){return(n=Object.assign||function(e){for(var t=1;t>/.source,e.exports.VariablesContext=h},function(e,t,r){!function(e){"use strict";function t(e,t,r,n,o,i){this.indented=e,this.column=t,this.type=r,this.info=n,this.align=o,this.prev=i}function r(e,r,n,o){var i=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=n&&(i=e.context.indented),e.context=new t(i,r,n,o,null,e.context)}function n(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function o(e,t,r){return"variable"==t.prevToken||"type"==t.prevToken||!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,r))||!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0}function i(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/,C=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,P=l.isReservedIdentifier||!1;function N(e,t){var r,n=e.next();if(_[n]){var o=_[n](e,t);if(!1!==o)return o}if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){for(var n,o=!1,i=!1;null!=(n=e.next());){if(n==r&&!o){i=!0;break}o=!o&&"\\"==n}return(i||!o&&!E)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(w.test(n))return u=n,null;if(S.test(n)){if(e.backUp(1),e.match(A))return"number";e.next()}if("/"==n){if(e.eat("*"))return t.tokenize=R,R(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(O.test(n)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(O););return"operator"}if(e.eatWhile(C),k)for(;e.match(k);)e.eatWhile(C);var i=e.current();return s(h,i)?(s(y,i)&&(u="newstatement"),s(v,i)&&(c=!0),"keyword"):s(m,i)?"type":s(g,i)||P&&P(i)?(s(y,i)&&(u="newstatement"),"builtin"):s(b,i)?"atom":"variable"}function R(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function D(e,t){l.typeFirstDefinitions&&e.eol()&&i(t.context)&&(t.typeAtEndOfLine=o(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-f,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return D(e,t),null;u=c=null;var s=(t.tokenize||N)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==u||":"==u||","==u&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)n(t);else if("{"==u)r(t,e.column(),"}");else if("["==u)r(t,e.column(),"]");else if("("==u)r(t,e.column(),")");else if("}"==u){for(;"statement"==a.type;)a=n(t);for("}"==a.type&&(a=n(t));"statement"==a.type;)a=n(t)}else u==a.type?n(t):T&&(("}"==a.type||"top"==a.type)&&";"!=u||"statement"==a.type&&"newstatement"==u)&&r(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&o(e,t,e.start)&&i(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),_.token){var f=_.token(e,t,s);void 0!==f&&(s=f)}return"def"==s&&!1===l.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=c?"def":s||u,D(e,t),s},indent:function(t,r){if(t.tokenize!=N&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var n=t.context,o=r&&r.charAt(0),i=o==n.type;if("statement"==n.type&&"}"==o&&(n=n.prev),l.dontIndentStatements)for(;"statement"==n.type&&l.dontIndentStatements.test(n.info);)n=n.prev;if(_.indent){var a=_.indent(t,n,r,f);if("number"==typeof a)return a}var s=n.prev&&"switch"==n.prev.info;if(l.allmanIndentation&&/[{(]/.test(o)){for(;"top"!=n.type&&"}"!=n.type;)n=n.prev;return n.indented}return"statement"==n.type?n.indented+("{"==o?0:p):!n.align||d&&")"==n.type?")"!=n.type||i?n.indented+(i?0:f)+(i||!s||/^(?:case|default)\b/.test(r)?0:f):n.indented+p:n.column+(i?0:1)},electricInput:x?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",u="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",c="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",f="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",p=a("int long char short double float unsigned signed void bool"),d=a("SEL instancetype id Class Protocol BOOL");function h(e){return s(p,e)||/.+_t$/.test(e)}function m(e){return h(e)||s(d,e)}var g="case do else for if switch while struct enum union";function y(e,t){if(!t.startOfLine)return!1;for(var r,n=null;r=e.peek();){if("\\"==r&&e.match(/^.$/)){n=y;break}if("/"==r&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=n,"meta"}function v(e,t){return"type"==t.prevToken&&"type"}function b(e){return!(!e||e.length<2||"_"!=e[0]||"_"!=e[1]&&e[1]===e[1].toLowerCase())}function _(e){return e.eatWhile(/[\w\.']/),"number"}function E(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var r=e.match(/"([^\s\\()]{0,16})\(/);return!!r&&(t.cpp11RawStringDelim=r[1],t.tokenize=k,k(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function T(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function x(e,t){for(var r;null!=(r=e.next());)if('"'==r&&!e.eat('"')){t.tokenize=null;break}return"string"}function k(e,t){var r=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+r+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function w(t,r){"string"==typeof t&&(t=[t]);var n=[];function o(e){if(e)for(var t in e)e.hasOwnProperty(t)&&n.push(t)}o(r.keywords),o(r.types),o(r.builtin),o(r.atoms),n.length&&(r.helperType=t[0],e.registerHelper("hintWords",t[0],n));for(var i=0;i!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=S,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,r){var n=r.context;return!("}"!=n.type||!n.align||!e.eat(">"))&&(r.context=new t(n.indented,n.column,n.type,n.info,null,n.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=A(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),w("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){var r;return t.tokenize=(r=e.match('""'),function(e,t){for(var n,o=!1,i=!1;!e.eol();){if(!r&&!o&&e.match('"')){i=!0;break}if(r&&e.match('"""')){i=!0;break}n=e.next(),!o&&"$"==n&&e.match("{")&&e.skipTo("}"),o=!o&&"\\"==n&&!r}return!i&&r||(t.tokenize=null),"string"}),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=A(1),t.tokenize(e,t))},indent:function(e,t,r,n){var o=r&&r.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=r?"operator"==e.prevToken&&"}"!=r&&"}"!=e.context.type||"variable"==e.prevToken&&"."==o||("}"==e.prevToken||")"==e.prevToken)&&"."==o?2*n+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(r||"").charAt(0)?0:n):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),w(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":y},modeProps:{fold:["brace","include"]}}),w("text/x-nesc",{name:"clike",keywords:a(l+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:h,blockKeywords:a(g),atoms:a("null true false"),hooks:{"#":y},modeProps:{fold:["brace","include"]}}),w("text/x-objectivec",{name:"clike",keywords:a(l+" "+c),types:m,builtin:a(f),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a("struct enum union @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:b,hooks:{"#":y,"*":v},modeProps:{fold:["brace","include"]}}),w("text/x-objectivec++",{name:"clike",keywords:a(l+" "+c+" "+u),types:m,builtin:a(f),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:a("struct enum union @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:b,hooks:{"#":y,"*":v,u:E,U:E,L:E,R:E,0:_,1:_,2:_,3:_,4:_,5:_,6:_,7:_,8:_,9:_,token:function(e,t,r){if("variable"==r&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&T(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),w("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:h,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":y},modeProps:{fold:["brace","include"]}});var O=null;w("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=function e(t){return function(r,n){for(var o,i=!1,a=!1;!r.eol();){if(!i&&r.match('"')&&("single"==t||r.match('""'))){a=!0;break}if(!i&&r.match("``")){O=e(t),a=!0;break}o=r.next(),i="single"==t&&!i&&"\\"==o}return a&&(n.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!O||!e.match("`"))&&(t.tokenize=O,O=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,r){if(("variable"==r||"type"==r)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}(r(0))},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,u=[],c=!1,f=-1;function p(){c&&l&&(c=!1,l.length?u=l.concat(u):f=-1,u.length&&d())}function d(){if(!c){var e=s(p);c=!0;for(var t=u.length;t;){for(l=u,u=[];++f1)for(var r=1;r=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=r(n(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=r(n(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var o=n(e.split("/")),i=n(r.split("/")),a=Math.min(o.length,i.length),s=a,l=0;l=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){n=i;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){r=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===n&&(o=!1,n=a+1),46===s?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){r=a+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r(43))},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=t&&t.type,o=i.call(e.handlers,n)?e.handlers[n]:e.unknownHandler;if(!n)throw new Error("Expected node, got `"+t+"`");return("function"==typeof o?o:a)(e,t,r)};var n=r(4),o=r(3),i={}.hasOwnProperty;function a(e,t){return function(e){var t=e.data||{};if(i.call(t,"hName")||i.call(t,"hProperties")||i.call(t,"hChildren"))return!1;return"value"in e}(t)?e.augment(t,n("text",t.value)):e(t,"div",o(e,t))}},function(e,t,r){"use strict";e.exports=function(e,t){return e(t,"hr")}},function(e,t,r){"use strict";e.exports=function(e,t){var r,i,a={},s=t.ordered?"ol":"ul",l=-1;"number"==typeof t.start&&1!==t.start&&(a.start=t.start);r=o(e,t),i=r.length;for(;++l=97&&t<=122||t>=65&&t<=90}},function(e,t,r){"use strict";e.exports=a;var n=["\\","`","*","{","}","[","]","(",")","#","+","-",".","!","_",">"],o=n.concat(["~","|"]),i=o.concat(["\n",'"',"$","%","&","'",",","/",":",";","<","=","?","@","^"]);function a(e){var t=e||{};return t.commonmark?i:t.gfm?o:n}a.default=n,a.gfm=o,a.commonmark=i},function(e,t,r){"use strict";e.exports={position:!0,gfm:!0,commonmark:!1,footnotes:!1,pedantic:!1,blocks:r(210)}},function(e,t,r){"use strict";e.exports=i;var o=r(18);function i(e,t,r,n){var i;function s(e,o,l){var u,c=[];return(t&&!i(e,o,l[l.length-1]||null)||!1!==(c=a(r(e,l)))[0])&&e.children&&"skip"!==c[0]&&!1===(u=a(function(e,t){var r,o=n?-1:1,i=(n?e.length:-1)+o;for(;i>-1&&i1&&(n=Math.floor(n/t)*t),i[n]=r,o=e.charAt(++r);return{indent:n,stops:i}}},function(e,t,r){"use strict";var n="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\u0000-\\u0020]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",o="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";t.openCloseTag=new RegExp("^(?:"+n+"|"+o+")"),t.tag=new RegExp("^(?:"+n+"|"+o+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|]*>|)")},function(e,t,r){"use strict";e.exports=function(e,t){return e.indexOf("<",t)}},function(e,t,r){"use strict";e.exports=function(e,t){var r=e.indexOf("[",t),n=e.indexOf("![",t);if(-1===n)return r;return r","OElig":"Œ","oelig":"œ","Scaron":"Š","scaron":"š","Yuml":"Ÿ","circ":"ˆ","tilde":"˜","ensp":" ","emsp":" ","thinsp":" ","zwnj":"","zwj":"","lrm":"","rlm":"","ndash":"–","mdash":"—","lsquo":"‘","rsquo":"’","sbquo":"‚","ldquo":"“","rdquo":"”","bdquo":"„","dagger":"†","Dagger":"‡","permil":"‰","lsaquo":"‹","rsaquo":"›","euro":"€"}')},function(e,t,r){"use strict";var n=r(256);e.exports=function(e){var t;if("&"!==e.charAt(0))return 0;return(t=e.split("&",2).join("&")).length-n(t).length}},function(e,t,r){"use strict";var n=r(5);e.exports=function(e,t){var r=e.split("\n"),o=r.length,i=n(" ",4*t);for(;o--;)0!==r[o].length&&(r[o]=i+r[o]);return r.join("\n")}},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,o=0,i=0;if("string"!=typeof t||1!==t.length)throw new Error("Expected character");e=String(e),n=e.indexOf(t),r=n;for(;-1!==n;)o++,n===r?o>i&&(i=o):o=1,r=n+1,n=e.indexOf(t,r);return i}},function(e,t,r){"use strict";e.exports=function(e){var t=e.referenceType;if("shortcut"===t)return"";return"["+("collapsed"===t?"":e.label||e.identifier)+"]"}},function(e,t,r){"use strict";e.exports=function(e,t){var r;if(null!=t&&"string"!=typeof t&&("object"!==n(t)||0===t.length))throw new Error("Expected `string` or `Array.` for `tagNames`, not `"+t+"`");if(!e||"object"!==n(e)||"element"!==e.type||"string"!=typeof e.tagName)return!1;if(null==t)return!0;if(r=e.tagName,"string"==typeof t)return r===t;return-1!==t.indexOf(r)}},function(e,t,r){"use strict";e.exports=function(e){var t;if(e&&"object"===n(e)&&"text"===e.type)t=e.value||"";else{if("string"!=typeof e)return!1;t=e}return""===t.replace(o,"")};var o=/[ \t\n\f\r]/g},function(e,t,r){"use strict";var n=r(18),o=r(88);e.exports=function(e){return i(e)&&o(e.value.charAt(0))};var i=n("text")},function(e,t,r){"use strict";var n=r(18),o=r(87),i=r(89),a=r(40).after,s=r(91),l=n("comment"),u=["option"].concat("optgroup"),c=["dt","dd"],f=["menuitem","hr","menu"],p=["rp","rt"],d=["tbody","tfoot"],h=["td","th"],m=["a","audio","del","ins","map","noscript","video"],g=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","section","table","ul"];function y(e,t,r){var n=a(r,t,!0);return!n||!l(n)&&!i(n)}function v(e,t,r){var n=a(r,t);return!n||o(n,p)}function b(e,t,r){var n=a(r,t);return!n||o(n,h)}e.exports=s({html:function(e,t,r){var n=a(r,t);return!n||!l(n)},head:y,body:function(e,t,r){var n=a(r,t);return!n||!l(n)},p:function(e,t,r){var n=a(r,t);return n?o(n,g):!r||!o(r,m)},li:function(e,t,r){var n=a(r,t);return!n||o(n,"li")},dt:function(e,t,r){var n=a(r,t);return n&&o(n,c)},dd:function(e,t,r){var n=a(r,t);return!n||o(n,c)},rt:v,rp:v,optgroup:function(e,t,r){var n=a(r,t);return!n||o(n,"optgroup")},option:function(e,t,r){var n=a(r,t);return!n||o(n,u)},menuitem:function(e,t,r){var n=a(r,t);return!n||o(n,f)},colgroup:y,caption:y,thead:function(e,t,r){var n=a(r,t);return n&&o(n,d)},tbody:function(e,t,r){var n=a(r,t);return!n||o(n,d)},tfoot:function(e,t,r){return!a(r,t)},tr:function(e,t,r){var n=a(r,t);return!n||o(n,"tr")},td:b,th:b})},function(e,t,r){"use strict";e.exports=function(e){return function(t,r,o){var i=t.tagName,a=!!n.call(e,i)&&e[i];return!!a&&a(t,r,o)}};var n={}.hasOwnProperty},function(e,t,r){"use strict";e.exports=function(e,t,r,i){var a=t&&t.type;if(!a)throw new Error("Expected node, not `"+t+"`");if(!n.call(o,a))throw new Error("Cannot compile unknown node `"+a+"`");return o[a](e,t,r,i)};var n={}.hasOwnProperty,o={};o.root=r(93),o.text=r(94),o.element=r(306),o.doctype=r(308),o.comment=r(309),o.raw=r(310)},function(e,t,r){"use strict";var n=r(92);e.exports=function(e,t){var r=t&&t.children,o=r&&r.length,i=-1,a=[];for(;++i","&","`"]),p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;function h(e,t){var r=t||{},n=r.subset,i=n?y(n):f,a=r.escapeOnly,h=r.omitOptionalSemicolons;return e=e.replace(i,v),n||a?e:e.replace(p,(function(e,t,r){return m(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,r.charAt(t+2),h)})).replace(d,v);function v(e,t,n){return function(e,t,r){var n,i,a,f,p=r.useShortestReferences,d=r.omitOptionalSemicolons;(p||r.useNamedReferences)&&u.call(c,e)&&(n=function(e,t,r,n){var i="&"+e;if(r&&u.call(o,e)&&-1===l.indexOf(e)&&(!n||t&&"="!==t&&!s(t)))return i;return i+";"}(c[e],t,d,r.attribute));!p&&n||(i=e.charCodeAt(0),a=m(i,t,d),p&&(f=g(i,t,d)).length=0?t.match(/\s?lang(?:uage)?-(\w+)/)[1]:"",c=a(o)||u;return n.createElement(n.Fragment,null,n.createElement("code",{className:["rdmd-code","lang-".concat(c)].join(" "),"data-lang":c,name:s,suppressHydrationWarning:!0},n.createElement(l,{className:"fa",code:r[0]}),i?i(r[0],c,{tokenizeVariables:!0}):r[0]))}l.propTypes={className:o.string,code:o.string,rootClass:o.string},u.propTypes={children:o.arrayOf(o.string).isRequired,className:o.string,lang:o.string,meta:o.string},u.defaultProps={className:"",lang:"",meta:""},e.exports=function(e){return e.attributes.code=["className","lang","meta","value"],u}},function(e,t,r){"use strict";e.exports=r(331)},function(e,t,r){!function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function r(e,t){if(!e)return/(?:)/;var r="";return e instanceof RegExp?(e.ignoreCase&&(r="i"),e=e.source):e=String(e),new RegExp((!1===t?"":"^")+"(?:"+e+")",r)}function o(e,n){(e.next||e.push)&&t(n,e.next||e.push),this.regex=r(e.regex),this.token=function(e){if(!e)return null;if(e.apply)return e;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],r=0;r2&&c.token&&"string"!=typeof c.token){n.pending=[];for(var d=2;d