@sme.up/ketchup 11.0.0-SNAPSHOT-20241118135127 → 11.0.0-SNAPSHOT-20241118143411
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{f-cell-2c5c4b63.js → f-cell-99c84f1c.js} +4 -4
- package/dist/cjs/{f-cell-2c5c4b63.js.map → f-cell-99c84f1c.js.map} +1 -1
- package/dist/cjs/{f-chip-c76e0caa.js → f-chip-29e9258a.js} +2 -2
- package/dist/cjs/{f-chip-c76e0caa.js.map → f-chip-29e9258a.js.map} +1 -1
- package/dist/cjs/{f-paginator-utils-e30b6e63.js → f-paginator-utils-af69bd51.js} +2 -2
- package/dist/cjs/{f-paginator-utils-e30b6e63.js.map → f-paginator-utils-af69bd51.js.map} +1 -1
- package/dist/cjs/{f-text-field-41132ecd.js → f-text-field-4226081f.js} +2 -2
- package/dist/cjs/{f-text-field-41132ecd.js.map → f-text-field-4226081f.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js +6 -6
- package/dist/cjs/kup-box.cjs.entry.js +6 -6
- package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +4 -4
- package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
- package/dist/cjs/{kup-data-table-helper-f228f568.js → kup-data-table-helper-00427a69.js} +2 -2
- package/dist/cjs/{kup-data-table-helper-f228f568.js.map → kup-data-table-helper-00427a69.js.map} +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-htm.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-input-panel.cjs.entry.js +4 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
- package/dist/cjs/{kup-manager-77611451.js → kup-manager-fe741ac9.js} +2 -2
- package/dist/cjs/{kup-manager-77611451.js.map → kup-manager-fe741ac9.js.map} +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/kup-txt.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography.cjs.entry.js +1 -1
- package/dist/components/kup-manager.js +1 -1
- package/dist/components/kup-manager.js.map +1 -1
- package/dist/esm/{f-cell-ed323876.js → f-cell-84b76695.js} +4 -4
- package/dist/esm/{f-cell-ed323876.js.map → f-cell-84b76695.js.map} +1 -1
- package/dist/esm/{f-chip-493f6e72.js → f-chip-cd564624.js} +2 -2
- package/dist/esm/{f-chip-493f6e72.js.map → f-chip-cd564624.js.map} +1 -1
- package/dist/esm/{f-paginator-utils-45b88cb0.js → f-paginator-utils-7fd2bb01.js} +2 -2
- package/dist/esm/{f-paginator-utils-45b88cb0.js.map → f-paginator-utils-7fd2bb01.js.map} +1 -1
- package/dist/esm/{f-text-field-234a66b4.js → f-text-field-66b6f8a6.js} +2 -2
- package/dist/esm/{f-text-field-234a66b4.js.map → f-text-field-66b6f8a6.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kup-accordion.entry.js +1 -1
- package/dist/esm/kup-activity-timeline.entry.js +2 -2
- package/dist/esm/kup-autocomplete_28.entry.js +6 -6
- package/dist/esm/kup-box.entry.js +6 -6
- package/dist/esm/kup-calendar.entry.js +2 -2
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +4 -4
- package/dist/esm/kup-dashboard.entry.js +2 -2
- package/dist/esm/{kup-data-table-helper-dc9ece8a.js → kup-data-table-helper-7807c3bc.js} +2 -2
- package/dist/esm/{kup-data-table-helper-dc9ece8a.js.map → kup-data-table-helper-7807c3bc.js.map} +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +1 -1
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-htm.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +4 -4
- package/dist/esm/kup-input-panel.entry.js +4 -4
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-0f056eae.js → kup-manager-e6854c15.js} +2 -2
- package/dist/esm/{kup-manager-0f056eae.js.map → kup-manager-e6854c15.js.map} +1 -1
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-pdf.entry.js +1 -1
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +1 -1
- package/dist/esm/kup-txt.entry.js +1 -1
- package/dist/esm/kup-typography-list.entry.js +1 -1
- package/dist/esm/kup-typography.entry.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-f8982626.entry.js → p-00696d0b.entry.js} +2 -2
- package/dist/ketchup/{p-4e4f3c12.entry.js → p-02d83afd.entry.js} +2 -2
- package/dist/ketchup/{p-28a98448.entry.js → p-08a8d90e.entry.js} +2 -2
- package/dist/ketchup/{p-e7ba0039.entry.js → p-0f194063.entry.js} +2 -2
- package/dist/ketchup/{p-e5b89e72.entry.js → p-0f8be7d2.entry.js} +2 -2
- package/dist/ketchup/{p-941633cf.entry.js → p-10cea33b.entry.js} +2 -2
- package/dist/ketchup/{p-07101843.entry.js → p-1b23ecb9.entry.js} +2 -2
- package/dist/ketchup/{p-8b1f6d22.js → p-1f0bd3bc.js} +2 -2
- package/dist/ketchup/{p-8666c112.entry.js → p-1fd1da4a.entry.js} +2 -2
- package/dist/ketchup/{p-e4e7cb0a.entry.js → p-36f1f1f2.entry.js} +2 -2
- package/dist/ketchup/{p-18c2474c.entry.js → p-3a0e74d7.entry.js} +2 -2
- package/dist/ketchup/{p-e177845a.entry.js → p-4e8485bb.entry.js} +2 -2
- package/dist/ketchup/{p-4ac7f525.js → p-5403ec7d.js} +2 -2
- package/dist/ketchup/{p-6722ad32.entry.js → p-56ebec9a.entry.js} +2 -2
- package/dist/ketchup/{p-6a7aad42.entry.js → p-582719d0.entry.js} +2 -2
- package/dist/ketchup/{p-d88f2604.entry.js → p-6b510eea.entry.js} +2 -2
- package/dist/ketchup/{p-73b94f37.entry.js → p-7fd94ab9.entry.js} +2 -2
- package/dist/ketchup/{p-7f6331ba.entry.js → p-822300c4.entry.js} +2 -2
- package/dist/ketchup/{p-98d28887.entry.js → p-9466c7b2.entry.js} +2 -2
- package/dist/ketchup/{p-7c151495.entry.js → p-9b45f18d.entry.js} +2 -2
- package/dist/ketchup/{p-43d46909.entry.js → p-b2a20978.entry.js} +2 -2
- package/dist/ketchup/{p-2215ccf4.entry.js → p-c0aed6b3.entry.js} +2 -2
- package/dist/ketchup/{p-27163fd2.js → p-c398ed83.js} +2 -2
- package/dist/ketchup/{p-f00d7dff.js → p-c618c6fd.js} +2 -2
- package/dist/ketchup/p-c71c14ea.entry.js +2 -0
- package/dist/ketchup/{p-c88e7d76.entry.js.map → p-c71c14ea.entry.js.map} +1 -1
- package/dist/ketchup/{p-525b168f.entry.js → p-cda00e9e.entry.js} +2 -2
- package/dist/ketchup/{p-996ba080.entry.js → p-d073f545.entry.js} +2 -2
- package/dist/ketchup/{p-fb533065.entry.js → p-d26f1d41.entry.js} +2 -2
- package/dist/ketchup/{p-99171aba.js → p-da7ae266.js} +2 -2
- package/dist/ketchup/{p-013a555c.entry.js → p-e1c69d06.entry.js} +2 -2
- package/dist/ketchup/{p-15f54117.js → p-e1cf074e.js} +4 -4
- package/dist/ketchup/p-e1cf074e.js.map +1 -0
- package/dist/ketchup/{p-b2699d88.entry.js → p-ee8fc062.entry.js} +2 -2
- package/dist/ketchup/{p-5b8896da.entry.js → p-f1d7efa6.entry.js} +2 -2
- package/dist/ketchup/{p-dc8e1959.entry.js → p-f9e43ad1.entry.js} +2 -2
- package/dist/ketchup/{p-12c06de2.entry.js → p-fcce8e0d.entry.js} +2 -2
- package/dist/ketchup/{p-b896d5c4.entry.js → p-ff6a7fca.entry.js} +2 -2
- package/package.json +1 -1
- package/dist/ketchup/p-15f54117.js.map +0 -1
- package/dist/ketchup/p-c88e7d76.entry.js +0 -2
- /package/dist/ketchup/{p-f8982626.entry.js.map → p-00696d0b.entry.js.map} +0 -0
- /package/dist/ketchup/{p-4e4f3c12.entry.js.map → p-02d83afd.entry.js.map} +0 -0
- /package/dist/ketchup/{p-28a98448.entry.js.map → p-08a8d90e.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e7ba0039.entry.js.map → p-0f194063.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e5b89e72.entry.js.map → p-0f8be7d2.entry.js.map} +0 -0
- /package/dist/ketchup/{p-941633cf.entry.js.map → p-10cea33b.entry.js.map} +0 -0
- /package/dist/ketchup/{p-07101843.entry.js.map → p-1b23ecb9.entry.js.map} +0 -0
- /package/dist/ketchup/{p-8b1f6d22.js.map → p-1f0bd3bc.js.map} +0 -0
- /package/dist/ketchup/{p-8666c112.entry.js.map → p-1fd1da4a.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e4e7cb0a.entry.js.map → p-36f1f1f2.entry.js.map} +0 -0
- /package/dist/ketchup/{p-18c2474c.entry.js.map → p-3a0e74d7.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e177845a.entry.js.map → p-4e8485bb.entry.js.map} +0 -0
- /package/dist/ketchup/{p-4ac7f525.js.map → p-5403ec7d.js.map} +0 -0
- /package/dist/ketchup/{p-6722ad32.entry.js.map → p-56ebec9a.entry.js.map} +0 -0
- /package/dist/ketchup/{p-6a7aad42.entry.js.map → p-582719d0.entry.js.map} +0 -0
- /package/dist/ketchup/{p-d88f2604.entry.js.map → p-6b510eea.entry.js.map} +0 -0
- /package/dist/ketchup/{p-73b94f37.entry.js.map → p-7fd94ab9.entry.js.map} +0 -0
- /package/dist/ketchup/{p-7f6331ba.entry.js.map → p-822300c4.entry.js.map} +0 -0
- /package/dist/ketchup/{p-98d28887.entry.js.map → p-9466c7b2.entry.js.map} +0 -0
- /package/dist/ketchup/{p-7c151495.entry.js.map → p-9b45f18d.entry.js.map} +0 -0
- /package/dist/ketchup/{p-43d46909.entry.js.map → p-b2a20978.entry.js.map} +0 -0
- /package/dist/ketchup/{p-2215ccf4.entry.js.map → p-c0aed6b3.entry.js.map} +0 -0
- /package/dist/ketchup/{p-27163fd2.js.map → p-c398ed83.js.map} +0 -0
- /package/dist/ketchup/{p-f00d7dff.js.map → p-c618c6fd.js.map} +0 -0
- /package/dist/ketchup/{p-525b168f.entry.js.map → p-cda00e9e.entry.js.map} +0 -0
- /package/dist/ketchup/{p-996ba080.entry.js.map → p-d073f545.entry.js.map} +0 -0
- /package/dist/ketchup/{p-fb533065.entry.js.map → p-d26f1d41.entry.js.map} +0 -0
- /package/dist/ketchup/{p-99171aba.js.map → p-da7ae266.js.map} +0 -0
- /package/dist/ketchup/{p-013a555c.entry.js.map → p-e1c69d06.entry.js.map} +0 -0
- /package/dist/ketchup/{p-b2699d88.entry.js.map → p-ee8fc062.entry.js.map} +0 -0
- /package/dist/ketchup/{p-5b8896da.entry.js.map → p-f1d7efa6.entry.js.map} +0 -0
- /package/dist/ketchup/{p-dc8e1959.entry.js.map → p-f9e43ad1.entry.js.map} +0 -0
- /package/dist/ketchup/{p-12c06de2.entry.js.map → p-fcce8e0d.entry.js.map} +0 -0
- /package/dist/ketchup/{p-b896d5c4.entry.js.map → p-ff6a7fca.entry.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as r,f as n,h as i,H as e,d as a}from"./p-d7c15b0e.js";import{k as u,g as o,s}from"./p-15f54117.js";import{c as f}from"./p-635bb4b3.js";import{c,g as l}from"./p-029c7cbe.js";var h={exports:{}};var v={exports:{}};(function(t,r){(function(r,n){t.exports=n()})(c,(function(){var t=navigator.userAgent;var r=navigator.platform;var n=/gecko\/\d/i.test(t);var i=/MSIE \d/.test(t);var e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t);var a=/Edge\/(\d+)/.exec(t);var u=i||e||a;var o=u&&(i?document.documentMode||6:+(a||e)[1]);var s=!a&&/WebKit\//.test(t);var f=s&&/Qt\/\d+\.\d+/.test(t);var c=!a&&/Chrome\/(\d+)/.exec(t);var l=c&&+c[1];var h=/Opera\//.test(t);var v=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t);var p=/PhantomJS/.test(t);var g=v&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2);var b=/Android/.test(t);var m=g||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t);var w=g||/Mac/.test(r);var y=/\bCrOS\b/.test(t);var k=/win/i.test(r);var T=h&&t.match(/Version\/(\d*\.\d*)/);if(T){T=Number(T[1])}if(T&&T>=15){h=false;s=true}var A=w&&(f||h&&(T==null||T<12.11));var E=n||u&&o>=9;function L(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var x=function(t,r){var n=t.className;var i=L(r).exec(n);if(i){var e=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(e?i[1]+e:"")}};function C(t){for(var r=t.childNodes.length;r>0;--r){t.removeChild(t.firstChild)}return t}function D(t,r){return C(t).appendChild(r)}function O(t,r,n,i){var e=document.createElement(t);if(n){e.className=n}if(i){e.style.cssText=i}if(typeof r=="string"){e.appendChild(document.createTextNode(r))}else if(r){for(var a=0;a<r.length;++a){e.appendChild(r[a])}}return e}function S(t,r,n,i){var e=O(t,r,n,i);e.setAttribute("role","presentation");return e}var N;if(document.createRange){N=function(t,r,n,i){var e=document.createRange();e.setEnd(i||t,n);e.setStart(t,r);return e}}else{N=function(t,r,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(t){return i}i.collapse(true);i.moveEnd("character",n);i.moveStart("character",r);return i}}function M(t,r){if(r.nodeType==3){r=r.parentNode}if(t.contains){return t.contains(r)}do{if(r.nodeType==11){r=r.host}if(r==t){return true}}while(r=r.parentNode)}function R(t){var r=t.ownerDocument||t;var n;try{n=t.activeElement}catch(t){n=r.body||null}while(n&&n.shadowRoot&&n.shadowRoot.activeElement){n=n.shadowRoot.activeElement}return n}function B(t,r){var n=t.className;if(!L(r).test(n)){t.className+=(n?" ":"")+r}}function I(t,r){var n=t.split(" ");for(var i=0;i<n.length;i++){if(n[i]&&!L(n[i]).test(r)){r+=" "+n[i]}}return r}var q=function(t){t.select()};if(g){q=function(t){t.selectionStart=0;t.selectionEnd=t.value.length}}else if(u){q=function(t){try{t.select()}catch(t){}}}function F(t){return t.display.wrapper.ownerDocument}function P(t){return j(t.display.wrapper)}function j(t){return t.getRootNode?t.getRootNode():t.ownerDocument}function _(t){return F(t).defaultView}function U(t){var r=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,r)}}function H(t,r,n){if(!r){r={}}for(var i in t){if(t.hasOwnProperty(i)&&(n!==false||!r.hasOwnProperty(i))){r[i]=t[i]}}return r}function z(t,r,n,i,e){if(r==null){r=t.search(/[^\s\u00a0]/);if(r==-1){r=t.length}}for(var a=i||0,u=e||0;;){var o=t.indexOf("\t",a);if(o<0||o>=r){return u+(r-a)}u+=o-a;u+=n-u%n;a=o+1}}var V=function(){this.id=null;this.f=null;this.time=0;this.handler=U(this.onTimeout,this)};V.prototype.onTimeout=function(t){t.id=0;if(t.time<=+new Date){t.f()}else{setTimeout(t.handler,t.time-+new Date)}};V.prototype.set=function(t,r){this.f=r;var n=+new Date+t;if(!this.id||n<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,t);this.time=n}};function $(t,r){for(var n=0;n<t.length;++n){if(t[n]==r){return n}}return-1}var G=50;var W={toString:function(){return"CodeMirror.Pass"}};var Z={scroll:false},K={origin:"*mouse"},Y={origin:"+move"};function Q(t,r,n){for(var i=0,e=0;;){var a=t.indexOf("\t",i);if(a==-1){a=t.length}var u=a-i;if(a==t.length||e+u>=r){return i+Math.min(u,r-e)}e+=a-i;e+=n-e%n;i=a+1;if(e>=r){return i}}}var X=[""];function J(t){while(X.length<=t){X.push(tt(X)+" ")}return X[t]}function tt(t){return t[t.length-1]}function rt(t,r){var n=[];for(var i=0;i<t.length;i++){n[i]=r(t[i],i)}return n}function nt(t,r,n){var i=0,e=n(r);while(i<t.length&&n(t[i])<=e){i++}t.splice(i,0,r)}function it(){}function et(t,r){var n;if(Object.create){n=Object.create(t)}else{it.prototype=t;n=new it}if(r){H(r,n)}return n}var at=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ut(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||at.test(t))}function ot(t,r){if(!r){return ut(t)}if(r.source.indexOf("\\w")>-1&&ut(t)){return true}return r.test(t)}function st(t){for(var r in t){if(t.hasOwnProperty(r)&&t[r]){return false}}return true}var ft=/[\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 ct(t){return t.charCodeAt(0)>=768&&ft.test(t)}function lt(t,r,n){while((n<0?r>0:r<t.length)&&ct(t.charAt(r))){r+=n}return r}function ht(t,r,n){var i=r>n?-1:1;for(;;){if(r==n){return r}var e=(r+n)/2,a=i<0?Math.ceil(e):Math.floor(e);if(a==r){return t(a)?r:n}if(t(a)){n=a}else{r=a+i}}}function vt(t,r,n,i){if(!t){return i(r,n,"ltr",0)}var e=false;for(var a=0;a<t.length;++a){var u=t[a];if(u.from<n&&u.to>r||r==n&&u.to==r){i(Math.max(u.from,r),Math.min(u.to,n),u.level==1?"rtl":"ltr",a);e=true}}if(!e){i(r,n,"ltr")}}var dt=null;function pt(t,r,n){var i;dt=null;for(var e=0;e<t.length;++e){var a=t[e];if(a.from<r&&a.to>r){return e}if(a.to==r){if(a.from!=a.to&&n=="before"){i=e}else{dt=e}}if(a.from==r){if(a.from!=a.to&&n!="before"){i=e}else{dt=e}}}return i!=null?i:dt}var gt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){if(n<=247){return t.charAt(n)}else if(1424<=n&&n<=1524){return"R"}else if(1536<=n&&n<=1785){return r.charAt(n-1536)}else if(1774<=n&&n<=2220){return"r"}else if(8192<=n&&n<=8203){return"w"}else if(n==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var e=/[stwN]/,a=/[LRr]/,u=/[Lb1n]/,o=/[1n]/;function s(t,r,n){this.level=t;this.from=r;this.to=n}return function(t,r){var f=r=="ltr"?"L":"R";if(t.length==0||r=="ltr"&&!i.test(t)){return false}var c=t.length,l=[];for(var h=0;h<c;++h){l.push(n(t.charCodeAt(h)))}for(var v=0,d=f;v<c;++v){var p=l[v];if(p=="m"){l[v]=d}else{d=p}}for(var g=0,b=f;g<c;++g){var m=l[g];if(m=="1"&&b=="r"){l[g]="n"}else if(a.test(m)){b=m;if(m=="r"){l[g]="R"}}}for(var w=1,y=l[0];w<c-1;++w){var k=l[w];if(k=="+"&&y=="1"&&l[w+1]=="1"){l[w]="1"}else if(k==","&&y==l[w+1]&&(y=="1"||y=="n")){l[w]=y}y=k}for(var T=0;T<c;++T){var A=l[T];if(A==","){l[T]="N"}else if(A=="%"){var E=void 0;for(E=T+1;E<c&&l[E]=="%";++E){}var L=T&&l[T-1]=="!"||E<c&&l[E]=="1"?"1":"N";for(var x=T;x<E;++x){l[x]=L}T=E-1}}for(var C=0,D=f;C<c;++C){var O=l[C];if(D=="L"&&O=="1"){l[C]="L"}else if(a.test(O)){D=O}}for(var S=0;S<c;++S){if(e.test(l[S])){var N=void 0;for(N=S+1;N<c&&e.test(l[N]);++N){}var M=(S?l[S-1]:f)=="L";var R=(N<c?l[N]:f)=="L";var B=M==R?M?"L":"R":f;for(var I=S;I<N;++I){l[I]=B}S=N-1}}var q=[],F;for(var P=0;P<c;){if(u.test(l[P])){var j=P;for(++P;P<c&&u.test(l[P]);++P){}q.push(new s(0,j,P))}else{var _=P,U=q.length,H=r=="rtl"?1:0;for(++P;P<c&&l[P]!="L";++P){}for(var z=_;z<P;){if(o.test(l[z])){if(_<z){q.splice(U,0,new s(1,_,z));U+=H}var V=z;for(++z;z<P&&o.test(l[z]);++z){}q.splice(U,0,new s(2,V,z));U+=H;_=z}else{++z}}if(_<P){q.splice(U,0,new s(1,_,P))}}}if(r=="ltr"){if(q[0].level==1&&(F=t.match(/^\s+/))){q[0].from=F[0].length;q.unshift(new s(0,0,F[0].length))}if(tt(q).level==1&&(F=t.match(/\s+$/))){tt(q).to-=F[0].length;q.push(new s(0,c-F[0].length,c))}}return r=="rtl"?q.reverse():q}}();function bt(t,r){var n=t.order;if(n==null){n=t.order=gt(t.text,r)}return n}var mt=[];var wt=function(t,r,n){if(t.addEventListener){t.addEventListener(r,n,false)}else if(t.attachEvent){t.attachEvent("on"+r,n)}else{var i=t._handlers||(t._handlers={});i[r]=(i[r]||mt).concat(n)}};function yt(t,r){return t._handlers&&t._handlers[r]||mt}function kt(t,r,n){if(t.removeEventListener){t.removeEventListener(r,n,false)}else if(t.detachEvent){t.detachEvent("on"+r,n)}else{var i=t._handlers,e=i&&i[r];if(e){var a=$(e,n);if(a>-1){i[r]=e.slice(0,a).concat(e.slice(a+1))}}}}function Tt(t,r){var n=yt(t,r);if(!n.length){return}var i=Array.prototype.slice.call(arguments,2);for(var e=0;e<n.length;++e){n[e].apply(null,i)}}function At(t,r,n){if(typeof r=="string"){r={type:r,preventDefault:function(){this.defaultPrevented=true}}}Tt(t,n||r.type,t,r);return Ot(r)||r.codemirrorIgnore}function Et(t){var r=t._handlers&&t._handlers.cursorActivity;if(!r){return}var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]);for(var i=0;i<r.length;++i){if($(n,r[i])==-1){n.push(r[i])}}}function Lt(t,r){return yt(t,r).length>0}function xt(t){t.prototype.on=function(t,r){wt(this,t,r)};t.prototype.off=function(t,r){kt(this,t,r)}}function Ct(t){if(t.preventDefault){t.preventDefault()}else{t.returnValue=false}}function Dt(t){if(t.stopPropagation){t.stopPropagation()}else{t.cancelBubble=true}}function Ot(t){return t.defaultPrevented!=null?t.defaultPrevented:t.returnValue==false}function St(t){Ct(t);Dt(t)}function Nt(t){return t.target||t.srcElement}function Mt(t){var r=t.which;if(r==null){if(t.button&1){r=1}else if(t.button&2){r=3}else if(t.button&4){r=2}}if(w&&t.ctrlKey&&r==1){r=3}return r}var Rt=function(){if(u&&o<9){return false}var t=O("div");return"draggable"in t||"dragDrop"in t}();var Bt;function It(t){if(Bt==null){var r=O("span","");D(t,O("span",[r,document.createTextNode("x")]));if(t.firstChild.offsetHeight!=0){Bt=r.offsetWidth<=1&&r.offsetHeight>2&&!(u&&o<8)}}var n=Bt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");n.setAttribute("cm-text","");return n}var qt;function Ft(t){if(qt!=null){return qt}var r=D(t,document.createTextNode("AخA"));var n=N(r,0,1).getBoundingClientRect();var i=N(r,1,2).getBoundingClientRect();C(t);if(!n||n.left==n.right){return false}return qt=i.right-n.right<3}var Pt="\n\nb".split(/\n/).length!=3?function(t){var r=0,n=[],i=t.length;while(r<=i){var e=t.indexOf("\n",r);if(e==-1){e=t.length}var a=t.slice(r,t.charAt(e-1)=="\r"?e-1:e);var u=a.indexOf("\r");if(u!=-1){n.push(a.slice(0,u));r+=u+1}else{n.push(a);r=e+1}}return n}:function(t){return t.split(/\r\n?|\n/)};var jt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return false}}:function(t){var r;try{r=t.ownerDocument.selection.createRange()}catch(t){}if(!r||r.parentElement()!=t){return false}return r.compareEndPoints("StartToEnd",r)!=0};var _t=function(){var t=O("div");if("oncopy"in t){return true}t.setAttribute("oncopy","return;");return typeof t.oncopy=="function"}();var Ut=null;function Ht(t){if(Ut!=null){return Ut}var r=D(t,O("span","x"));var n=r.getBoundingClientRect();var i=N(r,0,1).getBoundingClientRect();return Ut=Math.abs(n.left-i.left)>1}var zt={},Vt={};function $t(t,r){if(arguments.length>2){r.dependencies=Array.prototype.slice.call(arguments,2)}zt[t]=r}function Gt(t,r){Vt[t]=r}function Wt(t){if(typeof t=="string"&&Vt.hasOwnProperty(t)){t=Vt[t]}else if(t&&typeof t.name=="string"&&Vt.hasOwnProperty(t.name)){var r=Vt[t.name];if(typeof r=="string"){r={name:r}}t=et(r,t);t.name=r.name}else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t)){return Wt("application/xml")}else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(t)){return Wt("application/json")}if(typeof t=="string"){return{name:t}}else{return t||{name:"null"}}}function Zt(t,r){r=Wt(r);var n=zt[r.name];if(!n){return Zt(t,"text/plain")}var i=n(t,r);if(Kt.hasOwnProperty(r.name)){var e=Kt[r.name];for(var a in e){if(!e.hasOwnProperty(a)){continue}if(i.hasOwnProperty(a)){i["_"+a]=i[a]}i[a]=e[a]}}i.name=r.name;if(r.helperType){i.helperType=r.helperType}if(r.modeProps){for(var u in r.modeProps){i[u]=r.modeProps[u]}}return i}var Kt={};function Yt(t,r){var n=Kt.hasOwnProperty(t)?Kt[t]:Kt[t]={};H(r,n)}function Qt(t,r){if(r===true){return r}if(t.copyState){return t.copyState(r)}var n={};for(var i in r){var e=r[i];if(e instanceof Array){e=e.concat([])}n[i]=e}return n}function Xt(t,r){var n;while(t.innerMode){n=t.innerMode(r);if(!n||n.mode==t){break}r=n.state;t=n.mode}return n||{mode:t,state:r}}function Jt(t,r,n){return t.startState?t.startState(r,n):true}var tr=function(t,r,n){this.pos=this.start=0;this.string=t;this.tabSize=r||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=n};tr.prototype.eol=function(){return this.pos>=this.string.length};tr.prototype.sol=function(){return this.pos==this.lineStart};tr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};tr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};tr.prototype.eat=function(t){var r=this.string.charAt(this.pos);var n;if(typeof t=="string"){n=r==t}else{n=r&&(t.test?t.test(r):t(r))}if(n){++this.pos;return r}};tr.prototype.eatWhile=function(t){var r=this.pos;while(this.eat(t)){}return this.pos>r};tr.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>t};tr.prototype.skipToEnd=function(){this.pos=this.string.length};tr.prototype.skipTo=function(t){var r=this.string.indexOf(t,this.pos);if(r>-1){this.pos=r;return true}};tr.prototype.backUp=function(t){this.pos-=t};tr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)};tr.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)};tr.prototype.match=function(t,r,n){if(typeof t=="string"){var i=function(t){return n?t.toLowerCase():t};var e=this.string.substr(this.pos,t.length);if(i(e)==i(t)){if(r!==false){this.pos+=t.length}return true}}else{var a=this.string.slice(this.pos).match(t);if(a&&a.index>0){return null}if(a&&r!==false){this.pos+=a[0].length}return a}};tr.prototype.current=function(){return this.string.slice(this.start,this.pos)};tr.prototype.hideFirstChars=function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}};tr.prototype.lookAhead=function(t){var r=this.lineOracle;return r&&r.lookAhead(t)};tr.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};function rr(t,r){r-=t.first;if(r<0||r>=t.size){throw new Error("There is no line "+(r+t.first)+" in the document.")}var n=t;while(!n.lines){for(var i=0;;++i){var e=n.children[i],a=e.chunkSize();if(r<a){n=e;break}r-=a}}return n.lines[r]}function nr(t,r,n){var i=[],e=r.line;t.iter(r.line,n.line+1,(function(t){var a=t.text;if(e==n.line){a=a.slice(0,n.ch)}if(e==r.line){a=a.slice(r.ch)}i.push(a);++e}));return i}function ir(t,r,n){var i=[];t.iter(r,n,(function(t){i.push(t.text)}));return i}function er(t,r){var n=r-t.height;if(n){for(var i=t;i;i=i.parent){i.height+=n}}}function ar(t){if(t.parent==null){return null}var r=t.parent,n=$(r.lines,t);for(var i=r.parent;i;r=i,i=i.parent){for(var e=0;;++e){if(i.children[e]==r){break}n+=i.children[e].chunkSize()}}return n+r.first}function ur(t,r){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var e=t.children[i],a=e.height;if(r<a){t=e;continue t}r-=a;n+=e.chunkSize()}return n}while(!t.lines);var u=0;for(;u<t.lines.length;++u){var o=t.lines[u],s=o.height;if(r<s){break}r-=s}return n+u}function or(t,r){return r>=t.first&&r<t.first+t.size}function sr(t,r){return String(t.lineNumberFormatter(r+t.firstLineNumber))}function fr(t,r,n){if(n===void 0)n=null;if(!(this instanceof fr)){return new fr(t,r,n)}this.line=t;this.ch=r;this.sticky=n}function cr(t,r){return t.line-r.line||t.ch-r.ch}function lr(t,r){return t.sticky==r.sticky&&cr(t,r)==0}function hr(t){return fr(t.line,t.ch)}function vr(t,r){return cr(t,r)<0?r:t}function dr(t,r){return cr(t,r)<0?t:r}function pr(t,r){return Math.max(t.first,Math.min(r,t.first+t.size-1))}function gr(t,r){if(r.line<t.first){return fr(t.first,0)}var n=t.first+t.size-1;if(r.line>n){return fr(n,rr(t,n).text.length)}return br(r,rr(t,r.line).text.length)}function br(t,r){var n=t.ch;if(n==null||n>r){return fr(t.line,r)}else if(n<0){return fr(t.line,0)}else{return t}}function mr(t,r){var n=[];for(var i=0;i<r.length;i++){n[i]=gr(t,r[i])}return n}var wr=function(t,r){this.state=t;this.lookAhead=r};var yr=function(t,r,n,i){this.state=r;this.doc=t;this.line=n;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};yr.prototype.lookAhead=function(t){var r=this.doc.getLine(this.line+t);if(r!=null&&t>this.maxLookAhead){this.maxLookAhead=t}return r};yr.prototype.baseToken=function(t){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=t){this.baseTokenPos+=2}var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}};yr.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};yr.fromSaved=function(t,r,n){if(r instanceof wr){return new yr(t,Qt(t.mode,r.state),n,r.lookAhead)}else{return new yr(t,Qt(t.mode,r),n)}};yr.prototype.save=function(t){var r=t!==false?Qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wr(r,this.maxLookAhead):r};function kr(t,r,n,i){var e=[t.state.modeGen],a={};Sr(t,r.text,t.doc.mode,n,(function(t,r){return e.push(t,r)}),a,i);var u=n.state;var o=function(i){n.baseTokens=e;var o=t.state.overlays[i],s=1,f=0;n.state=true;Sr(t,r.text,o.mode,n,(function(t,r){var n=s;while(f<t){var i=e[s];if(i>t){e.splice(s,1,t,e[s+1],i)}s+=2;f=Math.min(t,i)}if(!r){return}if(o.opaque){e.splice(n,s-n,t,"overlay "+r);s=n+2}else{for(;n<s;n+=2){var a=e[n+1];e[n+1]=(a?a+" ":"")+"overlay "+r}}}),a);n.state=u;n.baseTokens=null;n.baseTokenPos=1};for(var s=0;s<t.state.overlays.length;++s)o(s);return{styles:e,classes:a.bgClass||a.textClass?a:null}}function Tr(t,r,n){if(!r.styles||r.styles[0]!=t.state.modeGen){var i=Ar(t,ar(r));var e=r.text.length>t.options.maxHighlightLength&&Qt(t.doc.mode,i.state);var a=kr(t,r,i);if(e){i.state=e}r.stateAfter=i.save(!e);r.styles=a.styles;if(a.classes){r.styleClasses=a.classes}else if(r.styleClasses){r.styleClasses=null}if(n===t.doc.highlightFrontier){t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier)}}return r.styles}function Ar(t,r,n){var i=t.doc,e=t.display;if(!i.mode.startState){return new yr(i,true,r)}var a=Nr(t,r,n);var u=a>i.first&&rr(i,a-1).stateAfter;var o=u?yr.fromSaved(i,u,a):new yr(i,Jt(i.mode),a);i.iter(a,r,(function(n){Er(t,n.text,o);var i=o.line;n.stateAfter=i==r-1||i%5==0||i>=e.viewFrom&&i<e.viewTo?o.save():null;o.nextLine()}));if(n){i.modeFrontier=o.line}return o}function Er(t,r,n,i){var e=t.doc.mode;var a=new tr(r,t.options.tabSize,n);a.start=a.pos=i||0;if(r==""){Lr(e,n.state)}while(!a.eol()){xr(e,a,n.state);a.start=a.pos}}function Lr(t,r){if(t.blankLine){return t.blankLine(r)}if(!t.innerMode){return}var n=Xt(t,r);if(n.mode.blankLine){return n.mode.blankLine(n.state)}}function xr(t,r,n,i){for(var e=0;e<10;e++){if(i){i[0]=Xt(t,n).mode}var a=t.token(r,n);if(r.pos>r.start){return a}}throw new Error("Mode "+t.name+" failed to advance stream.")}var Cr=function(t,r,n){this.start=t.start;this.end=t.pos;this.string=t.current();this.type=r||null;this.state=n};function Dr(t,r,n,i){var e=t.doc,a=e.mode,u;r=gr(e,r);var o=rr(e,r.line),s=Ar(t,r.line,n);var f=new tr(o.text,t.options.tabSize,s),c;if(i){c=[]}while((i||f.pos<r.ch)&&!f.eol()){f.start=f.pos;u=xr(a,f,s.state);if(i){c.push(new Cr(f,u,Qt(e.mode,s.state)))}}return i?c:new Cr(f,u,s.state)}function Or(t,r){if(t){for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n){break}t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";if(r[i]==null){r[i]=n[2]}else if(!new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(r[i])){r[i]+=" "+n[2]}}}return t}function Sr(t,r,n,i,e,a,u){var o=n.flattenSpans;if(o==null){o=t.options.flattenSpans}var s=0,f=null;var c=new tr(r,t.options.tabSize,i),l;var h=t.options.addModeClass&&[null];if(r==""){Or(Lr(n,i.state),a)}while(!c.eol()){if(c.pos>t.options.maxHighlightLength){o=false;if(u){Er(t,r,i,c.pos)}c.pos=r.length;l=null}else{l=Or(xr(n,c,i.state,h),a)}if(h){var v=h[0].name;if(v){l="m-"+(l?v+" "+l:v)}}if(!o||f!=l){while(s<c.start){s=Math.min(c.start,s+5e3);e(s,f)}f=l}c.start=c.pos}while(s<c.pos){var d=Math.min(c.pos,s+5e3);e(d,f);s=d}}function Nr(t,r,n){var i,e,a=t.doc;var u=n?-1:r-(t.doc.mode.innerMode?1e3:100);for(var o=r;o>u;--o){if(o<=a.first){return a.first}var s=rr(a,o-1),f=s.stateAfter;if(f&&(!n||o+(f instanceof wr?f.lookAhead:0)<=a.modeFrontier)){return o}var c=z(s.text,null,t.options.tabSize);if(e==null||i>c){e=o-1;i=c}}return e}function Mr(t,r){t.modeFrontier=Math.min(t.modeFrontier,r);if(t.highlightFrontier<r-10){return}var n=t.first;for(var i=r-1;i>n;i--){var e=rr(t,i).stateAfter;if(e&&(!(e instanceof wr)||i+e.lookAhead<r)){n=i+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}var Rr=false,Br=false;function Ir(){Rr=true}function qr(){Br=true}function Fr(t,r,n){this.marker=t;this.from=r;this.to=n}function Pr(t,r){if(t){for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==r){return i}}}}function jr(t,r){var n;for(var i=0;i<t.length;++i){if(t[i]!=r){(n||(n=[])).push(t[i])}}return n}function _r(t,r,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));if(i&&t.markedSpans&&i.has(t.markedSpans)){t.markedSpans.push(r)}else{t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r];if(i){i.add(t.markedSpans)}}r.marker.attachLine(t)}function Ur(t,r,n){var i;if(t){for(var e=0;e<t.length;++e){var a=t[e],u=a.marker;var o=a.from==null||(u.inclusiveLeft?a.from<=r:a.from<r);if(o||a.from==r&&u.type=="bookmark"&&(!n||!a.marker.insertLeft)){var s=a.to==null||(u.inclusiveRight?a.to>=r:a.to>r);(i||(i=[])).push(new Fr(u,a.from,s?null:a.to))}}}return i}function Hr(t,r,n){var i;if(t){for(var e=0;e<t.length;++e){var a=t[e],u=a.marker;var o=a.to==null||(u.inclusiveRight?a.to>=r:a.to>r);if(o||a.from==r&&u.type=="bookmark"&&(!n||a.marker.insertLeft)){var s=a.from==null||(u.inclusiveLeft?a.from<=r:a.from<r);(i||(i=[])).push(new Fr(u,s?null:a.from-r,a.to==null?null:a.to-r))}}}return i}function zr(t,r){if(r.full){return null}var n=or(t,r.from.line)&&rr(t,r.from.line).markedSpans;var i=or(t,r.to.line)&&rr(t,r.to.line).markedSpans;if(!n&&!i){return null}var e=r.from.ch,a=r.to.ch,u=cr(r.from,r.to)==0;var o=Ur(n,e,u);var s=Hr(i,a,u);var f=r.text.length==1,c=tt(r.text).length+(f?e:0);if(o){for(var l=0;l<o.length;++l){var h=o[l];if(h.to==null){var v=Pr(s,h.marker);if(!v){h.to=e}else if(f){h.to=v.to==null?null:v.to+c}}}}if(s){for(var d=0;d<s.length;++d){var p=s[d];if(p.to!=null){p.to+=c}if(p.from==null){var g=Pr(o,p.marker);if(!g){p.from=c;if(f){(o||(o=[])).push(p)}}}else{p.from+=c;if(f){(o||(o=[])).push(p)}}}}if(o){o=Vr(o)}if(s&&s!=o){s=Vr(s)}var b=[o];if(!f){var m=r.text.length-2,w;if(m>0&&o){for(var y=0;y<o.length;++y){if(o[y].to==null){(w||(w=[])).push(new Fr(o[y].marker,null,null))}}}for(var k=0;k<m;++k){b.push(w)}b.push(s)}return b}function Vr(t){for(var r=0;r<t.length;++r){var n=t[r];if(n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==false){t.splice(r--,1)}}if(!t.length){return null}return t}function $r(t,r,n){var i=null;t.iter(r.line,n.line+1,(function(t){if(t.markedSpans){for(var r=0;r<t.markedSpans.length;++r){var n=t.markedSpans[r].marker;if(n.readOnly&&(!i||$(i,n)==-1)){(i||(i=[])).push(n)}}}}));if(!i){return null}var e=[{from:r,to:n}];for(var a=0;a<i.length;++a){var u=i[a],o=u.find(0);for(var s=0;s<e.length;++s){var f=e[s];if(cr(f.to,o.from)<0||cr(f.from,o.to)>0){continue}var c=[s,1],l=cr(f.from,o.from),h=cr(f.to,o.to);if(l<0||!u.inclusiveLeft&&!l){c.push({from:f.from,to:o.from})}if(h>0||!u.inclusiveRight&&!h){c.push({from:o.to,to:f.to})}e.splice.apply(e,c);s+=c.length-3}}return e}function Gr(t){var r=t.markedSpans;if(!r){return}for(var n=0;n<r.length;++n){r[n].marker.detachLine(t)}t.markedSpans=null}function Wr(t,r){if(!r){return}for(var n=0;n<r.length;++n){r[n].marker.attachLine(t)}t.markedSpans=r}function Zr(t){return t.inclusiveLeft?-1:0}function Kr(t){return t.inclusiveRight?1:0}function Yr(t,r){var n=t.lines.length-r.lines.length;if(n!=0){return n}var i=t.find(),e=r.find();var a=cr(i.from,e.from)||Zr(t)-Zr(r);if(a){return-a}var u=cr(i.to,e.to)||Kr(t)-Kr(r);if(u){return u}return r.id-t.id}function Qr(t,r){var n=Br&&t.markedSpans,i;if(n){for(var e=void 0,a=0;a<n.length;++a){e=n[a];if(e.marker.collapsed&&(r?e.from:e.to)==null&&(!i||Yr(i,e.marker)<0)){i=e.marker}}}return i}function Xr(t){return Qr(t,true)}function Jr(t){return Qr(t,false)}function tn(t,r){var n=Br&&t.markedSpans,i;if(n){for(var e=0;e<n.length;++e){var a=n[e];if(a.marker.collapsed&&(a.from==null||a.from<r)&&(a.to==null||a.to>r)&&(!i||Yr(i,a.marker)<0)){i=a.marker}}}return i}function rn(t,r,n,i,e){var a=rr(t,r);var u=Br&&a.markedSpans;if(u){for(var o=0;o<u.length;++o){var s=u[o];if(!s.marker.collapsed){continue}var f=s.marker.find(0);var c=cr(f.from,n)||Zr(s.marker)-Zr(e);var l=cr(f.to,i)||Kr(s.marker)-Kr(e);if(c>=0&&l<=0||c<=0&&l>=0){continue}if(c<=0&&(s.marker.inclusiveRight&&e.inclusiveLeft?cr(f.to,n)>=0:cr(f.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&e.inclusiveLeft?cr(f.from,i)<=0:cr(f.from,i)<0)){return true}}}}function nn(t){var r;while(r=Xr(t)){t=r.find(-1,true).line}return t}function en(t){var r;while(r=Jr(t)){t=r.find(1,true).line}return t}function an(t){var r,n;while(r=Jr(t)){t=r.find(1,true).line;(n||(n=[])).push(t)}return n}function un(t,r){var n=rr(t,r),i=nn(n);if(n==i){return r}return ar(i)}function on(t,r){if(r>t.lastLine()){return r}var n=rr(t,r),i;if(!sn(t,n)){return r}while(i=Jr(n)){n=i.find(1,true).line}return ar(n)+1}function sn(t,r){var n=Br&&r.markedSpans;if(n){for(var i=void 0,e=0;e<n.length;++e){i=n[e];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&fn(t,r,i)){return true}}}}function fn(t,r,n){if(n.to==null){var i=n.marker.find(1,true);return fn(t,i.line,Pr(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==r.text.length){return true}for(var e=void 0,a=0;a<r.markedSpans.length;++a){e=r.markedSpans[a];if(e.marker.collapsed&&!e.marker.widgetNode&&e.from==n.to&&(e.to==null||e.to!=n.from)&&(e.marker.inclusiveLeft||n.marker.inclusiveRight)&&fn(t,r,e)){return true}}}function cn(t){t=nn(t);var r=0,n=t.parent;for(var i=0;i<n.lines.length;++i){var e=n.lines[i];if(e==t){break}else{r+=e.height}}for(var a=n.parent;a;n=a,a=n.parent){for(var u=0;u<a.children.length;++u){var o=a.children[u];if(o==n){break}else{r+=o.height}}}return r}function ln(t){if(t.height==0){return 0}var r=t.text.length,n,i=t;while(n=Xr(i)){var e=n.find(0,true);i=e.from.line;r+=e.from.ch-e.to.ch}i=t;while(n=Jr(i)){var a=n.find(0,true);r-=i.text.length-a.from.ch;i=a.to.line;r+=i.text.length-a.to.ch}return r}function hn(t){var r=t.display,n=t.doc;r.maxLine=rr(n,n.first);r.maxLineLength=ln(r.maxLine);r.maxLineChanged=true;n.iter((function(t){var n=ln(t);if(n>r.maxLineLength){r.maxLineLength=n;r.maxLine=t}}))}var vn=function(t,r,n){this.text=t;Wr(this,r);this.height=n?n(this):1};vn.prototype.lineNo=function(){return ar(this)};xt(vn);function dn(t,r,n,i){t.text=r;if(t.stateAfter){t.stateAfter=null}if(t.styles){t.styles=null}if(t.order!=null){t.order=null}Gr(t);Wr(t,n);var e=i?i(t):1;if(e!=t.height){er(t,e)}}function pn(t){t.parent=null;Gr(t)}var gn={},bn={};function mn(t,r){if(!t||/^\s*$/.test(t)){return null}var n=r.addModeClass?bn:gn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function wn(t,r){var n=S("span",null,null,s?"padding-right: .1px":null);var i={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:false,splitSpaces:t.getOption("lineWrapping")};r.measure={};for(var e=0;e<=(r.rest?r.rest.length:0);e++){var a=e?r.rest[e-1]:r.line,u=void 0;i.pos=0;i.addToken=kn;if(Ft(t.display.measure)&&(u=bt(a,t.doc.direction))){i.addToken=An(i.addToken,u)}i.map=[];var o=r!=t.display.externalMeasured&&ar(a);Ln(a,i,Tr(t,a,o));if(a.styleClasses){if(a.styleClasses.bgClass){i.bgClass=I(a.styleClasses.bgClass,i.bgClass||"")}if(a.styleClasses.textClass){i.textClass=I(a.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(It(t.display.measure)))}if(e==0){r.measure.map=i.map;r.measure.cache={}}else{(r.measure.maps||(r.measure.maps=[])).push(i.map);(r.measure.caches||(r.measure.caches=[])).push({})}}if(s){var f=i.content.lastChild;if(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}Tt(t,"renderLine",t,r.line,i.pre);if(i.pre.className){i.textClass=I(i.pre.className,i.textClass||"")}return i}function yn(t){var r=O("span","•","cm-invalidchar");r.title="\\u"+t.charCodeAt(0).toString(16);r.setAttribute("aria-label",r.title);return r}function kn(t,r,n,i,e,a,s){if(!r){return}var f=t.splitSpaces?Tn(r,t.trailingSpace):r;var c=t.cm.state.specialChars,l=false;var h;if(!c.test(r)){t.col+=r.length;h=document.createTextNode(f);t.map.push(t.pos,t.pos+r.length,h);if(u&&o<9){l=true}t.pos+=r.length}else{h=document.createDocumentFragment();var v=0;while(true){c.lastIndex=v;var d=c.exec(r);var p=d?d.index-v:r.length-v;if(p){var g=document.createTextNode(f.slice(v,v+p));if(u&&o<9){h.appendChild(O("span",[g]))}else{h.appendChild(g)}t.map.push(t.pos,t.pos+p,g);t.col+=p;t.pos+=p}if(!d){break}v+=p+1;var b=void 0;if(d[0]=="\t"){var m=t.cm.options.tabSize,w=m-t.col%m;b=h.appendChild(O("span",J(w),"cm-tab"));b.setAttribute("role","presentation");b.setAttribute("cm-text","\t");t.col+=w}else if(d[0]=="\r"||d[0]=="\n"){b=h.appendChild(O("span",d[0]=="\r"?"␍":"","cm-invalidchar"));b.setAttribute("cm-text",d[0]);t.col+=1}else{b=t.cm.options.specialCharPlaceholder(d[0]);b.setAttribute("cm-text",d[0]);if(u&&o<9){h.appendChild(O("span",[b]))}else{h.appendChild(b)}t.col+=1}t.map.push(t.pos,t.pos+1,b);t.pos++}}t.trailingSpace=f.charCodeAt(r.length-1)==32;if(n||i||e||l||a||s){var y=n||"";if(i){y+=i}if(e){y+=e}var k=O("span",[h],y,a);if(s){for(var T in s){if(s.hasOwnProperty(T)&&T!="style"&&T!="class"){k.setAttribute(T,s[T])}}}return t.content.appendChild(k)}t.content.appendChild(h)}function Tn(t,r){if(t.length>1&&!/ /.test(t)){return t}var n=r,i="";for(var e=0;e<t.length;e++){var a=t.charAt(e);if(a==" "&&n&&(e==t.length-1||t.charCodeAt(e+1)==32)){a=" "}i+=a;n=a==" "}return i}function An(t,r){return function(n,i,e,a,u,o,s){e=e?e+" cm-force-border":"cm-force-border";var f=n.pos,c=f+i.length;for(;;){var l=void 0;for(var h=0;h<r.length;h++){l=r[h];if(l.to>f&&l.from<=f){break}}if(l.to>=c){return t(n,i,e,a,u,o,s)}t(n,i.slice(0,l.to-f),e,a,null,o,s);a=null;i=i.slice(l.to-f);f=l.to}}}function En(t,r,n,i){var e=!i&&n.widgetNode;if(e){t.map.push(t.pos,t.pos+r,e)}if(!i&&t.cm.display.input.needsContentAttribute){if(!e){e=t.content.appendChild(document.createElement("span"))}e.setAttribute("cm-marker",n.id)}if(e){t.cm.display.input.setUneditable(e);t.content.appendChild(e)}t.pos+=r;t.trailingSpace=false}function Ln(t,r,n){var i=t.markedSpans,e=t.text,a=0;if(!i){for(var u=1;u<n.length;u+=2){r.addToken(r,e.slice(a,a=n[u]),mn(n[u+1],r.cm.options))}return}var o=e.length,s=0,f=1,c="",l,h;var v=0,d,p,g,b,m;for(;;){if(v==s){d=p=g=h="";m=null;b=null;v=Infinity;var w=[],y=void 0;for(var k=0;k<i.length;++k){var T=i[k],A=T.marker;if(A.type=="bookmark"&&T.from==s&&A.widgetNode){w.push(A)}else if(T.from<=s&&(T.to==null||T.to>s||A.collapsed&&T.to==s&&T.from==s)){if(T.to!=null&&T.to!=s&&v>T.to){v=T.to;p=""}if(A.className){d+=" "+A.className}if(A.css){h=(h?h+";":"")+A.css}if(A.startStyle&&T.from==s){g+=" "+A.startStyle}if(A.endStyle&&T.to==v){(y||(y=[])).push(A.endStyle,T.to)}if(A.title){(m||(m={})).title=A.title}if(A.attributes){for(var E in A.attributes){(m||(m={}))[E]=A.attributes[E]}}if(A.collapsed&&(!b||Yr(b.marker,A)<0)){b=T}}else if(T.from>s&&v>T.from){v=T.from}}if(y){for(var L=0;L<y.length;L+=2){if(y[L+1]==v){p+=" "+y[L]}}}if(!b||b.from==s){for(var x=0;x<w.length;++x){En(r,0,w[x])}}if(b&&(b.from||0)==s){En(r,(b.to==null?o+1:b.to)-s,b.marker,b.from==null);if(b.to==null){return}if(b.to==s){b=false}}}if(s>=o){break}var C=Math.min(o,v);while(true){if(c){var D=s+c.length;if(!b){var O=D>C?c.slice(0,C-s):c;r.addToken(r,O,l?l+d:d,g,s+O.length==v?p:"",h,m)}if(D>=C){c=c.slice(C-s);s=C;break}s=D;g=""}c=e.slice(a,a=n[f++]);l=mn(n[f++],r.cm.options)}}}function xn(t,r,n){this.line=r;this.rest=an(r);this.size=this.rest?ar(tt(this.rest))-n+1:1;this.node=this.text=null;this.hidden=sn(t,r)}function Cn(t,r,n){var i=[],e;for(var a=r;a<n;a=e){var u=new xn(t.doc,rr(t.doc,a),a);e=a+u.size;i.push(u)}return i}var Dn=null;function On(t){if(Dn){Dn.ops.push(t)}else{t.ownsGroup=Dn={ops:[t],delayedCallbacks:[]}}}function Sn(t){var r=t.delayedCallbacks,n=0;do{for(;n<r.length;n++){r[n].call(null)}for(var i=0;i<t.ops.length;i++){var e=t.ops[i];if(e.cursorActivityHandlers){while(e.cursorActivityCalled<e.cursorActivityHandlers.length){e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}}}while(n<r.length)}function Nn(t,r){var n=t.ownsGroup;if(!n){return}try{Sn(n)}finally{Dn=null;r(n)}}var Mn=null;function Rn(t,r){var n=yt(t,r);if(!n.length){return}var i=Array.prototype.slice.call(arguments,2),e;if(Dn){e=Dn.delayedCallbacks}else if(Mn){e=Mn}else{e=Mn=[];setTimeout(Bn,0)}var a=function(t){e.push((function(){return n[t].apply(null,i)}))};for(var u=0;u<n.length;++u)a(u)}function Bn(){var t=Mn;Mn=null;for(var r=0;r<t.length;++r){t[r]()}}function In(t,r,n,i){for(var e=0;e<r.changes.length;e++){var a=r.changes[e];if(a=="text"){jn(t,r)}else if(a=="gutter"){Un(t,r,n,i)}else if(a=="class"){_n(t,r)}else if(a=="widget"){Hn(t,r,i)}}r.changes=null}function qn(t){if(t.node==t.text){t.node=O("div",null,null,"position: relative");if(t.text.parentNode){t.text.parentNode.replaceChild(t.node,t.text)}t.node.appendChild(t.text);if(u&&o<8){t.node.style.zIndex=2}}return t.node}function Fn(t,r){var n=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(n){n+=" CodeMirror-linebackground"}if(r.background){if(n){r.background.className=n}else{r.background.parentNode.removeChild(r.background);r.background=null}}else if(n){var i=qn(r);r.background=i.insertBefore(O("div",null,n),i.firstChild);t.display.input.setUneditable(r.background)}}function Pn(t,r){var n=t.display.externalMeasured;if(n&&n.line==r.line){t.display.externalMeasured=null;r.measure=n.measure;return n.built}return wn(t,r)}function jn(t,r){var n=r.text.className;var i=Pn(t,r);if(r.text==r.node){r.node=i.pre}r.text.parentNode.replaceChild(i.pre,r.text);r.text=i.pre;if(i.bgClass!=r.bgClass||i.textClass!=r.textClass){r.bgClass=i.bgClass;r.textClass=i.textClass;_n(t,r)}else if(n){r.text.className=n}}function _n(t,r){Fn(t,r);if(r.line.wrapClass){qn(r).className=r.line.wrapClass}else if(r.node!=r.text){r.node.className=""}var n=r.textClass?r.textClass+" "+(r.line.textClass||""):r.line.textClass;r.text.className=n||""}function Un(t,r,n,i){if(r.gutter){r.node.removeChild(r.gutter);r.gutter=null}if(r.gutterBackground){r.node.removeChild(r.gutterBackground);r.gutterBackground=null}if(r.line.gutterClass){var e=qn(r);r.gutterBackground=O("div",null,"CodeMirror-gutter-background "+r.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");t.display.input.setUneditable(r.gutterBackground);e.insertBefore(r.gutterBackground,r.text)}var a=r.line.gutterMarkers;if(t.options.lineNumbers||a){var u=qn(r);var o=r.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");o.setAttribute("aria-hidden","true");t.display.input.setUneditable(o);u.insertBefore(o,r.text);if(r.line.gutterClass){o.className+=" "+r.line.gutterClass}if(t.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])){r.lineNumber=o.appendChild(O("div",sr(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))}if(a){for(var s=0;s<t.display.gutterSpecs.length;++s){var f=t.display.gutterSpecs[s].className,c=a.hasOwnProperty(f)&&a[f];if(c){o.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[f]+"px; width: "+i.gutterWidth[f]+"px"))}}}}}function Hn(t,r,n){if(r.alignable){r.alignable=null}var i=L("CodeMirror-linewidget");for(var e=r.node.firstChild,a=void 0;e;e=a){a=e.nextSibling;if(i.test(e.className)){r.node.removeChild(e)}}Vn(t,r,n)}function zn(t,r,n,i){var e=Pn(t,r);r.text=r.node=e.pre;if(e.bgClass){r.bgClass=e.bgClass}if(e.textClass){r.textClass=e.textClass}_n(t,r);Un(t,r,n,i);Vn(t,r,i);return r.node}function Vn(t,r,n){$n(t,r.line,r,n,true);if(r.rest){for(var i=0;i<r.rest.length;i++){$n(t,r.rest[i],r,n,false)}}}function $n(t,r,n,i,e){if(!r.widgets){return}var a=qn(n);for(var u=0,o=r.widgets;u<o.length;++u){var s=o[u],f=O("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));if(!s.handleMouseEvents){f.setAttribute("cm-ignore-events","true")}Gn(s,f,n,i);t.display.input.setUneditable(f);if(e&&s.above){a.insertBefore(f,n.gutter||n.text)}else{a.appendChild(f)}Rn(s,"redraw")}}function Gn(t,r,n,i){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(r);var e=i.wrapperWidth;r.style.left=i.fixedPos+"px";if(!t.coverGutter){e-=i.gutterTotalWidth;r.style.paddingLeft=i.gutterTotalWidth+"px"}r.style.width=e+"px"}if(t.coverGutter){r.style.zIndex=5;r.style.position="relative";if(!t.noHScroll){r.style.marginLeft=-i.gutterTotalWidth+"px"}}}function Wn(t){if(t.height!=null){return t.height}var r=t.doc.cm;if(!r){return 0}if(!M(document.body,t.node)){var n="position: relative;";if(t.coverGutter){n+="margin-left: -"+r.display.gutters.offsetWidth+"px;"}if(t.noHScroll){n+="width: "+r.display.wrapper.clientWidth+"px;"}D(r.display.measure,O("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Zn(t,r){for(var n=Nt(r);n!=t.wrapper;n=n.parentNode){if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==t.sizer&&n!=t.mover){return true}}}function Kn(t){return t.lineSpace.offsetTop}function Yn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Qn(t){if(t.cachedPaddingH){return t.cachedPaddingH}var r=D(t.measure,O("pre","x","CodeMirror-line-like"));var n=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle;var i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){t.cachedPaddingH=i}return i}function Xn(t){return G-t.display.nativeBarWidth}function Jn(t){return t.display.scroller.clientWidth-Xn(t)-t.display.barWidth}function ti(t){return t.display.scroller.clientHeight-Xn(t)-t.display.barHeight}function ri(t,r,n){var i=t.options.lineWrapping;var e=i&&Jn(t);if(!r.measure.heights||i&&r.measure.width!=e){var a=r.measure.heights=[];if(i){r.measure.width=e;var u=r.text.firstChild.getClientRects();for(var o=0;o<u.length-1;o++){var s=u[o],f=u[o+1];if(Math.abs(s.bottom-f.bottom)>2){a.push((s.bottom+f.top)/2-n.top)}}}a.push(n.bottom-n.top)}}function ni(t,r,n){if(t.line==r){return{map:t.measure.map,cache:t.measure.cache}}if(t.rest){for(var i=0;i<t.rest.length;i++){if(t.rest[i]==r){return{map:t.measure.maps[i],cache:t.measure.caches[i]}}}for(var e=0;e<t.rest.length;e++){if(ar(t.rest[e])>n){return{map:t.measure.maps[e],cache:t.measure.caches[e],before:true}}}}}function ii(t,r){r=nn(r);var n=ar(r);var i=t.display.externalMeasured=new xn(t.doc,r,n);i.lineN=n;var e=i.built=wn(t,i);i.text=e.pre;D(t.display.lineMeasure,e.pre);return i}function ei(t,r,n,i){return oi(t,ui(t,r),n,i)}function ai(t,r){if(r>=t.display.viewFrom&&r<t.display.viewTo){return t.display.view[_i(t,r)]}var n=t.display.externalMeasured;if(n&&r>=n.lineN&&r<n.lineN+n.size){return n}}function ui(t,r){var n=ar(r);var i=ai(t,n);if(i&&!i.text){i=null}else if(i&&i.changes){In(t,i,n,Ii(t));t.curOp.forceUpdate=true}if(!i){i=ii(t,r)}var e=ni(i,r,n);return{line:r,view:i,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:false}}function oi(t,r,n,i,e){if(r.before){n=-1}var a=n+(i||""),u;if(r.cache.hasOwnProperty(a)){u=r.cache[a]}else{if(!r.rect){r.rect=r.view.text.getBoundingClientRect()}if(!r.hasHeights){ri(t,r.view,r.rect);r.hasHeights=true}u=li(t,r,n,i);if(!u.bogus){r.cache[a]=u}}return{left:u.left,right:u.right,top:e?u.rtop:u.top,bottom:e?u.rbottom:u.bottom}}var si={left:0,right:0,top:0,bottom:0};function fi(t,r,n){var i,e,a,u,o,s;for(var f=0;f<t.length;f+=3){o=t[f];s=t[f+1];if(r<o){e=0;a=1;u="left"}else if(r<s){e=r-o;a=e+1}else if(f==t.length-3||r==s&&t[f+3]>r){a=s-o;e=a-1;if(r>=s){u="right"}}if(e!=null){i=t[f+2];if(o==s&&n==(i.insertLeft?"left":"right")){u=n}if(n=="left"&&e==0){while(f&&t[f-2]==t[f-3]&&t[f-1].insertLeft){i=t[(f-=3)+2];u="left"}}if(n=="right"&&e==s-o){while(f<t.length-3&&t[f+3]==t[f+4]&&!t[f+5].insertLeft){i=t[(f+=3)+2];u="right"}}break}}return{node:i,start:e,end:a,collapse:u,coverStart:o,coverEnd:s}}function ci(t,r){var n=si;if(r=="left"){for(var i=0;i<t.length;i++){if((n=t[i]).left!=n.right){break}}}else{for(var e=t.length-1;e>=0;e--){if((n=t[e]).left!=n.right){break}}}return n}function li(t,r,n,i){var e=fi(r.map,n,i);var a=e.node,s=e.start,f=e.end,c=e.collapse;var l;if(a.nodeType==3){for(var h=0;h<4;h++){while(s&&ct(r.line.text.charAt(e.coverStart+s))){--s}while(e.coverStart+f<e.coverEnd&&ct(r.line.text.charAt(e.coverStart+f))){++f}if(u&&o<9&&s==0&&f==e.coverEnd-e.coverStart){l=a.parentNode.getBoundingClientRect()}else{l=ci(N(a,s,f).getClientRects(),i)}if(l.left||l.right||s==0){break}f=s;s=s-1;c="right"}if(u&&o<11){l=hi(t.display.measure,l)}}else{if(s>0){c=i="right"}var v;if(t.options.lineWrapping&&(v=a.getClientRects()).length>1){l=v[i=="right"?v.length-1:0]}else{l=a.getBoundingClientRect()}}if(u&&o<9&&!s&&(!l||!l.left&&!l.right)){var d=a.parentNode.getClientRects()[0];if(d){l={left:d.left,right:d.left+Bi(t.display),top:d.top,bottom:d.bottom}}else{l=si}}var p=l.top-r.rect.top,g=l.bottom-r.rect.top;var b=(p+g)/2;var m=r.view.measure.heights;var w=0;for(;w<m.length-1;w++){if(b<m[w]){break}}var y=w?m[w-1]:0,k=m[w];var T={left:(c=="right"?l.right:l.left)-r.rect.left,right:(c=="left"?l.left:l.right)-r.rect.left,top:y,bottom:k};if(!l.left&&!l.right){T.bogus=true}if(!t.options.singleCursorHeightPerLine){T.rtop=p;T.rbottom=g}return T}function hi(t,r){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ht(t)){return r}var n=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*n,right:r.right*n,top:r.top*i,bottom:r.bottom*i}}function vi(t){if(t.measure){t.measure.cache={};t.measure.heights=null;if(t.rest){for(var r=0;r<t.rest.length;r++){t.measure.caches[r]={}}}}}function di(t){t.display.externalMeasure=null;C(t.display.lineMeasure);for(var r=0;r<t.display.view.length;r++){vi(t.display.view[r])}}function pi(t){di(t);t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null;if(!t.options.lineWrapping){t.display.maxLineChanged=true}t.display.lineNumChars=null}function gi(t){if(c&&b){return-(t.body.getBoundingClientRect().left-parseInt(getComputedStyle(t.body).marginLeft))}return t.defaultView.pageXOffset||(t.documentElement||t.body).scrollLeft}function bi(t){if(c&&b){return-(t.body.getBoundingClientRect().top-parseInt(getComputedStyle(t.body).marginTop))}return t.defaultView.pageYOffset||(t.documentElement||t.body).scrollTop}function mi(t){var r=nn(t);var n=r.widgets;var i=0;if(n){for(var e=0;e<n.length;++e){if(n[e].above){i+=Wn(n[e])}}}return i}function wi(t,r,n,i,e){if(!e){var a=mi(r);n.top+=a;n.bottom+=a}if(i=="line"){return n}if(!i){i="local"}var u=cn(r);if(i=="local"){u+=Kn(t.display)}else{u-=t.display.viewOffset}if(i=="page"||i=="window"){var o=t.display.lineSpace.getBoundingClientRect();u+=o.top+(i=="window"?0:bi(F(t)));var s=o.left+(i=="window"?0:gi(F(t)));n.left+=s;n.right+=s}n.top+=u;n.bottom+=u;return n}function yi(t,r,n){if(n=="div"){return r}var i=r.left,e=r.top;if(n=="page"){i-=gi(F(t));e-=bi(F(t))}else if(n=="local"||!n){var a=t.display.sizer.getBoundingClientRect();i+=a.left;e+=a.top}var u=t.display.lineSpace.getBoundingClientRect();return{left:i-u.left,top:e-u.top}}function ki(t,r,n,i,e){if(!i){i=rr(t.doc,r.line)}return wi(t,i,ei(t,i,r.ch,e),n)}function Ti(t,r,n,i,e,a){i=i||rr(t.doc,r.line);if(!e){e=ui(t,i)}function u(r,u){var o=oi(t,e,r,u?"right":"left",a);if(u){o.left=o.right}else{o.right=o.left}return wi(t,i,o,n)}var o=bt(i,t.doc.direction),s=r.ch,f=r.sticky;if(s>=i.text.length){s=i.text.length;f="before"}else if(s<=0){s=0;f="after"}if(!o){return u(f=="before"?s-1:s,f=="before")}function c(t,r,n){var i=o[r],e=i.level==1;return u(n?t-1:t,e!=n)}var l=pt(o,s,f);var h=dt;var v=c(s,l,f=="before");if(h!=null){v.other=c(s,h,f!="before")}return v}function Ai(t,r){var n=0;r=gr(t.doc,r);if(!t.options.lineWrapping){n=Bi(t.display)*r.ch}var i=rr(t.doc,r.line);var e=cn(i)+Kn(t.display);return{left:n,right:n,top:e,bottom:e+i.height}}function Ei(t,r,n,i,e){var a=fr(t,r,n);a.xRel=e;if(i){a.outside=i}return a}function Li(t,r,n){var i=t.doc;n+=t.display.viewOffset;if(n<0){return Ei(i.first,0,null,-1,-1)}var e=ur(i,n),a=i.first+i.size-1;if(e>a){return Ei(i.first+i.size-1,rr(i,a).text.length,null,1,1)}if(r<0){r=0}var u=rr(i,e);for(;;){var o=Oi(t,u,e,r,n);var s=tn(u,o.ch+(o.xRel>0||o.outside>0?1:0));if(!s){return o}var f=s.find(1);if(f.line==e){return f}u=rr(i,e=f.line)}}function xi(t,r,n,i){i-=mi(r);var e=r.text.length;var a=ht((function(r){return oi(t,n,r-1).bottom<=i}),e,0);e=ht((function(r){return oi(t,n,r).top>i}),a,e);return{begin:a,end:e}}function Ci(t,r,n,i){if(!n){n=ui(t,r)}var e=wi(t,r,oi(t,n,i),"line").top;return xi(t,r,n,e)}function Di(t,r,n,i){return t.bottom<=n?false:t.top>n?true:(i?t.left:t.right)>r}function Oi(t,r,n,i,e){e-=cn(r);var a=ui(t,r);var u=mi(r);var o=0,s=r.text.length,f=true;var c=bt(r,t.doc.direction);if(c){var l=(t.options.lineWrapping?Ni:Si)(t,r,n,a,c,i,e);f=l.level!=1;o=f?l.from:l.to-1;s=f?l.to:l.from-1}var h=null,v=null;var d=ht((function(r){var n=oi(t,a,r);n.top+=u;n.bottom+=u;if(!Di(n,i,e,false)){return false}if(n.top<=e&&n.left<=i){h=r;v=n}return true}),o,s);var p,g,b=false;if(v){var m=i-v.left<v.right-i,w=m==f;d=h+(w?0:1);g=w?"after":"before";p=m?v.left:v.right}else{if(!f&&(d==s||d==o)){d++}g=d==0?"after":d==r.text.length?"before":oi(t,a,d-(f?1:0)).bottom+u<=e==f?"after":"before";var y=Ti(t,fr(n,d,g),"line",r,a);p=y.left;b=e<y.top?-1:e>=y.bottom?1:0}d=lt(r.text,d,1);return Ei(n,d,g,b,i-p)}function Si(t,r,n,i,e,a,u){var o=ht((function(o){var s=e[o],f=s.level!=1;return Di(Ti(t,fr(n,f?s.to:s.from,f?"before":"after"),"line",r,i),a,u,true)}),0,e.length-1);var s=e[o];if(o>0){var f=s.level!=1;var c=Ti(t,fr(n,f?s.from:s.to,f?"after":"before"),"line",r,i);if(Di(c,a,u,true)&&c.top>u){s=e[o-1]}}return s}function Ni(t,r,n,i,e,a,u){var o=xi(t,r,i,u);var s=o.begin;var f=o.end;if(/\s/.test(r.text.charAt(f-1))){f--}var c=null,l=null;for(var h=0;h<e.length;h++){var v=e[h];if(v.from>=f||v.to<=s){continue}var d=v.level!=1;var p=oi(t,i,d?Math.min(f,v.to)-1:Math.max(s,v.from)).right;var g=p<a?a-p+1e9:p-a;if(!c||l>g){c=v;l=g}}if(!c){c=e[e.length-1]}if(c.from<s){c={from:s,to:c.to,level:c.level}}if(c.to>f){c={from:c.from,to:f,level:c.level}}return c}var Mi;function Ri(t){if(t.cachedTextHeight!=null){return t.cachedTextHeight}if(Mi==null){Mi=O("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r){Mi.appendChild(document.createTextNode("x"));Mi.appendChild(O("br"))}Mi.appendChild(document.createTextNode("x"))}D(t.measure,Mi);var n=Mi.offsetHeight/50;if(n>3){t.cachedTextHeight=n}C(t.measure);return n||1}function Bi(t){if(t.cachedCharWidth!=null){return t.cachedCharWidth}var r=O("span","xxxxxxxxxx");var n=O("pre",[r],"CodeMirror-line-like");D(t.measure,n);var i=r.getBoundingClientRect(),e=(i.right-i.left)/10;if(e>2){t.cachedCharWidth=e}return e||10}function Ii(t){var r=t.display,n={},i={};var e=r.gutters.clientLeft;for(var a=r.gutters.firstChild,u=0;a;a=a.nextSibling,++u){var o=t.display.gutterSpecs[u].className;n[o]=a.offsetLeft+a.clientLeft+e;i[o]=a.clientWidth}return{fixedPos:qi(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:r.wrapper.clientWidth}}function qi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Fi(t){var r=Ri(t.display),n=t.options.lineWrapping;var i=n&&Math.max(5,t.display.scroller.clientWidth/Bi(t.display)-3);return function(e){if(sn(t.doc,e)){return 0}var a=0;if(e.widgets){for(var u=0;u<e.widgets.length;u++){if(e.widgets[u].height){a+=e.widgets[u].height}}}if(n){return a+(Math.ceil(e.text.length/i)||1)*r}else{return a+r}}}function Pi(t){var r=t.doc,n=Fi(t);r.iter((function(t){var r=n(t);if(r!=t.height){er(t,r)}}))}function ji(t,r,n,i){var e=t.display;if(!n&&Nt(r).getAttribute("cm-not-content")=="true"){return null}var a,u,o=e.lineSpace.getBoundingClientRect();try{a=r.clientX-o.left;u=r.clientY-o.top}catch(t){return null}var s=Li(t,a,u),f;if(i&&s.xRel>0&&(f=rr(t.doc,s.line).text).length==s.ch){var c=z(f,f.length,t.options.tabSize)-f.length;s=fr(s.line,Math.max(0,Math.round((a-Qn(t.display).left)/Bi(t.display))-c))}return s}function _i(t,r){if(r>=t.display.viewTo){return null}r-=t.display.viewFrom;if(r<0){return null}var n=t.display.view;for(var i=0;i<n.length;i++){r-=n[i].size;if(r<0){return i}}}function Ui(t,r,n,i){if(r==null){r=t.doc.first}if(n==null){n=t.doc.first+t.doc.size}if(!i){i=0}var e=t.display;if(i&&n<e.viewTo&&(e.updateLineNumbers==null||e.updateLineNumbers>r)){e.updateLineNumbers=r}t.curOp.viewChanged=true;if(r>=e.viewTo){if(Br&&un(t.doc,r)<e.viewTo){zi(t)}}else if(n<=e.viewFrom){if(Br&&on(t.doc,n+i)>e.viewFrom){zi(t)}else{e.viewFrom+=i;e.viewTo+=i}}else if(r<=e.viewFrom&&n>=e.viewTo){zi(t)}else if(r<=e.viewFrom){var a=Vi(t,n,n+i,1);if(a){e.view=e.view.slice(a.index);e.viewFrom=a.lineN;e.viewTo+=i}else{zi(t)}}else if(n>=e.viewTo){var u=Vi(t,r,r,-1);if(u){e.view=e.view.slice(0,u.index);e.viewTo=u.lineN}else{zi(t)}}else{var o=Vi(t,r,r,-1);var s=Vi(t,n,n+i,1);if(o&&s){e.view=e.view.slice(0,o.index).concat(Cn(t,o.lineN,s.lineN)).concat(e.view.slice(s.index));e.viewTo+=i}else{zi(t)}}var f=e.externalMeasured;if(f){if(n<f.lineN){f.lineN+=i}else if(r<f.lineN+f.size){e.externalMeasured=null}}}function Hi(t,r,n){t.curOp.viewChanged=true;var i=t.display,e=t.display.externalMeasured;if(e&&r>=e.lineN&&r<e.lineN+e.size){i.externalMeasured=null}if(r<i.viewFrom||r>=i.viewTo){return}var a=i.view[_i(t,r)];if(a.node==null){return}var u=a.changes||(a.changes=[]);if($(u,n)==-1){u.push(n)}}function zi(t){t.display.viewFrom=t.display.viewTo=t.doc.first;t.display.view=[];t.display.viewOffset=0}function Vi(t,r,n,i){var e=_i(t,r),a,u=t.display.view;if(!Br||n==t.doc.first+t.doc.size){return{index:e,lineN:n}}var o=t.display.viewFrom;for(var s=0;s<e;s++){o+=u[s].size}if(o!=r){if(i>0){if(e==u.length-1){return null}a=o+u[e].size-r;e++}else{a=o-r}r+=a;n+=a}while(un(t.doc,n)!=n){if(e==(i<0?0:u.length-1)){return null}n+=i*u[e-(i<0?1:0)].size;e+=i}return{index:e,lineN:n}}function $i(t,r,n){var i=t.display,e=i.view;if(e.length==0||r>=i.viewTo||n<=i.viewFrom){i.view=Cn(t,r,n);i.viewFrom=r}else{if(i.viewFrom>r){i.view=Cn(t,r,i.viewFrom).concat(i.view)}else if(i.viewFrom<r){i.view=i.view.slice(_i(t,r))}i.viewFrom=r;if(i.viewTo<n){i.view=i.view.concat(Cn(t,i.viewTo,n))}else if(i.viewTo>n){i.view=i.view.slice(0,_i(t,n))}}i.viewTo=n}function Gi(t){var r=t.display.view,n=0;for(var i=0;i<r.length;i++){var e=r[i];if(!e.hidden&&(!e.node||e.changes)){++n}}return n}function Wi(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Zi(t,r){if(r===void 0)r=true;var n=t.doc,i={};var e=i.cursors=document.createDocumentFragment();var a=i.selection=document.createDocumentFragment();var u=t.options.$customCursor;if(u){r=true}for(var o=0;o<n.sel.ranges.length;o++){if(!r&&o==n.sel.primIndex){continue}var s=n.sel.ranges[o];if(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom){continue}var f=s.empty();if(u){var c=u(t,s);if(c){Ki(t,c,e)}}else if(f||t.options.showCursorWhenSelecting){Ki(t,s.head,e)}if(!f){Qi(t,s,a)}}return i}function Ki(t,r,n){var i=Ti(t,r,"div",null,null,!t.options.singleCursorHeightPerLine);var e=n.appendChild(O("div"," ","CodeMirror-cursor"));e.style.left=i.left+"px";e.style.top=i.top+"px";e.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var a=ki(t,r,"div",null,null);var u=a.right-a.left;e.style.width=(u>0?u:t.defaultCharWidth())+"px"}if(i.other){var o=n.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=i.other.left+"px";o.style.top=i.other.top+"px";o.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Yi(t,r){return t.top-r.top||t.left-r.left}function Qi(t,r,n){var i=t.display,e=t.doc;var a=document.createDocumentFragment();var u=Qn(t.display),o=u.left;var s=Math.max(i.sizerWidth,Jn(t)-i.sizer.offsetLeft)-u.right;var f=e.direction=="ltr";function c(t,r,n,i){if(r<0){r=0}r=Math.round(r);i=Math.round(i);a.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+r+"px; width: "+(n==null?s-t:n)+"px;\n height: "+(i-r)+"px"))}function l(r,n,i){var a=rr(e,r);var u=a.text.length;var l,h;function v(n,i){return ki(t,fr(r,n),"div",a,i)}function d(r,n,i){var e=Ci(t,a,null,r);var u=n=="ltr"==(i=="after")?"left":"right";var o=i=="after"?e.begin:e.end-(/\s/.test(a.text.charAt(e.end-1))?2:1);return v(o,u)[u]}var p=bt(a,e.direction);vt(p,n||0,i==null?u:i,(function(t,r,e,a){var g=e=="ltr";var b=v(t,g?"left":"right");var m=v(r-1,g?"right":"left");var w=n==null&&t==0,y=i==null&&r==u;var k=a==0,T=!p||a==p.length-1;if(m.top-b.top<=3){var A=(f?w:y)&&k;var E=(f?y:w)&&T;var L=A?o:(g?b:m).left;var x=E?s:(g?m:b).right;c(L,b.top,x-L,b.bottom)}else{var C,D,O,S;if(g){C=f&&w&&k?o:b.left;D=f?s:d(t,e,"before");O=f?o:d(r,e,"after");S=f&&y&&T?s:m.right}else{C=!f?o:d(t,e,"before");D=!f&&w&&k?s:b.right;O=!f&&y&&T?o:m.left;S=!f?s:d(r,e,"after")}c(C,b.top,D-C,b.bottom);if(b.bottom<m.top){c(o,b.bottom,null,m.top)}c(O,m.top,S-O,m.bottom)}if(!l||Yi(b,l)<0){l=b}if(Yi(m,l)<0){l=m}if(!h||Yi(b,h)<0){h=b}if(Yi(m,h)<0){h=m}}));return{start:l,end:h}}var h=r.from(),v=r.to();if(h.line==v.line){l(h.line,h.ch,v.ch)}else{var d=rr(e,h.line),p=rr(e,v.line);var g=nn(d)==nn(p);var b=l(h.line,h.ch,g?d.text.length+1:null).end;var m=l(v.line,g?0:null,v.ch).start;if(g){if(b.top<m.top-2){c(b.right,b.top,null,b.bottom);c(o,m.top,m.left,m.bottom)}else{c(b.right,b.top,m.left-b.right,b.bottom)}}if(b.bottom<m.top){c(o,b.bottom,null,m.top)}}n.appendChild(a)}function Xi(t){if(!t.state.focused){return}var r=t.display;clearInterval(r.blinker);var n=true;r.cursorDiv.style.visibility="";if(t.options.cursorBlinkRate>0){r.blinker=setInterval((function(){if(!t.hasFocus()){ne(t)}r.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate)}else if(t.options.cursorBlinkRate<0){r.cursorDiv.style.visibility="hidden"}}function Ji(t){if(!t.hasFocus()){t.display.input.focus();if(!t.state.focused){re(t)}}}function te(t){t.state.delayingBlurEvent=true;setTimeout((function(){if(t.state.delayingBlurEvent){t.state.delayingBlurEvent=false;if(t.state.focused){ne(t)}}}),100)}function re(t,r){if(t.state.delayingBlurEvent&&!t.state.draggingText){t.state.delayingBlurEvent=false}if(t.options.readOnly=="nocursor"){return}if(!t.state.focused){Tt(t,"focus",t,r);t.state.focused=true;B(t.display.wrapper,"CodeMirror-focused");if(!t.curOp&&t.display.selForContextMenu!=t.doc.sel){t.display.input.reset();if(s){setTimeout((function(){return t.display.input.reset(true)}),20)}}t.display.input.receivedFocus()}Xi(t)}function ne(t,r){if(t.state.delayingBlurEvent){return}if(t.state.focused){Tt(t,"blur",t,r);t.state.focused=false;x(t.display.wrapper,"CodeMirror-focused")}clearInterval(t.display.blinker);setTimeout((function(){if(!t.state.focused){t.display.shift=false}}),150)}function ie(t){var r=t.display;var n=r.lineDiv.offsetTop;var i=Math.max(0,r.scroller.getBoundingClientRect().top);var e=r.lineDiv.getBoundingClientRect().top;var a=0;for(var s=0;s<r.view.length;s++){var f=r.view[s],c=t.options.lineWrapping;var l=void 0,h=0;if(f.hidden){continue}e+=f.line.height;if(u&&o<8){var v=f.node.offsetTop+f.node.offsetHeight;l=v-n;n=v}else{var d=f.node.getBoundingClientRect();l=d.bottom-d.top;if(!c&&f.text.firstChild){h=f.text.firstChild.getBoundingClientRect().right-d.left-1}}var p=f.line.height-l;if(p>.005||p<-.005){if(e<i){a-=p}er(f.line,l);ee(f.line);if(f.rest){for(var g=0;g<f.rest.length;g++){ee(f.rest[g])}}}if(h>t.display.sizerWidth){var b=Math.ceil(h/Bi(t.display));if(b>t.display.maxLineLength){t.display.maxLineLength=b;t.display.maxLine=f.line;t.display.maxLineChanged=true}}}if(Math.abs(a)>2){r.scroller.scrollTop+=a}}function ee(t){if(t.widgets){for(var r=0;r<t.widgets.length;++r){var n=t.widgets[r],i=n.node.parentNode;if(i){n.height=i.offsetHeight}}}}function ae(t,r,n){var i=n&&n.top!=null?Math.max(0,n.top):t.scroller.scrollTop;i=Math.floor(i-Kn(t));var e=n&&n.bottom!=null?n.bottom:i+t.wrapper.clientHeight;var a=ur(r,i),u=ur(r,e);if(n&&n.ensure){var o=n.ensure.from.line,s=n.ensure.to.line;if(o<a){a=o;u=ur(r,cn(rr(r,o))+t.wrapper.clientHeight)}else if(Math.min(s,r.lastLine())>=u){a=ur(r,cn(rr(r,s))-t.wrapper.clientHeight);u=s}}return{from:a,to:Math.max(u,a+1)}}function ue(t,r){if(At(t,"scrollCursorIntoView")){return}var n=t.display,i=n.sizer.getBoundingClientRect(),e=null;var a=n.wrapper.ownerDocument;if(r.top+i.top<0){e=true}else if(r.bottom+i.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)){e=false}if(e!=null&&!p){var u=O("div","",null,"position: absolute;\n top: "+(r.top-n.viewOffset-Kn(t.display))+"px;\n height: "+(r.bottom-r.top+Xn(t)+n.barHeight)+"px;\n left: "+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");t.display.lineSpace.appendChild(u);u.scrollIntoView(e);t.display.lineSpace.removeChild(u)}}function oe(t,r,n,i){if(i==null){i=0}var e;if(!t.options.lineWrapping&&r==n){n=r.sticky=="before"?fr(r.line,r.ch+1,"before"):r;r=r.ch?fr(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r}for(var a=0;a<5;a++){var u=false;var o=Ti(t,r);var s=!n||n==r?o:Ti(t,n);e={left:Math.min(o.left,s.left),top:Math.min(o.top,s.top)-i,right:Math.max(o.left,s.left),bottom:Math.max(o.bottom,s.bottom)+i};var f=fe(t,e);var c=t.doc.scrollTop,l=t.doc.scrollLeft;if(f.scrollTop!=null){ge(t,f.scrollTop);if(Math.abs(t.doc.scrollTop-c)>1){u=true}}if(f.scrollLeft!=null){me(t,f.scrollLeft);if(Math.abs(t.doc.scrollLeft-l)>1){u=true}}if(!u){break}}return e}function se(t,r){var n=fe(t,r);if(n.scrollTop!=null){ge(t,n.scrollTop)}if(n.scrollLeft!=null){me(t,n.scrollLeft)}}function fe(t,r){var n=t.display,i=Ri(t.display);if(r.top<0){r.top=0}var e=t.curOp&&t.curOp.scrollTop!=null?t.curOp.scrollTop:n.scroller.scrollTop;var a=ti(t),u={};if(r.bottom-r.top>a){r.bottom=r.top+a}var o=t.doc.height+Yn(n);var s=r.top<i,f=r.bottom>o-i;if(r.top<e){u.scrollTop=s?0:r.top}else if(r.bottom>e+a){var c=Math.min(r.top,(f?o:r.bottom)-a);if(c!=e){u.scrollTop=c}}var l=t.options.fixedGutter?0:n.gutters.offsetWidth;var h=t.curOp&&t.curOp.scrollLeft!=null?t.curOp.scrollLeft:n.scroller.scrollLeft-l;var v=Jn(t)-n.gutters.offsetWidth;var d=r.right-r.left>v;if(d){r.right=r.left+v}if(r.left<10){u.scrollLeft=0}else if(r.left<h){u.scrollLeft=Math.max(0,r.left+l-(d?0:10))}else if(r.right>v+h-3){u.scrollLeft=r.right+(d?0:10)-v}return u}function ce(t,r){if(r==null){return}de(t);t.curOp.scrollTop=(t.curOp.scrollTop==null?t.doc.scrollTop:t.curOp.scrollTop)+r}function le(t){de(t);var r=t.getCursor();t.curOp.scrollToPos={from:r,to:r,margin:t.options.cursorScrollMargin}}function he(t,r,n){if(r!=null||n!=null){de(t)}if(r!=null){t.curOp.scrollLeft=r}if(n!=null){t.curOp.scrollTop=n}}function ve(t,r){de(t);t.curOp.scrollToPos=r}function de(t){var r=t.curOp.scrollToPos;if(r){t.curOp.scrollToPos=null;var n=Ai(t,r.from),i=Ai(t,r.to);pe(t,n,i,r.margin)}}function pe(t,r,n,i){var e=fe(t,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-i,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+i});he(t,e.scrollLeft,e.scrollTop)}function ge(t,r){if(Math.abs(t.doc.scrollTop-r)<2){return}if(!n){We(t,{top:r})}be(t,r,true);if(n){We(t)}je(t,100)}function be(t,r,n){r=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,r));if(t.display.scroller.scrollTop==r&&!n){return}t.doc.scrollTop=r;t.display.scrollbars.setScrollTop(r);if(t.display.scroller.scrollTop!=r){t.display.scroller.scrollTop=r}}function me(t,r,n,i){r=Math.max(0,Math.min(r,t.display.scroller.scrollWidth-t.display.scroller.clientWidth));if((n?r==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-r)<2)&&!i){return}t.doc.scrollLeft=r;Qe(t);if(t.display.scroller.scrollLeft!=r){t.display.scroller.scrollLeft=r}t.display.scrollbars.setScrollLeft(r)}function we(t){var r=t.display,n=r.gutters.offsetWidth;var i=Math.round(t.doc.height+Yn(t.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Xn(t)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:n}}var ye=function(t,r,n){this.cm=n;var i=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var e=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=e.tabIndex=-1;t(i);t(e);wt(i,"scroll",(function(){if(i.clientHeight){r(i.scrollTop,"vertical")}}));wt(e,"scroll",(function(){if(e.clientWidth){r(e.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(u&&o<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};ye.prototype.update=function(t){var r=t.scrollWidth>t.clientWidth+1;var n=t.scrollHeight>t.clientHeight+1;var i=t.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=r?i+"px":"0";var e=t.viewHeight-(r?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+e)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(r){this.horiz.style.display="block";this.horiz.style.right=n?i+"px":"0";this.horiz.style.left=t.barLeft+"px";var a=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+a)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&t.clientHeight>0){if(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:n?i:0,bottom:r?i:0}};ye.prototype.setScrollLeft=function(t){if(this.horiz.scrollLeft!=t){this.horiz.scrollLeft=t}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};ye.prototype.setScrollTop=function(t){if(this.vert.scrollTop!=t){this.vert.scrollTop=t}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};ye.prototype.zeroWidthHack=function(){var t=w&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new V;this.disableVert=new V};ye.prototype.enableZeroWidthBar=function(t,r,n){t.style.visibility="";function i(){var e=t.getBoundingClientRect();var a=n=="vert"?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);if(a!=t){t.style.visibility="hidden"}else{r.set(1e3,i)}}r.set(1e3,i)};ye.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz);t.removeChild(this.vert)};var ke=function(){};ke.prototype.update=function(){return{bottom:0,right:0}};ke.prototype.setScrollLeft=function(){};ke.prototype.setScrollTop=function(){};ke.prototype.clear=function(){};function Te(t,r){if(!r){r=we(t)}var n=t.display.barWidth,i=t.display.barHeight;Ae(t,r);for(var e=0;e<4&&n!=t.display.barWidth||i!=t.display.barHeight;e++){if(n!=t.display.barWidth&&t.options.lineWrapping){ie(t)}Ae(t,we(t));n=t.display.barWidth;i=t.display.barHeight}}function Ae(t,r){var n=t.display;var i=n.scrollbars.update(r);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px";n.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=i.bottom+"px";n.scrollbarFiller.style.width=i.right+"px"}else{n.scrollbarFiller.style.display=""}if(i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=i.bottom+"px";n.gutterFiller.style.width=r.gutterWidth+"px"}else{n.gutterFiller.style.display=""}}var Ee={native:ye,null:ke};function Le(t){if(t.display.scrollbars){t.display.scrollbars.clear();if(t.display.scrollbars.addClass){x(t.display.wrapper,t.display.scrollbars.addClass)}}t.display.scrollbars=new Ee[t.options.scrollbarStyle]((function(r){t.display.wrapper.insertBefore(r,t.display.scrollbarFiller);wt(r,"mousedown",(function(){if(t.state.focused){setTimeout((function(){return t.display.input.focus()}),0)}}));r.setAttribute("cm-not-content","true")}),(function(r,n){if(n=="horizontal"){me(t,r)}else{ge(t,r)}}),t);if(t.display.scrollbars.addClass){B(t.display.wrapper,t.display.scrollbars.addClass)}}var xe=0;function Ce(t){t.curOp={cm:t,viewChanged:false,startHeight:t.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++xe,markArrays:null};On(t.curOp)}function De(t){var r=t.curOp;if(r){Nn(r,(function(t){for(var r=0;r<t.ops.length;r++){t.ops[r].cm.curOp=null}Oe(t)}))}}function Oe(t){var r=t.ops;for(var n=0;n<r.length;n++){Se(r[n])}for(var i=0;i<r.length;i++){Ne(r[i])}for(var e=0;e<r.length;e++){Me(r[e])}for(var a=0;a<r.length;a++){Re(r[a])}for(var u=0;u<r.length;u++){Be(r[u])}}function Se(t){var r=t.cm,n=r.display;He(r);if(t.updateMaxLine){hn(r)}t.mustUpdate=t.viewChanged||t.forceUpdate||t.scrollTop!=null||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&r.options.lineWrapping;t.update=t.mustUpdate&&new Ue(r,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ne(t){t.updatedDisplay=t.mustUpdate&&$e(t.cm,t.update)}function Me(t){var r=t.cm,n=r.display;if(t.updatedDisplay){ie(r)}t.barMeasure=we(r);if(n.maxLineChanged&&!r.options.lineWrapping){t.adjustWidthTo=ei(r,n.maxLine,n.maxLine.text.length).left+3;r.display.sizerWidth=t.adjustWidthTo;t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Xn(r)+r.display.barWidth);t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Jn(r))}if(t.updatedDisplay||t.selectionChanged){t.preparedSelection=n.input.prepareSelection()}}function Re(t){var r=t.cm;if(t.adjustWidthTo!=null){r.display.sizer.style.minWidth=t.adjustWidthTo+"px";if(t.maxScrollLeft<r.doc.scrollLeft){me(r,Math.min(r.display.scroller.scrollLeft,t.maxScrollLeft),true)}r.display.maxLineChanged=false}var n=t.focus&&t.focus==R(P(r));if(t.preparedSelection){r.display.input.showSelection(t.preparedSelection,n)}if(t.updatedDisplay||t.startHeight!=r.doc.height){Te(r,t.barMeasure)}if(t.updatedDisplay){Ye(r,t.barMeasure)}if(t.selectionChanged){Xi(r)}if(r.state.focused&&t.updateInput){r.display.input.reset(t.typing)}if(n){Ji(t.cm)}}function Be(t){var r=t.cm,n=r.display,i=r.doc;if(t.updatedDisplay){Ge(r,t.update)}if(n.wheelStartX!=null&&(t.scrollTop!=null||t.scrollLeft!=null||t.scrollToPos)){n.wheelStartX=n.wheelStartY=null}if(t.scrollTop!=null){be(r,t.scrollTop,t.forceScroll)}if(t.scrollLeft!=null){me(r,t.scrollLeft,true,true)}if(t.scrollToPos){var e=oe(r,gr(i,t.scrollToPos.from),gr(i,t.scrollToPos.to),t.scrollToPos.margin);ue(r,e)}var a=t.maybeHiddenMarkers,u=t.maybeUnhiddenMarkers;if(a){for(var o=0;o<a.length;++o){if(!a[o].lines.length){Tt(a[o],"hide")}}}if(u){for(var s=0;s<u.length;++s){if(u[s].lines.length){Tt(u[s],"unhide")}}}if(n.wrapper.offsetHeight){i.scrollTop=r.display.scroller.scrollTop}if(t.changeObjs){Tt(r,"changes",r,t.changeObjs)}if(t.update){t.update.finish()}}function Ie(t,r){if(t.curOp){return r()}Ce(t);try{return r()}finally{De(t)}}function qe(t,r){return function(){if(t.curOp){return r.apply(t,arguments)}Ce(t);try{return r.apply(t,arguments)}finally{De(t)}}}function Fe(t){return function(){if(this.curOp){return t.apply(this,arguments)}Ce(this);try{return t.apply(this,arguments)}finally{De(this)}}}function Pe(t){return function(){var r=this.cm;if(!r||r.curOp){return t.apply(this,arguments)}Ce(r);try{return t.apply(this,arguments)}finally{De(r)}}}function je(t,r){if(t.doc.highlightFrontier<t.display.viewTo){t.state.highlight.set(r,U(_e,t))}}function _e(t){var r=t.doc;if(r.highlightFrontier>=t.display.viewTo){return}var n=+new Date+t.options.workTime;var i=Ar(t,r.highlightFrontier);var e=[];r.iter(i.line,Math.min(r.first+r.size,t.display.viewTo+500),(function(a){if(i.line>=t.display.viewFrom){var u=a.styles;var o=a.text.length>t.options.maxHighlightLength?Qt(r.mode,i.state):null;var s=kr(t,a,i,true);if(o){i.state=o}a.styles=s.styles;var f=a.styleClasses,c=s.classes;if(c){a.styleClasses=c}else if(f){a.styleClasses=null}var l=!u||u.length!=a.styles.length||f!=c&&(!f||!c||f.bgClass!=c.bgClass||f.textClass!=c.textClass);for(var h=0;!l&&h<u.length;++h){l=u[h]!=a.styles[h]}if(l){e.push(i.line)}a.stateAfter=i.save();i.nextLine()}else{if(a.text.length<=t.options.maxHighlightLength){Er(t,a.text,i)}a.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>n){je(t,t.options.workDelay);return true}}));r.highlightFrontier=i.line;r.modeFrontier=Math.max(r.modeFrontier,i.line);if(e.length){Ie(t,(function(){for(var r=0;r<e.length;r++){Hi(t,e[r],"text")}}))}}var Ue=function(t,r,n){var i=t.display;this.viewport=r;this.visible=ae(i,t.doc,r);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=Jn(t);this.force=n;this.dims=Ii(t);this.events=[]};Ue.prototype.signal=function(t,r){if(Lt(t,r)){this.events.push(arguments)}};Ue.prototype.finish=function(){for(var t=0;t<this.events.length;t++){Tt.apply(null,this.events[t])}};function He(t){var r=t.display;if(!r.scrollbarsClipped&&r.scroller.offsetWidth){r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth;r.heightForcer.style.height=Xn(t)+"px";r.sizer.style.marginBottom=-r.nativeBarWidth+"px";r.sizer.style.borderRightWidth=Xn(t)+"px";r.scrollbarsClipped=true}}function ze(t){if(t.hasFocus()){return null}var r=R(P(t));if(!r||!M(t.display.lineDiv,r)){return null}var n={activeElt:r};if(window.getSelection){var i=_(t).getSelection();if(i.anchorNode&&i.extend&&M(t.display.lineDiv,i.anchorNode)){n.anchorNode=i.anchorNode;n.anchorOffset=i.anchorOffset;n.focusNode=i.focusNode;n.focusOffset=i.focusOffset}}return n}function Ve(t){if(!t||!t.activeElt||t.activeElt==R(j(t.activeElt))){return}t.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&M(document.body,t.anchorNode)&&M(document.body,t.focusNode)){var r=t.activeElt.ownerDocument;var n=r.defaultView.getSelection(),i=r.createRange();i.setEnd(t.anchorNode,t.anchorOffset);i.collapse(false);n.removeAllRanges();n.addRange(i);n.extend(t.focusNode,t.focusOffset)}}function $e(t,r){var n=t.display,i=t.doc;if(r.editorIsHidden){zi(t);return false}if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Gi(t)==0){return false}if(Xe(t)){zi(t);r.dims=Ii(t)}var e=i.first+i.size;var a=Math.max(r.visible.from-t.options.viewportMargin,i.first);var u=Math.min(e,r.visible.to+t.options.viewportMargin);if(n.viewFrom<a&&a-n.viewFrom<20){a=Math.max(i.first,n.viewFrom)}if(n.viewTo>u&&n.viewTo-u<20){u=Math.min(e,n.viewTo)}if(Br){a=un(t.doc,a);u=on(t.doc,u)}var o=a!=n.viewFrom||u!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;$i(t,a,u);n.viewOffset=cn(rr(t.doc,n.viewFrom));t.display.mover.style.top=n.viewOffset+"px";var s=Gi(t);if(!o&&s==0&&!r.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)){return false}var f=ze(t);if(s>4){n.lineDiv.style.display="none"}Ze(t,n.updateLineNumbers,r.dims);if(s>4){n.lineDiv.style.display=""}n.renderedView=n.view;Ve(f);C(n.cursorDiv);C(n.selectionDiv);n.gutters.style.height=n.sizer.style.minHeight=0;if(o){n.lastWrapHeight=r.wrapperHeight;n.lastWrapWidth=r.wrapperWidth;je(t,400)}n.updateLineNumbers=null;return true}function Ge(t,r){var n=r.viewport;for(var i=true;;i=false){if(!i||!t.options.lineWrapping||r.oldDisplayWidth==Jn(t)){if(n&&n.top!=null){n={top:Math.min(t.doc.height+Yn(t.display)-ti(t),n.top)}}r.visible=ae(t.display,t.doc,n);if(r.visible.from>=t.display.viewFrom&&r.visible.to<=t.display.viewTo){break}}else if(i){r.visible=ae(t.display,t.doc,n)}if(!$e(t,r)){break}ie(t);var e=we(t);Wi(t);Te(t,e);Ye(t,e);r.force=false}r.signal(t,"update",t);if(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo){r.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo);t.display.reportedViewFrom=t.display.viewFrom;t.display.reportedViewTo=t.display.viewTo}}function We(t,r){var n=new Ue(t,r);if($e(t,n)){ie(t);Ge(t,n);var i=we(t);Wi(t);Te(t,i);Ye(t,i);n.finish()}}function Ze(t,r,n){var i=t.display,e=t.options.lineNumbers;var a=i.lineDiv,u=a.firstChild;function o(r){var n=r.nextSibling;if(s&&w&&t.display.currentWheelTarget==r){r.style.display="none"}else{r.parentNode.removeChild(r)}return n}var f=i.view,c=i.viewFrom;for(var l=0;l<f.length;l++){var h=f[l];if(h.hidden);else if(!h.node||h.node.parentNode!=a){var v=zn(t,h,c,n);a.insertBefore(v,u)}else{while(u!=h.node){u=o(u)}var d=e&&r!=null&&r<=c&&h.lineNumber;if(h.changes){if($(h.changes,"gutter")>-1){d=false}In(t,h,c,n)}if(d){C(h.lineNumber);h.lineNumber.appendChild(document.createTextNode(sr(t.options,c)))}u=h.node.nextSibling}c+=h.size}while(u){u=o(u)}}function Ke(t){var r=t.gutters.offsetWidth;t.sizer.style.marginLeft=r+"px";Rn(t,"gutterChanged",t)}function Ye(t,r){t.display.sizer.style.minHeight=r.docHeight+"px";t.display.heightForcer.style.top=r.docHeight+"px";t.display.gutters.style.height=r.docHeight+t.display.barHeight+Xn(t)+"px"}function Qe(t){var r=t.display,n=r.view;if(!r.alignWidgets&&(!r.gutters.firstChild||!t.options.fixedGutter)){return}var i=qi(r)-r.scroller.scrollLeft+t.doc.scrollLeft;var e=r.gutters.offsetWidth,a=i+"px";for(var u=0;u<n.length;u++){if(!n[u].hidden){if(t.options.fixedGutter){if(n[u].gutter){n[u].gutter.style.left=a}if(n[u].gutterBackground){n[u].gutterBackground.style.left=a}}var o=n[u].alignable;if(o){for(var s=0;s<o.length;s++){o[s].style.left=a}}}}if(t.options.fixedGutter){r.gutters.style.left=i+e+"px"}}function Xe(t){if(!t.options.lineNumbers){return false}var r=t.doc,n=sr(t.options,r.first+r.size-1),i=t.display;if(n.length!=i.lineNumChars){var e=i.measure.appendChild(O("div",[O("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var a=e.firstChild.offsetWidth,u=e.offsetWidth-a;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-u)+1;i.lineNumWidth=i.lineNumInnerWidth+u;i.lineNumChars=i.lineNumInnerWidth?n.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Ke(t.display);return true}return false}function Je(t,r){var n=[],i=false;for(var e=0;e<t.length;e++){var a=t[e],u=null;if(typeof a!="string"){u=a.style;a=a.className}if(a=="CodeMirror-linenumbers"){if(!r){continue}else{i=true}}n.push({className:a,style:u})}if(r&&!i){n.push({className:"CodeMirror-linenumbers",style:null})}return n}function ta(t){var r=t.gutters,n=t.gutterSpecs;C(r);t.lineGutter=null;for(var i=0;i<n.length;++i){var e=n[i];var a=e.className;var u=e.style;var o=r.appendChild(O("div",null,"CodeMirror-gutter "+a));if(u){o.style.cssText=u}if(a=="CodeMirror-linenumbers"){t.lineGutter=o;o.style.width=(t.lineNumWidth||1)+"px"}}r.style.display=n.length?"":"none";Ke(t)}function ra(t){ta(t.display);Ui(t);Qe(t)}function na(t,r,i,e){var a=this;this.input=i;a.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler");a.scrollbarFiller.setAttribute("cm-not-content","true");a.gutterFiller=O("div",null,"CodeMirror-gutter-filler");a.gutterFiller.setAttribute("cm-not-content","true");a.lineDiv=S("div",null,"CodeMirror-code");a.selectionDiv=O("div",null,null,"position: relative; z-index: 1");a.cursorDiv=O("div",null,"CodeMirror-cursors");a.measure=O("div",null,"CodeMirror-measure");a.lineMeasure=O("div",null,"CodeMirror-measure");a.lineSpace=S("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var f=S("div",[a.lineSpace],"CodeMirror-lines");a.mover=O("div",[f],null,"position: relative");a.sizer=O("div",[a.mover],"CodeMirror-sizer");a.sizerWidth=null;a.heightForcer=O("div",null,null,"position: absolute; height: "+G+"px; width: 1px;");a.gutters=O("div",null,"CodeMirror-gutters");a.lineGutter=null;a.scroller=O("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll");a.scroller.setAttribute("tabIndex","-1");a.wrapper=O("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror");if(c&&l>=105){a.wrapper.style.clipPath="inset(0px)"}a.wrapper.setAttribute("translate","no");if(u&&o<8){a.gutters.style.zIndex=-1;a.scroller.style.paddingRight=0}if(!s&&!(n&&m)){a.scroller.draggable=true}if(t){if(t.appendChild){t.appendChild(a.wrapper)}else{t(a.wrapper)}}a.viewFrom=a.viewTo=r.first;a.reportedViewFrom=a.reportedViewTo=r.first;a.view=[];a.renderedView=null;a.externalMeasured=null;a.viewOffset=0;a.lastWrapHeight=a.lastWrapWidth=0;a.updateLineNumbers=null;a.nativeBarWidth=a.barHeight=a.barWidth=0;a.scrollbarsClipped=false;a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null;a.alignWidgets=false;a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null;a.maxLine=null;a.maxLineLength=0;a.maxLineChanged=false;a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null;a.shift=false;a.selForContextMenu=null;a.activeTouch=null;a.gutterSpecs=Je(e.gutters,e.lineNumbers);ta(a);i.init(a)}var ia=0,ea=null;if(u){ea=-.53}else if(n){ea=15}else if(c){ea=-.7}else if(v){ea=-1/3}function aa(t){var r=t.wheelDeltaX,n=t.wheelDeltaY;if(r==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS){r=t.detail}if(n==null&&t.detail&&t.axis==t.VERTICAL_AXIS){n=t.detail}else if(n==null){n=t.wheelDelta}return{x:r,y:n}}function ua(t){var r=aa(t);r.x*=ea;r.y*=ea;return r}function oa(t,r){if(c&&l==102){if(t.display.chromeScrollHack==null){t.display.sizer.style.pointerEvents="none"}else{clearTimeout(t.display.chromeScrollHack)}t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null;t.display.sizer.style.pointerEvents=""}),100)}var i=aa(r),e=i.x,a=i.y;var u=ea;if(r.deltaMode===0){e=r.deltaX;a=r.deltaY;u=1}var o=t.display,f=o.scroller;var v=f.scrollWidth>f.clientWidth;var d=f.scrollHeight>f.clientHeight;if(!(e&&v||a&&d)){return}if(a&&w&&s){t:for(var p=r.target,g=o.view;p!=f;p=p.parentNode){for(var b=0;b<g.length;b++){if(g[b].node==p){t.display.currentWheelTarget=p;break t}}}}if(e&&!n&&!h&&u!=null){if(a&&d){ge(t,Math.max(0,f.scrollTop+a*u))}me(t,Math.max(0,f.scrollLeft+e*u));if(!a||a&&d){Ct(r)}o.wheelStartX=null;return}if(a&&u!=null){var m=a*u;var y=t.doc.scrollTop,k=y+o.wrapper.clientHeight;if(m<0){y=Math.max(0,y+m-50)}else{k=Math.min(t.doc.height,k+m+50)}We(t,{top:y,bottom:k})}if(ia<20&&r.deltaMode!==0){if(o.wheelStartX==null){o.wheelStartX=f.scrollLeft;o.wheelStartY=f.scrollTop;o.wheelDX=e;o.wheelDY=a;setTimeout((function(){if(o.wheelStartX==null){return}var t=f.scrollLeft-o.wheelStartX;var r=f.scrollTop-o.wheelStartY;var n=r&&o.wheelDY&&r/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(!n){return}ea=(ea*ia+n)/(ia+1);++ia}),200)}else{o.wheelDX+=e;o.wheelDY+=a}}}var sa=function(t,r){this.ranges=t;this.primIndex=r};sa.prototype.primary=function(){return this.ranges[this.primIndex]};sa.prototype.equals=function(t){if(t==this){return true}if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length){return false}for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r],i=t.ranges[r];if(!lr(n.anchor,i.anchor)||!lr(n.head,i.head)){return false}}return true};sa.prototype.deepCopy=function(){var t=[];for(var r=0;r<this.ranges.length;r++){t[r]=new fa(hr(this.ranges[r].anchor),hr(this.ranges[r].head))}return new sa(t,this.primIndex)};sa.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++){if(!this.ranges[t].empty()){return true}}return false};sa.prototype.contains=function(t,r){if(!r){r=t}for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(cr(r,i.from())>=0&&cr(t,i.to())<=0){return n}}return-1};var fa=function(t,r){this.anchor=t;this.head=r};fa.prototype.from=function(){return dr(this.anchor,this.head)};fa.prototype.to=function(){return vr(this.anchor,this.head)};fa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ca(t,r,n){var i=t&&t.options.selectionsMayTouch;var e=r[n];r.sort((function(t,r){return cr(t.from(),r.from())}));n=$(r,e);for(var a=1;a<r.length;a++){var u=r[a],o=r[a-1];var s=cr(o.to(),u.from());if(i&&!u.empty()?s>0:s>=0){var f=dr(o.from(),u.from()),c=vr(o.to(),u.to());var l=o.empty()?u.from()==u.head:o.from()==o.head;if(a<=n){--n}r.splice(--a,2,new fa(l?c:f,l?f:c))}}return new sa(r,n)}function la(t,r){return new sa([new fa(t,r||t)],0)}function ha(t){if(!t.text){return t.to}return fr(t.from.line+t.text.length-1,tt(t.text).length+(t.text.length==1?t.from.ch:0))}function va(t,r){if(cr(t,r.from)<0){return t}if(cr(t,r.to)<=0){return ha(r)}var n=t.line+r.text.length-(r.to.line-r.from.line)-1,i=t.ch;if(t.line==r.to.line){i+=ha(r).ch-r.to.ch}return fr(n,i)}function da(t,r){var n=[];for(var i=0;i<t.sel.ranges.length;i++){var e=t.sel.ranges[i];n.push(new fa(va(e.anchor,r),va(e.head,r)))}return ca(t.cm,n,t.sel.primIndex)}function pa(t,r,n){if(t.line==r.line){return fr(n.line,t.ch-r.ch+n.ch)}else{return fr(n.line+(t.line-r.line),t.ch)}}function ga(t,r,n){var i=[];var e=fr(t.first,0),a=e;for(var u=0;u<r.length;u++){var o=r[u];var s=pa(o.from,e,a);var f=pa(ha(o),e,a);e=o.to;a=f;if(n=="around"){var c=t.sel.ranges[u],l=cr(c.head,c.anchor)<0;i[u]=new fa(l?f:s,l?s:f)}else{i[u]=new fa(s,s)}}return new sa(i,t.sel.primIndex)}function ba(t){t.doc.mode=Zt(t.options,t.doc.modeOption);ma(t)}function ma(t){t.doc.iter((function(t){if(t.stateAfter){t.stateAfter=null}if(t.styles){t.styles=null}}));t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first;je(t,100);t.state.modeGen++;if(t.curOp){Ui(t)}}function wa(t,r){return r.from.ch==0&&r.to.ch==0&&tt(r.text)==""&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function ya(t,r,n,i){function e(t){return n?n[t]:null}function a(t,n,e){dn(t,n,e,i);Rn(t,"change",t,r)}function u(t,r){var n=[];for(var a=t;a<r;++a){n.push(new vn(f[a],e(a),i))}return n}var o=r.from,s=r.to,f=r.text;var c=rr(t,o.line),l=rr(t,s.line);var h=tt(f),v=e(f.length-1),d=s.line-o.line;if(r.full){t.insert(0,u(0,f.length));t.remove(f.length,t.size-f.length)}else if(wa(t,r)){var p=u(0,f.length-1);a(l,l.text,v);if(d){t.remove(o.line,d)}if(p.length){t.insert(o.line,p)}}else if(c==l){if(f.length==1){a(c,c.text.slice(0,o.ch)+h+c.text.slice(s.ch),v)}else{var g=u(1,f.length-1);g.push(new vn(h+c.text.slice(s.ch),v,i));a(c,c.text.slice(0,o.ch)+f[0],e(0));t.insert(o.line+1,g)}}else if(f.length==1){a(c,c.text.slice(0,o.ch)+f[0]+l.text.slice(s.ch),e(0));t.remove(o.line+1,d)}else{a(c,c.text.slice(0,o.ch)+f[0],e(0));a(l,h+l.text.slice(s.ch),v);var b=u(1,f.length-1);if(d>1){t.remove(o.line+1,d-1)}t.insert(o.line+1,b)}Rn(t,"change",t,r)}function ka(t,r,n){function i(t,e,a){if(t.linked){for(var u=0;u<t.linked.length;++u){var o=t.linked[u];if(o.doc==e){continue}var s=a&&o.sharedHist;if(n&&!s){continue}r(o.doc,s);i(o.doc,t,s)}}}i(t,null,true)}function Ta(t,r){if(r.cm){throw new Error("This document is already in use.")}t.doc=r;r.cm=t;Pi(t);ba(t);Aa(t);t.options.direction=r.direction;if(!t.options.lineWrapping){hn(t)}t.options.mode=r.modeOption;Ui(t)}function Aa(t){(t.doc.direction=="rtl"?B:x)(t.display.lineDiv,"CodeMirror-rtl")}function Ea(t){Ie(t,(function(){Aa(t);Ui(t)}))}function La(t){this.done=[];this.undone=[];this.undoDepth=t?t.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=t?t.maxGeneration:1}function xa(t,r){var n={from:hr(r.from),to:ha(r),text:nr(t,r.from,r.to)};Ra(t,n,r.from.line,r.to.line+1);ka(t,(function(t){return Ra(t,n,r.from.line,r.to.line+1)}),true);return n}function Ca(t){while(t.length){var r=tt(t);if(r.ranges){t.pop()}else{break}}}function Da(t,r){if(r){Ca(t.done);return tt(t.done)}else if(t.done.length&&!tt(t.done).ranges){return tt(t.done)}else if(t.done.length>1&&!t.done[t.done.length-2].ranges){t.done.pop();return tt(t.done)}}function Oa(t,r,n,i){var e=t.history;e.undone.length=0;var a=+new Date,u;var o;if((e.lastOp==i||e.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&e.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(u=Da(e,e.lastOp==i))){o=tt(u.changes);if(cr(r.from,r.to)==0&&cr(r.from,o.to)==0){o.to=ha(r)}else{u.changes.push(xa(t,r))}}else{var s=tt(e.done);if(!s||!s.ranges){Ma(t.sel,e.done)}u={changes:[xa(t,r)],generation:e.generation};e.done.push(u);while(e.done.length>e.undoDepth){e.done.shift();if(!e.done[0].ranges){e.done.shift()}}}e.done.push(n);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=a;e.lastOp=e.lastSelOp=i;e.lastOrigin=e.lastSelOrigin=r.origin;if(!o){Tt(t,"historyAdded")}}function Sa(t,r,n,i){var e=r.charAt(0);return e=="*"||e=="+"&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Na(t,r,n,i){var e=t.history,a=i&&i.origin;if(n==e.lastSelOp||a&&e.lastSelOrigin==a&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==a||Sa(t,a,tt(e.done),r))){e.done[e.done.length-1]=r}else{Ma(r,e.done)}e.lastSelTime=+new Date;e.lastSelOrigin=a;e.lastSelOp=n;if(i&&i.clearRedo!==false){Ca(e.undone)}}function Ma(t,r){var n=tt(r);if(!(n&&n.ranges&&n.equals(t))){r.push(t)}}function Ra(t,r,n,i){var e=r["spans_"+t.id],a=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){if(n.markedSpans){(e||(e=r["spans_"+t.id]={}))[a]=n.markedSpans}++a}))}function Ba(t){if(!t){return null}var r;for(var n=0;n<t.length;++n){if(t[n].marker.explicitlyCleared){if(!r){r=t.slice(0,n)}}else if(r){r.push(t[n])}}return!r?t:r.length?r:null}function Ia(t,r){var n=r["spans_"+t.id];if(!n){return null}var i=[];for(var e=0;e<r.text.length;++e){i.push(Ba(n[e]))}return i}function qa(t,r){var n=Ia(t,r);var i=zr(t,r);if(!n){return i}if(!i){return n}for(var e=0;e<n.length;++e){var a=n[e],u=i[e];if(a&&u){t:for(var o=0;o<u.length;++o){var s=u[o];for(var f=0;f<a.length;++f){if(a[f].marker==s.marker){continue t}}a.push(s)}}else if(u){n[e]=u}}return n}function Fa(t,r,n){var i=[];for(var e=0;e<t.length;++e){var a=t[e];if(a.ranges){i.push(n?sa.prototype.deepCopy.call(a):a);continue}var u=a.changes,o=[];i.push({changes:o});for(var s=0;s<u.length;++s){var f=u[s],c=void 0;o.push({from:f.from,to:f.to,text:f.text});if(r){for(var l in f){if(c=l.match(/^spans_(\d+)$/)){if($(r,Number(c[1]))>-1){tt(o)[l]=f[l];delete f[l]}}}}}}return i}function Pa(t,r,n,i){if(i){var e=t.anchor;if(n){var a=cr(r,e)<0;if(a!=cr(n,e)<0){e=r;r=n}else if(a!=cr(r,n)<0){r=n}}return new fa(e,r)}else{return new fa(n||r,r)}}function ja(t,r,n,i,e){if(e==null){e=t.cm&&(t.cm.display.shift||t.extend)}$a(t,new sa([Pa(t.sel.primary(),r,n,e)],0),i)}function _a(t,r,n){var i=[];var e=t.cm&&(t.cm.display.shift||t.extend);for(var a=0;a<t.sel.ranges.length;a++){i[a]=Pa(t.sel.ranges[a],r[a],null,e)}var u=ca(t.cm,i,t.sel.primIndex);$a(t,u,n)}function Ua(t,r,n,i){var e=t.sel.ranges.slice(0);e[r]=n;$a(t,ca(t.cm,e,t.sel.primIndex),i)}function Ha(t,r,n,i){$a(t,la(r,n),i)}function za(t,r,n){var i={ranges:r.ranges,update:function(r){this.ranges=[];for(var n=0;n<r.length;n++){this.ranges[n]=new fa(gr(t,r[n].anchor),gr(t,r[n].head))}},origin:n&&n.origin};Tt(t,"beforeSelectionChange",t,i);if(t.cm){Tt(t.cm,"beforeSelectionChange",t.cm,i)}if(i.ranges!=r.ranges){return ca(t.cm,i.ranges,i.ranges.length-1)}else{return r}}function Va(t,r,n){var i=t.history.done,e=tt(i);if(e&&e.ranges){i[i.length-1]=r;Ga(t,r,n)}else{$a(t,r,n)}}function $a(t,r,n){Ga(t,r,n);Na(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Ga(t,r,n){if(Lt(t,"beforeSelectionChange")||t.cm&&Lt(t.cm,"beforeSelectionChange")){r=za(t,r,n)}var i=n&&n.bias||(cr(r.primary().head,t.sel.primary().head)<0?-1:1);Wa(t,Ka(t,r,i,true));if(!(n&&n.scroll===false)&&t.cm&&t.cm.getOption("readOnly")!="nocursor"){le(t.cm)}}function Wa(t,r){if(r.equals(t.sel)){return}t.sel=r;if(t.cm){t.cm.curOp.updateInput=1;t.cm.curOp.selectionChanged=true;Et(t.cm)}Rn(t,"cursorActivity",t)}function Za(t){Wa(t,Ka(t,t.sel,null,false))}function Ka(t,r,n,i){var e;for(var a=0;a<r.ranges.length;a++){var u=r.ranges[a];var o=r.ranges.length==t.sel.ranges.length&&t.sel.ranges[a];var s=Qa(t,u.anchor,o&&o.anchor,n,i);var f=u.head==u.anchor?s:Qa(t,u.head,o&&o.head,n,i);if(e||s!=u.anchor||f!=u.head){if(!e){e=r.ranges.slice(0,a)}e[a]=new fa(s,f)}}return e?ca(t.cm,e,r.primIndex):r}function Ya(t,r,n,i,e){var a=rr(t,r.line);if(a.markedSpans){for(var u=0;u<a.markedSpans.length;++u){var o=a.markedSpans[u],s=o.marker;var f="selectLeft"in s?!s.selectLeft:s.inclusiveLeft;var c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((o.from==null||(f?o.from<=r.ch:o.from<r.ch))&&(o.to==null||(c?o.to>=r.ch:o.to>r.ch))){if(e){Tt(s,"beforeCursorEnter");if(s.explicitlyCleared){if(!a.markedSpans){break}else{--u;continue}}}if(!s.atomic){continue}if(n){var l=s.find(i<0?1:-1),h=void 0;if(i<0?c:f){l=Xa(t,l,-i,l&&l.line==r.line?a:null)}if(l&&l.line==r.line&&(h=cr(l,n))&&(i<0?h<0:h>0)){return Ya(t,l,r,i,e)}}var v=s.find(i<0?-1:1);if(i<0?f:c){v=Xa(t,v,i,v.line==r.line?a:null)}return v?Ya(t,v,r,i,e):null}}}return r}function Qa(t,r,n,i,e){var a=i||1;var u=Ya(t,r,n,a,e)||!e&&Ya(t,r,n,a,true)||Ya(t,r,n,-a,e)||!e&&Ya(t,r,n,-a,true);if(!u){t.cantEdit=true;return fr(t.first,0)}return u}function Xa(t,r,n,i){if(n<0&&r.ch==0){if(r.line>t.first){return gr(t,fr(r.line-1))}else{return null}}else if(n>0&&r.ch==(i||rr(t,r.line)).text.length){if(r.line<t.first+t.size-1){return fr(r.line+1,0)}else{return null}}else{return new fr(r.line,r.ch+n)}}function Ja(t){t.setSelection(fr(t.firstLine(),0),fr(t.lastLine()),Z)}function tu(t,r,n){var i={canceled:false,from:r.from,to:r.to,text:r.text,origin:r.origin,cancel:function(){return i.canceled=true}};if(n){i.update=function(r,n,e,a){if(r){i.from=gr(t,r)}if(n){i.to=gr(t,n)}if(e){i.text=e}if(a!==undefined){i.origin=a}}}Tt(t,"beforeChange",t,i);if(t.cm){Tt(t.cm,"beforeChange",t.cm,i)}if(i.canceled){if(t.cm){t.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ru(t,r,n){if(t.cm){if(!t.cm.curOp){return qe(t.cm,ru)(t,r,n)}if(t.cm.state.suppressEdits){return}}if(Lt(t,"beforeChange")||t.cm&&Lt(t.cm,"beforeChange")){r=tu(t,r,true);if(!r){return}}var i=Rr&&!n&&$r(t,r.from,r.to);if(i){for(var e=i.length-1;e>=0;--e){nu(t,{from:i[e].from,to:i[e].to,text:e?[""]:r.text,origin:r.origin})}}else{nu(t,r)}}function nu(t,r){if(r.text.length==1&&r.text[0]==""&&cr(r.from,r.to)==0){return}var n=da(t,r);Oa(t,r,n,t.cm?t.cm.curOp.id:NaN);au(t,r,n,zr(t,r));var i=[];ka(t,(function(t,n){if(!n&&$(i,t.history)==-1){cu(t.history,r);i.push(t.history)}au(t,r,null,zr(t,r))}))}function iu(t,r,n){var i=t.cm&&t.cm.state.suppressEdits;if(i&&!n){return}var e=t.history,a,u=t.sel;var o=r=="undo"?e.done:e.undone,s=r=="undo"?e.undone:e.done;var f=0;for(;f<o.length;f++){a=o[f];if(n?a.ranges&&!a.equals(t.sel):!a.ranges){break}}if(f==o.length){return}e.lastOrigin=e.lastSelOrigin=null;for(;;){a=o.pop();if(a.ranges){Ma(a,s);if(n&&!a.equals(t.sel)){$a(t,a,{clearRedo:false});return}u=a}else if(i){o.push(a);return}else{break}}var c=[];Ma(u,s);s.push({changes:c,generation:e.generation});e.generation=a.generation||++e.maxGeneration;var l=Lt(t,"beforeChange")||t.cm&&Lt(t.cm,"beforeChange");var h=function(n){var i=a.changes[n];i.origin=r;if(l&&!tu(t,i,false)){o.length=0;return{}}c.push(xa(t,i));var e=n?da(t,i):tt(o);au(t,i,e,qa(t,i));if(!n&&t.cm){t.cm.scrollIntoView({from:i.from,to:ha(i)})}var u=[];ka(t,(function(t,r){if(!r&&$(u,t.history)==-1){cu(t.history,i);u.push(t.history)}au(t,i,null,qa(t,i))}))};for(var v=a.changes.length-1;v>=0;--v){var d=h(v);if(d)return d.v}}function eu(t,r){if(r==0){return}t.first+=r;t.sel=new sa(rt(t.sel.ranges,(function(t){return new fa(fr(t.anchor.line+r,t.anchor.ch),fr(t.head.line+r,t.head.ch))})),t.sel.primIndex);if(t.cm){Ui(t.cm,t.first,t.first-r,r);for(var n=t.cm.display,i=n.viewFrom;i<n.viewTo;i++){Hi(t.cm,i,"gutter")}}}function au(t,r,n,i){if(t.cm&&!t.cm.curOp){return qe(t.cm,au)(t,r,n,i)}if(r.to.line<t.first){eu(t,r.text.length-1-(r.to.line-r.from.line));return}if(r.from.line>t.lastLine()){return}if(r.from.line<t.first){var e=r.text.length-1-(t.first-r.from.line);eu(t,e);r={from:fr(t.first,0),to:fr(r.to.line+e,r.to.ch),text:[tt(r.text)],origin:r.origin}}var a=t.lastLine();if(r.to.line>a){r={from:r.from,to:fr(a,rr(t,a).text.length),text:[r.text[0]],origin:r.origin}}r.removed=nr(t,r.from,r.to);if(!n){n=da(t,r)}if(t.cm){uu(t.cm,r,i)}else{ya(t,r,i)}Ga(t,n,Z);if(t.cantEdit&&Qa(t,fr(t.firstLine(),0))){t.cantEdit=false}}function uu(t,r,n){var i=t.doc,e=t.display,a=r.from,u=r.to;var o=false,s=a.line;if(!t.options.lineWrapping){s=ar(nn(rr(i,a.line)));i.iter(s,u.line+1,(function(t){if(t==e.maxLine){o=true;return true}}))}if(i.sel.contains(r.from,r.to)>-1){Et(t)}ya(i,r,n,Fi(t));if(!t.options.lineWrapping){i.iter(s,a.line+r.text.length,(function(t){var r=ln(t);if(r>e.maxLineLength){e.maxLine=t;e.maxLineLength=r;e.maxLineChanged=true;o=false}}));if(o){t.curOp.updateMaxLine=true}}Mr(i,a.line);je(t,400);var f=r.text.length-(u.line-a.line)-1;if(r.full){Ui(t)}else if(a.line==u.line&&r.text.length==1&&!wa(t.doc,r)){Hi(t,a.line,"text")}else{Ui(t,a.line,u.line+1,f)}var c=Lt(t,"changes"),l=Lt(t,"change");if(l||c){var h={from:a,to:u,text:r.text,removed:r.removed,origin:r.origin};if(l){Rn(t,"change",t,h)}if(c){(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}}t.display.selForContextMenu=null}function ou(t,r,n,i,e){var a;if(!i){i=n}if(cr(i,n)<0){a=[i,n],n=a[0],i=a[1]}if(typeof r=="string"){r=t.splitLines(r)}ru(t,{from:n,to:i,text:r,origin:e})}function su(t,r,n,i){if(n<t.line){t.line+=i}else if(r<t.line){t.line=r;t.ch=0}}function fu(t,r,n,i){for(var e=0;e<t.length;++e){var a=t[e],u=true;if(a.ranges){if(!a.copied){a=t[e]=a.deepCopy();a.copied=true}for(var o=0;o<a.ranges.length;o++){su(a.ranges[o].anchor,r,n,i);su(a.ranges[o].head,r,n,i)}continue}for(var s=0;s<a.changes.length;++s){var f=a.changes[s];if(n<f.from.line){f.from=fr(f.from.line+i,f.from.ch);f.to=fr(f.to.line+i,f.to.ch)}else if(r<=f.to.line){u=false;break}}if(!u){t.splice(0,e+1);e=0}}}function cu(t,r){var n=r.from.line,i=r.to.line,e=r.text.length-(i-n)-1;fu(t.done,n,i,e);fu(t.undone,n,i,e)}function lu(t,r,n,i){var e=r,a=r;if(typeof r=="number"){a=rr(t,pr(t,r))}else{e=ar(r)}if(e==null){return null}if(i(a,e)&&t.cm){Hi(t.cm,e,n)}return a}function hu(t){this.lines=t;this.parent=null;var r=0;for(var n=0;n<t.length;++n){t[n].parent=this;r+=t[n].height}this.height=r}hu.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,r){for(var n=t,i=t+r;n<i;++n){var e=this.lines[n];this.height-=e.height;pn(e);Rn(e,"delete")}this.lines.splice(t,r)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,r,n){this.height+=n;this.lines=this.lines.slice(0,t).concat(r).concat(this.lines.slice(t));for(var i=0;i<r.length;++i){r[i].parent=this}},iterN:function(t,r,n){for(var i=t+r;t<i;++t){if(n(this.lines[t])){return true}}}};function vu(t){this.children=t;var r=0,n=0;for(var i=0;i<t.length;++i){var e=t[i];r+=e.chunkSize();n+=e.height;e.parent=this}this.size=r;this.height=n;this.parent=null}vu.prototype={chunkSize:function(){return this.size},removeInner:function(t,r){this.size-=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],e=i.chunkSize();if(t<e){var a=Math.min(r,e-t),u=i.height;i.removeInner(t,a);this.height-=u-i.height;if(e==a){this.children.splice(n--,1);i.parent=null}if((r-=a)==0){break}t=0}else{t-=e}}if(this.size-r<25&&(this.children.length>1||!(this.children[0]instanceof hu))){var o=[];this.collapse(o);this.children=[new hu(o)];this.children[0].parent=this}},collapse:function(t){for(var r=0;r<this.children.length;++r){this.children[r].collapse(t)}},insertInner:function(t,r,n){this.size+=r.length;this.height+=n;for(var i=0;i<this.children.length;++i){var e=this.children[i],a=e.chunkSize();if(t<=a){e.insertInner(t,r,n);if(e.lines&&e.lines.length>50){var u=e.lines.length%25+25;for(var o=u;o<e.lines.length;){var s=new hu(e.lines.slice(o,o+=25));e.height-=s.height;this.children.splice(++i,0,s);s.parent=this}e.lines=e.lines.slice(0,u);this.maybeSpill()}break}t-=a}},maybeSpill:function(){if(this.children.length<=10){return}var t=this;do{var r=t.children.splice(t.children.length-5,5);var n=new vu(r);if(!t.parent){var i=new vu(t.children);i.parent=t;t.children=[i,n];t=i}else{t.size-=n.size;t.height-=n.height;var e=$(t.parent.children,t);t.parent.children.splice(e+1,0,n)}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()},iterN:function(t,r,n){for(var i=0;i<this.children.length;++i){var e=this.children[i],a=e.chunkSize();if(t<a){var u=Math.min(r,a-t);if(e.iterN(t,u,n)){return true}if((r-=u)==0){break}t=0}else{t-=a}}}};var du=function(t,r,n){if(n){for(var i in n){if(n.hasOwnProperty(i)){this[i]=n[i]}}}this.doc=t;this.node=r};du.prototype.clear=function(){var t=this.doc.cm,r=this.line.widgets,n=this.line,i=ar(n);if(i==null||!r){return}for(var e=0;e<r.length;++e){if(r[e]==this){r.splice(e--,1)}}if(!r.length){n.widgets=null}var a=Wn(this);er(n,Math.max(0,n.height-a));if(t){Ie(t,(function(){pu(t,n,-a);Hi(t,i,"widget")}));Rn(t,"lineWidgetCleared",t,this,i)}};du.prototype.changed=function(){var t=this;var r=this.height,n=this.doc.cm,i=this.line;this.height=null;var e=Wn(this)-r;if(!e){return}if(!sn(this.doc,i)){er(i,i.height+e)}if(n){Ie(n,(function(){n.curOp.forceUpdate=true;pu(n,i,e);Rn(n,"lineWidgetChanged",n,t,ar(i))}))}};xt(du);function pu(t,r,n){if(cn(r)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)){ce(t,n)}}function gu(t,r,n,i){var e=new du(t,n,i);var a=t.cm;if(a&&e.noHScroll){a.display.alignWidgets=true}lu(t,r,"widget",(function(r){var n=r.widgets||(r.widgets=[]);if(e.insertAt==null){n.push(e)}else{n.splice(Math.min(n.length,Math.max(0,e.insertAt)),0,e)}e.line=r;if(a&&!sn(t,r)){var i=cn(r)<t.scrollTop;er(r,r.height+Wn(e));if(i){ce(a,e.height)}a.curOp.forceUpdate=true}return true}));if(a){Rn(a,"lineWidgetAdded",a,e,typeof r=="number"?r:ar(r))}return e}var bu=0;var mu=function(t,r){this.lines=[];this.type=r;this.doc=t;this.id=++bu};mu.prototype.clear=function(){if(this.explicitlyCleared){return}var t=this.doc.cm,r=t&&!t.curOp;if(r){Ce(t)}if(Lt(this,"clear")){var n=this.find();if(n){Rn(this,"clear",n.from,n.to)}}var i=null,e=null;for(var a=0;a<this.lines.length;++a){var u=this.lines[a];var o=Pr(u.markedSpans,this);if(t&&!this.collapsed){Hi(t,ar(u),"text")}else if(t){if(o.to!=null){e=ar(u)}if(o.from!=null){i=ar(u)}}u.markedSpans=jr(u.markedSpans,o);if(o.from==null&&this.collapsed&&!sn(this.doc,u)&&t){er(u,Ri(t.display))}}if(t&&this.collapsed&&!t.options.lineWrapping){for(var s=0;s<this.lines.length;++s){var f=nn(this.lines[s]),c=ln(f);if(c>t.display.maxLineLength){t.display.maxLine=f;t.display.maxLineLength=c;t.display.maxLineChanged=true}}}if(i!=null&&t&&this.collapsed){Ui(t,i,e+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(t){Za(t.doc)}}if(t){Rn(t,"markerCleared",t,this,i,e)}if(r){De(t)}if(this.parent){this.parent.clear()}};mu.prototype.find=function(t,r){if(t==null&&this.type=="bookmark"){t=1}var n,i;for(var e=0;e<this.lines.length;++e){var a=this.lines[e];var u=Pr(a.markedSpans,this);if(u.from!=null){n=fr(r?a:ar(a),u.from);if(t==-1){return n}}if(u.to!=null){i=fr(r?a:ar(a),u.to);if(t==1){return i}}}return n&&{from:n,to:i}};mu.prototype.changed=function(){var t=this;var r=this.find(-1,true),n=this,i=this.doc.cm;if(!r||!i){return}Ie(i,(function(){var e=r.line,a=ar(r.line);var u=ai(i,a);if(u){vi(u);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!sn(n.doc,e)&&n.height!=null){var o=n.height;n.height=null;var s=Wn(n)-o;if(s){er(e,e.height+s)}}Rn(i,"markerChanged",i,t)}))};mu.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;if(!r.maybeHiddenMarkers||$(r.maybeHiddenMarkers,this)==-1){(r.maybeUnhiddenMarkers||(r.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(t)};mu.prototype.detachLine=function(t){this.lines.splice($(this.lines,t),1);if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(r.maybeHiddenMarkers||(r.maybeHiddenMarkers=[])).push(this)}};xt(mu);function wu(t,r,n,i,e){if(i&&i.shared){return ku(t,r,n,i,e)}if(t.cm&&!t.cm.curOp){return qe(t.cm,wu)(t,r,n,i,e)}var a=new mu(t,e),u=cr(r,n);if(i){H(i,a,false)}if(u>0||u==0&&a.clearWhenEmpty!==false){return a}if(a.replacedWith){a.collapsed=true;a.widgetNode=S("span",[a.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){a.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){a.widgetNode.insertLeft=true}}if(a.collapsed){if(rn(t,r.line,r,n,a)||r.line!=n.line&&rn(t,n.line,r,n,a)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}qr()}if(a.addToHistory){Oa(t,{from:r,to:n,origin:"markText"},t.sel,NaN)}var o=r.line,s=t.cm,f;t.iter(o,n.line+1,(function(i){if(s&&a.collapsed&&!s.options.lineWrapping&&nn(i)==s.display.maxLine){f=true}if(a.collapsed&&o!=r.line){er(i,0)}_r(i,new Fr(a,o==r.line?r.ch:null,o==n.line?n.ch:null),t.cm&&t.cm.curOp);++o}));if(a.collapsed){t.iter(r.line,n.line+1,(function(r){if(sn(t,r)){er(r,0)}}))}if(a.clearOnEnter){wt(a,"beforeCursorEnter",(function(){return a.clear()}))}if(a.readOnly){Ir();if(t.history.done.length||t.history.undone.length){t.clearHistory()}}if(a.collapsed){a.id=++bu;a.atomic=true}if(s){if(f){s.curOp.updateMaxLine=true}if(a.collapsed){Ui(s,r.line,n.line+1)}else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title){for(var c=r.line;c<=n.line;c++){Hi(s,c,"text")}}if(a.atomic){Za(s.doc)}Rn(s,"markerAdded",s,a)}return a}var yu=function(t,r){this.markers=t;this.primary=r;for(var n=0;n<t.length;++n){t[n].parent=this}};yu.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var t=0;t<this.markers.length;++t){this.markers[t].clear()}Rn(this,"clear")};yu.prototype.find=function(t,r){return this.primary.find(t,r)};xt(yu);function ku(t,r,n,i,e){i=H(i);i.shared=false;var a=[wu(t,r,n,i,e)],u=a[0];var o=i.widgetNode;ka(t,(function(t){if(o){i.widgetNode=o.cloneNode(true)}a.push(wu(t,gr(t,r),gr(t,n),i,e));for(var s=0;s<t.linked.length;++s){if(t.linked[s].isParent){return}}u=tt(a)}));return new yu(a,u)}function Tu(t){return t.findMarks(fr(t.first,0),t.clipPos(fr(t.lastLine())),(function(t){return t.parent}))}function Au(t,r){for(var n=0;n<r.length;n++){var i=r[n],e=i.find();var a=t.clipPos(e.from),u=t.clipPos(e.to);if(cr(a,u)){var o=wu(t,a,u,i.primary,i.primary.type);i.markers.push(o);o.parent=i}}}function Eu(t){var r=function(r){var n=t[r],i=[n.primary.doc];ka(n.primary.doc,(function(t){return i.push(t)}));for(var e=0;e<n.markers.length;e++){var a=n.markers[e];if($(i,a.doc)==-1){a.parent=null;n.markers.splice(e--,1)}}};for(var n=0;n<t.length;n++)r(n)}var Lu=0;var xu=function(t,r,n,i,e){if(!(this instanceof xu)){return new xu(t,r,n,i,e)}if(n==null){n=0}vu.call(this,[new hu([new vn("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=n;var a=fr(n,0);this.sel=la(a);this.history=new La(null);this.id=++Lu;this.modeOption=r;this.lineSep=i;this.direction=e=="rtl"?"rtl":"ltr";this.extend=false;if(typeof t=="string"){t=this.splitLines(t)}ya(this,{from:a,to:a,text:t});$a(this,la(a),Z)};xu.prototype=et(vu.prototype,{constructor:xu,iter:function(t,r,n){if(n){this.iterN(t-this.first,r-t,n)}else{this.iterN(this.first,this.first+this.size,t)}},insert:function(t,r){var n=0;for(var i=0;i<r.length;++i){n+=r[i].height}this.insertInner(t-this.first,r,n)},remove:function(t,r){this.removeInner(t-this.first,r)},getValue:function(t){var r=ir(this,this.first,this.first+this.size);if(t===false){return r}return r.join(t||this.lineSeparator())},setValue:Pe((function(t){var r=fr(this.first,0),n=this.first+this.size-1;ru(this,{from:r,to:fr(n,rr(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:true},true);if(this.cm){he(this.cm,0,0)}$a(this,la(r),Z)})),replaceRange:function(t,r,n,i){r=gr(this,r);n=n?gr(this,n):r;ou(this,t,r,n,i)},getRange:function(t,r,n){var i=nr(this,gr(this,t),gr(this,r));if(n===false){return i}if(n===""){return i.join("")}return i.join(n||this.lineSeparator())},getLine:function(t){var r=this.getLineHandle(t);return r&&r.text},getLineHandle:function(t){if(or(this,t)){return rr(this,t)}},getLineNumber:function(t){return ar(t)},getLineHandleVisualStart:function(t){if(typeof t=="number"){t=rr(this,t)}return nn(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return gr(this,t)},getCursor:function(t){var r=this.sel.primary(),n;if(t==null||t=="head"){n=r.head}else if(t=="anchor"){n=r.anchor}else if(t=="end"||t=="to"||t===false){n=r.to()}else{n=r.from()}return n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Pe((function(t,r,n){Ha(this,gr(this,typeof t=="number"?fr(t,r||0):t),null,n)})),setSelection:Pe((function(t,r,n){Ha(this,gr(this,t),gr(this,r||t),n)})),extendSelection:Pe((function(t,r,n){ja(this,gr(this,t),r&&gr(this,r),n)})),extendSelections:Pe((function(t,r){_a(this,mr(this,t),r)})),extendSelectionsBy:Pe((function(t,r){var n=rt(this.sel.ranges,t);_a(this,mr(this,n),r)})),setSelections:Pe((function(t,r,n){if(!t.length){return}var i=[];for(var e=0;e<t.length;e++){i[e]=new fa(gr(this,t[e].anchor),gr(this,t[e].head||t[e].anchor))}if(r==null){r=Math.min(t.length-1,this.sel.primIndex)}$a(this,ca(this.cm,i,r),n)})),addSelection:Pe((function(t,r,n){var i=this.sel.ranges.slice(0);i.push(new fa(gr(this,t),gr(this,r||t)));$a(this,ca(this.cm,i,i.length-1),n)})),getSelection:function(t){var r=this.sel.ranges,n;for(var i=0;i<r.length;i++){var e=nr(this,r[i].from(),r[i].to());n=n?n.concat(e):e}if(t===false){return n}else{return n.join(t||this.lineSeparator())}},getSelections:function(t){var r=[],n=this.sel.ranges;for(var i=0;i<n.length;i++){var e=nr(this,n[i].from(),n[i].to());if(t!==false){e=e.join(t||this.lineSeparator())}r[i]=e}return r},replaceSelection:function(t,r,n){var i=[];for(var e=0;e<this.sel.ranges.length;e++){i[e]=t}this.replaceSelections(i,r,n||"+input")},replaceSelections:Pe((function(t,r,n){var i=[],e=this.sel;for(var a=0;a<e.ranges.length;a++){var u=e.ranges[a];i[a]={from:u.from(),to:u.to(),text:this.splitLines(t[a]),origin:n}}var o=r&&r!="end"&&ga(this,i,r);for(var s=i.length-1;s>=0;s--){ru(this,i[s])}if(o){Va(this,o)}else if(this.cm){le(this.cm)}})),undo:Pe((function(){iu(this,"undo")})),redo:Pe((function(){iu(this,"redo")})),undoSelection:Pe((function(){iu(this,"undo",true)})),redoSelection:Pe((function(){iu(this,"redo",true)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){var t=this.history,r=0,n=0;for(var i=0;i<t.done.length;i++){if(!t.done[i].ranges){++r}}for(var e=0;e<t.undone.length;e++){if(!t.undone[e].ranges){++n}}return{undo:r,redo:n}},clearHistory:function(){var t=this;this.history=new La(this.history);ka(this,(function(r){return r.history=t.history}),true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(t){if(t){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Fa(this.history.done),undone:Fa(this.history.undone)}},setHistory:function(t){var r=this.history=new La(this.history);r.done=Fa(t.done.slice(0),null,true);r.undone=Fa(t.undone.slice(0),null,true)},setGutterMarker:Pe((function(t,r,n){return lu(this,t,"gutter",(function(t){var i=t.gutterMarkers||(t.gutterMarkers={});i[r]=n;if(!n&&st(i)){t.gutterMarkers=null}return true}))})),clearGutter:Pe((function(t){var r=this;this.iter((function(n){if(n.gutterMarkers&&n.gutterMarkers[t]){lu(r,n,"gutter",(function(){n.gutterMarkers[t]=null;if(st(n.gutterMarkers)){n.gutterMarkers=null}return true}))}}))})),lineInfo:function(t){var r;if(typeof t=="number"){if(!or(this,t)){return null}r=t;t=rr(this,t);if(!t){return null}}else{r=ar(t);if(r==null){return null}}return{line:r,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:Pe((function(t,r,n){return lu(this,t,r=="gutter"?"gutter":"class",(function(t){var i=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";if(!t[i]){t[i]=n}else if(L(n).test(t[i])){return false}else{t[i]+=" "+n}return true}))})),removeLineClass:Pe((function(t,r,n){return lu(this,t,r=="gutter"?"gutter":"class",(function(t){var i=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";var e=t[i];if(!e){return false}else if(n==null){t[i]=null}else{var a=e.match(L(n));if(!a){return false}var u=a.index+a[0].length;t[i]=e.slice(0,a.index)+(!a.index||u==e.length?"":" ")+e.slice(u)||null}return true}))})),addLineWidget:Pe((function(t,r,n){return gu(this,t,r,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,r,n){return wu(this,gr(this,t),gr(this,r),n,n&&n.type||"range")},setBookmark:function(t,r){var n={replacedWith:r&&(r.nodeType==null?r.widget:r),insertLeft:r&&r.insertLeft,clearWhenEmpty:false,shared:r&&r.shared,handleMouseEvents:r&&r.handleMouseEvents};t=gr(this,t);return wu(this,t,t,n,"bookmark")},findMarksAt:function(t){t=gr(this,t);var r=[],n=rr(this,t.line).markedSpans;if(n){for(var i=0;i<n.length;++i){var e=n[i];if((e.from==null||e.from<=t.ch)&&(e.to==null||e.to>=t.ch)){r.push(e.marker.parent||e.marker)}}}return r},findMarks:function(t,r,n){t=gr(this,t);r=gr(this,r);var i=[],e=t.line;this.iter(t.line,r.line+1,(function(a){var u=a.markedSpans;if(u){for(var o=0;o<u.length;o++){var s=u[o];if(!(s.to!=null&&e==t.line&&t.ch>=s.to||s.from==null&&e!=t.line||s.from!=null&&e==r.line&&s.from>=r.ch)&&(!n||n(s.marker))){i.push(s.marker.parent||s.marker)}}}++e}));return i},getAllMarks:function(){var t=[];this.iter((function(r){var n=r.markedSpans;if(n){for(var i=0;i<n.length;++i){if(n[i].from!=null){t.push(n[i].marker)}}}}));return t},posFromIndex:function(t){var r,n=this.first,i=this.lineSeparator().length;this.iter((function(e){var a=e.text.length+i;if(a>t){r=t;return true}t-=a;++n}));return gr(this,fr(n,r))},indexFromPos:function(t){t=gr(this,t);var r=t.ch;if(t.line<this.first||t.ch<0){return 0}var n=this.lineSeparator().length;this.iter(this.first,t.line,(function(t){r+=t.text.length+n}));return r},copy:function(t){var r=new xu(ir(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);r.scrollTop=this.scrollTop;r.scrollLeft=this.scrollLeft;r.sel=this.sel;r.extend=false;if(t){r.history.undoDepth=this.history.undoDepth;r.setHistory(this.getHistory())}return r},linkedDoc:function(t){if(!t){t={}}var r=this.first,n=this.first+this.size;if(t.from!=null&&t.from>r){r=t.from}if(t.to!=null&&t.to<n){n=t.to}var i=new xu(ir(this,r,n),t.mode||this.modeOption,r,this.lineSep,this.direction);if(t.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:t.sharedHist}];Au(i,Tu(this));return i},unlinkDoc:function(t){if(t instanceof Uo){t=t.doc}if(this.linked){for(var r=0;r<this.linked.length;++r){var n=this.linked[r];if(n.doc!=t){continue}this.linked.splice(r,1);t.unlinkDoc(this);Eu(Tu(this));break}}if(t.history==this.history){var i=[t.id];ka(t,(function(t){return i.push(t.id)}),true);t.history=new La(null);t.history.done=Fa(this.history.done,i);t.history.undone=Fa(this.history.undone,i)}},iterLinkedDocs:function(t){ka(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){if(this.lineSep){return t.split(this.lineSep)}return Pt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Pe((function(t){if(t!="rtl"){t="ltr"}if(t==this.direction){return}this.direction=t;this.iter((function(t){return t.order=null}));if(this.cm){Ea(this.cm)}}))});xu.prototype.eachLine=xu.prototype.iter;var Cu=0;function Du(t){var r=this;Nu(r);if(At(r,t)||Zn(r.display,t)){return}Ct(t);if(u){Cu=+new Date}var n=ji(r,t,true),i=t.dataTransfer.files;if(!n||r.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var e=i.length,a=Array(e),o=0;var s=function(){if(++o==e){qe(r,(function(){n=gr(r.doc,n);var t={from:n,to:n,text:r.doc.splitLines(a.filter((function(t){return t!=null})).join(r.doc.lineSeparator())),origin:"paste"};ru(r.doc,t);Va(r.doc,la(gr(r.doc,n),gr(r.doc,ha(t))))}))()}};var f=function(t,n){if(r.options.allowDropFileTypes&&$(r.options.allowDropFileTypes,t.type)==-1){s();return}var i=new FileReader;i.onerror=function(){return s()};i.onload=function(){var t=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)){s();return}a[n]=t;s()};i.readAsText(t)};for(var c=0;c<i.length;c++){f(i[c],c)}}else{if(r.state.draggingText&&r.doc.sel.contains(n)>-1){r.state.draggingText(t);setTimeout((function(){return r.display.input.focus()}),20);return}try{var l=t.dataTransfer.getData("Text");if(l){var h;if(r.state.draggingText&&!r.state.draggingText.copy){h=r.listSelections()}Ga(r.doc,la(n,n));if(h){for(var v=0;v<h.length;++v){ou(r.doc,"",h[v].anchor,h[v].head,"drag")}}r.replaceSelection(l,"around","paste");r.display.input.focus()}}catch(t){}}}function Ou(t,r){if(u&&(!t.state.draggingText||+new Date-Cu<100)){St(r);return}if(At(t,r)||Zn(t.display,r)){return}r.dataTransfer.setData("Text",t.getSelection());r.dataTransfer.effectAllowed="copyMove";if(r.dataTransfer.setDragImage&&!v){var n=O("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(h){n.width=n.height=1;t.display.wrapper.appendChild(n);n._top=n.offsetTop}r.dataTransfer.setDragImage(n,0,0);if(h){n.parentNode.removeChild(n)}}}function Su(t,r){var n=ji(t,r);if(!n){return}var i=document.createDocumentFragment();Ki(t,n,i);if(!t.display.dragCursor){t.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors");t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)}D(t.display.dragCursor,i)}function Nu(t){if(t.display.dragCursor){t.display.lineSpace.removeChild(t.display.dragCursor);t.display.dragCursor=null}}function Mu(t){if(!document.getElementsByClassName){return}var r=document.getElementsByClassName("CodeMirror"),n=[];for(var i=0;i<r.length;i++){var e=r[i].CodeMirror;if(e){n.push(e)}}if(n.length){n[0].operation((function(){for(var r=0;r<n.length;r++){t(n[r])}}))}}var Ru=false;function Bu(){if(Ru){return}Iu();Ru=true}function Iu(){var t;wt(window,"resize",(function(){if(t==null){t=setTimeout((function(){t=null;Mu(qu)}),100)}}));wt(window,"blur",(function(){return Mu(ne)}))}function qu(t){var r=t.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null;r.scrollbarsClipped=false;t.setSize()}var Fu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var Pu=0;Pu<10;Pu++){Fu[Pu+48]=Fu[Pu+96]=String(Pu)}for(var ju=65;ju<=90;ju++){Fu[ju]=String.fromCharCode(ju)}for(var _u=1;_u<=12;_u++){Fu[_u+111]=Fu[_u+63235]="F"+_u}var Uu={};Uu.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"};Uu.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"};Uu.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};Uu.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"]};Uu["default"]=w?Uu.macDefault:Uu.pcDefault;function Hu(t){var r=t.split(/-(?!$)/);t=r[r.length-1];var n,i,e,a;for(var u=0;u<r.length-1;u++){var o=r[u];if(/^(cmd|meta|m)$/i.test(o)){a=true}else if(/^a(lt)?$/i.test(o)){n=true}else if(/^(c|ctrl|control)$/i.test(o)){i=true}else if(/^s(hift)?$/i.test(o)){e=true}else{throw new Error("Unrecognized modifier name: "+o)}}if(n){t="Alt-"+t}if(i){t="Ctrl-"+t}if(a){t="Cmd-"+t}if(e){t="Shift-"+t}return t}function zu(t){var r={};for(var n in t){if(t.hasOwnProperty(n)){var i=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n)){continue}if(i=="..."){delete t[n];continue}var e=rt(n.split(" "),Hu);for(var a=0;a<e.length;a++){var u=void 0,o=void 0;if(a==e.length-1){o=e.join(" ");u=i}else{o=e.slice(0,a+1).join(" ");u="..."}var s=r[o];if(!s){r[o]=u}else if(s!=u){throw new Error("Inconsistent bindings for "+o)}}delete t[n]}}for(var f in r){t[f]=r[f]}return t}function Vu(t,r,n,i){r=Zu(r);var e=r.call?r.call(t,i):r[t];if(e===false){return"nothing"}if(e==="..."){return"multi"}if(e!=null&&n(e)){return"handled"}if(r.fallthrough){if(Object.prototype.toString.call(r.fallthrough)!="[object Array]"){return Vu(t,r.fallthrough,n,i)}for(var a=0;a<r.fallthrough.length;a++){var u=Vu(t,r.fallthrough[a],n,i);if(u){return u}}}}function $u(t){var r=typeof t=="string"?t:Fu[t.keyCode];return r=="Ctrl"||r=="Alt"||r=="Shift"||r=="Mod"}function Gu(t,r,n){var i=t;if(r.altKey&&i!="Alt"){t="Alt-"+t}if((A?r.metaKey:r.ctrlKey)&&i!="Ctrl"){t="Ctrl-"+t}if((A?r.ctrlKey:r.metaKey)&&i!="Mod"){t="Cmd-"+t}if(!n&&r.shiftKey&&i!="Shift"){t="Shift-"+t}return t}function Wu(t,r){if(h&&t.keyCode==34&&t["char"]){return false}var n=Fu[t.keyCode];if(n==null||t.altGraphKey){return false}if(t.keyCode==3&&t.code){n=t.code}return Gu(n,t,r)}function Zu(t){return typeof t=="string"?Uu[t]:t}function Ku(t,r){var n=t.doc.sel.ranges,i=[];for(var e=0;e<n.length;e++){var a=r(n[e]);while(i.length&&cr(a.from,tt(i).to)<=0){var u=i.pop();if(cr(u.from,a.from)<0){a.from=u.from;break}}i.push(a)}Ie(t,(function(){for(var r=i.length-1;r>=0;r--){ou(t.doc,"",i[r].from,i[r].to,"+delete")}le(t)}))}function Yu(t,r,n){var i=lt(t.text,r+n,n);return i<0||i>t.text.length?null:i}function Qu(t,r,n){var i=Yu(t,r.ch,n);return i==null?null:new fr(r.line,i,n<0?"after":"before")}function Xu(t,r,n,i,e){if(t){if(r.doc.direction=="rtl"){e=-e}var a=bt(n,r.doc.direction);if(a){var u=e<0?tt(a):a[0];var o=e<0==(u.level==1);var s=o?"after":"before";var f;if(u.level>0||r.doc.direction=="rtl"){var c=ui(r,n);f=e<0?n.text.length-1:0;var l=oi(r,c,f).top;f=ht((function(t){return oi(r,c,t).top==l}),e<0==(u.level==1)?u.from:u.to-1,f);if(s=="before"){f=Yu(n,f,1)}}else{f=e<0?u.to:u.from}return new fr(i,f,s)}}return new fr(i,e<0?n.text.length:0,e<0?"before":"after")}function Ju(t,r,n,i){var e=bt(r,t.doc.direction);if(!e){return Qu(r,n,i)}if(n.ch>=r.text.length){n.ch=r.text.length;n.sticky="before"}else if(n.ch<=0){n.ch=0;n.sticky="after"}var a=pt(e,n.ch,n.sticky),u=e[a];if(t.doc.direction=="ltr"&&u.level%2==0&&(i>0?u.to>n.ch:u.from<n.ch)){return Qu(r,n,i)}var o=function(t,n){return Yu(r,t instanceof fr?t.ch:t,n)};var s;var f=function(n){if(!t.options.lineWrapping){return{begin:0,end:r.text.length}}s=s||ui(t,r);return Ci(t,r,s,n)};var c=f(n.sticky=="before"?o(n,-1):n.ch);if(t.doc.direction=="rtl"||u.level==1){var l=u.level==1==i<0;var h=o(n,l?1:-1);if(h!=null&&(!l?h>=u.from&&h>=c.begin:h<=u.to&&h<=c.end)){var v=l?"before":"after";return new fr(n.line,h,v)}}var d=function(t,r,i){var a=function(t,r){return r?new fr(n.line,o(t,1),"before"):new fr(n.line,t,"after")};for(;t>=0&&t<e.length;t+=r){var u=e[t];var s=r>0==(u.level!=1);var f=s?i.begin:o(i.end,-1);if(u.from<=f&&f<u.to){return a(f,s)}f=s?u.from:o(u.to,-1);if(i.begin<=f&&f<i.end){return a(f,s)}}};var p=d(a+i,i,c);if(p){return p}var g=i>0?c.end:o(c.begin,-1);if(g!=null&&!(i>0&&g==r.text.length)){p=d(i>0?0:e.length-1,i,f(g));if(p){return p}}return null}var to={selectAll:Ja,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),Z)},killLine:function(t){return Ku(t,(function(r){if(r.empty()){var n=rr(t.doc,r.head.line).text.length;if(r.head.ch==n&&r.head.line<t.lastLine()){return{from:r.head,to:fr(r.head.line+1,0)}}else{return{from:r.head,to:fr(r.head.line,n)}}}else{return{from:r.from(),to:r.to()}}}))},deleteLine:function(t){return Ku(t,(function(r){return{from:fr(r.from().line,0),to:gr(t.doc,fr(r.to().line+1,0))}}))},delLineLeft:function(t){return Ku(t,(function(t){return{from:fr(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Ku(t,(function(r){var n=t.charCoords(r.head,"div").top+5;var i=t.coordsChar({left:0,top:n},"div");return{from:i,to:r.from()}}))},delWrappedLineRight:function(t){return Ku(t,(function(r){var n=t.charCoords(r.head,"div").top+5;var i=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:r.from(),to:i}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(fr(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(fr(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(r){return ro(t,r.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(r){return io(t,r.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(r){return no(t,r.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(r){var n=t.cursorCoords(r.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),Y)},goLineLeft:function(t){return t.extendSelectionsBy((function(r){var n=t.cursorCoords(r.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),Y)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(r){var n=t.cursorCoords(r.head,"div").top+5;var i=t.coordsChar({left:0,top:n},"div");if(i.ch<t.getLine(i.line).search(/\S/)){return io(t,r.head)}return i}),Y)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){var r=[],n=t.listSelections(),i=t.options.tabSize;for(var e=0;e<n.length;e++){var a=n[e].from();var u=z(t.getLine(a.line),a.ch,i);r.push(J(i-u%i))}t.replaceSelections(r)},defaultTab:function(t){if(t.somethingSelected()){t.indentSelection("add")}else{t.execCommand("insertTab")}},transposeChars:function(t){return Ie(t,(function(){var r=t.listSelections(),n=[];for(var i=0;i<r.length;i++){if(!r[i].empty()){continue}var e=r[i].head,a=rr(t.doc,e.line).text;if(a){if(e.ch==a.length){e=new fr(e.line,e.ch-1)}if(e.ch>0){e=new fr(e.line,e.ch+1);t.replaceRange(a.charAt(e.ch-1)+a.charAt(e.ch-2),fr(e.line,e.ch-2),e,"+transpose")}else if(e.line>t.doc.first){var u=rr(t.doc,e.line-1).text;if(u){e=new fr(e.line,1);t.replaceRange(a.charAt(0)+t.doc.lineSeparator()+u.charAt(u.length-1),fr(e.line-1,u.length-1),e,"+transpose")}}}n.push(new fa(e,e))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ie(t,(function(){var r=t.listSelections();for(var n=r.length-1;n>=0;n--){t.replaceRange(t.doc.lineSeparator(),r[n].anchor,r[n].head,"+input")}r=t.listSelections();for(var i=0;i<r.length;i++){t.indentLine(r[i].from().line,null,true)}le(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function ro(t,r){var n=rr(t.doc,r);var i=nn(n);if(i!=n){r=ar(i)}return Xu(true,t,i,r,1)}function no(t,r){var n=rr(t.doc,r);var i=en(n);if(i!=n){r=ar(i)}return Xu(true,t,n,r,-1)}function io(t,r){var n=ro(t,r.line);var i=rr(t.doc,n.line);var e=bt(i,t.doc.direction);if(!e||e[0].level==0){var a=Math.max(n.ch,i.text.search(/\S/));var u=r.line==n.line&&r.ch<=a&&r.ch;return fr(n.line,u?0:a,n.sticky)}return n}function eo(t,r,n){if(typeof r=="string"){r=to[r];if(!r){return false}}t.display.input.ensurePolled();var i=t.display.shift,e=false;try{if(t.isReadOnly()){t.state.suppressEdits=true}if(n){t.display.shift=false}e=r(t)!=W}finally{t.display.shift=i;t.state.suppressEdits=false}return e}function ao(t,r,n){for(var i=0;i<t.state.keyMaps.length;i++){var e=Vu(r,t.state.keyMaps[i],n,t);if(e){return e}}return t.options.extraKeys&&Vu(r,t.options.extraKeys,n,t)||Vu(r,t.options.keyMap,n,t)}var uo=new V;function oo(t,r,n,i){var e=t.state.keySeq;if(e){if($u(r)){return"handled"}if(/\'$/.test(r)){t.state.keySeq=null}else{uo.set(50,(function(){if(t.state.keySeq==e){t.state.keySeq=null;t.display.input.reset()}}))}if(so(t,e+" "+r,n,i)){return true}}return so(t,r,n,i)}function so(t,r,n,i){var e=ao(t,r,i);if(e=="multi"){t.state.keySeq=r}if(e=="handled"){Rn(t,"keyHandled",t,r,n)}if(e=="handled"||e=="multi"){Ct(n);Xi(t)}return!!e}function fo(t,r){var n=Wu(r,true);if(!n){return false}if(r.shiftKey&&!t.state.keySeq){return oo(t,"Shift-"+n,r,(function(r){return eo(t,r,true)}))||oo(t,n,r,(function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion){return eo(t,r)}}))}else{return oo(t,n,r,(function(r){return eo(t,r)}))}}function co(t,r,n){return oo(t,"'"+n+"'",r,(function(r){return eo(t,r,true)}))}var lo=null;function ho(t){var r=this;if(t.target&&t.target!=r.display.input.getField()){return}r.curOp.focus=R(P(r));if(At(r,t)){return}if(u&&o<11&&t.keyCode==27){t.returnValue=false}var i=t.keyCode;r.display.shift=i==16||t.shiftKey;var e=fo(r,t);if(h){lo=e?i:null;if(!e&&i==88&&!_t&&(w?t.metaKey:t.ctrlKey)){r.replaceSelection("",null,"cut")}}if(n&&!w&&!e&&i==46&&t.shiftKey&&!t.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)){vo(r)}}function vo(t){var r=t.display.lineDiv;B(r,"CodeMirror-crosshair");function n(t){if(t.keyCode==18||!t.altKey){x(r,"CodeMirror-crosshair");kt(document,"keyup",n);kt(document,"mouseover",n)}}wt(document,"keyup",n);wt(document,"mouseover",n)}function po(t){if(t.keyCode==16){this.doc.sel.shift=false}At(this,t)}function go(t){var r=this;if(t.target&&t.target!=r.display.input.getField()){return}if(Zn(r.display,t)||At(r,t)||t.ctrlKey&&!t.altKey||w&&t.metaKey){return}var n=t.keyCode,i=t.charCode;if(h&&n==lo){lo=null;Ct(t);return}if(h&&(!t.which||t.which<10)&&fo(r,t)){return}var e=String.fromCharCode(i==null?n:i);if(e=="\b"){return}if(co(r,t,e)){return}r.display.input.onKeyPress(t)}var bo=400;var mo=function(t,r,n){this.time=t;this.pos=r;this.button=n};mo.prototype.compare=function(t,r,n){return this.time+bo>t&&cr(r,this.pos)==0&&n==this.button};var wo,yo;function ko(t,r){var n=+new Date;if(yo&&yo.compare(n,t,r)){wo=yo=null;return"triple"}else if(wo&&wo.compare(n,t,r)){yo=new mo(n,t,r);wo=null;return"double"}else{wo=new mo(n,t,r);yo=null;return"single"}}function To(t){var r=this,n=r.display;if(At(r,t)||n.activeTouch&&n.input.supportsTouch()){return}n.input.ensurePolled();n.shift=t.shiftKey;if(Zn(n,t)){if(!s){n.scroller.draggable=false;setTimeout((function(){return n.scroller.draggable=true}),100)}return}if(No(r,t)){return}var i=ji(r,t),e=Mt(t),a=i?ko(i,e):"single";_(r).focus();if(e==1&&r.state.selectingText){r.state.selectingText(t)}if(i&&Ao(r,e,i,a,t)){return}if(e==1){if(i){Lo(r,i,a,t)}else if(Nt(t)==n.scroller){Ct(t)}}else if(e==2){if(i){ja(r.doc,i)}setTimeout((function(){return n.input.focus()}),20)}else if(e==3){if(E){r.display.input.onContextMenu(t)}else{te(r)}}}function Ao(t,r,n,i,e){var a="Click";if(i=="double"){a="Double"+a}else if(i=="triple"){a="Triple"+a}a=(r==1?"Left":r==2?"Middle":"Right")+a;return oo(t,Gu(a,e),e,(function(r){if(typeof r=="string"){r=to[r]}if(!r){return false}var i=false;try{if(t.isReadOnly()){t.state.suppressEdits=true}i=r(t,n)!=W}finally{t.state.suppressEdits=false}return i}))}function Eo(t,r,n){var i=t.getOption("configureMouse");var e=i?i(t,r,n):{};if(e.unit==null){var a=y?n.shiftKey&&n.metaKey:n.altKey;e.unit=a?"rectangle":r=="single"?"char":r=="double"?"word":"line"}if(e.extend==null||t.doc.extend){e.extend=t.doc.extend||n.shiftKey}if(e.addNew==null){e.addNew=w?n.metaKey:n.ctrlKey}if(e.moveOnDrag==null){e.moveOnDrag=!(w?n.altKey:n.ctrlKey)}return e}function Lo(t,r,n,i){if(u){setTimeout(U(Ji,t),0)}else{t.curOp.focus=R(P(t))}var e=Eo(t,n,i);var a=t.doc.sel,o;if(t.options.dragDrop&&Rt&&!t.isReadOnly()&&n=="single"&&(o=a.contains(r))>-1&&(cr((o=a.ranges[o]).from(),r)<0||r.xRel>0)&&(cr(o.to(),r)>0||r.xRel<0)){xo(t,i,r,e)}else{Do(t,i,r,e)}}function xo(t,r,n,i){var e=t.display,a=false;var f=qe(t,(function(r){if(s){e.scroller.draggable=false}t.state.draggingText=false;if(t.state.delayingBlurEvent){if(t.hasFocus()){t.state.delayingBlurEvent=false}else{te(t)}}kt(e.wrapper.ownerDocument,"mouseup",f);kt(e.wrapper.ownerDocument,"mousemove",c);kt(e.scroller,"dragstart",l);kt(e.scroller,"drop",f);if(!a){Ct(r);if(!i.addNew){ja(t.doc,n,null,null,i.extend)}if(s&&!v||u&&o==9){setTimeout((function(){e.wrapper.ownerDocument.body.focus({preventScroll:true});e.input.focus()}),20)}else{e.input.focus()}}}));var c=function(t){a=a||Math.abs(r.clientX-t.clientX)+Math.abs(r.clientY-t.clientY)>=10};var l=function(){return a=true};if(s){e.scroller.draggable=true}t.state.draggingText=f;f.copy=!i.moveOnDrag;wt(e.wrapper.ownerDocument,"mouseup",f);wt(e.wrapper.ownerDocument,"mousemove",c);wt(e.scroller,"dragstart",l);wt(e.scroller,"drop",f);t.state.delayingBlurEvent=true;setTimeout((function(){return e.input.focus()}),20);if(e.scroller.dragDrop){e.scroller.dragDrop()}}function Co(t,r,n){if(n=="char"){return new fa(r,r)}if(n=="word"){return t.findWordAt(r)}if(n=="line"){return new fa(fr(r.line,0),gr(t.doc,fr(r.line+1,0)))}var i=n(t,r);return new fa(i.from,i.to)}function Do(t,r,n,i){if(u){te(t)}var e=t.display,a=t.doc;Ct(r);var o,s,f=a.sel,c=f.ranges;if(i.addNew&&!i.extend){s=a.sel.contains(n);if(s>-1){o=c[s]}else{o=new fa(n,n)}}else{o=a.sel.primary();s=a.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){o=new fa(n,n)}n=ji(t,r,true,true);s=-1}else{var l=Co(t,n,i.unit);if(i.extend){o=Pa(o,l.anchor,l.head,i.extend)}else{o=l}}if(!i.addNew){s=0;$a(a,new sa([o],0),K);f=a.sel}else if(s==-1){s=c.length;$a(a,ca(t,c.concat([o]),s),{scroll:false,origin:"*mouse"})}else if(c.length>1&&c[s].empty()&&i.unit=="char"&&!i.extend){$a(a,ca(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:false,origin:"*mouse"});f=a.sel}else{Ua(a,s,o,K)}var h=n;function v(r){if(cr(h,r)==0){return}h=r;if(i.unit=="rectangle"){var e=[],u=t.options.tabSize;var c=z(rr(a,n.line).text,n.ch,u);var l=z(rr(a,r.line).text,r.ch,u);var v=Math.min(c,l),d=Math.max(c,l);for(var p=Math.min(n.line,r.line),g=Math.min(t.lastLine(),Math.max(n.line,r.line));p<=g;p++){var b=rr(a,p).text,m=Q(b,v,u);if(v==d){e.push(new fa(fr(p,m),fr(p,m)))}else if(b.length>m){e.push(new fa(fr(p,m),fr(p,Q(b,d,u))))}}if(!e.length){e.push(new fa(n,n))}$a(a,ca(t,f.ranges.slice(0,s).concat(e),s),{origin:"*mouse",scroll:false});t.scrollIntoView(r)}else{var w=o;var y=Co(t,r,i.unit);var k=w.anchor,T;if(cr(y.anchor,k)>0){T=y.head;k=dr(w.from(),y.anchor)}else{T=y.anchor;k=vr(w.to(),y.head)}var A=f.ranges.slice(0);A[s]=Oo(t,new fa(gr(a,k),T));$a(a,ca(t,A,s),K)}}var d=e.wrapper.getBoundingClientRect();var p=0;function g(r){var n=++p;var u=ji(t,r,true,i.unit=="rectangle");if(!u){return}if(cr(u,h)!=0){t.curOp.focus=R(P(t));v(u);var o=ae(e,a);if(u.line>=o.to||u.line<o.from){setTimeout(qe(t,(function(){if(p==n){g(r)}})),150)}}else{var s=r.clientY<d.top?-20:r.clientY>d.bottom?20:0;if(s){setTimeout(qe(t,(function(){if(p!=n){return}e.scroller.scrollTop+=s;g(r)})),50)}}}function b(r){t.state.selectingText=false;p=Infinity;if(r){Ct(r);e.input.focus()}kt(e.wrapper.ownerDocument,"mousemove",m);kt(e.wrapper.ownerDocument,"mouseup",w);a.history.lastSelOrigin=null}var m=qe(t,(function(t){if(t.buttons===0||!Mt(t)){b(t)}else{g(t)}}));var w=qe(t,b);t.state.selectingText=w;wt(e.wrapper.ownerDocument,"mousemove",m);wt(e.wrapper.ownerDocument,"mouseup",w)}function Oo(t,r){var n=r.anchor;var i=r.head;var e=rr(t.doc,n.line);if(cr(n,i)==0&&n.sticky==i.sticky){return r}var a=bt(e);if(!a){return r}var u=pt(a,n.ch,n.sticky),o=a[u];if(o.from!=n.ch&&o.to!=n.ch){return r}var s=u+(o.from==n.ch==(o.level!=1)?0:1);if(s==0||s==a.length){return r}var f;if(i.line!=n.line){f=(i.line-n.line)*(t.doc.direction=="ltr"?1:-1)>0}else{var c=pt(a,i.ch,i.sticky);var l=c-u||(i.ch-n.ch)*(o.level==1?-1:1);if(c==s-1||c==s){f=l<0}else{f=l>0}}var h=a[s+(f?-1:0)];var v=f==(h.level==1);var d=v?h.from:h.to,p=v?"after":"before";return n.ch==d&&n.sticky==p?r:new fa(new fr(n.line,d,p),i)}function So(t,r,n,i){var e,a;if(r.touches){e=r.touches[0].clientX;a=r.touches[0].clientY}else{try{e=r.clientX;a=r.clientY}catch(t){return false}}if(e>=Math.floor(t.display.gutters.getBoundingClientRect().right)){return false}if(i){Ct(r)}var u=t.display;var o=u.lineDiv.getBoundingClientRect();if(a>o.bottom||!Lt(t,n)){return Ot(r)}a-=o.top-u.viewOffset;for(var s=0;s<t.display.gutterSpecs.length;++s){var f=u.gutters.childNodes[s];if(f&&f.getBoundingClientRect().right>=e){var c=ur(t.doc,a);var l=t.display.gutterSpecs[s];Tt(t,n,t,c,l.className,r);return Ot(r)}}}function No(t,r){return So(t,r,"gutterClick",true)}function Mo(t,r){if(Zn(t.display,r)||Ro(t,r)){return}if(At(t,r,"contextmenu")){return}if(!E){t.display.input.onContextMenu(r)}}function Ro(t,r){if(!Lt(t,"gutterContextMenu")){return false}return So(t,r,"gutterContextMenu",false)}function Bo(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-");pi(t)}var Io={toString:function(){return"CodeMirror.Init"}};var qo={};var Fo={};function Po(t){var r=t.optionHandlers;function n(n,i,e,a){t.defaults[n]=i;if(e){r[n]=a?function(t,r,n){if(n!=Io){e(t,r,n)}}:e}}t.defineOption=n;t.Init=Io;n("value","",(function(t,r){return t.setValue(r)}),true);n("mode",null,(function(t,r){t.doc.modeOption=r;ba(t)}),true);n("indentUnit",2,ba,true);n("indentWithTabs",false);n("smartIndent",true);n("tabSize",4,(function(t){ma(t);pi(t);Ui(t)}),true);n("lineSeparator",null,(function(t,r){t.doc.lineSep=r;if(!r){return}var n=[],i=t.doc.first;t.doc.iter((function(t){for(var e=0;;){var a=t.text.indexOf(r,e);if(a==-1){break}e=a+r.length;n.push(fr(i,a))}i++}));for(var e=n.length-1;e>=0;e--){ou(t.doc,r,n[e],fr(n[e].line,n[e].ch+r.length))}}));n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test("\t")?"":"|\t"),"g");if(n!=Io){t.refresh()}}));n("specialCharPlaceholder",yn,(function(t){return t.refresh()}),true);n("electricChars",true);n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);n("spellcheck",false,(function(t,r){return t.getInputField().spellcheck=r}),true);n("autocorrect",false,(function(t,r){return t.getInputField().autocorrect=r}),true);n("autocapitalize",false,(function(t,r){return t.getInputField().autocapitalize=r}),true);n("rtlMoveVisually",!k);n("wholeLineUpdateBefore",true);n("theme","default",(function(t){Bo(t);ra(t)}),true);n("keyMap","default",(function(t,r,n){var i=Zu(r);var e=n!=Io&&Zu(n);if(e&&e.detach){e.detach(t,i)}if(i.attach){i.attach(t,e||null)}}));n("extraKeys",null);n("configureMouse",null);n("lineWrapping",false,_o,true);n("gutters",[],(function(t,r){t.display.gutterSpecs=Je(r,t.options.lineNumbers);ra(t)}),true);n("fixedGutter",true,(function(t,r){t.display.gutters.style.left=r?qi(t.display)+"px":"0";t.refresh()}),true);n("coverGutterNextToScrollbar",false,(function(t){return Te(t)}),true);n("scrollbarStyle","native",(function(t){Le(t);Te(t);t.display.scrollbars.setScrollTop(t.doc.scrollTop);t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),true);n("lineNumbers",false,(function(t,r){t.display.gutterSpecs=Je(t.options.gutters,r);ra(t)}),true);n("firstLineNumber",1,ra,true);n("lineNumberFormatter",(function(t){return t}),ra,true);n("showCursorWhenSelecting",false,Wi,true);n("resetSelectionOnContextMenu",true);n("lineWiseCopyCut",true);n("pasteLinesPerSelection",true);n("selectionsMayTouch",false);n("readOnly",false,(function(t,r){if(r=="nocursor"){ne(t);t.display.input.blur()}t.display.input.readOnlyChanged(r)}));n("screenReaderLabel",null,(function(t,r){r=r===""?null:r;t.display.input.screenReaderLabelChanged(r)}));n("disableInput",false,(function(t,r){if(!r){t.display.input.reset()}}),true);n("dragDrop",true,jo);n("allowDropFileTypes",null);n("cursorBlinkRate",530);n("cursorScrollMargin",0);n("cursorHeight",1,Wi,true);n("singleCursorHeightPerLine",true,Wi,true);n("workTime",100);n("workDelay",100);n("flattenSpans",true,ma,true);n("addModeClass",false,ma,true);n("pollInterval",100);n("undoDepth",200,(function(t,r){return t.doc.history.undoDepth=r}));n("historyEventDelay",1250);n("viewportMargin",10,(function(t){return t.refresh()}),true);n("maxHighlightLength",1e4,ma,true);n("moveInputWithCursor",true,(function(t,r){if(!r){t.display.input.resetPosition()}}));n("tabindex",null,(function(t,r){return t.display.input.getField().tabIndex=r||""}));n("autofocus",null);n("direction","ltr",(function(t,r){return t.doc.setDirection(r)}),true);n("phrases",null)}function jo(t,r,n){var i=n&&n!=Io;if(!r!=!i){var e=t.display.dragFunctions;var a=r?wt:kt;a(t.display.scroller,"dragstart",e.start);a(t.display.scroller,"dragenter",e.enter);a(t.display.scroller,"dragover",e.over);a(t.display.scroller,"dragleave",e.leave);a(t.display.scroller,"drop",e.drop)}}function _o(t){if(t.options.lineWrapping){B(t.display.wrapper,"CodeMirror-wrap");t.display.sizer.style.minWidth="";t.display.sizerWidth=null}else{x(t.display.wrapper,"CodeMirror-wrap");hn(t)}Pi(t);Ui(t);pi(t);setTimeout((function(){return Te(t)}),100)}function Uo(t,r){var n=this;if(!(this instanceof Uo)){return new Uo(t,r)}this.options=r=r?H(r):{};H(qo,r,false);var i=r.value;if(typeof i=="string"){i=new xu(i,r.mode,null,r.lineSeparator,r.direction)}else if(r.mode){i.modeOption=r.mode}this.doc=i;var e=new Uo.inputStyles[r.inputStyle](this);var a=this.display=new na(t,i,e,r);a.wrapper.CodeMirror=this;Bo(this);if(r.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}Le(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new V,keySeq:null,specialChars:null};if(r.autofocus&&!m){a.input.focus()}if(u&&o<11){setTimeout((function(){return n.display.input.reset(true)}),20)}Ho(this);Bu();Ce(this);this.curOp.forceUpdate=true;Ta(this,i);if(r.autofocus&&!m||this.hasFocus()){setTimeout((function(){if(n.hasFocus()&&!n.state.focused){re(n)}}),20)}else{ne(this)}for(var f in Fo){if(Fo.hasOwnProperty(f)){Fo[f](this,r[f],Io)}}Xe(this);if(r.finishInit){r.finishInit(this)}for(var c=0;c<zo.length;++c){zo[c](this)}De(this);if(s&&r.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"){a.lineDiv.style.textRendering="auto"}}Uo.defaults=qo;Uo.optionHandlers=Fo;function Ho(t){var r=t.display;wt(r.scroller,"mousedown",qe(t,To));if(u&&o<11){wt(r.scroller,"dblclick",qe(t,(function(r){if(At(t,r)){return}var n=ji(t,r);if(!n||No(t,r)||Zn(t.display,r)){return}Ct(r);var i=t.findWordAt(n);ja(t.doc,i.anchor,i.head)})))}else{wt(r.scroller,"dblclick",(function(r){return At(t,r)||Ct(r)}))}wt(r.scroller,"contextmenu",(function(r){return Mo(t,r)}));wt(r.input.getField(),"contextmenu",(function(n){if(!r.scroller.contains(n.target)){Mo(t,n)}}));var n,i={end:0};function e(){if(r.activeTouch){n=setTimeout((function(){return r.activeTouch=null}),1e3);i=r.activeTouch;i.end=+new Date}}function a(t){if(t.touches.length!=1){return false}var r=t.touches[0];return r.radiusX<=1&&r.radiusY<=1}function s(t,r){if(r.left==null){return true}var n=r.left-t.left,i=r.top-t.top;return n*n+i*i>20*20}wt(r.scroller,"touchstart",(function(e){if(!At(t,e)&&!a(e)&&!No(t,e)){r.input.ensurePolled();clearTimeout(n);var u=+new Date;r.activeTouch={start:u,moved:false,prev:u-i.end<=300?i:null};if(e.touches.length==1){r.activeTouch.left=e.touches[0].pageX;r.activeTouch.top=e.touches[0].pageY}}}));wt(r.scroller,"touchmove",(function(){if(r.activeTouch){r.activeTouch.moved=true}}));wt(r.scroller,"touchend",(function(n){var i=r.activeTouch;if(i&&!Zn(r,n)&&i.left!=null&&!i.moved&&new Date-i.start<300){var a=t.coordsChar(r.activeTouch,"page"),u;if(!i.prev||s(i,i.prev)){u=new fa(a,a)}else if(!i.prev.prev||s(i,i.prev.prev)){u=t.findWordAt(a)}else{u=new fa(fr(a.line,0),gr(t.doc,fr(a.line+1,0)))}t.setSelection(u.anchor,u.head);t.focus();Ct(n)}e()}));wt(r.scroller,"touchcancel",e);wt(r.scroller,"scroll",(function(){if(r.scroller.clientHeight){ge(t,r.scroller.scrollTop);me(t,r.scroller.scrollLeft,true);Tt(t,"scroll",t)}}));wt(r.scroller,"mousewheel",(function(r){return oa(t,r)}));wt(r.scroller,"DOMMouseScroll",(function(r){return oa(t,r)}));wt(r.wrapper,"scroll",(function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}));r.dragFunctions={enter:function(r){if(!At(t,r)){St(r)}},over:function(r){if(!At(t,r)){Su(t,r);St(r)}},start:function(r){return Ou(t,r)},drop:qe(t,Du),leave:function(r){if(!At(t,r)){Nu(t)}}};var f=r.input.getField();wt(f,"keyup",(function(r){return po.call(t,r)}));wt(f,"keydown",qe(t,ho));wt(f,"keypress",qe(t,go));wt(f,"focus",(function(r){return re(t,r)}));wt(f,"blur",(function(r){return ne(t,r)}))}var zo=[];Uo.defineInitHook=function(t){return zo.push(t)};function Vo(t,r,n,i){var e=t.doc,a;if(n==null){n="add"}if(n=="smart"){if(!e.mode.indent){n="prev"}else{a=Ar(t,r).state}}var u=t.options.tabSize;var o=rr(e,r),s=z(o.text,null,u);if(o.stateAfter){o.stateAfter=null}var f=o.text.match(/^\s*/)[0],c;if(!i&&!/\S/.test(o.text)){c=0;n="not"}else if(n=="smart"){c=e.mode.indent(a,o.text.slice(f.length),o.text);if(c==W||c>150){if(!i){return}n="prev"}}if(n=="prev"){if(r>e.first){c=z(rr(e,r-1).text,null,u)}else{c=0}}else if(n=="add"){c=s+t.options.indentUnit}else if(n=="subtract"){c=s-t.options.indentUnit}else if(typeof n=="number"){c=s+n}c=Math.max(0,c);var l="",h=0;if(t.options.indentWithTabs){for(var v=Math.floor(c/u);v;--v){h+=u;l+="\t"}}if(h<c){l+=J(c-h)}if(l!=f){ou(e,l,fr(r,0),fr(r,f.length),"+input");o.stateAfter=null;return true}else{for(var d=0;d<e.sel.ranges.length;d++){var p=e.sel.ranges[d];if(p.head.line==r&&p.head.ch<f.length){var g=fr(r,f.length);Ua(e,d,new fa(g,g));break}}}}var $o=null;function Go(t){$o=t}function Wo(t,r,n,i,e){var a=t.doc;t.display.shift=false;if(!i){i=a.sel}var u=+new Date-200;var o=e=="paste"||t.state.pasteIncoming>u;var s=Pt(r),f=null;if(o&&i.ranges.length>1){if($o&&$o.text.join("\n")==r){if(i.ranges.length%$o.text.length==0){f=[];for(var c=0;c<$o.text.length;c++){f.push(a.splitLines($o.text[c]))}}}else if(s.length==i.ranges.length&&t.options.pasteLinesPerSelection){f=rt(s,(function(t){return[t]}))}}var l=t.curOp.updateInput;for(var h=i.ranges.length-1;h>=0;h--){var v=i.ranges[h];var d=v.from(),p=v.to();if(v.empty()){if(n&&n>0){d=fr(d.line,d.ch-n)}else if(t.state.overwrite&&!o){p=fr(p.line,Math.min(rr(a,p.line).text.length,p.ch+tt(s).length))}else if(o&&$o&&$o.lineWise&&$o.text.join("\n")==s.join("\n")){d=p=fr(d.line,0)}}var g={from:d,to:p,text:f?f[h%f.length]:s,origin:e||(o?"paste":t.state.cutIncoming>u?"cut":"+input")};ru(t.doc,g);Rn(t,"inputRead",t,g)}if(r&&!o){Ko(t,r)}le(t);if(t.curOp.updateInput<2){t.curOp.updateInput=l}t.curOp.typing=true;t.state.pasteIncoming=t.state.cutIncoming=-1}function Zo(t,r){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n){t.preventDefault();if(!r.isReadOnly()&&!r.options.disableInput&&r.hasFocus()){Ie(r,(function(){return Wo(r,n,0,null,"paste")}))}return true}}function Ko(t,r){if(!t.options.electricChars||!t.options.smartIndent){return}var n=t.doc.sel;for(var i=n.ranges.length-1;i>=0;i--){var e=n.ranges[i];if(e.head.ch>100||i&&n.ranges[i-1].head.line==e.head.line){continue}var a=t.getModeAt(e.head);var u=false;if(a.electricChars){for(var o=0;o<a.electricChars.length;o++){if(r.indexOf(a.electricChars.charAt(o))>-1){u=Vo(t,e.head.line,"smart");break}}}else if(a.electricInput){if(a.electricInput.test(rr(t.doc,e.head.line).text.slice(0,e.head.ch))){u=Vo(t,e.head.line,"smart")}}if(u){Rn(t,"electricInput",t,e.head.line)}}}function Yo(t){var r=[],n=[];for(var i=0;i<t.doc.sel.ranges.length;i++){var e=t.doc.sel.ranges[i].head.line;var a={anchor:fr(e,0),head:fr(e+1,0)};n.push(a);r.push(t.getRange(a.anchor,a.head))}return{text:r,ranges:n}}function Qo(t,r,n,i){t.setAttribute("autocorrect",n?"on":"off");t.setAttribute("autocapitalize",i?"on":"off");t.setAttribute("spellcheck",!!r)}function Xo(){var t=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var r=O("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(s){t.style.width="1000px"}else{t.setAttribute("wrap","off")}if(g){t.style.border="1px solid black"}return r}function Jo(t){var r=t.optionHandlers;var n=t.helpers={};t.prototype={constructor:t,focus:function(){_(this).focus();this.display.input.focus()},setOption:function(t,n){var i=this.options,e=i[t];if(i[t]==n&&t!="mode"){return}i[t]=n;if(r.hasOwnProperty(t)){qe(this,r[t])(this,n,e)}Tt(this,"optionChange",this,t)},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,r){this.state.keyMaps[r?"push":"unshift"](Zu(t))},removeKeyMap:function(t){var r=this.state.keyMaps;for(var n=0;n<r.length;++n){if(r[n]==t||r[n].name==t){r.splice(n,1);return true}}},addOverlay:Fe((function(r,n){var i=r.token?r:t.getMode(this.options,r);if(i.startState){throw new Error("Overlays may not be stateful.")}nt(this.state.overlays,{mode:i,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority}));this.state.modeGen++;Ui(this)})),removeOverlay:Fe((function(t){var r=this.state.overlays;for(var n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==t||typeof t=="string"&&i.name==t){r.splice(n,1);this.state.modeGen++;Ui(this);return}}})),indentLine:Fe((function(t,r,n){if(typeof r!="string"&&typeof r!="number"){if(r==null){r=this.options.smartIndent?"smart":"prev"}else{r=r?"add":"subtract"}}if(or(this.doc,t)){Vo(this,t,r,n)}})),indentSelection:Fe((function(t){var r=this.doc.sel.ranges,n=-1;for(var i=0;i<r.length;i++){var e=r[i];if(!e.empty()){var a=e.from(),u=e.to();var o=Math.max(n,a.line);n=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var s=o;s<n;++s){Vo(this,s,t)}var f=this.doc.sel.ranges;if(a.ch==0&&r.length==f.length&&f[i].from().ch>0){Ua(this.doc,i,new fa(a,f[i].to()),Z)}}else if(e.head.line>n){Vo(this,e.head.line,t,true);n=e.head.line;if(i==this.doc.sel.primIndex){le(this)}}}})),getTokenAt:function(t,r){return Dr(this,t,r)},getLineTokens:function(t,r){return Dr(this,fr(t),r,true)},getTokenTypeAt:function(t){t=gr(this.doc,t);var r=Tr(this,rr(this.doc,t.line));var n=0,i=(r.length-1)/2,e=t.ch;var a;if(e==0){a=r[2]}else{for(;;){var u=n+i>>1;if((u?r[u*2-1]:0)>=e){i=u}else if(r[u*2+1]<e){n=u+1}else{a=r[u*2+2];break}}}var o=a?a.indexOf("overlay "):-1;return o<0?a:o==0?null:a.slice(0,o-1)},getModeAt:function(r){var n=this.doc.mode;if(!n.innerMode){return n}return t.innerMode(n,this.getTokenAt(r).state).mode},getHelper:function(t,r){return this.getHelpers(t,r)[0]},getHelpers:function(t,r){var i=[];if(!n.hasOwnProperty(r)){return i}var e=n[r],a=this.getModeAt(t);if(typeof a[r]=="string"){if(e[a[r]]){i.push(e[a[r]])}}else if(a[r]){for(var u=0;u<a[r].length;u++){var o=e[a[r][u]];if(o){i.push(o)}}}else if(a.helperType&&e[a.helperType]){i.push(e[a.helperType])}else if(e[a.name]){i.push(e[a.name])}for(var s=0;s<e._global.length;s++){var f=e._global[s];if(f.pred(a,this)&&$(i,f.val)==-1){i.push(f.val)}}return i},getStateAfter:function(t,r){var n=this.doc;t=pr(n,t==null?n.first+n.size-1:t);return Ar(this,t+1,r).state},cursorCoords:function(t,r){var n,i=this.doc.sel.primary();if(t==null){n=i.head}else if(typeof t=="object"){n=gr(this.doc,t)}else{n=t?i.from():i.to()}return Ti(this,n,r||"page")},charCoords:function(t,r){return ki(this,gr(this.doc,t),r||"page")},coordsChar:function(t,r){t=yi(this,t,r||"page");return Li(this,t.left,t.top)},lineAtHeight:function(t,r){t=yi(this,{top:t,left:0},r||"page").top;return ur(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,r,n){var i=false,e;if(typeof t=="number"){var a=this.doc.first+this.doc.size-1;if(t<this.doc.first){t=this.doc.first}else if(t>a){t=a;i=true}e=rr(this.doc,t)}else{e=t}return wi(this,e,{top:0,left:0},r||"page",n||i).top+(i?this.doc.height-cn(e):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,r,n,i,e){var a=this.display;t=Ti(this,gr(this.doc,t));var u=t.bottom,o=t.left;r.style.position="absolute";r.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(r);a.sizer.appendChild(r);if(i=="over"){u=t.top}else if(i=="above"||i=="near"){var s=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);if((i=="above"||t.bottom+r.offsetHeight>s)&&t.top>r.offsetHeight){u=t.top-r.offsetHeight}else if(t.bottom+r.offsetHeight<=s){u=t.bottom}if(o+r.offsetWidth>f){o=f-r.offsetWidth}}r.style.top=u+"px";r.style.left=r.style.right="";if(e=="right"){o=a.sizer.clientWidth-r.offsetWidth;r.style.right="0px"}else{if(e=="left"){o=0}else if(e=="middle"){o=(a.sizer.clientWidth-r.offsetWidth)/2}r.style.left=o+"px"}if(n){se(this,{left:o,top:u,right:o+r.offsetWidth,bottom:u+r.offsetHeight})}},triggerOnKeyDown:Fe(ho),triggerOnKeyPress:Fe(go),triggerOnKeyUp:po,triggerOnMouseDown:Fe(To),execCommand:function(t){if(to.hasOwnProperty(t)){return to[t].call(null,this)}},triggerElectric:Fe((function(t){Ko(this,t)})),findPosH:function(t,r,n,i){var e=1;if(r<0){e=-1;r=-r}var a=gr(this.doc,t);for(var u=0;u<r;++u){a=ts(this.doc,a,e,n,i);if(a.hitSide){break}}return a},moveH:Fe((function(t,r){var n=this;this.extendSelectionsBy((function(i){if(n.display.shift||n.doc.extend||i.empty()){return ts(n.doc,i.head,t,r,n.options.rtlMoveVisually)}else{return t<0?i.from():i.to()}}),Y)})),deleteH:Fe((function(t,r){var n=this.doc.sel,i=this.doc;if(n.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Ku(this,(function(n){var e=ts(i,n.head,t,r,false);return t<0?{from:e,to:n.head}:{from:n.head,to:e}}))}})),findPosV:function(t,r,n,i){var e=1,a=i;if(r<0){e=-1;r=-r}var u=gr(this.doc,t);for(var o=0;o<r;++o){var s=Ti(this,u,"div");if(a==null){a=s.left}else{s.left=a}u=rs(this,s,e,n);if(u.hitSide){break}}return u},moveV:Fe((function(t,r){var n=this;var i=this.doc,e=[];var a=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy((function(u){if(a){return t<0?u.from():u.to()}var o=Ti(n,u.head,"div");if(u.goalColumn!=null){o.left=u.goalColumn}e.push(o.left);var s=rs(n,o,t,r);if(r=="page"&&u==i.sel.primary()){ce(n,ki(n,s,"div").top-o.top)}return s}),Y);if(e.length){for(var u=0;u<i.sel.ranges.length;u++){i.sel.ranges[u].goalColumn=e[u]}}})),findWordAt:function(t){var r=this.doc,n=rr(r,t.line).text;var i=t.ch,e=t.ch;if(n){var a=this.getHelper(t,"wordChars");if((t.sticky=="before"||e==n.length)&&i){--i}else{++e}var u=n.charAt(i);var o=ot(u,a)?function(t){return ot(t,a)}:/\s/.test(u)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!ot(t)};while(i>0&&o(n.charAt(i-1))){--i}while(e<n.length&&o(n.charAt(e))){++e}}return new fa(fr(t.line,i),fr(t.line,e))},toggleOverwrite:function(t){if(t!=null&&t==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){B(this.display.cursorDiv,"CodeMirror-overwrite")}else{x(this.display.cursorDiv,"CodeMirror-overwrite")}Tt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==R(P(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Fe((function(t,r){he(this,t,r)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Xn(this)-this.display.barHeight,width:t.scrollWidth-Xn(this)-this.display.barWidth,clientHeight:ti(this),clientWidth:Jn(this)}},scrollIntoView:Fe((function(t,r){if(t==null){t={from:this.doc.sel.primary().head,to:null};if(r==null){r=this.options.cursorScrollMargin}}else if(typeof t=="number"){t={from:fr(t,0),to:null}}else if(t.from==null){t={from:t,to:null}}if(!t.to){t.to=t.from}t.margin=r||0;if(t.from.line!=null){ve(this,t)}else{pe(this,t.from,t.to,t.margin)}})),setSize:Fe((function(t,r){var n=this;var i=function(t){return typeof t=="number"||/^\d+$/.test(String(t))?t+"px":t};if(t!=null){this.display.wrapper.style.width=i(t)}if(r!=null){this.display.wrapper.style.height=i(r)}if(this.options.lineWrapping){di(this)}var e=this.display.viewFrom;this.doc.iter(e,this.display.viewTo,(function(t){if(t.widgets){for(var r=0;r<t.widgets.length;r++){if(t.widgets[r].noHScroll){Hi(n,e,"widget");break}}}++e}));this.curOp.forceUpdate=true;Tt(this,"refresh",this)})),operation:function(t){return Ie(this,t)},startOperation:function(){return Ce(this)},endOperation:function(){return De(this)},refresh:Fe((function(){var t=this.display.cachedTextHeight;Ui(this);this.curOp.forceUpdate=true;pi(this);he(this,this.doc.scrollLeft,this.doc.scrollTop);Ke(this.display);if(t==null||Math.abs(t-Ri(this.display))>.5||this.options.lineWrapping){Pi(this)}Tt(this,"refresh",this)})),swapDoc:Fe((function(t){var r=this.doc;r.cm=null;if(this.state.selectingText){this.state.selectingText()}Ta(this,t);pi(this);this.display.input.reset();he(this,t.scrollLeft,t.scrollTop);this.curOp.forceScroll=true;Rn(this,"swapDoc",this,r);return r})),phrase:function(t){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};xt(t);t.registerHelper=function(r,i,e){if(!n.hasOwnProperty(r)){n[r]=t[r]={_global:[]}}n[r][i]=e};t.registerGlobalHelper=function(r,i,e,a){t.registerHelper(r,i,a);n[r]._global.push({pred:e,val:a})}}function ts(t,r,n,i,e){var a=r;var u=n;var o=rr(t,r.line);var s=e&&t.direction=="rtl"?-n:n;function f(){var n=r.line+s;if(n<t.first||n>=t.first+t.size){return false}r=new fr(n,r.ch,r.sticky);return o=rr(t,n)}function c(a){var u;if(i=="codepoint"){var c=o.text.charCodeAt(r.ch+(n>0?0:-1));if(isNaN(c)){u=null}else{var l=n>0?c>=55296&&c<56320:c>=56320&&c<57343;u=new fr(r.line,Math.max(0,Math.min(o.text.length,r.ch+n*(l?2:1))),-n)}}else if(e){u=Ju(t.cm,o,r,n)}else{u=Qu(o,r,n)}if(u==null){if(!a&&f()){r=Xu(e,t.cm,o,r.line,s)}else{return false}}else{r=u}return true}if(i=="char"||i=="codepoint"){c()}else if(i=="column"){c(true)}else if(i=="word"||i=="group"){var l=null,h=i=="group";var v=t.cm&&t.cm.getHelper(r,"wordChars");for(var d=true;;d=false){if(n<0&&!c(!d)){break}var p=o.text.charAt(r.ch)||"\n";var g=ot(p,v)?"w":h&&p=="\n"?"n":!h||/\s/.test(p)?null:"p";if(h&&!d&&!g){g="s"}if(l&&l!=g){if(n<0){n=1;c();r.sticky="after"}break}if(g){l=g}if(n>0&&!c(!d)){break}}}var b=Qa(t,r,a,u,true);if(lr(a,b)){b.hitSide=true}return b}function rs(t,r,n,i){var e=t.doc,a=r.left,u;if(i=="page"){var o=Math.min(t.display.wrapper.clientHeight,_(t).innerHeight||e(t).documentElement.clientHeight);var s=Math.max(o-.5*Ri(t.display),3);u=(n>0?r.bottom:r.top)+n*s}else if(i=="line"){u=n>0?r.bottom+3:r.top-3}var f;for(;;){f=Li(t,a,u);if(!f.outside){break}if(n<0?u<=0:u>=e.height){f.hitSide=true;break}u+=n*5}return f}var ns=function(t){this.cm=t;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new V;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};ns.prototype.init=function(t){var r=this;var n=this,i=n.cm;var e=n.div=t.lineDiv;e.contentEditable=true;Qo(e,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function a(t){for(var r=t.target;r;r=r.parentNode){if(r==e){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(r.className)){break}}return false}wt(e,"paste",(function(t){if(!a(t)||At(i,t)||Zo(t,i)){return}if(o<=11){setTimeout(qe(i,(function(){return r.updateFromDOM()})),20)}}));wt(e,"compositionstart",(function(t){r.composing={data:t.data,done:false}}));wt(e,"compositionupdate",(function(t){if(!r.composing){r.composing={data:t.data,done:false}}}));wt(e,"compositionend",(function(t){if(r.composing){if(t.data!=r.composing.data){r.readFromDOMSoon()}r.composing.done=true}}));wt(e,"touchstart",(function(){return n.forceCompositionEnd()}));wt(e,"input",(function(){if(!r.composing){r.readFromDOMSoon()}}));function u(t){if(!a(t)||At(i,t)){return}if(i.somethingSelected()){Go({lineWise:false,text:i.getSelections()});if(t.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var r=Yo(i);Go({lineWise:true,text:r.text});if(t.type=="cut"){i.operation((function(){i.setSelections(r.ranges,0,Z);i.replaceSelection("",null,"cut")}))}}if(t.clipboardData){t.clipboardData.clearData();var u=$o.text.join("\n");t.clipboardData.setData("Text",u);if(t.clipboardData.getData("Text")==u){t.preventDefault();return}}var o=Xo(),s=o.firstChild;Qo(s);i.display.lineSpace.insertBefore(o,i.display.lineSpace.firstChild);s.value=$o.text.join("\n");var f=R(j(e));q(s);setTimeout((function(){i.display.lineSpace.removeChild(o);f.focus();if(f==e){n.showPrimarySelection()}}),50)}wt(e,"copy",u);wt(e,"cut",u)};ns.prototype.screenReaderLabelChanged=function(t){if(t){this.div.setAttribute("aria-label",t)}else{this.div.removeAttribute("aria-label")}};ns.prototype.prepareSelection=function(){var t=Zi(this.cm,false);t.focus=R(j(this.div))==this.div;return t};ns.prototype.showSelection=function(t,r){if(!t||!this.cm.display.view.length){return}if(t.focus||r){this.showPrimarySelection()}this.showMultipleSelections(t)};ns.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ns.prototype.showPrimarySelection=function(){var t=this.getSelection(),r=this.cm,i=r.doc.sel.primary();var e=i.from(),a=i.to();if(r.display.viewTo==r.display.viewFrom||e.line>=r.display.viewTo||a.line<r.display.viewFrom){t.removeAllRanges();return}var u=os(r,t.anchorNode,t.anchorOffset);var o=os(r,t.focusNode,t.focusOffset);if(u&&!u.bad&&o&&!o.bad&&cr(dr(u,o),e)==0&&cr(vr(u,o),a)==0){return}var s=r.display.view;var f=e.line>=r.display.viewFrom&&is(r,e)||{node:s[0].measure.map[2],offset:0};var c=a.line<r.display.viewTo&&is(r,a);if(!c){var l=s[s.length-1].measure;var h=l.maps?l.maps[l.maps.length-1]:l.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!f||!c){t.removeAllRanges();return}var v=t.rangeCount&&t.getRangeAt(0),d;try{d=N(f.node,f.offset,c.offset,c.node)}catch(t){}if(d){if(!n&&r.state.focused){t.collapse(f.node,f.offset);if(!d.collapsed){t.removeAllRanges();t.addRange(d)}}else{t.removeAllRanges();t.addRange(d)}if(v&&t.anchorNode==null){t.addRange(v)}else if(n){this.startGracePeriod()}}this.rememberSelection()};ns.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout((function(){t.gracePeriod=false;if(t.selectionChanged()){t.cm.operation((function(){return t.cm.curOp.selectionChanged=true}))}}),20)};ns.prototype.showMultipleSelections=function(t){D(this.cm.display.cursorDiv,t.cursors);D(this.cm.display.selectionDiv,t.selection)};ns.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode;this.lastAnchorOffset=t.anchorOffset;this.lastFocusNode=t.focusNode;this.lastFocusOffset=t.focusOffset};ns.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount){return false}var r=t.getRangeAt(0).commonAncestorContainer;return M(this.div,r)};ns.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||R(j(this.div))!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};ns.prototype.blur=function(){this.div.blur()};ns.prototype.getField=function(){return this.div};ns.prototype.supportsTouch=function(){return true};ns.prototype.receivedFocus=function(){var t=this;var r=this;if(this.selectionInEditor()){setTimeout((function(){return t.pollSelection()}),20)}else{Ie(this.cm,(function(){return r.cm.curOp.selectionChanged=true}))}function n(){if(r.cm.state.focused){r.pollSelection();r.polling.set(r.cm.options.pollInterval,n)}}this.polling.set(this.cm.options.pollInterval,n)};ns.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset};ns.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var t=this.getSelection(),r=this.cm;if(b&&c&&this.cm.display.gutterSpecs.length&&es(t.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var n=os(r,t.anchorNode,t.anchorOffset);var i=os(r,t.focusNode,t.focusOffset);if(n&&i){Ie(r,(function(){$a(r.doc,la(n,i),Z);if(n.bad||i.bad){r.curOp.selectionChanged=true}}))}};ns.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var t=this.cm,r=t.display,n=t.doc.sel.primary();var i=n.from(),e=n.to();if(i.ch==0&&i.line>t.firstLine()){i=fr(i.line-1,rr(t.doc,i.line-1).length)}if(e.ch==rr(t.doc,e.line).text.length&&e.line<t.lastLine()){e=fr(e.line+1,0)}if(i.line<r.viewFrom||e.line>r.viewTo-1){return false}var a,u,o;if(i.line==r.viewFrom||(a=_i(t,i.line))==0){u=ar(r.view[0].line);o=r.view[0].node}else{u=ar(r.view[a].line);o=r.view[a-1].node.nextSibling}var s=_i(t,e.line);var f,c;if(s==r.view.length-1){f=r.viewTo-1;c=r.lineDiv.lastChild}else{f=ar(r.view[s+1].line)-1;c=r.view[s+1].node.previousSibling}if(!o){return false}var l=t.doc.splitLines(us(t,o,c,u,f));var h=nr(t.doc,fr(u,0),fr(f,rr(t.doc,f).text.length));while(l.length>1&&h.length>1){if(tt(l)==tt(h)){l.pop();h.pop();f--}else if(l[0]==h[0]){l.shift();h.shift();u++}else{break}}var v=0,d=0;var p=l[0],g=h[0],b=Math.min(p.length,g.length);while(v<b&&p.charCodeAt(v)==g.charCodeAt(v)){++v}var m=tt(l),w=tt(h);var y=Math.min(m.length-(l.length==1?v:0),w.length-(h.length==1?v:0));while(d<y&&m.charCodeAt(m.length-d-1)==w.charCodeAt(w.length-d-1)){++d}if(l.length==1&&h.length==1&&u==i.line){while(v&&v>i.ch&&m.charCodeAt(m.length-d-1)==w.charCodeAt(w.length-d-1)){v--;d++}}l[l.length-1]=m.slice(0,m.length-d).replace(/^\u200b+/,"");l[0]=l[0].slice(v).replace(/\u200b+$/,"");var k=fr(u,v);var T=fr(f,h.length?tt(h).length-d:0);if(l.length>1||l[0]||cr(k,T)){ou(t.doc,l,k,T,"+input");return true}};ns.prototype.ensurePolled=function(){this.forceCompositionEnd()};ns.prototype.reset=function(){this.forceCompositionEnd()};ns.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};ns.prototype.readFromDOMSoon=function(){var t=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout((function(){t.readDOMTimeout=null;if(t.composing){if(t.composing.done){t.composing=null}else{return}}t.updateFromDOM()}),80)};ns.prototype.updateFromDOM=function(){var t=this;if(this.cm.isReadOnly()||!this.pollContent()){Ie(this.cm,(function(){return Ui(t.cm)}))}};ns.prototype.setUneditable=function(t){t.contentEditable="false"};ns.prototype.onKeyPress=function(t){if(t.charCode==0||this.composing){return}t.preventDefault();if(!this.cm.isReadOnly()){qe(this.cm,Wo)(this.cm,String.fromCharCode(t.charCode==null?t.keyCode:t.charCode),0)}};ns.prototype.readOnlyChanged=function(t){this.div.contentEditable=String(t!="nocursor")};ns.prototype.onContextMenu=function(){};ns.prototype.resetPosition=function(){};ns.prototype.needsContentAttribute=true;function is(t,r){var n=ai(t,r.line);if(!n||n.hidden){return null}var i=rr(t.doc,r.line);var e=ni(n,i,r.line);var a=bt(i,t.doc.direction),u="left";if(a){var o=pt(a,r.ch);u=o%2?"right":"left"}var s=fi(e.map,r.ch,u);s.offset=s.collapse=="right"?s.end:s.start;return s}function es(t){for(var r=t;r;r=r.parentNode){if(/CodeMirror-gutter-wrapper/.test(r.className)){return true}}return false}function as(t,r){if(r){t.bad=true}return t}function us(t,r,n,i,e){var a="",u=false,o=t.doc.lineSeparator(),s=false;function f(t){return function(r){return r.id==t}}function c(){if(u){a+=o;if(s){a+=o}u=s=false}}function l(t){if(t){c();a+=t}}function h(r){if(r.nodeType==1){var n=r.getAttribute("cm-text");if(n){l(n);return}var a=r.getAttribute("cm-marker"),v;if(a){var d=t.findMarks(fr(i,0),fr(e+1,0),f(+a));if(d.length&&(v=d[0].find(0))){l(nr(t.doc,v.from,v.to).join(o))}return}if(r.getAttribute("contenteditable")=="false"){return}var p=/^(pre|div|p|li|table|br)$/i.test(r.nodeName);if(!/^br$/i.test(r.nodeName)&&r.textContent.length==0){return}if(p){c()}for(var g=0;g<r.childNodes.length;g++){h(r.childNodes[g])}if(/^(pre|p)$/i.test(r.nodeName)){s=true}if(p){u=true}}else if(r.nodeType==3){l(r.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){h(r);if(r==n){break}r=r.nextSibling;s=false}return a}function os(t,r,n){var i;if(r==t.display.lineDiv){i=t.display.lineDiv.childNodes[n];if(!i){return as(t.clipPos(fr(t.display.viewTo-1)),true)}r=null;n=0}else{for(i=r;;i=i.parentNode){if(!i||i==t.display.lineDiv){return null}if(i.parentNode&&i.parentNode==t.display.lineDiv){break}}}for(var e=0;e<t.display.view.length;e++){var a=t.display.view[e];if(a.node==i){return ss(a,r,n)}}}function ss(t,r,n){var i=t.text.firstChild,e=false;if(!r||!M(i,r)){return as(fr(ar(t.line),0),true)}if(r==i){e=true;r=i.childNodes[n];n=0;if(!r){var a=t.rest?tt(t.rest):t.line;return as(fr(ar(a),a.text.length),e)}}var u=r.nodeType==3?r:null,o=r;if(!u&&r.childNodes.length==1&&r.firstChild.nodeType==3){u=r.firstChild;if(n){n=u.nodeValue.length}}while(o.parentNode!=i){o=o.parentNode}var s=t.measure,f=s.maps;function c(r,n,i){for(var e=-1;e<(f?f.length:0);e++){var a=e<0?s.map:f[e];for(var u=0;u<a.length;u+=3){var o=a[u+2];if(o==r||o==n){var c=ar(e<0?t.line:t.rest[e]);var l=a[u]+i;if(i<0||o!=r){l=a[u+(i?1:0)]}return fr(c,l)}}}}var l=c(u,o,n);if(l){return as(l,e)}for(var h=o.nextSibling,v=u?u.nodeValue.length-n:0;h;h=h.nextSibling){l=c(h,h.firstChild,0);if(l){return as(fr(l.line,l.ch-v),e)}else{v+=h.textContent.length}}for(var d=o.previousSibling,p=n;d;d=d.previousSibling){l=c(d,d.firstChild,-1);if(l){return as(fr(l.line,l.ch+p),e)}else{p+=d.textContent.length}}}var fs=function(t){this.cm=t;this.prevInput="";this.pollingFast=false;this.polling=new V;this.hasSelection=false;this.composing=null;this.resetting=false};fs.prototype.init=function(t){var r=this;var n=this,i=this.cm;this.createField(t);var e=this.textarea;t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild);if(g){e.style.width="0px"}wt(e,"input",(function(){if(u&&o>=9&&r.hasSelection){r.hasSelection=null}n.poll()}));wt(e,"paste",(function(t){if(At(i,t)||Zo(t,i)){return}i.state.pasteIncoming=+new Date;n.fastPoll()}));function a(t){if(At(i,t)){return}if(i.somethingSelected()){Go({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var r=Yo(i);Go({lineWise:true,text:r.text});if(t.type=="cut"){i.setSelections(r.ranges,null,Z)}else{n.prevInput="";e.value=r.text.join("\n");q(e)}}if(t.type=="cut"){i.state.cutIncoming=+new Date}}wt(e,"cut",a);wt(e,"copy",a);wt(t.scroller,"paste",(function(r){if(Zn(t,r)||At(i,r)){return}if(!e.dispatchEvent){i.state.pasteIncoming=+new Date;n.focus();return}var a=new Event("paste");a.clipboardData=r.clipboardData;e.dispatchEvent(a)}));wt(t.lineSpace,"selectstart",(function(r){if(!Zn(t,r)){Ct(r)}}));wt(e,"compositionstart",(function(){var t=i.getCursor("from");if(n.composing){n.composing.range.clear()}n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}));wt(e,"compositionend",(function(){if(n.composing){n.poll();n.composing.range.clear();n.composing=null}}))};fs.prototype.createField=function(t){this.wrapper=Xo();this.textarea=this.wrapper.firstChild;var r=this.cm.options;Qo(this.textarea,r.spellcheck,r.autocorrect,r.autocapitalize)};fs.prototype.screenReaderLabelChanged=function(t){if(t){this.textarea.setAttribute("aria-label",t)}else{this.textarea.removeAttribute("aria-label")}};fs.prototype.prepareSelection=function(){var t=this.cm,r=t.display,n=t.doc;var i=Zi(t);if(t.options.moveInputWithCursor){var e=Ti(t,n.sel.primary().head,"div");var a=r.wrapper.getBoundingClientRect(),u=r.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,e.top+u.top-a.top));i.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,e.left+u.left-a.left))}return i};fs.prototype.showSelection=function(t){var r=this.cm,n=r.display;D(n.cursorDiv,t.cursors);D(n.selectionDiv,t.selection);if(t.teTop!=null){this.wrapper.style.top=t.teTop+"px";this.wrapper.style.left=t.teLeft+"px"}};fs.prototype.reset=function(t){if(this.contextMenuPending||this.composing&&t){return}var r=this.cm;this.resetting=true;if(r.somethingSelected()){this.prevInput="";var n=r.getSelection();this.textarea.value=n;if(r.state.focused){q(this.textarea)}if(u&&o>=9){this.hasSelection=n}}else if(!t){this.prevInput=this.textarea.value="";if(u&&o>=9){this.hasSelection=null}}this.resetting=false};fs.prototype.getField=function(){return this.textarea};fs.prototype.supportsTouch=function(){return false};fs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!m||R(j(this.textarea))!=this.textarea)){try{this.textarea.focus()}catch(t){}}};fs.prototype.blur=function(){this.textarea.blur()};fs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};fs.prototype.receivedFocus=function(){this.slowPoll()};fs.prototype.slowPoll=function(){var t=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,(function(){t.poll();if(t.cm.state.focused){t.slowPoll()}}))};fs.prototype.fastPoll=function(){var t=false,r=this;r.pollingFast=true;function n(){var i=r.poll();if(!i&&!t){t=true;r.polling.set(60,n)}else{r.pollingFast=false;r.slowPoll()}}r.polling.set(20,n)};fs.prototype.poll=function(){var t=this;var r=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!r.state.focused||jt(n)&&!i&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq){return false}var e=n.value;if(e==i&&!r.somethingSelected()){return false}if(u&&o>=9&&this.hasSelection===e||w&&/[\uf700-\uf7ff]/.test(e)){r.display.input.reset();return false}if(r.doc.sel==r.display.selForContextMenu){var a=e.charCodeAt(0);if(a==8203&&!i){i=""}if(a==8666){this.reset();return this.cm.execCommand("undo")}}var s=0,f=Math.min(i.length,e.length);while(s<f&&i.charCodeAt(s)==e.charCodeAt(s)){++s}Ie(r,(function(){Wo(r,e.slice(s),i.length-s,null,t.composing?"*compose":null);if(e.length>1e3||e.indexOf("\n")>-1){n.value=t.prevInput=""}else{t.prevInput=e}if(t.composing){t.composing.range.clear();t.composing.range=r.markText(t.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};fs.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};fs.prototype.onKeyPress=function(){if(u&&o>=9){this.hasSelection=null}this.fastPoll()};fs.prototype.onContextMenu=function(t){var r=this,n=r.cm,i=n.display,e=r.textarea;if(r.contextMenuPending){r.contextMenuPending()}var a=ji(n,t),f=i.scroller.scrollTop;if(!a||h){return}var c=n.options.resetSelectionOnContextMenu;if(c&&n.doc.sel.contains(a)==-1){qe(n,$a)(n.doc,la(a),Z)}var l=e.style.cssText,v=r.wrapper.style.cssText;var d=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static";e.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(u?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var p;if(s){p=e.ownerDocument.defaultView.scrollY}i.input.focus();if(s){e.ownerDocument.defaultView.scrollTo(null,p)}i.input.reset();if(!n.somethingSelected()){e.value=r.prevInput=" "}r.contextMenuPending=b;i.selForContextMenu=n.doc.sel;clearTimeout(i.detectingSelectAll);function g(){if(e.selectionStart!=null){var t=n.somethingSelected();var a=""+(t?e.value:"");e.value="⇚";e.value=a;r.prevInput=t?"":"";e.selectionStart=1;e.selectionEnd=a.length;i.selForContextMenu=n.doc.sel}}function b(){if(r.contextMenuPending!=b){return}r.contextMenuPending=false;r.wrapper.style.cssText=v;e.style.cssText=l;if(u&&o<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=f)}if(e.selectionStart!=null){if(!u||u&&o<9){g()}var t=0,a=function(){if(i.selForContextMenu==n.doc.sel&&e.selectionStart==0&&e.selectionEnd>0&&r.prevInput==""){qe(n,Ja)(n)}else if(t++<10){i.detectingSelectAll=setTimeout(a,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(a,200)}}if(u&&o>=9){g()}if(E){St(t);var m=function(){kt(window,"mouseup",m);setTimeout(b,20)};wt(window,"mouseup",m)}else{setTimeout(b,50)}};fs.prototype.readOnlyChanged=function(t){if(!t){this.reset()}this.textarea.disabled=t=="nocursor";this.textarea.readOnly=!!t};fs.prototype.setUneditable=function(){};fs.prototype.needsContentAttribute=false;function cs(t,r){r=r?H(r):{};r.value=t.value;if(!r.tabindex&&t.tabIndex){r.tabindex=t.tabIndex}if(!r.placeholder&&t.placeholder){r.placeholder=t.placeholder}if(r.autofocus==null){var n=R(j(t));r.autofocus=n==t||t.getAttribute("autofocus")!=null&&n==document.body}function i(){t.value=o.getValue()}var e;if(t.form){wt(t.form,"submit",i);if(!r.leaveSubmitMethodAlone){var a=t.form;e=a.submit;try{var u=a.submit=function(){i();a.submit=e;a.submit();a.submit=u}}catch(t){}}}r.finishInit=function(n){n.save=i;n.getTextArea=function(){return t};n.toTextArea=function(){n.toTextArea=isNaN;i();t.parentNode.removeChild(n.getWrapperElement());t.style.display="";if(t.form){kt(t.form,"submit",i);if(!r.leaveSubmitMethodAlone&&typeof t.form.submit=="function"){t.form.submit=e}}}};t.style.display="none";var o=Uo((function(r){return t.parentNode.insertBefore(r,t.nextSibling)}),r);return o}function ls(t){t.off=kt;t.on=wt;t.wheelEventPixels=ua;t.Doc=xu;t.splitLines=Pt;t.countColumn=z;t.findColumn=Q;t.isWordChar=ut;t.Pass=W;t.signal=Tt;t.Line=vn;t.changeEnd=ha;t.scrollbarModel=Ee;t.Pos=fr;t.cmpPos=cr;t.modes=zt;t.mimeModes=Vt;t.resolveMode=Wt;t.getMode=Zt;t.modeExtensions=Kt;t.extendMode=Yt;t.copyState=Qt;t.startState=Jt;t.innerMode=Xt;t.commands=to;t.keyMap=Uu;t.keyName=Wu;t.isModifierKey=$u;t.lookupKey=Vu;t.normalizeKeyMap=zu;t.StringStream=tr;t.SharedTextMarker=yu;t.TextMarker=mu;t.LineWidget=du;t.e_preventDefault=Ct;t.e_stopPropagation=Dt;t.e_stop=St;t.addClass=B;t.contains=M;t.rmClass=x;t.keyNames=Fu}Po(Uo);Jo(Uo);var hs="iter insert remove copy getEditor constructor".split(" ");for(var vs in xu.prototype){if(xu.prototype.hasOwnProperty(vs)&&$(hs,vs)<0){Uo.prototype[vs]=function(t){return function(){return t.apply(this.doc,arguments)}}(xu.prototype[vs])}}xt(xu);Uo.inputStyles={textarea:fs,contenteditable:ns};Uo.defineMode=function(t){if(!Uo.defaults.mode&&t!="null"){Uo.defaults.mode=t}$t.apply(this,arguments)};Uo.defineMIME=Gt;Uo.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}}));Uo.defineMIME("text/plain","null");Uo.defineExtension=function(t,r){Uo.prototype[t]=r};Uo.defineDocExtension=function(t,r){xu.prototype[t]=r};Uo.fromTextArea=cs;ls(Uo);Uo.version="5.65.17";return Uo}))})(v);
|
|
1
|
+
import{r as t,c as r,f as n,h as i,H as e,d as a}from"./p-d7c15b0e.js";import{k as u,g as o,s}from"./p-e1cf074e.js";import{c as f}from"./p-635bb4b3.js";import{c,g as l}from"./p-029c7cbe.js";var h={exports:{}};var v={exports:{}};(function(t,r){(function(r,n){t.exports=n()})(c,(function(){var t=navigator.userAgent;var r=navigator.platform;var n=/gecko\/\d/i.test(t);var i=/MSIE \d/.test(t);var e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t);var a=/Edge\/(\d+)/.exec(t);var u=i||e||a;var o=u&&(i?document.documentMode||6:+(a||e)[1]);var s=!a&&/WebKit\//.test(t);var f=s&&/Qt\/\d+\.\d+/.test(t);var c=!a&&/Chrome\/(\d+)/.exec(t);var l=c&&+c[1];var h=/Opera\//.test(t);var v=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t);var p=/PhantomJS/.test(t);var g=v&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2);var b=/Android/.test(t);var m=g||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t);var w=g||/Mac/.test(r);var y=/\bCrOS\b/.test(t);var k=/win/i.test(r);var T=h&&t.match(/Version\/(\d*\.\d*)/);if(T){T=Number(T[1])}if(T&&T>=15){h=false;s=true}var A=w&&(f||h&&(T==null||T<12.11));var E=n||u&&o>=9;function L(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var x=function(t,r){var n=t.className;var i=L(r).exec(n);if(i){var e=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(e?i[1]+e:"")}};function C(t){for(var r=t.childNodes.length;r>0;--r){t.removeChild(t.firstChild)}return t}function D(t,r){return C(t).appendChild(r)}function O(t,r,n,i){var e=document.createElement(t);if(n){e.className=n}if(i){e.style.cssText=i}if(typeof r=="string"){e.appendChild(document.createTextNode(r))}else if(r){for(var a=0;a<r.length;++a){e.appendChild(r[a])}}return e}function S(t,r,n,i){var e=O(t,r,n,i);e.setAttribute("role","presentation");return e}var N;if(document.createRange){N=function(t,r,n,i){var e=document.createRange();e.setEnd(i||t,n);e.setStart(t,r);return e}}else{N=function(t,r,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(t){return i}i.collapse(true);i.moveEnd("character",n);i.moveStart("character",r);return i}}function M(t,r){if(r.nodeType==3){r=r.parentNode}if(t.contains){return t.contains(r)}do{if(r.nodeType==11){r=r.host}if(r==t){return true}}while(r=r.parentNode)}function R(t){var r=t.ownerDocument||t;var n;try{n=t.activeElement}catch(t){n=r.body||null}while(n&&n.shadowRoot&&n.shadowRoot.activeElement){n=n.shadowRoot.activeElement}return n}function B(t,r){var n=t.className;if(!L(r).test(n)){t.className+=(n?" ":"")+r}}function I(t,r){var n=t.split(" ");for(var i=0;i<n.length;i++){if(n[i]&&!L(n[i]).test(r)){r+=" "+n[i]}}return r}var q=function(t){t.select()};if(g){q=function(t){t.selectionStart=0;t.selectionEnd=t.value.length}}else if(u){q=function(t){try{t.select()}catch(t){}}}function F(t){return t.display.wrapper.ownerDocument}function P(t){return j(t.display.wrapper)}function j(t){return t.getRootNode?t.getRootNode():t.ownerDocument}function _(t){return F(t).defaultView}function U(t){var r=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,r)}}function H(t,r,n){if(!r){r={}}for(var i in t){if(t.hasOwnProperty(i)&&(n!==false||!r.hasOwnProperty(i))){r[i]=t[i]}}return r}function z(t,r,n,i,e){if(r==null){r=t.search(/[^\s\u00a0]/);if(r==-1){r=t.length}}for(var a=i||0,u=e||0;;){var o=t.indexOf("\t",a);if(o<0||o>=r){return u+(r-a)}u+=o-a;u+=n-u%n;a=o+1}}var V=function(){this.id=null;this.f=null;this.time=0;this.handler=U(this.onTimeout,this)};V.prototype.onTimeout=function(t){t.id=0;if(t.time<=+new Date){t.f()}else{setTimeout(t.handler,t.time-+new Date)}};V.prototype.set=function(t,r){this.f=r;var n=+new Date+t;if(!this.id||n<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,t);this.time=n}};function $(t,r){for(var n=0;n<t.length;++n){if(t[n]==r){return n}}return-1}var G=50;var W={toString:function(){return"CodeMirror.Pass"}};var Z={scroll:false},K={origin:"*mouse"},Y={origin:"+move"};function Q(t,r,n){for(var i=0,e=0;;){var a=t.indexOf("\t",i);if(a==-1){a=t.length}var u=a-i;if(a==t.length||e+u>=r){return i+Math.min(u,r-e)}e+=a-i;e+=n-e%n;i=a+1;if(e>=r){return i}}}var X=[""];function J(t){while(X.length<=t){X.push(tt(X)+" ")}return X[t]}function tt(t){return t[t.length-1]}function rt(t,r){var n=[];for(var i=0;i<t.length;i++){n[i]=r(t[i],i)}return n}function nt(t,r,n){var i=0,e=n(r);while(i<t.length&&n(t[i])<=e){i++}t.splice(i,0,r)}function it(){}function et(t,r){var n;if(Object.create){n=Object.create(t)}else{it.prototype=t;n=new it}if(r){H(r,n)}return n}var at=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ut(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||at.test(t))}function ot(t,r){if(!r){return ut(t)}if(r.source.indexOf("\\w")>-1&&ut(t)){return true}return r.test(t)}function st(t){for(var r in t){if(t.hasOwnProperty(r)&&t[r]){return false}}return true}var ft=/[\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 ct(t){return t.charCodeAt(0)>=768&&ft.test(t)}function lt(t,r,n){while((n<0?r>0:r<t.length)&&ct(t.charAt(r))){r+=n}return r}function ht(t,r,n){var i=r>n?-1:1;for(;;){if(r==n){return r}var e=(r+n)/2,a=i<0?Math.ceil(e):Math.floor(e);if(a==r){return t(a)?r:n}if(t(a)){n=a}else{r=a+i}}}function vt(t,r,n,i){if(!t){return i(r,n,"ltr",0)}var e=false;for(var a=0;a<t.length;++a){var u=t[a];if(u.from<n&&u.to>r||r==n&&u.to==r){i(Math.max(u.from,r),Math.min(u.to,n),u.level==1?"rtl":"ltr",a);e=true}}if(!e){i(r,n,"ltr")}}var dt=null;function pt(t,r,n){var i;dt=null;for(var e=0;e<t.length;++e){var a=t[e];if(a.from<r&&a.to>r){return e}if(a.to==r){if(a.from!=a.to&&n=="before"){i=e}else{dt=e}}if(a.from==r){if(a.from!=a.to&&n!="before"){i=e}else{dt=e}}}return i!=null?i:dt}var gt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){if(n<=247){return t.charAt(n)}else if(1424<=n&&n<=1524){return"R"}else if(1536<=n&&n<=1785){return r.charAt(n-1536)}else if(1774<=n&&n<=2220){return"r"}else if(8192<=n&&n<=8203){return"w"}else if(n==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var e=/[stwN]/,a=/[LRr]/,u=/[Lb1n]/,o=/[1n]/;function s(t,r,n){this.level=t;this.from=r;this.to=n}return function(t,r){var f=r=="ltr"?"L":"R";if(t.length==0||r=="ltr"&&!i.test(t)){return false}var c=t.length,l=[];for(var h=0;h<c;++h){l.push(n(t.charCodeAt(h)))}for(var v=0,d=f;v<c;++v){var p=l[v];if(p=="m"){l[v]=d}else{d=p}}for(var g=0,b=f;g<c;++g){var m=l[g];if(m=="1"&&b=="r"){l[g]="n"}else if(a.test(m)){b=m;if(m=="r"){l[g]="R"}}}for(var w=1,y=l[0];w<c-1;++w){var k=l[w];if(k=="+"&&y=="1"&&l[w+1]=="1"){l[w]="1"}else if(k==","&&y==l[w+1]&&(y=="1"||y=="n")){l[w]=y}y=k}for(var T=0;T<c;++T){var A=l[T];if(A==","){l[T]="N"}else if(A=="%"){var E=void 0;for(E=T+1;E<c&&l[E]=="%";++E){}var L=T&&l[T-1]=="!"||E<c&&l[E]=="1"?"1":"N";for(var x=T;x<E;++x){l[x]=L}T=E-1}}for(var C=0,D=f;C<c;++C){var O=l[C];if(D=="L"&&O=="1"){l[C]="L"}else if(a.test(O)){D=O}}for(var S=0;S<c;++S){if(e.test(l[S])){var N=void 0;for(N=S+1;N<c&&e.test(l[N]);++N){}var M=(S?l[S-1]:f)=="L";var R=(N<c?l[N]:f)=="L";var B=M==R?M?"L":"R":f;for(var I=S;I<N;++I){l[I]=B}S=N-1}}var q=[],F;for(var P=0;P<c;){if(u.test(l[P])){var j=P;for(++P;P<c&&u.test(l[P]);++P){}q.push(new s(0,j,P))}else{var _=P,U=q.length,H=r=="rtl"?1:0;for(++P;P<c&&l[P]!="L";++P){}for(var z=_;z<P;){if(o.test(l[z])){if(_<z){q.splice(U,0,new s(1,_,z));U+=H}var V=z;for(++z;z<P&&o.test(l[z]);++z){}q.splice(U,0,new s(2,V,z));U+=H;_=z}else{++z}}if(_<P){q.splice(U,0,new s(1,_,P))}}}if(r=="ltr"){if(q[0].level==1&&(F=t.match(/^\s+/))){q[0].from=F[0].length;q.unshift(new s(0,0,F[0].length))}if(tt(q).level==1&&(F=t.match(/\s+$/))){tt(q).to-=F[0].length;q.push(new s(0,c-F[0].length,c))}}return r=="rtl"?q.reverse():q}}();function bt(t,r){var n=t.order;if(n==null){n=t.order=gt(t.text,r)}return n}var mt=[];var wt=function(t,r,n){if(t.addEventListener){t.addEventListener(r,n,false)}else if(t.attachEvent){t.attachEvent("on"+r,n)}else{var i=t._handlers||(t._handlers={});i[r]=(i[r]||mt).concat(n)}};function yt(t,r){return t._handlers&&t._handlers[r]||mt}function kt(t,r,n){if(t.removeEventListener){t.removeEventListener(r,n,false)}else if(t.detachEvent){t.detachEvent("on"+r,n)}else{var i=t._handlers,e=i&&i[r];if(e){var a=$(e,n);if(a>-1){i[r]=e.slice(0,a).concat(e.slice(a+1))}}}}function Tt(t,r){var n=yt(t,r);if(!n.length){return}var i=Array.prototype.slice.call(arguments,2);for(var e=0;e<n.length;++e){n[e].apply(null,i)}}function At(t,r,n){if(typeof r=="string"){r={type:r,preventDefault:function(){this.defaultPrevented=true}}}Tt(t,n||r.type,t,r);return Ot(r)||r.codemirrorIgnore}function Et(t){var r=t._handlers&&t._handlers.cursorActivity;if(!r){return}var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]);for(var i=0;i<r.length;++i){if($(n,r[i])==-1){n.push(r[i])}}}function Lt(t,r){return yt(t,r).length>0}function xt(t){t.prototype.on=function(t,r){wt(this,t,r)};t.prototype.off=function(t,r){kt(this,t,r)}}function Ct(t){if(t.preventDefault){t.preventDefault()}else{t.returnValue=false}}function Dt(t){if(t.stopPropagation){t.stopPropagation()}else{t.cancelBubble=true}}function Ot(t){return t.defaultPrevented!=null?t.defaultPrevented:t.returnValue==false}function St(t){Ct(t);Dt(t)}function Nt(t){return t.target||t.srcElement}function Mt(t){var r=t.which;if(r==null){if(t.button&1){r=1}else if(t.button&2){r=3}else if(t.button&4){r=2}}if(w&&t.ctrlKey&&r==1){r=3}return r}var Rt=function(){if(u&&o<9){return false}var t=O("div");return"draggable"in t||"dragDrop"in t}();var Bt;function It(t){if(Bt==null){var r=O("span","");D(t,O("span",[r,document.createTextNode("x")]));if(t.firstChild.offsetHeight!=0){Bt=r.offsetWidth<=1&&r.offsetHeight>2&&!(u&&o<8)}}var n=Bt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");n.setAttribute("cm-text","");return n}var qt;function Ft(t){if(qt!=null){return qt}var r=D(t,document.createTextNode("AخA"));var n=N(r,0,1).getBoundingClientRect();var i=N(r,1,2).getBoundingClientRect();C(t);if(!n||n.left==n.right){return false}return qt=i.right-n.right<3}var Pt="\n\nb".split(/\n/).length!=3?function(t){var r=0,n=[],i=t.length;while(r<=i){var e=t.indexOf("\n",r);if(e==-1){e=t.length}var a=t.slice(r,t.charAt(e-1)=="\r"?e-1:e);var u=a.indexOf("\r");if(u!=-1){n.push(a.slice(0,u));r+=u+1}else{n.push(a);r=e+1}}return n}:function(t){return t.split(/\r\n?|\n/)};var jt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return false}}:function(t){var r;try{r=t.ownerDocument.selection.createRange()}catch(t){}if(!r||r.parentElement()!=t){return false}return r.compareEndPoints("StartToEnd",r)!=0};var _t=function(){var t=O("div");if("oncopy"in t){return true}t.setAttribute("oncopy","return;");return typeof t.oncopy=="function"}();var Ut=null;function Ht(t){if(Ut!=null){return Ut}var r=D(t,O("span","x"));var n=r.getBoundingClientRect();var i=N(r,0,1).getBoundingClientRect();return Ut=Math.abs(n.left-i.left)>1}var zt={},Vt={};function $t(t,r){if(arguments.length>2){r.dependencies=Array.prototype.slice.call(arguments,2)}zt[t]=r}function Gt(t,r){Vt[t]=r}function Wt(t){if(typeof t=="string"&&Vt.hasOwnProperty(t)){t=Vt[t]}else if(t&&typeof t.name=="string"&&Vt.hasOwnProperty(t.name)){var r=Vt[t.name];if(typeof r=="string"){r={name:r}}t=et(r,t);t.name=r.name}else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t)){return Wt("application/xml")}else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(t)){return Wt("application/json")}if(typeof t=="string"){return{name:t}}else{return t||{name:"null"}}}function Zt(t,r){r=Wt(r);var n=zt[r.name];if(!n){return Zt(t,"text/plain")}var i=n(t,r);if(Kt.hasOwnProperty(r.name)){var e=Kt[r.name];for(var a in e){if(!e.hasOwnProperty(a)){continue}if(i.hasOwnProperty(a)){i["_"+a]=i[a]}i[a]=e[a]}}i.name=r.name;if(r.helperType){i.helperType=r.helperType}if(r.modeProps){for(var u in r.modeProps){i[u]=r.modeProps[u]}}return i}var Kt={};function Yt(t,r){var n=Kt.hasOwnProperty(t)?Kt[t]:Kt[t]={};H(r,n)}function Qt(t,r){if(r===true){return r}if(t.copyState){return t.copyState(r)}var n={};for(var i in r){var e=r[i];if(e instanceof Array){e=e.concat([])}n[i]=e}return n}function Xt(t,r){var n;while(t.innerMode){n=t.innerMode(r);if(!n||n.mode==t){break}r=n.state;t=n.mode}return n||{mode:t,state:r}}function Jt(t,r,n){return t.startState?t.startState(r,n):true}var tr=function(t,r,n){this.pos=this.start=0;this.string=t;this.tabSize=r||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=n};tr.prototype.eol=function(){return this.pos>=this.string.length};tr.prototype.sol=function(){return this.pos==this.lineStart};tr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};tr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};tr.prototype.eat=function(t){var r=this.string.charAt(this.pos);var n;if(typeof t=="string"){n=r==t}else{n=r&&(t.test?t.test(r):t(r))}if(n){++this.pos;return r}};tr.prototype.eatWhile=function(t){var r=this.pos;while(this.eat(t)){}return this.pos>r};tr.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>t};tr.prototype.skipToEnd=function(){this.pos=this.string.length};tr.prototype.skipTo=function(t){var r=this.string.indexOf(t,this.pos);if(r>-1){this.pos=r;return true}};tr.prototype.backUp=function(t){this.pos-=t};tr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)};tr.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)};tr.prototype.match=function(t,r,n){if(typeof t=="string"){var i=function(t){return n?t.toLowerCase():t};var e=this.string.substr(this.pos,t.length);if(i(e)==i(t)){if(r!==false){this.pos+=t.length}return true}}else{var a=this.string.slice(this.pos).match(t);if(a&&a.index>0){return null}if(a&&r!==false){this.pos+=a[0].length}return a}};tr.prototype.current=function(){return this.string.slice(this.start,this.pos)};tr.prototype.hideFirstChars=function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}};tr.prototype.lookAhead=function(t){var r=this.lineOracle;return r&&r.lookAhead(t)};tr.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};function rr(t,r){r-=t.first;if(r<0||r>=t.size){throw new Error("There is no line "+(r+t.first)+" in the document.")}var n=t;while(!n.lines){for(var i=0;;++i){var e=n.children[i],a=e.chunkSize();if(r<a){n=e;break}r-=a}}return n.lines[r]}function nr(t,r,n){var i=[],e=r.line;t.iter(r.line,n.line+1,(function(t){var a=t.text;if(e==n.line){a=a.slice(0,n.ch)}if(e==r.line){a=a.slice(r.ch)}i.push(a);++e}));return i}function ir(t,r,n){var i=[];t.iter(r,n,(function(t){i.push(t.text)}));return i}function er(t,r){var n=r-t.height;if(n){for(var i=t;i;i=i.parent){i.height+=n}}}function ar(t){if(t.parent==null){return null}var r=t.parent,n=$(r.lines,t);for(var i=r.parent;i;r=i,i=i.parent){for(var e=0;;++e){if(i.children[e]==r){break}n+=i.children[e].chunkSize()}}return n+r.first}function ur(t,r){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var e=t.children[i],a=e.height;if(r<a){t=e;continue t}r-=a;n+=e.chunkSize()}return n}while(!t.lines);var u=0;for(;u<t.lines.length;++u){var o=t.lines[u],s=o.height;if(r<s){break}r-=s}return n+u}function or(t,r){return r>=t.first&&r<t.first+t.size}function sr(t,r){return String(t.lineNumberFormatter(r+t.firstLineNumber))}function fr(t,r,n){if(n===void 0)n=null;if(!(this instanceof fr)){return new fr(t,r,n)}this.line=t;this.ch=r;this.sticky=n}function cr(t,r){return t.line-r.line||t.ch-r.ch}function lr(t,r){return t.sticky==r.sticky&&cr(t,r)==0}function hr(t){return fr(t.line,t.ch)}function vr(t,r){return cr(t,r)<0?r:t}function dr(t,r){return cr(t,r)<0?t:r}function pr(t,r){return Math.max(t.first,Math.min(r,t.first+t.size-1))}function gr(t,r){if(r.line<t.first){return fr(t.first,0)}var n=t.first+t.size-1;if(r.line>n){return fr(n,rr(t,n).text.length)}return br(r,rr(t,r.line).text.length)}function br(t,r){var n=t.ch;if(n==null||n>r){return fr(t.line,r)}else if(n<0){return fr(t.line,0)}else{return t}}function mr(t,r){var n=[];for(var i=0;i<r.length;i++){n[i]=gr(t,r[i])}return n}var wr=function(t,r){this.state=t;this.lookAhead=r};var yr=function(t,r,n,i){this.state=r;this.doc=t;this.line=n;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};yr.prototype.lookAhead=function(t){var r=this.doc.getLine(this.line+t);if(r!=null&&t>this.maxLookAhead){this.maxLookAhead=t}return r};yr.prototype.baseToken=function(t){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=t){this.baseTokenPos+=2}var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}};yr.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};yr.fromSaved=function(t,r,n){if(r instanceof wr){return new yr(t,Qt(t.mode,r.state),n,r.lookAhead)}else{return new yr(t,Qt(t.mode,r),n)}};yr.prototype.save=function(t){var r=t!==false?Qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wr(r,this.maxLookAhead):r};function kr(t,r,n,i){var e=[t.state.modeGen],a={};Sr(t,r.text,t.doc.mode,n,(function(t,r){return e.push(t,r)}),a,i);var u=n.state;var o=function(i){n.baseTokens=e;var o=t.state.overlays[i],s=1,f=0;n.state=true;Sr(t,r.text,o.mode,n,(function(t,r){var n=s;while(f<t){var i=e[s];if(i>t){e.splice(s,1,t,e[s+1],i)}s+=2;f=Math.min(t,i)}if(!r){return}if(o.opaque){e.splice(n,s-n,t,"overlay "+r);s=n+2}else{for(;n<s;n+=2){var a=e[n+1];e[n+1]=(a?a+" ":"")+"overlay "+r}}}),a);n.state=u;n.baseTokens=null;n.baseTokenPos=1};for(var s=0;s<t.state.overlays.length;++s)o(s);return{styles:e,classes:a.bgClass||a.textClass?a:null}}function Tr(t,r,n){if(!r.styles||r.styles[0]!=t.state.modeGen){var i=Ar(t,ar(r));var e=r.text.length>t.options.maxHighlightLength&&Qt(t.doc.mode,i.state);var a=kr(t,r,i);if(e){i.state=e}r.stateAfter=i.save(!e);r.styles=a.styles;if(a.classes){r.styleClasses=a.classes}else if(r.styleClasses){r.styleClasses=null}if(n===t.doc.highlightFrontier){t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier)}}return r.styles}function Ar(t,r,n){var i=t.doc,e=t.display;if(!i.mode.startState){return new yr(i,true,r)}var a=Nr(t,r,n);var u=a>i.first&&rr(i,a-1).stateAfter;var o=u?yr.fromSaved(i,u,a):new yr(i,Jt(i.mode),a);i.iter(a,r,(function(n){Er(t,n.text,o);var i=o.line;n.stateAfter=i==r-1||i%5==0||i>=e.viewFrom&&i<e.viewTo?o.save():null;o.nextLine()}));if(n){i.modeFrontier=o.line}return o}function Er(t,r,n,i){var e=t.doc.mode;var a=new tr(r,t.options.tabSize,n);a.start=a.pos=i||0;if(r==""){Lr(e,n.state)}while(!a.eol()){xr(e,a,n.state);a.start=a.pos}}function Lr(t,r){if(t.blankLine){return t.blankLine(r)}if(!t.innerMode){return}var n=Xt(t,r);if(n.mode.blankLine){return n.mode.blankLine(n.state)}}function xr(t,r,n,i){for(var e=0;e<10;e++){if(i){i[0]=Xt(t,n).mode}var a=t.token(r,n);if(r.pos>r.start){return a}}throw new Error("Mode "+t.name+" failed to advance stream.")}var Cr=function(t,r,n){this.start=t.start;this.end=t.pos;this.string=t.current();this.type=r||null;this.state=n};function Dr(t,r,n,i){var e=t.doc,a=e.mode,u;r=gr(e,r);var o=rr(e,r.line),s=Ar(t,r.line,n);var f=new tr(o.text,t.options.tabSize,s),c;if(i){c=[]}while((i||f.pos<r.ch)&&!f.eol()){f.start=f.pos;u=xr(a,f,s.state);if(i){c.push(new Cr(f,u,Qt(e.mode,s.state)))}}return i?c:new Cr(f,u,s.state)}function Or(t,r){if(t){for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n){break}t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";if(r[i]==null){r[i]=n[2]}else if(!new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(r[i])){r[i]+=" "+n[2]}}}return t}function Sr(t,r,n,i,e,a,u){var o=n.flattenSpans;if(o==null){o=t.options.flattenSpans}var s=0,f=null;var c=new tr(r,t.options.tabSize,i),l;var h=t.options.addModeClass&&[null];if(r==""){Or(Lr(n,i.state),a)}while(!c.eol()){if(c.pos>t.options.maxHighlightLength){o=false;if(u){Er(t,r,i,c.pos)}c.pos=r.length;l=null}else{l=Or(xr(n,c,i.state,h),a)}if(h){var v=h[0].name;if(v){l="m-"+(l?v+" "+l:v)}}if(!o||f!=l){while(s<c.start){s=Math.min(c.start,s+5e3);e(s,f)}f=l}c.start=c.pos}while(s<c.pos){var d=Math.min(c.pos,s+5e3);e(d,f);s=d}}function Nr(t,r,n){var i,e,a=t.doc;var u=n?-1:r-(t.doc.mode.innerMode?1e3:100);for(var o=r;o>u;--o){if(o<=a.first){return a.first}var s=rr(a,o-1),f=s.stateAfter;if(f&&(!n||o+(f instanceof wr?f.lookAhead:0)<=a.modeFrontier)){return o}var c=z(s.text,null,t.options.tabSize);if(e==null||i>c){e=o-1;i=c}}return e}function Mr(t,r){t.modeFrontier=Math.min(t.modeFrontier,r);if(t.highlightFrontier<r-10){return}var n=t.first;for(var i=r-1;i>n;i--){var e=rr(t,i).stateAfter;if(e&&(!(e instanceof wr)||i+e.lookAhead<r)){n=i+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}var Rr=false,Br=false;function Ir(){Rr=true}function qr(){Br=true}function Fr(t,r,n){this.marker=t;this.from=r;this.to=n}function Pr(t,r){if(t){for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==r){return i}}}}function jr(t,r){var n;for(var i=0;i<t.length;++i){if(t[i]!=r){(n||(n=[])).push(t[i])}}return n}function _r(t,r,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));if(i&&t.markedSpans&&i.has(t.markedSpans)){t.markedSpans.push(r)}else{t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r];if(i){i.add(t.markedSpans)}}r.marker.attachLine(t)}function Ur(t,r,n){var i;if(t){for(var e=0;e<t.length;++e){var a=t[e],u=a.marker;var o=a.from==null||(u.inclusiveLeft?a.from<=r:a.from<r);if(o||a.from==r&&u.type=="bookmark"&&(!n||!a.marker.insertLeft)){var s=a.to==null||(u.inclusiveRight?a.to>=r:a.to>r);(i||(i=[])).push(new Fr(u,a.from,s?null:a.to))}}}return i}function Hr(t,r,n){var i;if(t){for(var e=0;e<t.length;++e){var a=t[e],u=a.marker;var o=a.to==null||(u.inclusiveRight?a.to>=r:a.to>r);if(o||a.from==r&&u.type=="bookmark"&&(!n||a.marker.insertLeft)){var s=a.from==null||(u.inclusiveLeft?a.from<=r:a.from<r);(i||(i=[])).push(new Fr(u,s?null:a.from-r,a.to==null?null:a.to-r))}}}return i}function zr(t,r){if(r.full){return null}var n=or(t,r.from.line)&&rr(t,r.from.line).markedSpans;var i=or(t,r.to.line)&&rr(t,r.to.line).markedSpans;if(!n&&!i){return null}var e=r.from.ch,a=r.to.ch,u=cr(r.from,r.to)==0;var o=Ur(n,e,u);var s=Hr(i,a,u);var f=r.text.length==1,c=tt(r.text).length+(f?e:0);if(o){for(var l=0;l<o.length;++l){var h=o[l];if(h.to==null){var v=Pr(s,h.marker);if(!v){h.to=e}else if(f){h.to=v.to==null?null:v.to+c}}}}if(s){for(var d=0;d<s.length;++d){var p=s[d];if(p.to!=null){p.to+=c}if(p.from==null){var g=Pr(o,p.marker);if(!g){p.from=c;if(f){(o||(o=[])).push(p)}}}else{p.from+=c;if(f){(o||(o=[])).push(p)}}}}if(o){o=Vr(o)}if(s&&s!=o){s=Vr(s)}var b=[o];if(!f){var m=r.text.length-2,w;if(m>0&&o){for(var y=0;y<o.length;++y){if(o[y].to==null){(w||(w=[])).push(new Fr(o[y].marker,null,null))}}}for(var k=0;k<m;++k){b.push(w)}b.push(s)}return b}function Vr(t){for(var r=0;r<t.length;++r){var n=t[r];if(n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==false){t.splice(r--,1)}}if(!t.length){return null}return t}function $r(t,r,n){var i=null;t.iter(r.line,n.line+1,(function(t){if(t.markedSpans){for(var r=0;r<t.markedSpans.length;++r){var n=t.markedSpans[r].marker;if(n.readOnly&&(!i||$(i,n)==-1)){(i||(i=[])).push(n)}}}}));if(!i){return null}var e=[{from:r,to:n}];for(var a=0;a<i.length;++a){var u=i[a],o=u.find(0);for(var s=0;s<e.length;++s){var f=e[s];if(cr(f.to,o.from)<0||cr(f.from,o.to)>0){continue}var c=[s,1],l=cr(f.from,o.from),h=cr(f.to,o.to);if(l<0||!u.inclusiveLeft&&!l){c.push({from:f.from,to:o.from})}if(h>0||!u.inclusiveRight&&!h){c.push({from:o.to,to:f.to})}e.splice.apply(e,c);s+=c.length-3}}return e}function Gr(t){var r=t.markedSpans;if(!r){return}for(var n=0;n<r.length;++n){r[n].marker.detachLine(t)}t.markedSpans=null}function Wr(t,r){if(!r){return}for(var n=0;n<r.length;++n){r[n].marker.attachLine(t)}t.markedSpans=r}function Zr(t){return t.inclusiveLeft?-1:0}function Kr(t){return t.inclusiveRight?1:0}function Yr(t,r){var n=t.lines.length-r.lines.length;if(n!=0){return n}var i=t.find(),e=r.find();var a=cr(i.from,e.from)||Zr(t)-Zr(r);if(a){return-a}var u=cr(i.to,e.to)||Kr(t)-Kr(r);if(u){return u}return r.id-t.id}function Qr(t,r){var n=Br&&t.markedSpans,i;if(n){for(var e=void 0,a=0;a<n.length;++a){e=n[a];if(e.marker.collapsed&&(r?e.from:e.to)==null&&(!i||Yr(i,e.marker)<0)){i=e.marker}}}return i}function Xr(t){return Qr(t,true)}function Jr(t){return Qr(t,false)}function tn(t,r){var n=Br&&t.markedSpans,i;if(n){for(var e=0;e<n.length;++e){var a=n[e];if(a.marker.collapsed&&(a.from==null||a.from<r)&&(a.to==null||a.to>r)&&(!i||Yr(i,a.marker)<0)){i=a.marker}}}return i}function rn(t,r,n,i,e){var a=rr(t,r);var u=Br&&a.markedSpans;if(u){for(var o=0;o<u.length;++o){var s=u[o];if(!s.marker.collapsed){continue}var f=s.marker.find(0);var c=cr(f.from,n)||Zr(s.marker)-Zr(e);var l=cr(f.to,i)||Kr(s.marker)-Kr(e);if(c>=0&&l<=0||c<=0&&l>=0){continue}if(c<=0&&(s.marker.inclusiveRight&&e.inclusiveLeft?cr(f.to,n)>=0:cr(f.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&e.inclusiveLeft?cr(f.from,i)<=0:cr(f.from,i)<0)){return true}}}}function nn(t){var r;while(r=Xr(t)){t=r.find(-1,true).line}return t}function en(t){var r;while(r=Jr(t)){t=r.find(1,true).line}return t}function an(t){var r,n;while(r=Jr(t)){t=r.find(1,true).line;(n||(n=[])).push(t)}return n}function un(t,r){var n=rr(t,r),i=nn(n);if(n==i){return r}return ar(i)}function on(t,r){if(r>t.lastLine()){return r}var n=rr(t,r),i;if(!sn(t,n)){return r}while(i=Jr(n)){n=i.find(1,true).line}return ar(n)+1}function sn(t,r){var n=Br&&r.markedSpans;if(n){for(var i=void 0,e=0;e<n.length;++e){i=n[e];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&fn(t,r,i)){return true}}}}function fn(t,r,n){if(n.to==null){var i=n.marker.find(1,true);return fn(t,i.line,Pr(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==r.text.length){return true}for(var e=void 0,a=0;a<r.markedSpans.length;++a){e=r.markedSpans[a];if(e.marker.collapsed&&!e.marker.widgetNode&&e.from==n.to&&(e.to==null||e.to!=n.from)&&(e.marker.inclusiveLeft||n.marker.inclusiveRight)&&fn(t,r,e)){return true}}}function cn(t){t=nn(t);var r=0,n=t.parent;for(var i=0;i<n.lines.length;++i){var e=n.lines[i];if(e==t){break}else{r+=e.height}}for(var a=n.parent;a;n=a,a=n.parent){for(var u=0;u<a.children.length;++u){var o=a.children[u];if(o==n){break}else{r+=o.height}}}return r}function ln(t){if(t.height==0){return 0}var r=t.text.length,n,i=t;while(n=Xr(i)){var e=n.find(0,true);i=e.from.line;r+=e.from.ch-e.to.ch}i=t;while(n=Jr(i)){var a=n.find(0,true);r-=i.text.length-a.from.ch;i=a.to.line;r+=i.text.length-a.to.ch}return r}function hn(t){var r=t.display,n=t.doc;r.maxLine=rr(n,n.first);r.maxLineLength=ln(r.maxLine);r.maxLineChanged=true;n.iter((function(t){var n=ln(t);if(n>r.maxLineLength){r.maxLineLength=n;r.maxLine=t}}))}var vn=function(t,r,n){this.text=t;Wr(this,r);this.height=n?n(this):1};vn.prototype.lineNo=function(){return ar(this)};xt(vn);function dn(t,r,n,i){t.text=r;if(t.stateAfter){t.stateAfter=null}if(t.styles){t.styles=null}if(t.order!=null){t.order=null}Gr(t);Wr(t,n);var e=i?i(t):1;if(e!=t.height){er(t,e)}}function pn(t){t.parent=null;Gr(t)}var gn={},bn={};function mn(t,r){if(!t||/^\s*$/.test(t)){return null}var n=r.addModeClass?bn:gn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function wn(t,r){var n=S("span",null,null,s?"padding-right: .1px":null);var i={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:false,splitSpaces:t.getOption("lineWrapping")};r.measure={};for(var e=0;e<=(r.rest?r.rest.length:0);e++){var a=e?r.rest[e-1]:r.line,u=void 0;i.pos=0;i.addToken=kn;if(Ft(t.display.measure)&&(u=bt(a,t.doc.direction))){i.addToken=An(i.addToken,u)}i.map=[];var o=r!=t.display.externalMeasured&&ar(a);Ln(a,i,Tr(t,a,o));if(a.styleClasses){if(a.styleClasses.bgClass){i.bgClass=I(a.styleClasses.bgClass,i.bgClass||"")}if(a.styleClasses.textClass){i.textClass=I(a.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(It(t.display.measure)))}if(e==0){r.measure.map=i.map;r.measure.cache={}}else{(r.measure.maps||(r.measure.maps=[])).push(i.map);(r.measure.caches||(r.measure.caches=[])).push({})}}if(s){var f=i.content.lastChild;if(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}Tt(t,"renderLine",t,r.line,i.pre);if(i.pre.className){i.textClass=I(i.pre.className,i.textClass||"")}return i}function yn(t){var r=O("span","•","cm-invalidchar");r.title="\\u"+t.charCodeAt(0).toString(16);r.setAttribute("aria-label",r.title);return r}function kn(t,r,n,i,e,a,s){if(!r){return}var f=t.splitSpaces?Tn(r,t.trailingSpace):r;var c=t.cm.state.specialChars,l=false;var h;if(!c.test(r)){t.col+=r.length;h=document.createTextNode(f);t.map.push(t.pos,t.pos+r.length,h);if(u&&o<9){l=true}t.pos+=r.length}else{h=document.createDocumentFragment();var v=0;while(true){c.lastIndex=v;var d=c.exec(r);var p=d?d.index-v:r.length-v;if(p){var g=document.createTextNode(f.slice(v,v+p));if(u&&o<9){h.appendChild(O("span",[g]))}else{h.appendChild(g)}t.map.push(t.pos,t.pos+p,g);t.col+=p;t.pos+=p}if(!d){break}v+=p+1;var b=void 0;if(d[0]=="\t"){var m=t.cm.options.tabSize,w=m-t.col%m;b=h.appendChild(O("span",J(w),"cm-tab"));b.setAttribute("role","presentation");b.setAttribute("cm-text","\t");t.col+=w}else if(d[0]=="\r"||d[0]=="\n"){b=h.appendChild(O("span",d[0]=="\r"?"␍":"","cm-invalidchar"));b.setAttribute("cm-text",d[0]);t.col+=1}else{b=t.cm.options.specialCharPlaceholder(d[0]);b.setAttribute("cm-text",d[0]);if(u&&o<9){h.appendChild(O("span",[b]))}else{h.appendChild(b)}t.col+=1}t.map.push(t.pos,t.pos+1,b);t.pos++}}t.trailingSpace=f.charCodeAt(r.length-1)==32;if(n||i||e||l||a||s){var y=n||"";if(i){y+=i}if(e){y+=e}var k=O("span",[h],y,a);if(s){for(var T in s){if(s.hasOwnProperty(T)&&T!="style"&&T!="class"){k.setAttribute(T,s[T])}}}return t.content.appendChild(k)}t.content.appendChild(h)}function Tn(t,r){if(t.length>1&&!/ /.test(t)){return t}var n=r,i="";for(var e=0;e<t.length;e++){var a=t.charAt(e);if(a==" "&&n&&(e==t.length-1||t.charCodeAt(e+1)==32)){a=" "}i+=a;n=a==" "}return i}function An(t,r){return function(n,i,e,a,u,o,s){e=e?e+" cm-force-border":"cm-force-border";var f=n.pos,c=f+i.length;for(;;){var l=void 0;for(var h=0;h<r.length;h++){l=r[h];if(l.to>f&&l.from<=f){break}}if(l.to>=c){return t(n,i,e,a,u,o,s)}t(n,i.slice(0,l.to-f),e,a,null,o,s);a=null;i=i.slice(l.to-f);f=l.to}}}function En(t,r,n,i){var e=!i&&n.widgetNode;if(e){t.map.push(t.pos,t.pos+r,e)}if(!i&&t.cm.display.input.needsContentAttribute){if(!e){e=t.content.appendChild(document.createElement("span"))}e.setAttribute("cm-marker",n.id)}if(e){t.cm.display.input.setUneditable(e);t.content.appendChild(e)}t.pos+=r;t.trailingSpace=false}function Ln(t,r,n){var i=t.markedSpans,e=t.text,a=0;if(!i){for(var u=1;u<n.length;u+=2){r.addToken(r,e.slice(a,a=n[u]),mn(n[u+1],r.cm.options))}return}var o=e.length,s=0,f=1,c="",l,h;var v=0,d,p,g,b,m;for(;;){if(v==s){d=p=g=h="";m=null;b=null;v=Infinity;var w=[],y=void 0;for(var k=0;k<i.length;++k){var T=i[k],A=T.marker;if(A.type=="bookmark"&&T.from==s&&A.widgetNode){w.push(A)}else if(T.from<=s&&(T.to==null||T.to>s||A.collapsed&&T.to==s&&T.from==s)){if(T.to!=null&&T.to!=s&&v>T.to){v=T.to;p=""}if(A.className){d+=" "+A.className}if(A.css){h=(h?h+";":"")+A.css}if(A.startStyle&&T.from==s){g+=" "+A.startStyle}if(A.endStyle&&T.to==v){(y||(y=[])).push(A.endStyle,T.to)}if(A.title){(m||(m={})).title=A.title}if(A.attributes){for(var E in A.attributes){(m||(m={}))[E]=A.attributes[E]}}if(A.collapsed&&(!b||Yr(b.marker,A)<0)){b=T}}else if(T.from>s&&v>T.from){v=T.from}}if(y){for(var L=0;L<y.length;L+=2){if(y[L+1]==v){p+=" "+y[L]}}}if(!b||b.from==s){for(var x=0;x<w.length;++x){En(r,0,w[x])}}if(b&&(b.from||0)==s){En(r,(b.to==null?o+1:b.to)-s,b.marker,b.from==null);if(b.to==null){return}if(b.to==s){b=false}}}if(s>=o){break}var C=Math.min(o,v);while(true){if(c){var D=s+c.length;if(!b){var O=D>C?c.slice(0,C-s):c;r.addToken(r,O,l?l+d:d,g,s+O.length==v?p:"",h,m)}if(D>=C){c=c.slice(C-s);s=C;break}s=D;g=""}c=e.slice(a,a=n[f++]);l=mn(n[f++],r.cm.options)}}}function xn(t,r,n){this.line=r;this.rest=an(r);this.size=this.rest?ar(tt(this.rest))-n+1:1;this.node=this.text=null;this.hidden=sn(t,r)}function Cn(t,r,n){var i=[],e;for(var a=r;a<n;a=e){var u=new xn(t.doc,rr(t.doc,a),a);e=a+u.size;i.push(u)}return i}var Dn=null;function On(t){if(Dn){Dn.ops.push(t)}else{t.ownsGroup=Dn={ops:[t],delayedCallbacks:[]}}}function Sn(t){var r=t.delayedCallbacks,n=0;do{for(;n<r.length;n++){r[n].call(null)}for(var i=0;i<t.ops.length;i++){var e=t.ops[i];if(e.cursorActivityHandlers){while(e.cursorActivityCalled<e.cursorActivityHandlers.length){e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}}}while(n<r.length)}function Nn(t,r){var n=t.ownsGroup;if(!n){return}try{Sn(n)}finally{Dn=null;r(n)}}var Mn=null;function Rn(t,r){var n=yt(t,r);if(!n.length){return}var i=Array.prototype.slice.call(arguments,2),e;if(Dn){e=Dn.delayedCallbacks}else if(Mn){e=Mn}else{e=Mn=[];setTimeout(Bn,0)}var a=function(t){e.push((function(){return n[t].apply(null,i)}))};for(var u=0;u<n.length;++u)a(u)}function Bn(){var t=Mn;Mn=null;for(var r=0;r<t.length;++r){t[r]()}}function In(t,r,n,i){for(var e=0;e<r.changes.length;e++){var a=r.changes[e];if(a=="text"){jn(t,r)}else if(a=="gutter"){Un(t,r,n,i)}else if(a=="class"){_n(t,r)}else if(a=="widget"){Hn(t,r,i)}}r.changes=null}function qn(t){if(t.node==t.text){t.node=O("div",null,null,"position: relative");if(t.text.parentNode){t.text.parentNode.replaceChild(t.node,t.text)}t.node.appendChild(t.text);if(u&&o<8){t.node.style.zIndex=2}}return t.node}function Fn(t,r){var n=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(n){n+=" CodeMirror-linebackground"}if(r.background){if(n){r.background.className=n}else{r.background.parentNode.removeChild(r.background);r.background=null}}else if(n){var i=qn(r);r.background=i.insertBefore(O("div",null,n),i.firstChild);t.display.input.setUneditable(r.background)}}function Pn(t,r){var n=t.display.externalMeasured;if(n&&n.line==r.line){t.display.externalMeasured=null;r.measure=n.measure;return n.built}return wn(t,r)}function jn(t,r){var n=r.text.className;var i=Pn(t,r);if(r.text==r.node){r.node=i.pre}r.text.parentNode.replaceChild(i.pre,r.text);r.text=i.pre;if(i.bgClass!=r.bgClass||i.textClass!=r.textClass){r.bgClass=i.bgClass;r.textClass=i.textClass;_n(t,r)}else if(n){r.text.className=n}}function _n(t,r){Fn(t,r);if(r.line.wrapClass){qn(r).className=r.line.wrapClass}else if(r.node!=r.text){r.node.className=""}var n=r.textClass?r.textClass+" "+(r.line.textClass||""):r.line.textClass;r.text.className=n||""}function Un(t,r,n,i){if(r.gutter){r.node.removeChild(r.gutter);r.gutter=null}if(r.gutterBackground){r.node.removeChild(r.gutterBackground);r.gutterBackground=null}if(r.line.gutterClass){var e=qn(r);r.gutterBackground=O("div",null,"CodeMirror-gutter-background "+r.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");t.display.input.setUneditable(r.gutterBackground);e.insertBefore(r.gutterBackground,r.text)}var a=r.line.gutterMarkers;if(t.options.lineNumbers||a){var u=qn(r);var o=r.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");o.setAttribute("aria-hidden","true");t.display.input.setUneditable(o);u.insertBefore(o,r.text);if(r.line.gutterClass){o.className+=" "+r.line.gutterClass}if(t.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])){r.lineNumber=o.appendChild(O("div",sr(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))}if(a){for(var s=0;s<t.display.gutterSpecs.length;++s){var f=t.display.gutterSpecs[s].className,c=a.hasOwnProperty(f)&&a[f];if(c){o.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[f]+"px; width: "+i.gutterWidth[f]+"px"))}}}}}function Hn(t,r,n){if(r.alignable){r.alignable=null}var i=L("CodeMirror-linewidget");for(var e=r.node.firstChild,a=void 0;e;e=a){a=e.nextSibling;if(i.test(e.className)){r.node.removeChild(e)}}Vn(t,r,n)}function zn(t,r,n,i){var e=Pn(t,r);r.text=r.node=e.pre;if(e.bgClass){r.bgClass=e.bgClass}if(e.textClass){r.textClass=e.textClass}_n(t,r);Un(t,r,n,i);Vn(t,r,i);return r.node}function Vn(t,r,n){$n(t,r.line,r,n,true);if(r.rest){for(var i=0;i<r.rest.length;i++){$n(t,r.rest[i],r,n,false)}}}function $n(t,r,n,i,e){if(!r.widgets){return}var a=qn(n);for(var u=0,o=r.widgets;u<o.length;++u){var s=o[u],f=O("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));if(!s.handleMouseEvents){f.setAttribute("cm-ignore-events","true")}Gn(s,f,n,i);t.display.input.setUneditable(f);if(e&&s.above){a.insertBefore(f,n.gutter||n.text)}else{a.appendChild(f)}Rn(s,"redraw")}}function Gn(t,r,n,i){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(r);var e=i.wrapperWidth;r.style.left=i.fixedPos+"px";if(!t.coverGutter){e-=i.gutterTotalWidth;r.style.paddingLeft=i.gutterTotalWidth+"px"}r.style.width=e+"px"}if(t.coverGutter){r.style.zIndex=5;r.style.position="relative";if(!t.noHScroll){r.style.marginLeft=-i.gutterTotalWidth+"px"}}}function Wn(t){if(t.height!=null){return t.height}var r=t.doc.cm;if(!r){return 0}if(!M(document.body,t.node)){var n="position: relative;";if(t.coverGutter){n+="margin-left: -"+r.display.gutters.offsetWidth+"px;"}if(t.noHScroll){n+="width: "+r.display.wrapper.clientWidth+"px;"}D(r.display.measure,O("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Zn(t,r){for(var n=Nt(r);n!=t.wrapper;n=n.parentNode){if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==t.sizer&&n!=t.mover){return true}}}function Kn(t){return t.lineSpace.offsetTop}function Yn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Qn(t){if(t.cachedPaddingH){return t.cachedPaddingH}var r=D(t.measure,O("pre","x","CodeMirror-line-like"));var n=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle;var i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){t.cachedPaddingH=i}return i}function Xn(t){return G-t.display.nativeBarWidth}function Jn(t){return t.display.scroller.clientWidth-Xn(t)-t.display.barWidth}function ti(t){return t.display.scroller.clientHeight-Xn(t)-t.display.barHeight}function ri(t,r,n){var i=t.options.lineWrapping;var e=i&&Jn(t);if(!r.measure.heights||i&&r.measure.width!=e){var a=r.measure.heights=[];if(i){r.measure.width=e;var u=r.text.firstChild.getClientRects();for(var o=0;o<u.length-1;o++){var s=u[o],f=u[o+1];if(Math.abs(s.bottom-f.bottom)>2){a.push((s.bottom+f.top)/2-n.top)}}}a.push(n.bottom-n.top)}}function ni(t,r,n){if(t.line==r){return{map:t.measure.map,cache:t.measure.cache}}if(t.rest){for(var i=0;i<t.rest.length;i++){if(t.rest[i]==r){return{map:t.measure.maps[i],cache:t.measure.caches[i]}}}for(var e=0;e<t.rest.length;e++){if(ar(t.rest[e])>n){return{map:t.measure.maps[e],cache:t.measure.caches[e],before:true}}}}}function ii(t,r){r=nn(r);var n=ar(r);var i=t.display.externalMeasured=new xn(t.doc,r,n);i.lineN=n;var e=i.built=wn(t,i);i.text=e.pre;D(t.display.lineMeasure,e.pre);return i}function ei(t,r,n,i){return oi(t,ui(t,r),n,i)}function ai(t,r){if(r>=t.display.viewFrom&&r<t.display.viewTo){return t.display.view[_i(t,r)]}var n=t.display.externalMeasured;if(n&&r>=n.lineN&&r<n.lineN+n.size){return n}}function ui(t,r){var n=ar(r);var i=ai(t,n);if(i&&!i.text){i=null}else if(i&&i.changes){In(t,i,n,Ii(t));t.curOp.forceUpdate=true}if(!i){i=ii(t,r)}var e=ni(i,r,n);return{line:r,view:i,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:false}}function oi(t,r,n,i,e){if(r.before){n=-1}var a=n+(i||""),u;if(r.cache.hasOwnProperty(a)){u=r.cache[a]}else{if(!r.rect){r.rect=r.view.text.getBoundingClientRect()}if(!r.hasHeights){ri(t,r.view,r.rect);r.hasHeights=true}u=li(t,r,n,i);if(!u.bogus){r.cache[a]=u}}return{left:u.left,right:u.right,top:e?u.rtop:u.top,bottom:e?u.rbottom:u.bottom}}var si={left:0,right:0,top:0,bottom:0};function fi(t,r,n){var i,e,a,u,o,s;for(var f=0;f<t.length;f+=3){o=t[f];s=t[f+1];if(r<o){e=0;a=1;u="left"}else if(r<s){e=r-o;a=e+1}else if(f==t.length-3||r==s&&t[f+3]>r){a=s-o;e=a-1;if(r>=s){u="right"}}if(e!=null){i=t[f+2];if(o==s&&n==(i.insertLeft?"left":"right")){u=n}if(n=="left"&&e==0){while(f&&t[f-2]==t[f-3]&&t[f-1].insertLeft){i=t[(f-=3)+2];u="left"}}if(n=="right"&&e==s-o){while(f<t.length-3&&t[f+3]==t[f+4]&&!t[f+5].insertLeft){i=t[(f+=3)+2];u="right"}}break}}return{node:i,start:e,end:a,collapse:u,coverStart:o,coverEnd:s}}function ci(t,r){var n=si;if(r=="left"){for(var i=0;i<t.length;i++){if((n=t[i]).left!=n.right){break}}}else{for(var e=t.length-1;e>=0;e--){if((n=t[e]).left!=n.right){break}}}return n}function li(t,r,n,i){var e=fi(r.map,n,i);var a=e.node,s=e.start,f=e.end,c=e.collapse;var l;if(a.nodeType==3){for(var h=0;h<4;h++){while(s&&ct(r.line.text.charAt(e.coverStart+s))){--s}while(e.coverStart+f<e.coverEnd&&ct(r.line.text.charAt(e.coverStart+f))){++f}if(u&&o<9&&s==0&&f==e.coverEnd-e.coverStart){l=a.parentNode.getBoundingClientRect()}else{l=ci(N(a,s,f).getClientRects(),i)}if(l.left||l.right||s==0){break}f=s;s=s-1;c="right"}if(u&&o<11){l=hi(t.display.measure,l)}}else{if(s>0){c=i="right"}var v;if(t.options.lineWrapping&&(v=a.getClientRects()).length>1){l=v[i=="right"?v.length-1:0]}else{l=a.getBoundingClientRect()}}if(u&&o<9&&!s&&(!l||!l.left&&!l.right)){var d=a.parentNode.getClientRects()[0];if(d){l={left:d.left,right:d.left+Bi(t.display),top:d.top,bottom:d.bottom}}else{l=si}}var p=l.top-r.rect.top,g=l.bottom-r.rect.top;var b=(p+g)/2;var m=r.view.measure.heights;var w=0;for(;w<m.length-1;w++){if(b<m[w]){break}}var y=w?m[w-1]:0,k=m[w];var T={left:(c=="right"?l.right:l.left)-r.rect.left,right:(c=="left"?l.left:l.right)-r.rect.left,top:y,bottom:k};if(!l.left&&!l.right){T.bogus=true}if(!t.options.singleCursorHeightPerLine){T.rtop=p;T.rbottom=g}return T}function hi(t,r){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ht(t)){return r}var n=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*n,right:r.right*n,top:r.top*i,bottom:r.bottom*i}}function vi(t){if(t.measure){t.measure.cache={};t.measure.heights=null;if(t.rest){for(var r=0;r<t.rest.length;r++){t.measure.caches[r]={}}}}}function di(t){t.display.externalMeasure=null;C(t.display.lineMeasure);for(var r=0;r<t.display.view.length;r++){vi(t.display.view[r])}}function pi(t){di(t);t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null;if(!t.options.lineWrapping){t.display.maxLineChanged=true}t.display.lineNumChars=null}function gi(t){if(c&&b){return-(t.body.getBoundingClientRect().left-parseInt(getComputedStyle(t.body).marginLeft))}return t.defaultView.pageXOffset||(t.documentElement||t.body).scrollLeft}function bi(t){if(c&&b){return-(t.body.getBoundingClientRect().top-parseInt(getComputedStyle(t.body).marginTop))}return t.defaultView.pageYOffset||(t.documentElement||t.body).scrollTop}function mi(t){var r=nn(t);var n=r.widgets;var i=0;if(n){for(var e=0;e<n.length;++e){if(n[e].above){i+=Wn(n[e])}}}return i}function wi(t,r,n,i,e){if(!e){var a=mi(r);n.top+=a;n.bottom+=a}if(i=="line"){return n}if(!i){i="local"}var u=cn(r);if(i=="local"){u+=Kn(t.display)}else{u-=t.display.viewOffset}if(i=="page"||i=="window"){var o=t.display.lineSpace.getBoundingClientRect();u+=o.top+(i=="window"?0:bi(F(t)));var s=o.left+(i=="window"?0:gi(F(t)));n.left+=s;n.right+=s}n.top+=u;n.bottom+=u;return n}function yi(t,r,n){if(n=="div"){return r}var i=r.left,e=r.top;if(n=="page"){i-=gi(F(t));e-=bi(F(t))}else if(n=="local"||!n){var a=t.display.sizer.getBoundingClientRect();i+=a.left;e+=a.top}var u=t.display.lineSpace.getBoundingClientRect();return{left:i-u.left,top:e-u.top}}function ki(t,r,n,i,e){if(!i){i=rr(t.doc,r.line)}return wi(t,i,ei(t,i,r.ch,e),n)}function Ti(t,r,n,i,e,a){i=i||rr(t.doc,r.line);if(!e){e=ui(t,i)}function u(r,u){var o=oi(t,e,r,u?"right":"left",a);if(u){o.left=o.right}else{o.right=o.left}return wi(t,i,o,n)}var o=bt(i,t.doc.direction),s=r.ch,f=r.sticky;if(s>=i.text.length){s=i.text.length;f="before"}else if(s<=0){s=0;f="after"}if(!o){return u(f=="before"?s-1:s,f=="before")}function c(t,r,n){var i=o[r],e=i.level==1;return u(n?t-1:t,e!=n)}var l=pt(o,s,f);var h=dt;var v=c(s,l,f=="before");if(h!=null){v.other=c(s,h,f!="before")}return v}function Ai(t,r){var n=0;r=gr(t.doc,r);if(!t.options.lineWrapping){n=Bi(t.display)*r.ch}var i=rr(t.doc,r.line);var e=cn(i)+Kn(t.display);return{left:n,right:n,top:e,bottom:e+i.height}}function Ei(t,r,n,i,e){var a=fr(t,r,n);a.xRel=e;if(i){a.outside=i}return a}function Li(t,r,n){var i=t.doc;n+=t.display.viewOffset;if(n<0){return Ei(i.first,0,null,-1,-1)}var e=ur(i,n),a=i.first+i.size-1;if(e>a){return Ei(i.first+i.size-1,rr(i,a).text.length,null,1,1)}if(r<0){r=0}var u=rr(i,e);for(;;){var o=Oi(t,u,e,r,n);var s=tn(u,o.ch+(o.xRel>0||o.outside>0?1:0));if(!s){return o}var f=s.find(1);if(f.line==e){return f}u=rr(i,e=f.line)}}function xi(t,r,n,i){i-=mi(r);var e=r.text.length;var a=ht((function(r){return oi(t,n,r-1).bottom<=i}),e,0);e=ht((function(r){return oi(t,n,r).top>i}),a,e);return{begin:a,end:e}}function Ci(t,r,n,i){if(!n){n=ui(t,r)}var e=wi(t,r,oi(t,n,i),"line").top;return xi(t,r,n,e)}function Di(t,r,n,i){return t.bottom<=n?false:t.top>n?true:(i?t.left:t.right)>r}function Oi(t,r,n,i,e){e-=cn(r);var a=ui(t,r);var u=mi(r);var o=0,s=r.text.length,f=true;var c=bt(r,t.doc.direction);if(c){var l=(t.options.lineWrapping?Ni:Si)(t,r,n,a,c,i,e);f=l.level!=1;o=f?l.from:l.to-1;s=f?l.to:l.from-1}var h=null,v=null;var d=ht((function(r){var n=oi(t,a,r);n.top+=u;n.bottom+=u;if(!Di(n,i,e,false)){return false}if(n.top<=e&&n.left<=i){h=r;v=n}return true}),o,s);var p,g,b=false;if(v){var m=i-v.left<v.right-i,w=m==f;d=h+(w?0:1);g=w?"after":"before";p=m?v.left:v.right}else{if(!f&&(d==s||d==o)){d++}g=d==0?"after":d==r.text.length?"before":oi(t,a,d-(f?1:0)).bottom+u<=e==f?"after":"before";var y=Ti(t,fr(n,d,g),"line",r,a);p=y.left;b=e<y.top?-1:e>=y.bottom?1:0}d=lt(r.text,d,1);return Ei(n,d,g,b,i-p)}function Si(t,r,n,i,e,a,u){var o=ht((function(o){var s=e[o],f=s.level!=1;return Di(Ti(t,fr(n,f?s.to:s.from,f?"before":"after"),"line",r,i),a,u,true)}),0,e.length-1);var s=e[o];if(o>0){var f=s.level!=1;var c=Ti(t,fr(n,f?s.from:s.to,f?"after":"before"),"line",r,i);if(Di(c,a,u,true)&&c.top>u){s=e[o-1]}}return s}function Ni(t,r,n,i,e,a,u){var o=xi(t,r,i,u);var s=o.begin;var f=o.end;if(/\s/.test(r.text.charAt(f-1))){f--}var c=null,l=null;for(var h=0;h<e.length;h++){var v=e[h];if(v.from>=f||v.to<=s){continue}var d=v.level!=1;var p=oi(t,i,d?Math.min(f,v.to)-1:Math.max(s,v.from)).right;var g=p<a?a-p+1e9:p-a;if(!c||l>g){c=v;l=g}}if(!c){c=e[e.length-1]}if(c.from<s){c={from:s,to:c.to,level:c.level}}if(c.to>f){c={from:c.from,to:f,level:c.level}}return c}var Mi;function Ri(t){if(t.cachedTextHeight!=null){return t.cachedTextHeight}if(Mi==null){Mi=O("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r){Mi.appendChild(document.createTextNode("x"));Mi.appendChild(O("br"))}Mi.appendChild(document.createTextNode("x"))}D(t.measure,Mi);var n=Mi.offsetHeight/50;if(n>3){t.cachedTextHeight=n}C(t.measure);return n||1}function Bi(t){if(t.cachedCharWidth!=null){return t.cachedCharWidth}var r=O("span","xxxxxxxxxx");var n=O("pre",[r],"CodeMirror-line-like");D(t.measure,n);var i=r.getBoundingClientRect(),e=(i.right-i.left)/10;if(e>2){t.cachedCharWidth=e}return e||10}function Ii(t){var r=t.display,n={},i={};var e=r.gutters.clientLeft;for(var a=r.gutters.firstChild,u=0;a;a=a.nextSibling,++u){var o=t.display.gutterSpecs[u].className;n[o]=a.offsetLeft+a.clientLeft+e;i[o]=a.clientWidth}return{fixedPos:qi(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:r.wrapper.clientWidth}}function qi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Fi(t){var r=Ri(t.display),n=t.options.lineWrapping;var i=n&&Math.max(5,t.display.scroller.clientWidth/Bi(t.display)-3);return function(e){if(sn(t.doc,e)){return 0}var a=0;if(e.widgets){for(var u=0;u<e.widgets.length;u++){if(e.widgets[u].height){a+=e.widgets[u].height}}}if(n){return a+(Math.ceil(e.text.length/i)||1)*r}else{return a+r}}}function Pi(t){var r=t.doc,n=Fi(t);r.iter((function(t){var r=n(t);if(r!=t.height){er(t,r)}}))}function ji(t,r,n,i){var e=t.display;if(!n&&Nt(r).getAttribute("cm-not-content")=="true"){return null}var a,u,o=e.lineSpace.getBoundingClientRect();try{a=r.clientX-o.left;u=r.clientY-o.top}catch(t){return null}var s=Li(t,a,u),f;if(i&&s.xRel>0&&(f=rr(t.doc,s.line).text).length==s.ch){var c=z(f,f.length,t.options.tabSize)-f.length;s=fr(s.line,Math.max(0,Math.round((a-Qn(t.display).left)/Bi(t.display))-c))}return s}function _i(t,r){if(r>=t.display.viewTo){return null}r-=t.display.viewFrom;if(r<0){return null}var n=t.display.view;for(var i=0;i<n.length;i++){r-=n[i].size;if(r<0){return i}}}function Ui(t,r,n,i){if(r==null){r=t.doc.first}if(n==null){n=t.doc.first+t.doc.size}if(!i){i=0}var e=t.display;if(i&&n<e.viewTo&&(e.updateLineNumbers==null||e.updateLineNumbers>r)){e.updateLineNumbers=r}t.curOp.viewChanged=true;if(r>=e.viewTo){if(Br&&un(t.doc,r)<e.viewTo){zi(t)}}else if(n<=e.viewFrom){if(Br&&on(t.doc,n+i)>e.viewFrom){zi(t)}else{e.viewFrom+=i;e.viewTo+=i}}else if(r<=e.viewFrom&&n>=e.viewTo){zi(t)}else if(r<=e.viewFrom){var a=Vi(t,n,n+i,1);if(a){e.view=e.view.slice(a.index);e.viewFrom=a.lineN;e.viewTo+=i}else{zi(t)}}else if(n>=e.viewTo){var u=Vi(t,r,r,-1);if(u){e.view=e.view.slice(0,u.index);e.viewTo=u.lineN}else{zi(t)}}else{var o=Vi(t,r,r,-1);var s=Vi(t,n,n+i,1);if(o&&s){e.view=e.view.slice(0,o.index).concat(Cn(t,o.lineN,s.lineN)).concat(e.view.slice(s.index));e.viewTo+=i}else{zi(t)}}var f=e.externalMeasured;if(f){if(n<f.lineN){f.lineN+=i}else if(r<f.lineN+f.size){e.externalMeasured=null}}}function Hi(t,r,n){t.curOp.viewChanged=true;var i=t.display,e=t.display.externalMeasured;if(e&&r>=e.lineN&&r<e.lineN+e.size){i.externalMeasured=null}if(r<i.viewFrom||r>=i.viewTo){return}var a=i.view[_i(t,r)];if(a.node==null){return}var u=a.changes||(a.changes=[]);if($(u,n)==-1){u.push(n)}}function zi(t){t.display.viewFrom=t.display.viewTo=t.doc.first;t.display.view=[];t.display.viewOffset=0}function Vi(t,r,n,i){var e=_i(t,r),a,u=t.display.view;if(!Br||n==t.doc.first+t.doc.size){return{index:e,lineN:n}}var o=t.display.viewFrom;for(var s=0;s<e;s++){o+=u[s].size}if(o!=r){if(i>0){if(e==u.length-1){return null}a=o+u[e].size-r;e++}else{a=o-r}r+=a;n+=a}while(un(t.doc,n)!=n){if(e==(i<0?0:u.length-1)){return null}n+=i*u[e-(i<0?1:0)].size;e+=i}return{index:e,lineN:n}}function $i(t,r,n){var i=t.display,e=i.view;if(e.length==0||r>=i.viewTo||n<=i.viewFrom){i.view=Cn(t,r,n);i.viewFrom=r}else{if(i.viewFrom>r){i.view=Cn(t,r,i.viewFrom).concat(i.view)}else if(i.viewFrom<r){i.view=i.view.slice(_i(t,r))}i.viewFrom=r;if(i.viewTo<n){i.view=i.view.concat(Cn(t,i.viewTo,n))}else if(i.viewTo>n){i.view=i.view.slice(0,_i(t,n))}}i.viewTo=n}function Gi(t){var r=t.display.view,n=0;for(var i=0;i<r.length;i++){var e=r[i];if(!e.hidden&&(!e.node||e.changes)){++n}}return n}function Wi(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Zi(t,r){if(r===void 0)r=true;var n=t.doc,i={};var e=i.cursors=document.createDocumentFragment();var a=i.selection=document.createDocumentFragment();var u=t.options.$customCursor;if(u){r=true}for(var o=0;o<n.sel.ranges.length;o++){if(!r&&o==n.sel.primIndex){continue}var s=n.sel.ranges[o];if(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom){continue}var f=s.empty();if(u){var c=u(t,s);if(c){Ki(t,c,e)}}else if(f||t.options.showCursorWhenSelecting){Ki(t,s.head,e)}if(!f){Qi(t,s,a)}}return i}function Ki(t,r,n){var i=Ti(t,r,"div",null,null,!t.options.singleCursorHeightPerLine);var e=n.appendChild(O("div"," ","CodeMirror-cursor"));e.style.left=i.left+"px";e.style.top=i.top+"px";e.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var a=ki(t,r,"div",null,null);var u=a.right-a.left;e.style.width=(u>0?u:t.defaultCharWidth())+"px"}if(i.other){var o=n.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=i.other.left+"px";o.style.top=i.other.top+"px";o.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Yi(t,r){return t.top-r.top||t.left-r.left}function Qi(t,r,n){var i=t.display,e=t.doc;var a=document.createDocumentFragment();var u=Qn(t.display),o=u.left;var s=Math.max(i.sizerWidth,Jn(t)-i.sizer.offsetLeft)-u.right;var f=e.direction=="ltr";function c(t,r,n,i){if(r<0){r=0}r=Math.round(r);i=Math.round(i);a.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+r+"px; width: "+(n==null?s-t:n)+"px;\n height: "+(i-r)+"px"))}function l(r,n,i){var a=rr(e,r);var u=a.text.length;var l,h;function v(n,i){return ki(t,fr(r,n),"div",a,i)}function d(r,n,i){var e=Ci(t,a,null,r);var u=n=="ltr"==(i=="after")?"left":"right";var o=i=="after"?e.begin:e.end-(/\s/.test(a.text.charAt(e.end-1))?2:1);return v(o,u)[u]}var p=bt(a,e.direction);vt(p,n||0,i==null?u:i,(function(t,r,e,a){var g=e=="ltr";var b=v(t,g?"left":"right");var m=v(r-1,g?"right":"left");var w=n==null&&t==0,y=i==null&&r==u;var k=a==0,T=!p||a==p.length-1;if(m.top-b.top<=3){var A=(f?w:y)&&k;var E=(f?y:w)&&T;var L=A?o:(g?b:m).left;var x=E?s:(g?m:b).right;c(L,b.top,x-L,b.bottom)}else{var C,D,O,S;if(g){C=f&&w&&k?o:b.left;D=f?s:d(t,e,"before");O=f?o:d(r,e,"after");S=f&&y&&T?s:m.right}else{C=!f?o:d(t,e,"before");D=!f&&w&&k?s:b.right;O=!f&&y&&T?o:m.left;S=!f?s:d(r,e,"after")}c(C,b.top,D-C,b.bottom);if(b.bottom<m.top){c(o,b.bottom,null,m.top)}c(O,m.top,S-O,m.bottom)}if(!l||Yi(b,l)<0){l=b}if(Yi(m,l)<0){l=m}if(!h||Yi(b,h)<0){h=b}if(Yi(m,h)<0){h=m}}));return{start:l,end:h}}var h=r.from(),v=r.to();if(h.line==v.line){l(h.line,h.ch,v.ch)}else{var d=rr(e,h.line),p=rr(e,v.line);var g=nn(d)==nn(p);var b=l(h.line,h.ch,g?d.text.length+1:null).end;var m=l(v.line,g?0:null,v.ch).start;if(g){if(b.top<m.top-2){c(b.right,b.top,null,b.bottom);c(o,m.top,m.left,m.bottom)}else{c(b.right,b.top,m.left-b.right,b.bottom)}}if(b.bottom<m.top){c(o,b.bottom,null,m.top)}}n.appendChild(a)}function Xi(t){if(!t.state.focused){return}var r=t.display;clearInterval(r.blinker);var n=true;r.cursorDiv.style.visibility="";if(t.options.cursorBlinkRate>0){r.blinker=setInterval((function(){if(!t.hasFocus()){ne(t)}r.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate)}else if(t.options.cursorBlinkRate<0){r.cursorDiv.style.visibility="hidden"}}function Ji(t){if(!t.hasFocus()){t.display.input.focus();if(!t.state.focused){re(t)}}}function te(t){t.state.delayingBlurEvent=true;setTimeout((function(){if(t.state.delayingBlurEvent){t.state.delayingBlurEvent=false;if(t.state.focused){ne(t)}}}),100)}function re(t,r){if(t.state.delayingBlurEvent&&!t.state.draggingText){t.state.delayingBlurEvent=false}if(t.options.readOnly=="nocursor"){return}if(!t.state.focused){Tt(t,"focus",t,r);t.state.focused=true;B(t.display.wrapper,"CodeMirror-focused");if(!t.curOp&&t.display.selForContextMenu!=t.doc.sel){t.display.input.reset();if(s){setTimeout((function(){return t.display.input.reset(true)}),20)}}t.display.input.receivedFocus()}Xi(t)}function ne(t,r){if(t.state.delayingBlurEvent){return}if(t.state.focused){Tt(t,"blur",t,r);t.state.focused=false;x(t.display.wrapper,"CodeMirror-focused")}clearInterval(t.display.blinker);setTimeout((function(){if(!t.state.focused){t.display.shift=false}}),150)}function ie(t){var r=t.display;var n=r.lineDiv.offsetTop;var i=Math.max(0,r.scroller.getBoundingClientRect().top);var e=r.lineDiv.getBoundingClientRect().top;var a=0;for(var s=0;s<r.view.length;s++){var f=r.view[s],c=t.options.lineWrapping;var l=void 0,h=0;if(f.hidden){continue}e+=f.line.height;if(u&&o<8){var v=f.node.offsetTop+f.node.offsetHeight;l=v-n;n=v}else{var d=f.node.getBoundingClientRect();l=d.bottom-d.top;if(!c&&f.text.firstChild){h=f.text.firstChild.getBoundingClientRect().right-d.left-1}}var p=f.line.height-l;if(p>.005||p<-.005){if(e<i){a-=p}er(f.line,l);ee(f.line);if(f.rest){for(var g=0;g<f.rest.length;g++){ee(f.rest[g])}}}if(h>t.display.sizerWidth){var b=Math.ceil(h/Bi(t.display));if(b>t.display.maxLineLength){t.display.maxLineLength=b;t.display.maxLine=f.line;t.display.maxLineChanged=true}}}if(Math.abs(a)>2){r.scroller.scrollTop+=a}}function ee(t){if(t.widgets){for(var r=0;r<t.widgets.length;++r){var n=t.widgets[r],i=n.node.parentNode;if(i){n.height=i.offsetHeight}}}}function ae(t,r,n){var i=n&&n.top!=null?Math.max(0,n.top):t.scroller.scrollTop;i=Math.floor(i-Kn(t));var e=n&&n.bottom!=null?n.bottom:i+t.wrapper.clientHeight;var a=ur(r,i),u=ur(r,e);if(n&&n.ensure){var o=n.ensure.from.line,s=n.ensure.to.line;if(o<a){a=o;u=ur(r,cn(rr(r,o))+t.wrapper.clientHeight)}else if(Math.min(s,r.lastLine())>=u){a=ur(r,cn(rr(r,s))-t.wrapper.clientHeight);u=s}}return{from:a,to:Math.max(u,a+1)}}function ue(t,r){if(At(t,"scrollCursorIntoView")){return}var n=t.display,i=n.sizer.getBoundingClientRect(),e=null;var a=n.wrapper.ownerDocument;if(r.top+i.top<0){e=true}else if(r.bottom+i.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)){e=false}if(e!=null&&!p){var u=O("div","",null,"position: absolute;\n top: "+(r.top-n.viewOffset-Kn(t.display))+"px;\n height: "+(r.bottom-r.top+Xn(t)+n.barHeight)+"px;\n left: "+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");t.display.lineSpace.appendChild(u);u.scrollIntoView(e);t.display.lineSpace.removeChild(u)}}function oe(t,r,n,i){if(i==null){i=0}var e;if(!t.options.lineWrapping&&r==n){n=r.sticky=="before"?fr(r.line,r.ch+1,"before"):r;r=r.ch?fr(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r}for(var a=0;a<5;a++){var u=false;var o=Ti(t,r);var s=!n||n==r?o:Ti(t,n);e={left:Math.min(o.left,s.left),top:Math.min(o.top,s.top)-i,right:Math.max(o.left,s.left),bottom:Math.max(o.bottom,s.bottom)+i};var f=fe(t,e);var c=t.doc.scrollTop,l=t.doc.scrollLeft;if(f.scrollTop!=null){ge(t,f.scrollTop);if(Math.abs(t.doc.scrollTop-c)>1){u=true}}if(f.scrollLeft!=null){me(t,f.scrollLeft);if(Math.abs(t.doc.scrollLeft-l)>1){u=true}}if(!u){break}}return e}function se(t,r){var n=fe(t,r);if(n.scrollTop!=null){ge(t,n.scrollTop)}if(n.scrollLeft!=null){me(t,n.scrollLeft)}}function fe(t,r){var n=t.display,i=Ri(t.display);if(r.top<0){r.top=0}var e=t.curOp&&t.curOp.scrollTop!=null?t.curOp.scrollTop:n.scroller.scrollTop;var a=ti(t),u={};if(r.bottom-r.top>a){r.bottom=r.top+a}var o=t.doc.height+Yn(n);var s=r.top<i,f=r.bottom>o-i;if(r.top<e){u.scrollTop=s?0:r.top}else if(r.bottom>e+a){var c=Math.min(r.top,(f?o:r.bottom)-a);if(c!=e){u.scrollTop=c}}var l=t.options.fixedGutter?0:n.gutters.offsetWidth;var h=t.curOp&&t.curOp.scrollLeft!=null?t.curOp.scrollLeft:n.scroller.scrollLeft-l;var v=Jn(t)-n.gutters.offsetWidth;var d=r.right-r.left>v;if(d){r.right=r.left+v}if(r.left<10){u.scrollLeft=0}else if(r.left<h){u.scrollLeft=Math.max(0,r.left+l-(d?0:10))}else if(r.right>v+h-3){u.scrollLeft=r.right+(d?0:10)-v}return u}function ce(t,r){if(r==null){return}de(t);t.curOp.scrollTop=(t.curOp.scrollTop==null?t.doc.scrollTop:t.curOp.scrollTop)+r}function le(t){de(t);var r=t.getCursor();t.curOp.scrollToPos={from:r,to:r,margin:t.options.cursorScrollMargin}}function he(t,r,n){if(r!=null||n!=null){de(t)}if(r!=null){t.curOp.scrollLeft=r}if(n!=null){t.curOp.scrollTop=n}}function ve(t,r){de(t);t.curOp.scrollToPos=r}function de(t){var r=t.curOp.scrollToPos;if(r){t.curOp.scrollToPos=null;var n=Ai(t,r.from),i=Ai(t,r.to);pe(t,n,i,r.margin)}}function pe(t,r,n,i){var e=fe(t,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-i,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+i});he(t,e.scrollLeft,e.scrollTop)}function ge(t,r){if(Math.abs(t.doc.scrollTop-r)<2){return}if(!n){We(t,{top:r})}be(t,r,true);if(n){We(t)}je(t,100)}function be(t,r,n){r=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,r));if(t.display.scroller.scrollTop==r&&!n){return}t.doc.scrollTop=r;t.display.scrollbars.setScrollTop(r);if(t.display.scroller.scrollTop!=r){t.display.scroller.scrollTop=r}}function me(t,r,n,i){r=Math.max(0,Math.min(r,t.display.scroller.scrollWidth-t.display.scroller.clientWidth));if((n?r==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-r)<2)&&!i){return}t.doc.scrollLeft=r;Qe(t);if(t.display.scroller.scrollLeft!=r){t.display.scroller.scrollLeft=r}t.display.scrollbars.setScrollLeft(r)}function we(t){var r=t.display,n=r.gutters.offsetWidth;var i=Math.round(t.doc.height+Yn(t.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Xn(t)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:n}}var ye=function(t,r,n){this.cm=n;var i=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var e=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=e.tabIndex=-1;t(i);t(e);wt(i,"scroll",(function(){if(i.clientHeight){r(i.scrollTop,"vertical")}}));wt(e,"scroll",(function(){if(e.clientWidth){r(e.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(u&&o<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};ye.prototype.update=function(t){var r=t.scrollWidth>t.clientWidth+1;var n=t.scrollHeight>t.clientHeight+1;var i=t.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=r?i+"px":"0";var e=t.viewHeight-(r?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+e)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(r){this.horiz.style.display="block";this.horiz.style.right=n?i+"px":"0";this.horiz.style.left=t.barLeft+"px";var a=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+a)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&t.clientHeight>0){if(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:n?i:0,bottom:r?i:0}};ye.prototype.setScrollLeft=function(t){if(this.horiz.scrollLeft!=t){this.horiz.scrollLeft=t}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};ye.prototype.setScrollTop=function(t){if(this.vert.scrollTop!=t){this.vert.scrollTop=t}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};ye.prototype.zeroWidthHack=function(){var t=w&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new V;this.disableVert=new V};ye.prototype.enableZeroWidthBar=function(t,r,n){t.style.visibility="";function i(){var e=t.getBoundingClientRect();var a=n=="vert"?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);if(a!=t){t.style.visibility="hidden"}else{r.set(1e3,i)}}r.set(1e3,i)};ye.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz);t.removeChild(this.vert)};var ke=function(){};ke.prototype.update=function(){return{bottom:0,right:0}};ke.prototype.setScrollLeft=function(){};ke.prototype.setScrollTop=function(){};ke.prototype.clear=function(){};function Te(t,r){if(!r){r=we(t)}var n=t.display.barWidth,i=t.display.barHeight;Ae(t,r);for(var e=0;e<4&&n!=t.display.barWidth||i!=t.display.barHeight;e++){if(n!=t.display.barWidth&&t.options.lineWrapping){ie(t)}Ae(t,we(t));n=t.display.barWidth;i=t.display.barHeight}}function Ae(t,r){var n=t.display;var i=n.scrollbars.update(r);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px";n.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=i.bottom+"px";n.scrollbarFiller.style.width=i.right+"px"}else{n.scrollbarFiller.style.display=""}if(i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=i.bottom+"px";n.gutterFiller.style.width=r.gutterWidth+"px"}else{n.gutterFiller.style.display=""}}var Ee={native:ye,null:ke};function Le(t){if(t.display.scrollbars){t.display.scrollbars.clear();if(t.display.scrollbars.addClass){x(t.display.wrapper,t.display.scrollbars.addClass)}}t.display.scrollbars=new Ee[t.options.scrollbarStyle]((function(r){t.display.wrapper.insertBefore(r,t.display.scrollbarFiller);wt(r,"mousedown",(function(){if(t.state.focused){setTimeout((function(){return t.display.input.focus()}),0)}}));r.setAttribute("cm-not-content","true")}),(function(r,n){if(n=="horizontal"){me(t,r)}else{ge(t,r)}}),t);if(t.display.scrollbars.addClass){B(t.display.wrapper,t.display.scrollbars.addClass)}}var xe=0;function Ce(t){t.curOp={cm:t,viewChanged:false,startHeight:t.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++xe,markArrays:null};On(t.curOp)}function De(t){var r=t.curOp;if(r){Nn(r,(function(t){for(var r=0;r<t.ops.length;r++){t.ops[r].cm.curOp=null}Oe(t)}))}}function Oe(t){var r=t.ops;for(var n=0;n<r.length;n++){Se(r[n])}for(var i=0;i<r.length;i++){Ne(r[i])}for(var e=0;e<r.length;e++){Me(r[e])}for(var a=0;a<r.length;a++){Re(r[a])}for(var u=0;u<r.length;u++){Be(r[u])}}function Se(t){var r=t.cm,n=r.display;He(r);if(t.updateMaxLine){hn(r)}t.mustUpdate=t.viewChanged||t.forceUpdate||t.scrollTop!=null||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&r.options.lineWrapping;t.update=t.mustUpdate&&new Ue(r,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ne(t){t.updatedDisplay=t.mustUpdate&&$e(t.cm,t.update)}function Me(t){var r=t.cm,n=r.display;if(t.updatedDisplay){ie(r)}t.barMeasure=we(r);if(n.maxLineChanged&&!r.options.lineWrapping){t.adjustWidthTo=ei(r,n.maxLine,n.maxLine.text.length).left+3;r.display.sizerWidth=t.adjustWidthTo;t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Xn(r)+r.display.barWidth);t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Jn(r))}if(t.updatedDisplay||t.selectionChanged){t.preparedSelection=n.input.prepareSelection()}}function Re(t){var r=t.cm;if(t.adjustWidthTo!=null){r.display.sizer.style.minWidth=t.adjustWidthTo+"px";if(t.maxScrollLeft<r.doc.scrollLeft){me(r,Math.min(r.display.scroller.scrollLeft,t.maxScrollLeft),true)}r.display.maxLineChanged=false}var n=t.focus&&t.focus==R(P(r));if(t.preparedSelection){r.display.input.showSelection(t.preparedSelection,n)}if(t.updatedDisplay||t.startHeight!=r.doc.height){Te(r,t.barMeasure)}if(t.updatedDisplay){Ye(r,t.barMeasure)}if(t.selectionChanged){Xi(r)}if(r.state.focused&&t.updateInput){r.display.input.reset(t.typing)}if(n){Ji(t.cm)}}function Be(t){var r=t.cm,n=r.display,i=r.doc;if(t.updatedDisplay){Ge(r,t.update)}if(n.wheelStartX!=null&&(t.scrollTop!=null||t.scrollLeft!=null||t.scrollToPos)){n.wheelStartX=n.wheelStartY=null}if(t.scrollTop!=null){be(r,t.scrollTop,t.forceScroll)}if(t.scrollLeft!=null){me(r,t.scrollLeft,true,true)}if(t.scrollToPos){var e=oe(r,gr(i,t.scrollToPos.from),gr(i,t.scrollToPos.to),t.scrollToPos.margin);ue(r,e)}var a=t.maybeHiddenMarkers,u=t.maybeUnhiddenMarkers;if(a){for(var o=0;o<a.length;++o){if(!a[o].lines.length){Tt(a[o],"hide")}}}if(u){for(var s=0;s<u.length;++s){if(u[s].lines.length){Tt(u[s],"unhide")}}}if(n.wrapper.offsetHeight){i.scrollTop=r.display.scroller.scrollTop}if(t.changeObjs){Tt(r,"changes",r,t.changeObjs)}if(t.update){t.update.finish()}}function Ie(t,r){if(t.curOp){return r()}Ce(t);try{return r()}finally{De(t)}}function qe(t,r){return function(){if(t.curOp){return r.apply(t,arguments)}Ce(t);try{return r.apply(t,arguments)}finally{De(t)}}}function Fe(t){return function(){if(this.curOp){return t.apply(this,arguments)}Ce(this);try{return t.apply(this,arguments)}finally{De(this)}}}function Pe(t){return function(){var r=this.cm;if(!r||r.curOp){return t.apply(this,arguments)}Ce(r);try{return t.apply(this,arguments)}finally{De(r)}}}function je(t,r){if(t.doc.highlightFrontier<t.display.viewTo){t.state.highlight.set(r,U(_e,t))}}function _e(t){var r=t.doc;if(r.highlightFrontier>=t.display.viewTo){return}var n=+new Date+t.options.workTime;var i=Ar(t,r.highlightFrontier);var e=[];r.iter(i.line,Math.min(r.first+r.size,t.display.viewTo+500),(function(a){if(i.line>=t.display.viewFrom){var u=a.styles;var o=a.text.length>t.options.maxHighlightLength?Qt(r.mode,i.state):null;var s=kr(t,a,i,true);if(o){i.state=o}a.styles=s.styles;var f=a.styleClasses,c=s.classes;if(c){a.styleClasses=c}else if(f){a.styleClasses=null}var l=!u||u.length!=a.styles.length||f!=c&&(!f||!c||f.bgClass!=c.bgClass||f.textClass!=c.textClass);for(var h=0;!l&&h<u.length;++h){l=u[h]!=a.styles[h]}if(l){e.push(i.line)}a.stateAfter=i.save();i.nextLine()}else{if(a.text.length<=t.options.maxHighlightLength){Er(t,a.text,i)}a.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>n){je(t,t.options.workDelay);return true}}));r.highlightFrontier=i.line;r.modeFrontier=Math.max(r.modeFrontier,i.line);if(e.length){Ie(t,(function(){for(var r=0;r<e.length;r++){Hi(t,e[r],"text")}}))}}var Ue=function(t,r,n){var i=t.display;this.viewport=r;this.visible=ae(i,t.doc,r);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=Jn(t);this.force=n;this.dims=Ii(t);this.events=[]};Ue.prototype.signal=function(t,r){if(Lt(t,r)){this.events.push(arguments)}};Ue.prototype.finish=function(){for(var t=0;t<this.events.length;t++){Tt.apply(null,this.events[t])}};function He(t){var r=t.display;if(!r.scrollbarsClipped&&r.scroller.offsetWidth){r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth;r.heightForcer.style.height=Xn(t)+"px";r.sizer.style.marginBottom=-r.nativeBarWidth+"px";r.sizer.style.borderRightWidth=Xn(t)+"px";r.scrollbarsClipped=true}}function ze(t){if(t.hasFocus()){return null}var r=R(P(t));if(!r||!M(t.display.lineDiv,r)){return null}var n={activeElt:r};if(window.getSelection){var i=_(t).getSelection();if(i.anchorNode&&i.extend&&M(t.display.lineDiv,i.anchorNode)){n.anchorNode=i.anchorNode;n.anchorOffset=i.anchorOffset;n.focusNode=i.focusNode;n.focusOffset=i.focusOffset}}return n}function Ve(t){if(!t||!t.activeElt||t.activeElt==R(j(t.activeElt))){return}t.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&M(document.body,t.anchorNode)&&M(document.body,t.focusNode)){var r=t.activeElt.ownerDocument;var n=r.defaultView.getSelection(),i=r.createRange();i.setEnd(t.anchorNode,t.anchorOffset);i.collapse(false);n.removeAllRanges();n.addRange(i);n.extend(t.focusNode,t.focusOffset)}}function $e(t,r){var n=t.display,i=t.doc;if(r.editorIsHidden){zi(t);return false}if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Gi(t)==0){return false}if(Xe(t)){zi(t);r.dims=Ii(t)}var e=i.first+i.size;var a=Math.max(r.visible.from-t.options.viewportMargin,i.first);var u=Math.min(e,r.visible.to+t.options.viewportMargin);if(n.viewFrom<a&&a-n.viewFrom<20){a=Math.max(i.first,n.viewFrom)}if(n.viewTo>u&&n.viewTo-u<20){u=Math.min(e,n.viewTo)}if(Br){a=un(t.doc,a);u=on(t.doc,u)}var o=a!=n.viewFrom||u!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;$i(t,a,u);n.viewOffset=cn(rr(t.doc,n.viewFrom));t.display.mover.style.top=n.viewOffset+"px";var s=Gi(t);if(!o&&s==0&&!r.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)){return false}var f=ze(t);if(s>4){n.lineDiv.style.display="none"}Ze(t,n.updateLineNumbers,r.dims);if(s>4){n.lineDiv.style.display=""}n.renderedView=n.view;Ve(f);C(n.cursorDiv);C(n.selectionDiv);n.gutters.style.height=n.sizer.style.minHeight=0;if(o){n.lastWrapHeight=r.wrapperHeight;n.lastWrapWidth=r.wrapperWidth;je(t,400)}n.updateLineNumbers=null;return true}function Ge(t,r){var n=r.viewport;for(var i=true;;i=false){if(!i||!t.options.lineWrapping||r.oldDisplayWidth==Jn(t)){if(n&&n.top!=null){n={top:Math.min(t.doc.height+Yn(t.display)-ti(t),n.top)}}r.visible=ae(t.display,t.doc,n);if(r.visible.from>=t.display.viewFrom&&r.visible.to<=t.display.viewTo){break}}else if(i){r.visible=ae(t.display,t.doc,n)}if(!$e(t,r)){break}ie(t);var e=we(t);Wi(t);Te(t,e);Ye(t,e);r.force=false}r.signal(t,"update",t);if(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo){r.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo);t.display.reportedViewFrom=t.display.viewFrom;t.display.reportedViewTo=t.display.viewTo}}function We(t,r){var n=new Ue(t,r);if($e(t,n)){ie(t);Ge(t,n);var i=we(t);Wi(t);Te(t,i);Ye(t,i);n.finish()}}function Ze(t,r,n){var i=t.display,e=t.options.lineNumbers;var a=i.lineDiv,u=a.firstChild;function o(r){var n=r.nextSibling;if(s&&w&&t.display.currentWheelTarget==r){r.style.display="none"}else{r.parentNode.removeChild(r)}return n}var f=i.view,c=i.viewFrom;for(var l=0;l<f.length;l++){var h=f[l];if(h.hidden);else if(!h.node||h.node.parentNode!=a){var v=zn(t,h,c,n);a.insertBefore(v,u)}else{while(u!=h.node){u=o(u)}var d=e&&r!=null&&r<=c&&h.lineNumber;if(h.changes){if($(h.changes,"gutter")>-1){d=false}In(t,h,c,n)}if(d){C(h.lineNumber);h.lineNumber.appendChild(document.createTextNode(sr(t.options,c)))}u=h.node.nextSibling}c+=h.size}while(u){u=o(u)}}function Ke(t){var r=t.gutters.offsetWidth;t.sizer.style.marginLeft=r+"px";Rn(t,"gutterChanged",t)}function Ye(t,r){t.display.sizer.style.minHeight=r.docHeight+"px";t.display.heightForcer.style.top=r.docHeight+"px";t.display.gutters.style.height=r.docHeight+t.display.barHeight+Xn(t)+"px"}function Qe(t){var r=t.display,n=r.view;if(!r.alignWidgets&&(!r.gutters.firstChild||!t.options.fixedGutter)){return}var i=qi(r)-r.scroller.scrollLeft+t.doc.scrollLeft;var e=r.gutters.offsetWidth,a=i+"px";for(var u=0;u<n.length;u++){if(!n[u].hidden){if(t.options.fixedGutter){if(n[u].gutter){n[u].gutter.style.left=a}if(n[u].gutterBackground){n[u].gutterBackground.style.left=a}}var o=n[u].alignable;if(o){for(var s=0;s<o.length;s++){o[s].style.left=a}}}}if(t.options.fixedGutter){r.gutters.style.left=i+e+"px"}}function Xe(t){if(!t.options.lineNumbers){return false}var r=t.doc,n=sr(t.options,r.first+r.size-1),i=t.display;if(n.length!=i.lineNumChars){var e=i.measure.appendChild(O("div",[O("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var a=e.firstChild.offsetWidth,u=e.offsetWidth-a;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-u)+1;i.lineNumWidth=i.lineNumInnerWidth+u;i.lineNumChars=i.lineNumInnerWidth?n.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Ke(t.display);return true}return false}function Je(t,r){var n=[],i=false;for(var e=0;e<t.length;e++){var a=t[e],u=null;if(typeof a!="string"){u=a.style;a=a.className}if(a=="CodeMirror-linenumbers"){if(!r){continue}else{i=true}}n.push({className:a,style:u})}if(r&&!i){n.push({className:"CodeMirror-linenumbers",style:null})}return n}function ta(t){var r=t.gutters,n=t.gutterSpecs;C(r);t.lineGutter=null;for(var i=0;i<n.length;++i){var e=n[i];var a=e.className;var u=e.style;var o=r.appendChild(O("div",null,"CodeMirror-gutter "+a));if(u){o.style.cssText=u}if(a=="CodeMirror-linenumbers"){t.lineGutter=o;o.style.width=(t.lineNumWidth||1)+"px"}}r.style.display=n.length?"":"none";Ke(t)}function ra(t){ta(t.display);Ui(t);Qe(t)}function na(t,r,i,e){var a=this;this.input=i;a.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler");a.scrollbarFiller.setAttribute("cm-not-content","true");a.gutterFiller=O("div",null,"CodeMirror-gutter-filler");a.gutterFiller.setAttribute("cm-not-content","true");a.lineDiv=S("div",null,"CodeMirror-code");a.selectionDiv=O("div",null,null,"position: relative; z-index: 1");a.cursorDiv=O("div",null,"CodeMirror-cursors");a.measure=O("div",null,"CodeMirror-measure");a.lineMeasure=O("div",null,"CodeMirror-measure");a.lineSpace=S("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var f=S("div",[a.lineSpace],"CodeMirror-lines");a.mover=O("div",[f],null,"position: relative");a.sizer=O("div",[a.mover],"CodeMirror-sizer");a.sizerWidth=null;a.heightForcer=O("div",null,null,"position: absolute; height: "+G+"px; width: 1px;");a.gutters=O("div",null,"CodeMirror-gutters");a.lineGutter=null;a.scroller=O("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll");a.scroller.setAttribute("tabIndex","-1");a.wrapper=O("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror");if(c&&l>=105){a.wrapper.style.clipPath="inset(0px)"}a.wrapper.setAttribute("translate","no");if(u&&o<8){a.gutters.style.zIndex=-1;a.scroller.style.paddingRight=0}if(!s&&!(n&&m)){a.scroller.draggable=true}if(t){if(t.appendChild){t.appendChild(a.wrapper)}else{t(a.wrapper)}}a.viewFrom=a.viewTo=r.first;a.reportedViewFrom=a.reportedViewTo=r.first;a.view=[];a.renderedView=null;a.externalMeasured=null;a.viewOffset=0;a.lastWrapHeight=a.lastWrapWidth=0;a.updateLineNumbers=null;a.nativeBarWidth=a.barHeight=a.barWidth=0;a.scrollbarsClipped=false;a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null;a.alignWidgets=false;a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null;a.maxLine=null;a.maxLineLength=0;a.maxLineChanged=false;a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null;a.shift=false;a.selForContextMenu=null;a.activeTouch=null;a.gutterSpecs=Je(e.gutters,e.lineNumbers);ta(a);i.init(a)}var ia=0,ea=null;if(u){ea=-.53}else if(n){ea=15}else if(c){ea=-.7}else if(v){ea=-1/3}function aa(t){var r=t.wheelDeltaX,n=t.wheelDeltaY;if(r==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS){r=t.detail}if(n==null&&t.detail&&t.axis==t.VERTICAL_AXIS){n=t.detail}else if(n==null){n=t.wheelDelta}return{x:r,y:n}}function ua(t){var r=aa(t);r.x*=ea;r.y*=ea;return r}function oa(t,r){if(c&&l==102){if(t.display.chromeScrollHack==null){t.display.sizer.style.pointerEvents="none"}else{clearTimeout(t.display.chromeScrollHack)}t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null;t.display.sizer.style.pointerEvents=""}),100)}var i=aa(r),e=i.x,a=i.y;var u=ea;if(r.deltaMode===0){e=r.deltaX;a=r.deltaY;u=1}var o=t.display,f=o.scroller;var v=f.scrollWidth>f.clientWidth;var d=f.scrollHeight>f.clientHeight;if(!(e&&v||a&&d)){return}if(a&&w&&s){t:for(var p=r.target,g=o.view;p!=f;p=p.parentNode){for(var b=0;b<g.length;b++){if(g[b].node==p){t.display.currentWheelTarget=p;break t}}}}if(e&&!n&&!h&&u!=null){if(a&&d){ge(t,Math.max(0,f.scrollTop+a*u))}me(t,Math.max(0,f.scrollLeft+e*u));if(!a||a&&d){Ct(r)}o.wheelStartX=null;return}if(a&&u!=null){var m=a*u;var y=t.doc.scrollTop,k=y+o.wrapper.clientHeight;if(m<0){y=Math.max(0,y+m-50)}else{k=Math.min(t.doc.height,k+m+50)}We(t,{top:y,bottom:k})}if(ia<20&&r.deltaMode!==0){if(o.wheelStartX==null){o.wheelStartX=f.scrollLeft;o.wheelStartY=f.scrollTop;o.wheelDX=e;o.wheelDY=a;setTimeout((function(){if(o.wheelStartX==null){return}var t=f.scrollLeft-o.wheelStartX;var r=f.scrollTop-o.wheelStartY;var n=r&&o.wheelDY&&r/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(!n){return}ea=(ea*ia+n)/(ia+1);++ia}),200)}else{o.wheelDX+=e;o.wheelDY+=a}}}var sa=function(t,r){this.ranges=t;this.primIndex=r};sa.prototype.primary=function(){return this.ranges[this.primIndex]};sa.prototype.equals=function(t){if(t==this){return true}if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length){return false}for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r],i=t.ranges[r];if(!lr(n.anchor,i.anchor)||!lr(n.head,i.head)){return false}}return true};sa.prototype.deepCopy=function(){var t=[];for(var r=0;r<this.ranges.length;r++){t[r]=new fa(hr(this.ranges[r].anchor),hr(this.ranges[r].head))}return new sa(t,this.primIndex)};sa.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++){if(!this.ranges[t].empty()){return true}}return false};sa.prototype.contains=function(t,r){if(!r){r=t}for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(cr(r,i.from())>=0&&cr(t,i.to())<=0){return n}}return-1};var fa=function(t,r){this.anchor=t;this.head=r};fa.prototype.from=function(){return dr(this.anchor,this.head)};fa.prototype.to=function(){return vr(this.anchor,this.head)};fa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ca(t,r,n){var i=t&&t.options.selectionsMayTouch;var e=r[n];r.sort((function(t,r){return cr(t.from(),r.from())}));n=$(r,e);for(var a=1;a<r.length;a++){var u=r[a],o=r[a-1];var s=cr(o.to(),u.from());if(i&&!u.empty()?s>0:s>=0){var f=dr(o.from(),u.from()),c=vr(o.to(),u.to());var l=o.empty()?u.from()==u.head:o.from()==o.head;if(a<=n){--n}r.splice(--a,2,new fa(l?c:f,l?f:c))}}return new sa(r,n)}function la(t,r){return new sa([new fa(t,r||t)],0)}function ha(t){if(!t.text){return t.to}return fr(t.from.line+t.text.length-1,tt(t.text).length+(t.text.length==1?t.from.ch:0))}function va(t,r){if(cr(t,r.from)<0){return t}if(cr(t,r.to)<=0){return ha(r)}var n=t.line+r.text.length-(r.to.line-r.from.line)-1,i=t.ch;if(t.line==r.to.line){i+=ha(r).ch-r.to.ch}return fr(n,i)}function da(t,r){var n=[];for(var i=0;i<t.sel.ranges.length;i++){var e=t.sel.ranges[i];n.push(new fa(va(e.anchor,r),va(e.head,r)))}return ca(t.cm,n,t.sel.primIndex)}function pa(t,r,n){if(t.line==r.line){return fr(n.line,t.ch-r.ch+n.ch)}else{return fr(n.line+(t.line-r.line),t.ch)}}function ga(t,r,n){var i=[];var e=fr(t.first,0),a=e;for(var u=0;u<r.length;u++){var o=r[u];var s=pa(o.from,e,a);var f=pa(ha(o),e,a);e=o.to;a=f;if(n=="around"){var c=t.sel.ranges[u],l=cr(c.head,c.anchor)<0;i[u]=new fa(l?f:s,l?s:f)}else{i[u]=new fa(s,s)}}return new sa(i,t.sel.primIndex)}function ba(t){t.doc.mode=Zt(t.options,t.doc.modeOption);ma(t)}function ma(t){t.doc.iter((function(t){if(t.stateAfter){t.stateAfter=null}if(t.styles){t.styles=null}}));t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first;je(t,100);t.state.modeGen++;if(t.curOp){Ui(t)}}function wa(t,r){return r.from.ch==0&&r.to.ch==0&&tt(r.text)==""&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function ya(t,r,n,i){function e(t){return n?n[t]:null}function a(t,n,e){dn(t,n,e,i);Rn(t,"change",t,r)}function u(t,r){var n=[];for(var a=t;a<r;++a){n.push(new vn(f[a],e(a),i))}return n}var o=r.from,s=r.to,f=r.text;var c=rr(t,o.line),l=rr(t,s.line);var h=tt(f),v=e(f.length-1),d=s.line-o.line;if(r.full){t.insert(0,u(0,f.length));t.remove(f.length,t.size-f.length)}else if(wa(t,r)){var p=u(0,f.length-1);a(l,l.text,v);if(d){t.remove(o.line,d)}if(p.length){t.insert(o.line,p)}}else if(c==l){if(f.length==1){a(c,c.text.slice(0,o.ch)+h+c.text.slice(s.ch),v)}else{var g=u(1,f.length-1);g.push(new vn(h+c.text.slice(s.ch),v,i));a(c,c.text.slice(0,o.ch)+f[0],e(0));t.insert(o.line+1,g)}}else if(f.length==1){a(c,c.text.slice(0,o.ch)+f[0]+l.text.slice(s.ch),e(0));t.remove(o.line+1,d)}else{a(c,c.text.slice(0,o.ch)+f[0],e(0));a(l,h+l.text.slice(s.ch),v);var b=u(1,f.length-1);if(d>1){t.remove(o.line+1,d-1)}t.insert(o.line+1,b)}Rn(t,"change",t,r)}function ka(t,r,n){function i(t,e,a){if(t.linked){for(var u=0;u<t.linked.length;++u){var o=t.linked[u];if(o.doc==e){continue}var s=a&&o.sharedHist;if(n&&!s){continue}r(o.doc,s);i(o.doc,t,s)}}}i(t,null,true)}function Ta(t,r){if(r.cm){throw new Error("This document is already in use.")}t.doc=r;r.cm=t;Pi(t);ba(t);Aa(t);t.options.direction=r.direction;if(!t.options.lineWrapping){hn(t)}t.options.mode=r.modeOption;Ui(t)}function Aa(t){(t.doc.direction=="rtl"?B:x)(t.display.lineDiv,"CodeMirror-rtl")}function Ea(t){Ie(t,(function(){Aa(t);Ui(t)}))}function La(t){this.done=[];this.undone=[];this.undoDepth=t?t.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=t?t.maxGeneration:1}function xa(t,r){var n={from:hr(r.from),to:ha(r),text:nr(t,r.from,r.to)};Ra(t,n,r.from.line,r.to.line+1);ka(t,(function(t){return Ra(t,n,r.from.line,r.to.line+1)}),true);return n}function Ca(t){while(t.length){var r=tt(t);if(r.ranges){t.pop()}else{break}}}function Da(t,r){if(r){Ca(t.done);return tt(t.done)}else if(t.done.length&&!tt(t.done).ranges){return tt(t.done)}else if(t.done.length>1&&!t.done[t.done.length-2].ranges){t.done.pop();return tt(t.done)}}function Oa(t,r,n,i){var e=t.history;e.undone.length=0;var a=+new Date,u;var o;if((e.lastOp==i||e.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&e.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(u=Da(e,e.lastOp==i))){o=tt(u.changes);if(cr(r.from,r.to)==0&&cr(r.from,o.to)==0){o.to=ha(r)}else{u.changes.push(xa(t,r))}}else{var s=tt(e.done);if(!s||!s.ranges){Ma(t.sel,e.done)}u={changes:[xa(t,r)],generation:e.generation};e.done.push(u);while(e.done.length>e.undoDepth){e.done.shift();if(!e.done[0].ranges){e.done.shift()}}}e.done.push(n);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=a;e.lastOp=e.lastSelOp=i;e.lastOrigin=e.lastSelOrigin=r.origin;if(!o){Tt(t,"historyAdded")}}function Sa(t,r,n,i){var e=r.charAt(0);return e=="*"||e=="+"&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Na(t,r,n,i){var e=t.history,a=i&&i.origin;if(n==e.lastSelOp||a&&e.lastSelOrigin==a&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==a||Sa(t,a,tt(e.done),r))){e.done[e.done.length-1]=r}else{Ma(r,e.done)}e.lastSelTime=+new Date;e.lastSelOrigin=a;e.lastSelOp=n;if(i&&i.clearRedo!==false){Ca(e.undone)}}function Ma(t,r){var n=tt(r);if(!(n&&n.ranges&&n.equals(t))){r.push(t)}}function Ra(t,r,n,i){var e=r["spans_"+t.id],a=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){if(n.markedSpans){(e||(e=r["spans_"+t.id]={}))[a]=n.markedSpans}++a}))}function Ba(t){if(!t){return null}var r;for(var n=0;n<t.length;++n){if(t[n].marker.explicitlyCleared){if(!r){r=t.slice(0,n)}}else if(r){r.push(t[n])}}return!r?t:r.length?r:null}function Ia(t,r){var n=r["spans_"+t.id];if(!n){return null}var i=[];for(var e=0;e<r.text.length;++e){i.push(Ba(n[e]))}return i}function qa(t,r){var n=Ia(t,r);var i=zr(t,r);if(!n){return i}if(!i){return n}for(var e=0;e<n.length;++e){var a=n[e],u=i[e];if(a&&u){t:for(var o=0;o<u.length;++o){var s=u[o];for(var f=0;f<a.length;++f){if(a[f].marker==s.marker){continue t}}a.push(s)}}else if(u){n[e]=u}}return n}function Fa(t,r,n){var i=[];for(var e=0;e<t.length;++e){var a=t[e];if(a.ranges){i.push(n?sa.prototype.deepCopy.call(a):a);continue}var u=a.changes,o=[];i.push({changes:o});for(var s=0;s<u.length;++s){var f=u[s],c=void 0;o.push({from:f.from,to:f.to,text:f.text});if(r){for(var l in f){if(c=l.match(/^spans_(\d+)$/)){if($(r,Number(c[1]))>-1){tt(o)[l]=f[l];delete f[l]}}}}}}return i}function Pa(t,r,n,i){if(i){var e=t.anchor;if(n){var a=cr(r,e)<0;if(a!=cr(n,e)<0){e=r;r=n}else if(a!=cr(r,n)<0){r=n}}return new fa(e,r)}else{return new fa(n||r,r)}}function ja(t,r,n,i,e){if(e==null){e=t.cm&&(t.cm.display.shift||t.extend)}$a(t,new sa([Pa(t.sel.primary(),r,n,e)],0),i)}function _a(t,r,n){var i=[];var e=t.cm&&(t.cm.display.shift||t.extend);for(var a=0;a<t.sel.ranges.length;a++){i[a]=Pa(t.sel.ranges[a],r[a],null,e)}var u=ca(t.cm,i,t.sel.primIndex);$a(t,u,n)}function Ua(t,r,n,i){var e=t.sel.ranges.slice(0);e[r]=n;$a(t,ca(t.cm,e,t.sel.primIndex),i)}function Ha(t,r,n,i){$a(t,la(r,n),i)}function za(t,r,n){var i={ranges:r.ranges,update:function(r){this.ranges=[];for(var n=0;n<r.length;n++){this.ranges[n]=new fa(gr(t,r[n].anchor),gr(t,r[n].head))}},origin:n&&n.origin};Tt(t,"beforeSelectionChange",t,i);if(t.cm){Tt(t.cm,"beforeSelectionChange",t.cm,i)}if(i.ranges!=r.ranges){return ca(t.cm,i.ranges,i.ranges.length-1)}else{return r}}function Va(t,r,n){var i=t.history.done,e=tt(i);if(e&&e.ranges){i[i.length-1]=r;Ga(t,r,n)}else{$a(t,r,n)}}function $a(t,r,n){Ga(t,r,n);Na(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Ga(t,r,n){if(Lt(t,"beforeSelectionChange")||t.cm&&Lt(t.cm,"beforeSelectionChange")){r=za(t,r,n)}var i=n&&n.bias||(cr(r.primary().head,t.sel.primary().head)<0?-1:1);Wa(t,Ka(t,r,i,true));if(!(n&&n.scroll===false)&&t.cm&&t.cm.getOption("readOnly")!="nocursor"){le(t.cm)}}function Wa(t,r){if(r.equals(t.sel)){return}t.sel=r;if(t.cm){t.cm.curOp.updateInput=1;t.cm.curOp.selectionChanged=true;Et(t.cm)}Rn(t,"cursorActivity",t)}function Za(t){Wa(t,Ka(t,t.sel,null,false))}function Ka(t,r,n,i){var e;for(var a=0;a<r.ranges.length;a++){var u=r.ranges[a];var o=r.ranges.length==t.sel.ranges.length&&t.sel.ranges[a];var s=Qa(t,u.anchor,o&&o.anchor,n,i);var f=u.head==u.anchor?s:Qa(t,u.head,o&&o.head,n,i);if(e||s!=u.anchor||f!=u.head){if(!e){e=r.ranges.slice(0,a)}e[a]=new fa(s,f)}}return e?ca(t.cm,e,r.primIndex):r}function Ya(t,r,n,i,e){var a=rr(t,r.line);if(a.markedSpans){for(var u=0;u<a.markedSpans.length;++u){var o=a.markedSpans[u],s=o.marker;var f="selectLeft"in s?!s.selectLeft:s.inclusiveLeft;var c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((o.from==null||(f?o.from<=r.ch:o.from<r.ch))&&(o.to==null||(c?o.to>=r.ch:o.to>r.ch))){if(e){Tt(s,"beforeCursorEnter");if(s.explicitlyCleared){if(!a.markedSpans){break}else{--u;continue}}}if(!s.atomic){continue}if(n){var l=s.find(i<0?1:-1),h=void 0;if(i<0?c:f){l=Xa(t,l,-i,l&&l.line==r.line?a:null)}if(l&&l.line==r.line&&(h=cr(l,n))&&(i<0?h<0:h>0)){return Ya(t,l,r,i,e)}}var v=s.find(i<0?-1:1);if(i<0?f:c){v=Xa(t,v,i,v.line==r.line?a:null)}return v?Ya(t,v,r,i,e):null}}}return r}function Qa(t,r,n,i,e){var a=i||1;var u=Ya(t,r,n,a,e)||!e&&Ya(t,r,n,a,true)||Ya(t,r,n,-a,e)||!e&&Ya(t,r,n,-a,true);if(!u){t.cantEdit=true;return fr(t.first,0)}return u}function Xa(t,r,n,i){if(n<0&&r.ch==0){if(r.line>t.first){return gr(t,fr(r.line-1))}else{return null}}else if(n>0&&r.ch==(i||rr(t,r.line)).text.length){if(r.line<t.first+t.size-1){return fr(r.line+1,0)}else{return null}}else{return new fr(r.line,r.ch+n)}}function Ja(t){t.setSelection(fr(t.firstLine(),0),fr(t.lastLine()),Z)}function tu(t,r,n){var i={canceled:false,from:r.from,to:r.to,text:r.text,origin:r.origin,cancel:function(){return i.canceled=true}};if(n){i.update=function(r,n,e,a){if(r){i.from=gr(t,r)}if(n){i.to=gr(t,n)}if(e){i.text=e}if(a!==undefined){i.origin=a}}}Tt(t,"beforeChange",t,i);if(t.cm){Tt(t.cm,"beforeChange",t.cm,i)}if(i.canceled){if(t.cm){t.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ru(t,r,n){if(t.cm){if(!t.cm.curOp){return qe(t.cm,ru)(t,r,n)}if(t.cm.state.suppressEdits){return}}if(Lt(t,"beforeChange")||t.cm&&Lt(t.cm,"beforeChange")){r=tu(t,r,true);if(!r){return}}var i=Rr&&!n&&$r(t,r.from,r.to);if(i){for(var e=i.length-1;e>=0;--e){nu(t,{from:i[e].from,to:i[e].to,text:e?[""]:r.text,origin:r.origin})}}else{nu(t,r)}}function nu(t,r){if(r.text.length==1&&r.text[0]==""&&cr(r.from,r.to)==0){return}var n=da(t,r);Oa(t,r,n,t.cm?t.cm.curOp.id:NaN);au(t,r,n,zr(t,r));var i=[];ka(t,(function(t,n){if(!n&&$(i,t.history)==-1){cu(t.history,r);i.push(t.history)}au(t,r,null,zr(t,r))}))}function iu(t,r,n){var i=t.cm&&t.cm.state.suppressEdits;if(i&&!n){return}var e=t.history,a,u=t.sel;var o=r=="undo"?e.done:e.undone,s=r=="undo"?e.undone:e.done;var f=0;for(;f<o.length;f++){a=o[f];if(n?a.ranges&&!a.equals(t.sel):!a.ranges){break}}if(f==o.length){return}e.lastOrigin=e.lastSelOrigin=null;for(;;){a=o.pop();if(a.ranges){Ma(a,s);if(n&&!a.equals(t.sel)){$a(t,a,{clearRedo:false});return}u=a}else if(i){o.push(a);return}else{break}}var c=[];Ma(u,s);s.push({changes:c,generation:e.generation});e.generation=a.generation||++e.maxGeneration;var l=Lt(t,"beforeChange")||t.cm&&Lt(t.cm,"beforeChange");var h=function(n){var i=a.changes[n];i.origin=r;if(l&&!tu(t,i,false)){o.length=0;return{}}c.push(xa(t,i));var e=n?da(t,i):tt(o);au(t,i,e,qa(t,i));if(!n&&t.cm){t.cm.scrollIntoView({from:i.from,to:ha(i)})}var u=[];ka(t,(function(t,r){if(!r&&$(u,t.history)==-1){cu(t.history,i);u.push(t.history)}au(t,i,null,qa(t,i))}))};for(var v=a.changes.length-1;v>=0;--v){var d=h(v);if(d)return d.v}}function eu(t,r){if(r==0){return}t.first+=r;t.sel=new sa(rt(t.sel.ranges,(function(t){return new fa(fr(t.anchor.line+r,t.anchor.ch),fr(t.head.line+r,t.head.ch))})),t.sel.primIndex);if(t.cm){Ui(t.cm,t.first,t.first-r,r);for(var n=t.cm.display,i=n.viewFrom;i<n.viewTo;i++){Hi(t.cm,i,"gutter")}}}function au(t,r,n,i){if(t.cm&&!t.cm.curOp){return qe(t.cm,au)(t,r,n,i)}if(r.to.line<t.first){eu(t,r.text.length-1-(r.to.line-r.from.line));return}if(r.from.line>t.lastLine()){return}if(r.from.line<t.first){var e=r.text.length-1-(t.first-r.from.line);eu(t,e);r={from:fr(t.first,0),to:fr(r.to.line+e,r.to.ch),text:[tt(r.text)],origin:r.origin}}var a=t.lastLine();if(r.to.line>a){r={from:r.from,to:fr(a,rr(t,a).text.length),text:[r.text[0]],origin:r.origin}}r.removed=nr(t,r.from,r.to);if(!n){n=da(t,r)}if(t.cm){uu(t.cm,r,i)}else{ya(t,r,i)}Ga(t,n,Z);if(t.cantEdit&&Qa(t,fr(t.firstLine(),0))){t.cantEdit=false}}function uu(t,r,n){var i=t.doc,e=t.display,a=r.from,u=r.to;var o=false,s=a.line;if(!t.options.lineWrapping){s=ar(nn(rr(i,a.line)));i.iter(s,u.line+1,(function(t){if(t==e.maxLine){o=true;return true}}))}if(i.sel.contains(r.from,r.to)>-1){Et(t)}ya(i,r,n,Fi(t));if(!t.options.lineWrapping){i.iter(s,a.line+r.text.length,(function(t){var r=ln(t);if(r>e.maxLineLength){e.maxLine=t;e.maxLineLength=r;e.maxLineChanged=true;o=false}}));if(o){t.curOp.updateMaxLine=true}}Mr(i,a.line);je(t,400);var f=r.text.length-(u.line-a.line)-1;if(r.full){Ui(t)}else if(a.line==u.line&&r.text.length==1&&!wa(t.doc,r)){Hi(t,a.line,"text")}else{Ui(t,a.line,u.line+1,f)}var c=Lt(t,"changes"),l=Lt(t,"change");if(l||c){var h={from:a,to:u,text:r.text,removed:r.removed,origin:r.origin};if(l){Rn(t,"change",t,h)}if(c){(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}}t.display.selForContextMenu=null}function ou(t,r,n,i,e){var a;if(!i){i=n}if(cr(i,n)<0){a=[i,n],n=a[0],i=a[1]}if(typeof r=="string"){r=t.splitLines(r)}ru(t,{from:n,to:i,text:r,origin:e})}function su(t,r,n,i){if(n<t.line){t.line+=i}else if(r<t.line){t.line=r;t.ch=0}}function fu(t,r,n,i){for(var e=0;e<t.length;++e){var a=t[e],u=true;if(a.ranges){if(!a.copied){a=t[e]=a.deepCopy();a.copied=true}for(var o=0;o<a.ranges.length;o++){su(a.ranges[o].anchor,r,n,i);su(a.ranges[o].head,r,n,i)}continue}for(var s=0;s<a.changes.length;++s){var f=a.changes[s];if(n<f.from.line){f.from=fr(f.from.line+i,f.from.ch);f.to=fr(f.to.line+i,f.to.ch)}else if(r<=f.to.line){u=false;break}}if(!u){t.splice(0,e+1);e=0}}}function cu(t,r){var n=r.from.line,i=r.to.line,e=r.text.length-(i-n)-1;fu(t.done,n,i,e);fu(t.undone,n,i,e)}function lu(t,r,n,i){var e=r,a=r;if(typeof r=="number"){a=rr(t,pr(t,r))}else{e=ar(r)}if(e==null){return null}if(i(a,e)&&t.cm){Hi(t.cm,e,n)}return a}function hu(t){this.lines=t;this.parent=null;var r=0;for(var n=0;n<t.length;++n){t[n].parent=this;r+=t[n].height}this.height=r}hu.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,r){for(var n=t,i=t+r;n<i;++n){var e=this.lines[n];this.height-=e.height;pn(e);Rn(e,"delete")}this.lines.splice(t,r)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,r,n){this.height+=n;this.lines=this.lines.slice(0,t).concat(r).concat(this.lines.slice(t));for(var i=0;i<r.length;++i){r[i].parent=this}},iterN:function(t,r,n){for(var i=t+r;t<i;++t){if(n(this.lines[t])){return true}}}};function vu(t){this.children=t;var r=0,n=0;for(var i=0;i<t.length;++i){var e=t[i];r+=e.chunkSize();n+=e.height;e.parent=this}this.size=r;this.height=n;this.parent=null}vu.prototype={chunkSize:function(){return this.size},removeInner:function(t,r){this.size-=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],e=i.chunkSize();if(t<e){var a=Math.min(r,e-t),u=i.height;i.removeInner(t,a);this.height-=u-i.height;if(e==a){this.children.splice(n--,1);i.parent=null}if((r-=a)==0){break}t=0}else{t-=e}}if(this.size-r<25&&(this.children.length>1||!(this.children[0]instanceof hu))){var o=[];this.collapse(o);this.children=[new hu(o)];this.children[0].parent=this}},collapse:function(t){for(var r=0;r<this.children.length;++r){this.children[r].collapse(t)}},insertInner:function(t,r,n){this.size+=r.length;this.height+=n;for(var i=0;i<this.children.length;++i){var e=this.children[i],a=e.chunkSize();if(t<=a){e.insertInner(t,r,n);if(e.lines&&e.lines.length>50){var u=e.lines.length%25+25;for(var o=u;o<e.lines.length;){var s=new hu(e.lines.slice(o,o+=25));e.height-=s.height;this.children.splice(++i,0,s);s.parent=this}e.lines=e.lines.slice(0,u);this.maybeSpill()}break}t-=a}},maybeSpill:function(){if(this.children.length<=10){return}var t=this;do{var r=t.children.splice(t.children.length-5,5);var n=new vu(r);if(!t.parent){var i=new vu(t.children);i.parent=t;t.children=[i,n];t=i}else{t.size-=n.size;t.height-=n.height;var e=$(t.parent.children,t);t.parent.children.splice(e+1,0,n)}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()},iterN:function(t,r,n){for(var i=0;i<this.children.length;++i){var e=this.children[i],a=e.chunkSize();if(t<a){var u=Math.min(r,a-t);if(e.iterN(t,u,n)){return true}if((r-=u)==0){break}t=0}else{t-=a}}}};var du=function(t,r,n){if(n){for(var i in n){if(n.hasOwnProperty(i)){this[i]=n[i]}}}this.doc=t;this.node=r};du.prototype.clear=function(){var t=this.doc.cm,r=this.line.widgets,n=this.line,i=ar(n);if(i==null||!r){return}for(var e=0;e<r.length;++e){if(r[e]==this){r.splice(e--,1)}}if(!r.length){n.widgets=null}var a=Wn(this);er(n,Math.max(0,n.height-a));if(t){Ie(t,(function(){pu(t,n,-a);Hi(t,i,"widget")}));Rn(t,"lineWidgetCleared",t,this,i)}};du.prototype.changed=function(){var t=this;var r=this.height,n=this.doc.cm,i=this.line;this.height=null;var e=Wn(this)-r;if(!e){return}if(!sn(this.doc,i)){er(i,i.height+e)}if(n){Ie(n,(function(){n.curOp.forceUpdate=true;pu(n,i,e);Rn(n,"lineWidgetChanged",n,t,ar(i))}))}};xt(du);function pu(t,r,n){if(cn(r)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)){ce(t,n)}}function gu(t,r,n,i){var e=new du(t,n,i);var a=t.cm;if(a&&e.noHScroll){a.display.alignWidgets=true}lu(t,r,"widget",(function(r){var n=r.widgets||(r.widgets=[]);if(e.insertAt==null){n.push(e)}else{n.splice(Math.min(n.length,Math.max(0,e.insertAt)),0,e)}e.line=r;if(a&&!sn(t,r)){var i=cn(r)<t.scrollTop;er(r,r.height+Wn(e));if(i){ce(a,e.height)}a.curOp.forceUpdate=true}return true}));if(a){Rn(a,"lineWidgetAdded",a,e,typeof r=="number"?r:ar(r))}return e}var bu=0;var mu=function(t,r){this.lines=[];this.type=r;this.doc=t;this.id=++bu};mu.prototype.clear=function(){if(this.explicitlyCleared){return}var t=this.doc.cm,r=t&&!t.curOp;if(r){Ce(t)}if(Lt(this,"clear")){var n=this.find();if(n){Rn(this,"clear",n.from,n.to)}}var i=null,e=null;for(var a=0;a<this.lines.length;++a){var u=this.lines[a];var o=Pr(u.markedSpans,this);if(t&&!this.collapsed){Hi(t,ar(u),"text")}else if(t){if(o.to!=null){e=ar(u)}if(o.from!=null){i=ar(u)}}u.markedSpans=jr(u.markedSpans,o);if(o.from==null&&this.collapsed&&!sn(this.doc,u)&&t){er(u,Ri(t.display))}}if(t&&this.collapsed&&!t.options.lineWrapping){for(var s=0;s<this.lines.length;++s){var f=nn(this.lines[s]),c=ln(f);if(c>t.display.maxLineLength){t.display.maxLine=f;t.display.maxLineLength=c;t.display.maxLineChanged=true}}}if(i!=null&&t&&this.collapsed){Ui(t,i,e+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(t){Za(t.doc)}}if(t){Rn(t,"markerCleared",t,this,i,e)}if(r){De(t)}if(this.parent){this.parent.clear()}};mu.prototype.find=function(t,r){if(t==null&&this.type=="bookmark"){t=1}var n,i;for(var e=0;e<this.lines.length;++e){var a=this.lines[e];var u=Pr(a.markedSpans,this);if(u.from!=null){n=fr(r?a:ar(a),u.from);if(t==-1){return n}}if(u.to!=null){i=fr(r?a:ar(a),u.to);if(t==1){return i}}}return n&&{from:n,to:i}};mu.prototype.changed=function(){var t=this;var r=this.find(-1,true),n=this,i=this.doc.cm;if(!r||!i){return}Ie(i,(function(){var e=r.line,a=ar(r.line);var u=ai(i,a);if(u){vi(u);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!sn(n.doc,e)&&n.height!=null){var o=n.height;n.height=null;var s=Wn(n)-o;if(s){er(e,e.height+s)}}Rn(i,"markerChanged",i,t)}))};mu.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;if(!r.maybeHiddenMarkers||$(r.maybeHiddenMarkers,this)==-1){(r.maybeUnhiddenMarkers||(r.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(t)};mu.prototype.detachLine=function(t){this.lines.splice($(this.lines,t),1);if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(r.maybeHiddenMarkers||(r.maybeHiddenMarkers=[])).push(this)}};xt(mu);function wu(t,r,n,i,e){if(i&&i.shared){return ku(t,r,n,i,e)}if(t.cm&&!t.cm.curOp){return qe(t.cm,wu)(t,r,n,i,e)}var a=new mu(t,e),u=cr(r,n);if(i){H(i,a,false)}if(u>0||u==0&&a.clearWhenEmpty!==false){return a}if(a.replacedWith){a.collapsed=true;a.widgetNode=S("span",[a.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){a.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){a.widgetNode.insertLeft=true}}if(a.collapsed){if(rn(t,r.line,r,n,a)||r.line!=n.line&&rn(t,n.line,r,n,a)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}qr()}if(a.addToHistory){Oa(t,{from:r,to:n,origin:"markText"},t.sel,NaN)}var o=r.line,s=t.cm,f;t.iter(o,n.line+1,(function(i){if(s&&a.collapsed&&!s.options.lineWrapping&&nn(i)==s.display.maxLine){f=true}if(a.collapsed&&o!=r.line){er(i,0)}_r(i,new Fr(a,o==r.line?r.ch:null,o==n.line?n.ch:null),t.cm&&t.cm.curOp);++o}));if(a.collapsed){t.iter(r.line,n.line+1,(function(r){if(sn(t,r)){er(r,0)}}))}if(a.clearOnEnter){wt(a,"beforeCursorEnter",(function(){return a.clear()}))}if(a.readOnly){Ir();if(t.history.done.length||t.history.undone.length){t.clearHistory()}}if(a.collapsed){a.id=++bu;a.atomic=true}if(s){if(f){s.curOp.updateMaxLine=true}if(a.collapsed){Ui(s,r.line,n.line+1)}else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title){for(var c=r.line;c<=n.line;c++){Hi(s,c,"text")}}if(a.atomic){Za(s.doc)}Rn(s,"markerAdded",s,a)}return a}var yu=function(t,r){this.markers=t;this.primary=r;for(var n=0;n<t.length;++n){t[n].parent=this}};yu.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var t=0;t<this.markers.length;++t){this.markers[t].clear()}Rn(this,"clear")};yu.prototype.find=function(t,r){return this.primary.find(t,r)};xt(yu);function ku(t,r,n,i,e){i=H(i);i.shared=false;var a=[wu(t,r,n,i,e)],u=a[0];var o=i.widgetNode;ka(t,(function(t){if(o){i.widgetNode=o.cloneNode(true)}a.push(wu(t,gr(t,r),gr(t,n),i,e));for(var s=0;s<t.linked.length;++s){if(t.linked[s].isParent){return}}u=tt(a)}));return new yu(a,u)}function Tu(t){return t.findMarks(fr(t.first,0),t.clipPos(fr(t.lastLine())),(function(t){return t.parent}))}function Au(t,r){for(var n=0;n<r.length;n++){var i=r[n],e=i.find();var a=t.clipPos(e.from),u=t.clipPos(e.to);if(cr(a,u)){var o=wu(t,a,u,i.primary,i.primary.type);i.markers.push(o);o.parent=i}}}function Eu(t){var r=function(r){var n=t[r],i=[n.primary.doc];ka(n.primary.doc,(function(t){return i.push(t)}));for(var e=0;e<n.markers.length;e++){var a=n.markers[e];if($(i,a.doc)==-1){a.parent=null;n.markers.splice(e--,1)}}};for(var n=0;n<t.length;n++)r(n)}var Lu=0;var xu=function(t,r,n,i,e){if(!(this instanceof xu)){return new xu(t,r,n,i,e)}if(n==null){n=0}vu.call(this,[new hu([new vn("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=n;var a=fr(n,0);this.sel=la(a);this.history=new La(null);this.id=++Lu;this.modeOption=r;this.lineSep=i;this.direction=e=="rtl"?"rtl":"ltr";this.extend=false;if(typeof t=="string"){t=this.splitLines(t)}ya(this,{from:a,to:a,text:t});$a(this,la(a),Z)};xu.prototype=et(vu.prototype,{constructor:xu,iter:function(t,r,n){if(n){this.iterN(t-this.first,r-t,n)}else{this.iterN(this.first,this.first+this.size,t)}},insert:function(t,r){var n=0;for(var i=0;i<r.length;++i){n+=r[i].height}this.insertInner(t-this.first,r,n)},remove:function(t,r){this.removeInner(t-this.first,r)},getValue:function(t){var r=ir(this,this.first,this.first+this.size);if(t===false){return r}return r.join(t||this.lineSeparator())},setValue:Pe((function(t){var r=fr(this.first,0),n=this.first+this.size-1;ru(this,{from:r,to:fr(n,rr(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:true},true);if(this.cm){he(this.cm,0,0)}$a(this,la(r),Z)})),replaceRange:function(t,r,n,i){r=gr(this,r);n=n?gr(this,n):r;ou(this,t,r,n,i)},getRange:function(t,r,n){var i=nr(this,gr(this,t),gr(this,r));if(n===false){return i}if(n===""){return i.join("")}return i.join(n||this.lineSeparator())},getLine:function(t){var r=this.getLineHandle(t);return r&&r.text},getLineHandle:function(t){if(or(this,t)){return rr(this,t)}},getLineNumber:function(t){return ar(t)},getLineHandleVisualStart:function(t){if(typeof t=="number"){t=rr(this,t)}return nn(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return gr(this,t)},getCursor:function(t){var r=this.sel.primary(),n;if(t==null||t=="head"){n=r.head}else if(t=="anchor"){n=r.anchor}else if(t=="end"||t=="to"||t===false){n=r.to()}else{n=r.from()}return n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Pe((function(t,r,n){Ha(this,gr(this,typeof t=="number"?fr(t,r||0):t),null,n)})),setSelection:Pe((function(t,r,n){Ha(this,gr(this,t),gr(this,r||t),n)})),extendSelection:Pe((function(t,r,n){ja(this,gr(this,t),r&&gr(this,r),n)})),extendSelections:Pe((function(t,r){_a(this,mr(this,t),r)})),extendSelectionsBy:Pe((function(t,r){var n=rt(this.sel.ranges,t);_a(this,mr(this,n),r)})),setSelections:Pe((function(t,r,n){if(!t.length){return}var i=[];for(var e=0;e<t.length;e++){i[e]=new fa(gr(this,t[e].anchor),gr(this,t[e].head||t[e].anchor))}if(r==null){r=Math.min(t.length-1,this.sel.primIndex)}$a(this,ca(this.cm,i,r),n)})),addSelection:Pe((function(t,r,n){var i=this.sel.ranges.slice(0);i.push(new fa(gr(this,t),gr(this,r||t)));$a(this,ca(this.cm,i,i.length-1),n)})),getSelection:function(t){var r=this.sel.ranges,n;for(var i=0;i<r.length;i++){var e=nr(this,r[i].from(),r[i].to());n=n?n.concat(e):e}if(t===false){return n}else{return n.join(t||this.lineSeparator())}},getSelections:function(t){var r=[],n=this.sel.ranges;for(var i=0;i<n.length;i++){var e=nr(this,n[i].from(),n[i].to());if(t!==false){e=e.join(t||this.lineSeparator())}r[i]=e}return r},replaceSelection:function(t,r,n){var i=[];for(var e=0;e<this.sel.ranges.length;e++){i[e]=t}this.replaceSelections(i,r,n||"+input")},replaceSelections:Pe((function(t,r,n){var i=[],e=this.sel;for(var a=0;a<e.ranges.length;a++){var u=e.ranges[a];i[a]={from:u.from(),to:u.to(),text:this.splitLines(t[a]),origin:n}}var o=r&&r!="end"&&ga(this,i,r);for(var s=i.length-1;s>=0;s--){ru(this,i[s])}if(o){Va(this,o)}else if(this.cm){le(this.cm)}})),undo:Pe((function(){iu(this,"undo")})),redo:Pe((function(){iu(this,"redo")})),undoSelection:Pe((function(){iu(this,"undo",true)})),redoSelection:Pe((function(){iu(this,"redo",true)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){var t=this.history,r=0,n=0;for(var i=0;i<t.done.length;i++){if(!t.done[i].ranges){++r}}for(var e=0;e<t.undone.length;e++){if(!t.undone[e].ranges){++n}}return{undo:r,redo:n}},clearHistory:function(){var t=this;this.history=new La(this.history);ka(this,(function(r){return r.history=t.history}),true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(t){if(t){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Fa(this.history.done),undone:Fa(this.history.undone)}},setHistory:function(t){var r=this.history=new La(this.history);r.done=Fa(t.done.slice(0),null,true);r.undone=Fa(t.undone.slice(0),null,true)},setGutterMarker:Pe((function(t,r,n){return lu(this,t,"gutter",(function(t){var i=t.gutterMarkers||(t.gutterMarkers={});i[r]=n;if(!n&&st(i)){t.gutterMarkers=null}return true}))})),clearGutter:Pe((function(t){var r=this;this.iter((function(n){if(n.gutterMarkers&&n.gutterMarkers[t]){lu(r,n,"gutter",(function(){n.gutterMarkers[t]=null;if(st(n.gutterMarkers)){n.gutterMarkers=null}return true}))}}))})),lineInfo:function(t){var r;if(typeof t=="number"){if(!or(this,t)){return null}r=t;t=rr(this,t);if(!t){return null}}else{r=ar(t);if(r==null){return null}}return{line:r,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:Pe((function(t,r,n){return lu(this,t,r=="gutter"?"gutter":"class",(function(t){var i=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";if(!t[i]){t[i]=n}else if(L(n).test(t[i])){return false}else{t[i]+=" "+n}return true}))})),removeLineClass:Pe((function(t,r,n){return lu(this,t,r=="gutter"?"gutter":"class",(function(t){var i=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";var e=t[i];if(!e){return false}else if(n==null){t[i]=null}else{var a=e.match(L(n));if(!a){return false}var u=a.index+a[0].length;t[i]=e.slice(0,a.index)+(!a.index||u==e.length?"":" ")+e.slice(u)||null}return true}))})),addLineWidget:Pe((function(t,r,n){return gu(this,t,r,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,r,n){return wu(this,gr(this,t),gr(this,r),n,n&&n.type||"range")},setBookmark:function(t,r){var n={replacedWith:r&&(r.nodeType==null?r.widget:r),insertLeft:r&&r.insertLeft,clearWhenEmpty:false,shared:r&&r.shared,handleMouseEvents:r&&r.handleMouseEvents};t=gr(this,t);return wu(this,t,t,n,"bookmark")},findMarksAt:function(t){t=gr(this,t);var r=[],n=rr(this,t.line).markedSpans;if(n){for(var i=0;i<n.length;++i){var e=n[i];if((e.from==null||e.from<=t.ch)&&(e.to==null||e.to>=t.ch)){r.push(e.marker.parent||e.marker)}}}return r},findMarks:function(t,r,n){t=gr(this,t);r=gr(this,r);var i=[],e=t.line;this.iter(t.line,r.line+1,(function(a){var u=a.markedSpans;if(u){for(var o=0;o<u.length;o++){var s=u[o];if(!(s.to!=null&&e==t.line&&t.ch>=s.to||s.from==null&&e!=t.line||s.from!=null&&e==r.line&&s.from>=r.ch)&&(!n||n(s.marker))){i.push(s.marker.parent||s.marker)}}}++e}));return i},getAllMarks:function(){var t=[];this.iter((function(r){var n=r.markedSpans;if(n){for(var i=0;i<n.length;++i){if(n[i].from!=null){t.push(n[i].marker)}}}}));return t},posFromIndex:function(t){var r,n=this.first,i=this.lineSeparator().length;this.iter((function(e){var a=e.text.length+i;if(a>t){r=t;return true}t-=a;++n}));return gr(this,fr(n,r))},indexFromPos:function(t){t=gr(this,t);var r=t.ch;if(t.line<this.first||t.ch<0){return 0}var n=this.lineSeparator().length;this.iter(this.first,t.line,(function(t){r+=t.text.length+n}));return r},copy:function(t){var r=new xu(ir(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);r.scrollTop=this.scrollTop;r.scrollLeft=this.scrollLeft;r.sel=this.sel;r.extend=false;if(t){r.history.undoDepth=this.history.undoDepth;r.setHistory(this.getHistory())}return r},linkedDoc:function(t){if(!t){t={}}var r=this.first,n=this.first+this.size;if(t.from!=null&&t.from>r){r=t.from}if(t.to!=null&&t.to<n){n=t.to}var i=new xu(ir(this,r,n),t.mode||this.modeOption,r,this.lineSep,this.direction);if(t.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:t.sharedHist}];Au(i,Tu(this));return i},unlinkDoc:function(t){if(t instanceof Uo){t=t.doc}if(this.linked){for(var r=0;r<this.linked.length;++r){var n=this.linked[r];if(n.doc!=t){continue}this.linked.splice(r,1);t.unlinkDoc(this);Eu(Tu(this));break}}if(t.history==this.history){var i=[t.id];ka(t,(function(t){return i.push(t.id)}),true);t.history=new La(null);t.history.done=Fa(this.history.done,i);t.history.undone=Fa(this.history.undone,i)}},iterLinkedDocs:function(t){ka(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){if(this.lineSep){return t.split(this.lineSep)}return Pt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Pe((function(t){if(t!="rtl"){t="ltr"}if(t==this.direction){return}this.direction=t;this.iter((function(t){return t.order=null}));if(this.cm){Ea(this.cm)}}))});xu.prototype.eachLine=xu.prototype.iter;var Cu=0;function Du(t){var r=this;Nu(r);if(At(r,t)||Zn(r.display,t)){return}Ct(t);if(u){Cu=+new Date}var n=ji(r,t,true),i=t.dataTransfer.files;if(!n||r.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var e=i.length,a=Array(e),o=0;var s=function(){if(++o==e){qe(r,(function(){n=gr(r.doc,n);var t={from:n,to:n,text:r.doc.splitLines(a.filter((function(t){return t!=null})).join(r.doc.lineSeparator())),origin:"paste"};ru(r.doc,t);Va(r.doc,la(gr(r.doc,n),gr(r.doc,ha(t))))}))()}};var f=function(t,n){if(r.options.allowDropFileTypes&&$(r.options.allowDropFileTypes,t.type)==-1){s();return}var i=new FileReader;i.onerror=function(){return s()};i.onload=function(){var t=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)){s();return}a[n]=t;s()};i.readAsText(t)};for(var c=0;c<i.length;c++){f(i[c],c)}}else{if(r.state.draggingText&&r.doc.sel.contains(n)>-1){r.state.draggingText(t);setTimeout((function(){return r.display.input.focus()}),20);return}try{var l=t.dataTransfer.getData("Text");if(l){var h;if(r.state.draggingText&&!r.state.draggingText.copy){h=r.listSelections()}Ga(r.doc,la(n,n));if(h){for(var v=0;v<h.length;++v){ou(r.doc,"",h[v].anchor,h[v].head,"drag")}}r.replaceSelection(l,"around","paste");r.display.input.focus()}}catch(t){}}}function Ou(t,r){if(u&&(!t.state.draggingText||+new Date-Cu<100)){St(r);return}if(At(t,r)||Zn(t.display,r)){return}r.dataTransfer.setData("Text",t.getSelection());r.dataTransfer.effectAllowed="copyMove";if(r.dataTransfer.setDragImage&&!v){var n=O("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(h){n.width=n.height=1;t.display.wrapper.appendChild(n);n._top=n.offsetTop}r.dataTransfer.setDragImage(n,0,0);if(h){n.parentNode.removeChild(n)}}}function Su(t,r){var n=ji(t,r);if(!n){return}var i=document.createDocumentFragment();Ki(t,n,i);if(!t.display.dragCursor){t.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors");t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)}D(t.display.dragCursor,i)}function Nu(t){if(t.display.dragCursor){t.display.lineSpace.removeChild(t.display.dragCursor);t.display.dragCursor=null}}function Mu(t){if(!document.getElementsByClassName){return}var r=document.getElementsByClassName("CodeMirror"),n=[];for(var i=0;i<r.length;i++){var e=r[i].CodeMirror;if(e){n.push(e)}}if(n.length){n[0].operation((function(){for(var r=0;r<n.length;r++){t(n[r])}}))}}var Ru=false;function Bu(){if(Ru){return}Iu();Ru=true}function Iu(){var t;wt(window,"resize",(function(){if(t==null){t=setTimeout((function(){t=null;Mu(qu)}),100)}}));wt(window,"blur",(function(){return Mu(ne)}))}function qu(t){var r=t.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null;r.scrollbarsClipped=false;t.setSize()}var Fu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var Pu=0;Pu<10;Pu++){Fu[Pu+48]=Fu[Pu+96]=String(Pu)}for(var ju=65;ju<=90;ju++){Fu[ju]=String.fromCharCode(ju)}for(var _u=1;_u<=12;_u++){Fu[_u+111]=Fu[_u+63235]="F"+_u}var Uu={};Uu.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"};Uu.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"};Uu.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};Uu.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"]};Uu["default"]=w?Uu.macDefault:Uu.pcDefault;function Hu(t){var r=t.split(/-(?!$)/);t=r[r.length-1];var n,i,e,a;for(var u=0;u<r.length-1;u++){var o=r[u];if(/^(cmd|meta|m)$/i.test(o)){a=true}else if(/^a(lt)?$/i.test(o)){n=true}else if(/^(c|ctrl|control)$/i.test(o)){i=true}else if(/^s(hift)?$/i.test(o)){e=true}else{throw new Error("Unrecognized modifier name: "+o)}}if(n){t="Alt-"+t}if(i){t="Ctrl-"+t}if(a){t="Cmd-"+t}if(e){t="Shift-"+t}return t}function zu(t){var r={};for(var n in t){if(t.hasOwnProperty(n)){var i=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n)){continue}if(i=="..."){delete t[n];continue}var e=rt(n.split(" "),Hu);for(var a=0;a<e.length;a++){var u=void 0,o=void 0;if(a==e.length-1){o=e.join(" ");u=i}else{o=e.slice(0,a+1).join(" ");u="..."}var s=r[o];if(!s){r[o]=u}else if(s!=u){throw new Error("Inconsistent bindings for "+o)}}delete t[n]}}for(var f in r){t[f]=r[f]}return t}function Vu(t,r,n,i){r=Zu(r);var e=r.call?r.call(t,i):r[t];if(e===false){return"nothing"}if(e==="..."){return"multi"}if(e!=null&&n(e)){return"handled"}if(r.fallthrough){if(Object.prototype.toString.call(r.fallthrough)!="[object Array]"){return Vu(t,r.fallthrough,n,i)}for(var a=0;a<r.fallthrough.length;a++){var u=Vu(t,r.fallthrough[a],n,i);if(u){return u}}}}function $u(t){var r=typeof t=="string"?t:Fu[t.keyCode];return r=="Ctrl"||r=="Alt"||r=="Shift"||r=="Mod"}function Gu(t,r,n){var i=t;if(r.altKey&&i!="Alt"){t="Alt-"+t}if((A?r.metaKey:r.ctrlKey)&&i!="Ctrl"){t="Ctrl-"+t}if((A?r.ctrlKey:r.metaKey)&&i!="Mod"){t="Cmd-"+t}if(!n&&r.shiftKey&&i!="Shift"){t="Shift-"+t}return t}function Wu(t,r){if(h&&t.keyCode==34&&t["char"]){return false}var n=Fu[t.keyCode];if(n==null||t.altGraphKey){return false}if(t.keyCode==3&&t.code){n=t.code}return Gu(n,t,r)}function Zu(t){return typeof t=="string"?Uu[t]:t}function Ku(t,r){var n=t.doc.sel.ranges,i=[];for(var e=0;e<n.length;e++){var a=r(n[e]);while(i.length&&cr(a.from,tt(i).to)<=0){var u=i.pop();if(cr(u.from,a.from)<0){a.from=u.from;break}}i.push(a)}Ie(t,(function(){for(var r=i.length-1;r>=0;r--){ou(t.doc,"",i[r].from,i[r].to,"+delete")}le(t)}))}function Yu(t,r,n){var i=lt(t.text,r+n,n);return i<0||i>t.text.length?null:i}function Qu(t,r,n){var i=Yu(t,r.ch,n);return i==null?null:new fr(r.line,i,n<0?"after":"before")}function Xu(t,r,n,i,e){if(t){if(r.doc.direction=="rtl"){e=-e}var a=bt(n,r.doc.direction);if(a){var u=e<0?tt(a):a[0];var o=e<0==(u.level==1);var s=o?"after":"before";var f;if(u.level>0||r.doc.direction=="rtl"){var c=ui(r,n);f=e<0?n.text.length-1:0;var l=oi(r,c,f).top;f=ht((function(t){return oi(r,c,t).top==l}),e<0==(u.level==1)?u.from:u.to-1,f);if(s=="before"){f=Yu(n,f,1)}}else{f=e<0?u.to:u.from}return new fr(i,f,s)}}return new fr(i,e<0?n.text.length:0,e<0?"before":"after")}function Ju(t,r,n,i){var e=bt(r,t.doc.direction);if(!e){return Qu(r,n,i)}if(n.ch>=r.text.length){n.ch=r.text.length;n.sticky="before"}else if(n.ch<=0){n.ch=0;n.sticky="after"}var a=pt(e,n.ch,n.sticky),u=e[a];if(t.doc.direction=="ltr"&&u.level%2==0&&(i>0?u.to>n.ch:u.from<n.ch)){return Qu(r,n,i)}var o=function(t,n){return Yu(r,t instanceof fr?t.ch:t,n)};var s;var f=function(n){if(!t.options.lineWrapping){return{begin:0,end:r.text.length}}s=s||ui(t,r);return Ci(t,r,s,n)};var c=f(n.sticky=="before"?o(n,-1):n.ch);if(t.doc.direction=="rtl"||u.level==1){var l=u.level==1==i<0;var h=o(n,l?1:-1);if(h!=null&&(!l?h>=u.from&&h>=c.begin:h<=u.to&&h<=c.end)){var v=l?"before":"after";return new fr(n.line,h,v)}}var d=function(t,r,i){var a=function(t,r){return r?new fr(n.line,o(t,1),"before"):new fr(n.line,t,"after")};for(;t>=0&&t<e.length;t+=r){var u=e[t];var s=r>0==(u.level!=1);var f=s?i.begin:o(i.end,-1);if(u.from<=f&&f<u.to){return a(f,s)}f=s?u.from:o(u.to,-1);if(i.begin<=f&&f<i.end){return a(f,s)}}};var p=d(a+i,i,c);if(p){return p}var g=i>0?c.end:o(c.begin,-1);if(g!=null&&!(i>0&&g==r.text.length)){p=d(i>0?0:e.length-1,i,f(g));if(p){return p}}return null}var to={selectAll:Ja,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),Z)},killLine:function(t){return Ku(t,(function(r){if(r.empty()){var n=rr(t.doc,r.head.line).text.length;if(r.head.ch==n&&r.head.line<t.lastLine()){return{from:r.head,to:fr(r.head.line+1,0)}}else{return{from:r.head,to:fr(r.head.line,n)}}}else{return{from:r.from(),to:r.to()}}}))},deleteLine:function(t){return Ku(t,(function(r){return{from:fr(r.from().line,0),to:gr(t.doc,fr(r.to().line+1,0))}}))},delLineLeft:function(t){return Ku(t,(function(t){return{from:fr(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Ku(t,(function(r){var n=t.charCoords(r.head,"div").top+5;var i=t.coordsChar({left:0,top:n},"div");return{from:i,to:r.from()}}))},delWrappedLineRight:function(t){return Ku(t,(function(r){var n=t.charCoords(r.head,"div").top+5;var i=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:r.from(),to:i}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(fr(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(fr(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(r){return ro(t,r.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(r){return io(t,r.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(r){return no(t,r.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(r){var n=t.cursorCoords(r.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),Y)},goLineLeft:function(t){return t.extendSelectionsBy((function(r){var n=t.cursorCoords(r.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),Y)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(r){var n=t.cursorCoords(r.head,"div").top+5;var i=t.coordsChar({left:0,top:n},"div");if(i.ch<t.getLine(i.line).search(/\S/)){return io(t,r.head)}return i}),Y)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){var r=[],n=t.listSelections(),i=t.options.tabSize;for(var e=0;e<n.length;e++){var a=n[e].from();var u=z(t.getLine(a.line),a.ch,i);r.push(J(i-u%i))}t.replaceSelections(r)},defaultTab:function(t){if(t.somethingSelected()){t.indentSelection("add")}else{t.execCommand("insertTab")}},transposeChars:function(t){return Ie(t,(function(){var r=t.listSelections(),n=[];for(var i=0;i<r.length;i++){if(!r[i].empty()){continue}var e=r[i].head,a=rr(t.doc,e.line).text;if(a){if(e.ch==a.length){e=new fr(e.line,e.ch-1)}if(e.ch>0){e=new fr(e.line,e.ch+1);t.replaceRange(a.charAt(e.ch-1)+a.charAt(e.ch-2),fr(e.line,e.ch-2),e,"+transpose")}else if(e.line>t.doc.first){var u=rr(t.doc,e.line-1).text;if(u){e=new fr(e.line,1);t.replaceRange(a.charAt(0)+t.doc.lineSeparator()+u.charAt(u.length-1),fr(e.line-1,u.length-1),e,"+transpose")}}}n.push(new fa(e,e))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ie(t,(function(){var r=t.listSelections();for(var n=r.length-1;n>=0;n--){t.replaceRange(t.doc.lineSeparator(),r[n].anchor,r[n].head,"+input")}r=t.listSelections();for(var i=0;i<r.length;i++){t.indentLine(r[i].from().line,null,true)}le(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function ro(t,r){var n=rr(t.doc,r);var i=nn(n);if(i!=n){r=ar(i)}return Xu(true,t,i,r,1)}function no(t,r){var n=rr(t.doc,r);var i=en(n);if(i!=n){r=ar(i)}return Xu(true,t,n,r,-1)}function io(t,r){var n=ro(t,r.line);var i=rr(t.doc,n.line);var e=bt(i,t.doc.direction);if(!e||e[0].level==0){var a=Math.max(n.ch,i.text.search(/\S/));var u=r.line==n.line&&r.ch<=a&&r.ch;return fr(n.line,u?0:a,n.sticky)}return n}function eo(t,r,n){if(typeof r=="string"){r=to[r];if(!r){return false}}t.display.input.ensurePolled();var i=t.display.shift,e=false;try{if(t.isReadOnly()){t.state.suppressEdits=true}if(n){t.display.shift=false}e=r(t)!=W}finally{t.display.shift=i;t.state.suppressEdits=false}return e}function ao(t,r,n){for(var i=0;i<t.state.keyMaps.length;i++){var e=Vu(r,t.state.keyMaps[i],n,t);if(e){return e}}return t.options.extraKeys&&Vu(r,t.options.extraKeys,n,t)||Vu(r,t.options.keyMap,n,t)}var uo=new V;function oo(t,r,n,i){var e=t.state.keySeq;if(e){if($u(r)){return"handled"}if(/\'$/.test(r)){t.state.keySeq=null}else{uo.set(50,(function(){if(t.state.keySeq==e){t.state.keySeq=null;t.display.input.reset()}}))}if(so(t,e+" "+r,n,i)){return true}}return so(t,r,n,i)}function so(t,r,n,i){var e=ao(t,r,i);if(e=="multi"){t.state.keySeq=r}if(e=="handled"){Rn(t,"keyHandled",t,r,n)}if(e=="handled"||e=="multi"){Ct(n);Xi(t)}return!!e}function fo(t,r){var n=Wu(r,true);if(!n){return false}if(r.shiftKey&&!t.state.keySeq){return oo(t,"Shift-"+n,r,(function(r){return eo(t,r,true)}))||oo(t,n,r,(function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion){return eo(t,r)}}))}else{return oo(t,n,r,(function(r){return eo(t,r)}))}}function co(t,r,n){return oo(t,"'"+n+"'",r,(function(r){return eo(t,r,true)}))}var lo=null;function ho(t){var r=this;if(t.target&&t.target!=r.display.input.getField()){return}r.curOp.focus=R(P(r));if(At(r,t)){return}if(u&&o<11&&t.keyCode==27){t.returnValue=false}var i=t.keyCode;r.display.shift=i==16||t.shiftKey;var e=fo(r,t);if(h){lo=e?i:null;if(!e&&i==88&&!_t&&(w?t.metaKey:t.ctrlKey)){r.replaceSelection("",null,"cut")}}if(n&&!w&&!e&&i==46&&t.shiftKey&&!t.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)){vo(r)}}function vo(t){var r=t.display.lineDiv;B(r,"CodeMirror-crosshair");function n(t){if(t.keyCode==18||!t.altKey){x(r,"CodeMirror-crosshair");kt(document,"keyup",n);kt(document,"mouseover",n)}}wt(document,"keyup",n);wt(document,"mouseover",n)}function po(t){if(t.keyCode==16){this.doc.sel.shift=false}At(this,t)}function go(t){var r=this;if(t.target&&t.target!=r.display.input.getField()){return}if(Zn(r.display,t)||At(r,t)||t.ctrlKey&&!t.altKey||w&&t.metaKey){return}var n=t.keyCode,i=t.charCode;if(h&&n==lo){lo=null;Ct(t);return}if(h&&(!t.which||t.which<10)&&fo(r,t)){return}var e=String.fromCharCode(i==null?n:i);if(e=="\b"){return}if(co(r,t,e)){return}r.display.input.onKeyPress(t)}var bo=400;var mo=function(t,r,n){this.time=t;this.pos=r;this.button=n};mo.prototype.compare=function(t,r,n){return this.time+bo>t&&cr(r,this.pos)==0&&n==this.button};var wo,yo;function ko(t,r){var n=+new Date;if(yo&&yo.compare(n,t,r)){wo=yo=null;return"triple"}else if(wo&&wo.compare(n,t,r)){yo=new mo(n,t,r);wo=null;return"double"}else{wo=new mo(n,t,r);yo=null;return"single"}}function To(t){var r=this,n=r.display;if(At(r,t)||n.activeTouch&&n.input.supportsTouch()){return}n.input.ensurePolled();n.shift=t.shiftKey;if(Zn(n,t)){if(!s){n.scroller.draggable=false;setTimeout((function(){return n.scroller.draggable=true}),100)}return}if(No(r,t)){return}var i=ji(r,t),e=Mt(t),a=i?ko(i,e):"single";_(r).focus();if(e==1&&r.state.selectingText){r.state.selectingText(t)}if(i&&Ao(r,e,i,a,t)){return}if(e==1){if(i){Lo(r,i,a,t)}else if(Nt(t)==n.scroller){Ct(t)}}else if(e==2){if(i){ja(r.doc,i)}setTimeout((function(){return n.input.focus()}),20)}else if(e==3){if(E){r.display.input.onContextMenu(t)}else{te(r)}}}function Ao(t,r,n,i,e){var a="Click";if(i=="double"){a="Double"+a}else if(i=="triple"){a="Triple"+a}a=(r==1?"Left":r==2?"Middle":"Right")+a;return oo(t,Gu(a,e),e,(function(r){if(typeof r=="string"){r=to[r]}if(!r){return false}var i=false;try{if(t.isReadOnly()){t.state.suppressEdits=true}i=r(t,n)!=W}finally{t.state.suppressEdits=false}return i}))}function Eo(t,r,n){var i=t.getOption("configureMouse");var e=i?i(t,r,n):{};if(e.unit==null){var a=y?n.shiftKey&&n.metaKey:n.altKey;e.unit=a?"rectangle":r=="single"?"char":r=="double"?"word":"line"}if(e.extend==null||t.doc.extend){e.extend=t.doc.extend||n.shiftKey}if(e.addNew==null){e.addNew=w?n.metaKey:n.ctrlKey}if(e.moveOnDrag==null){e.moveOnDrag=!(w?n.altKey:n.ctrlKey)}return e}function Lo(t,r,n,i){if(u){setTimeout(U(Ji,t),0)}else{t.curOp.focus=R(P(t))}var e=Eo(t,n,i);var a=t.doc.sel,o;if(t.options.dragDrop&&Rt&&!t.isReadOnly()&&n=="single"&&(o=a.contains(r))>-1&&(cr((o=a.ranges[o]).from(),r)<0||r.xRel>0)&&(cr(o.to(),r)>0||r.xRel<0)){xo(t,i,r,e)}else{Do(t,i,r,e)}}function xo(t,r,n,i){var e=t.display,a=false;var f=qe(t,(function(r){if(s){e.scroller.draggable=false}t.state.draggingText=false;if(t.state.delayingBlurEvent){if(t.hasFocus()){t.state.delayingBlurEvent=false}else{te(t)}}kt(e.wrapper.ownerDocument,"mouseup",f);kt(e.wrapper.ownerDocument,"mousemove",c);kt(e.scroller,"dragstart",l);kt(e.scroller,"drop",f);if(!a){Ct(r);if(!i.addNew){ja(t.doc,n,null,null,i.extend)}if(s&&!v||u&&o==9){setTimeout((function(){e.wrapper.ownerDocument.body.focus({preventScroll:true});e.input.focus()}),20)}else{e.input.focus()}}}));var c=function(t){a=a||Math.abs(r.clientX-t.clientX)+Math.abs(r.clientY-t.clientY)>=10};var l=function(){return a=true};if(s){e.scroller.draggable=true}t.state.draggingText=f;f.copy=!i.moveOnDrag;wt(e.wrapper.ownerDocument,"mouseup",f);wt(e.wrapper.ownerDocument,"mousemove",c);wt(e.scroller,"dragstart",l);wt(e.scroller,"drop",f);t.state.delayingBlurEvent=true;setTimeout((function(){return e.input.focus()}),20);if(e.scroller.dragDrop){e.scroller.dragDrop()}}function Co(t,r,n){if(n=="char"){return new fa(r,r)}if(n=="word"){return t.findWordAt(r)}if(n=="line"){return new fa(fr(r.line,0),gr(t.doc,fr(r.line+1,0)))}var i=n(t,r);return new fa(i.from,i.to)}function Do(t,r,n,i){if(u){te(t)}var e=t.display,a=t.doc;Ct(r);var o,s,f=a.sel,c=f.ranges;if(i.addNew&&!i.extend){s=a.sel.contains(n);if(s>-1){o=c[s]}else{o=new fa(n,n)}}else{o=a.sel.primary();s=a.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){o=new fa(n,n)}n=ji(t,r,true,true);s=-1}else{var l=Co(t,n,i.unit);if(i.extend){o=Pa(o,l.anchor,l.head,i.extend)}else{o=l}}if(!i.addNew){s=0;$a(a,new sa([o],0),K);f=a.sel}else if(s==-1){s=c.length;$a(a,ca(t,c.concat([o]),s),{scroll:false,origin:"*mouse"})}else if(c.length>1&&c[s].empty()&&i.unit=="char"&&!i.extend){$a(a,ca(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:false,origin:"*mouse"});f=a.sel}else{Ua(a,s,o,K)}var h=n;function v(r){if(cr(h,r)==0){return}h=r;if(i.unit=="rectangle"){var e=[],u=t.options.tabSize;var c=z(rr(a,n.line).text,n.ch,u);var l=z(rr(a,r.line).text,r.ch,u);var v=Math.min(c,l),d=Math.max(c,l);for(var p=Math.min(n.line,r.line),g=Math.min(t.lastLine(),Math.max(n.line,r.line));p<=g;p++){var b=rr(a,p).text,m=Q(b,v,u);if(v==d){e.push(new fa(fr(p,m),fr(p,m)))}else if(b.length>m){e.push(new fa(fr(p,m),fr(p,Q(b,d,u))))}}if(!e.length){e.push(new fa(n,n))}$a(a,ca(t,f.ranges.slice(0,s).concat(e),s),{origin:"*mouse",scroll:false});t.scrollIntoView(r)}else{var w=o;var y=Co(t,r,i.unit);var k=w.anchor,T;if(cr(y.anchor,k)>0){T=y.head;k=dr(w.from(),y.anchor)}else{T=y.anchor;k=vr(w.to(),y.head)}var A=f.ranges.slice(0);A[s]=Oo(t,new fa(gr(a,k),T));$a(a,ca(t,A,s),K)}}var d=e.wrapper.getBoundingClientRect();var p=0;function g(r){var n=++p;var u=ji(t,r,true,i.unit=="rectangle");if(!u){return}if(cr(u,h)!=0){t.curOp.focus=R(P(t));v(u);var o=ae(e,a);if(u.line>=o.to||u.line<o.from){setTimeout(qe(t,(function(){if(p==n){g(r)}})),150)}}else{var s=r.clientY<d.top?-20:r.clientY>d.bottom?20:0;if(s){setTimeout(qe(t,(function(){if(p!=n){return}e.scroller.scrollTop+=s;g(r)})),50)}}}function b(r){t.state.selectingText=false;p=Infinity;if(r){Ct(r);e.input.focus()}kt(e.wrapper.ownerDocument,"mousemove",m);kt(e.wrapper.ownerDocument,"mouseup",w);a.history.lastSelOrigin=null}var m=qe(t,(function(t){if(t.buttons===0||!Mt(t)){b(t)}else{g(t)}}));var w=qe(t,b);t.state.selectingText=w;wt(e.wrapper.ownerDocument,"mousemove",m);wt(e.wrapper.ownerDocument,"mouseup",w)}function Oo(t,r){var n=r.anchor;var i=r.head;var e=rr(t.doc,n.line);if(cr(n,i)==0&&n.sticky==i.sticky){return r}var a=bt(e);if(!a){return r}var u=pt(a,n.ch,n.sticky),o=a[u];if(o.from!=n.ch&&o.to!=n.ch){return r}var s=u+(o.from==n.ch==(o.level!=1)?0:1);if(s==0||s==a.length){return r}var f;if(i.line!=n.line){f=(i.line-n.line)*(t.doc.direction=="ltr"?1:-1)>0}else{var c=pt(a,i.ch,i.sticky);var l=c-u||(i.ch-n.ch)*(o.level==1?-1:1);if(c==s-1||c==s){f=l<0}else{f=l>0}}var h=a[s+(f?-1:0)];var v=f==(h.level==1);var d=v?h.from:h.to,p=v?"after":"before";return n.ch==d&&n.sticky==p?r:new fa(new fr(n.line,d,p),i)}function So(t,r,n,i){var e,a;if(r.touches){e=r.touches[0].clientX;a=r.touches[0].clientY}else{try{e=r.clientX;a=r.clientY}catch(t){return false}}if(e>=Math.floor(t.display.gutters.getBoundingClientRect().right)){return false}if(i){Ct(r)}var u=t.display;var o=u.lineDiv.getBoundingClientRect();if(a>o.bottom||!Lt(t,n)){return Ot(r)}a-=o.top-u.viewOffset;for(var s=0;s<t.display.gutterSpecs.length;++s){var f=u.gutters.childNodes[s];if(f&&f.getBoundingClientRect().right>=e){var c=ur(t.doc,a);var l=t.display.gutterSpecs[s];Tt(t,n,t,c,l.className,r);return Ot(r)}}}function No(t,r){return So(t,r,"gutterClick",true)}function Mo(t,r){if(Zn(t.display,r)||Ro(t,r)){return}if(At(t,r,"contextmenu")){return}if(!E){t.display.input.onContextMenu(r)}}function Ro(t,r){if(!Lt(t,"gutterContextMenu")){return false}return So(t,r,"gutterContextMenu",false)}function Bo(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-");pi(t)}var Io={toString:function(){return"CodeMirror.Init"}};var qo={};var Fo={};function Po(t){var r=t.optionHandlers;function n(n,i,e,a){t.defaults[n]=i;if(e){r[n]=a?function(t,r,n){if(n!=Io){e(t,r,n)}}:e}}t.defineOption=n;t.Init=Io;n("value","",(function(t,r){return t.setValue(r)}),true);n("mode",null,(function(t,r){t.doc.modeOption=r;ba(t)}),true);n("indentUnit",2,ba,true);n("indentWithTabs",false);n("smartIndent",true);n("tabSize",4,(function(t){ma(t);pi(t);Ui(t)}),true);n("lineSeparator",null,(function(t,r){t.doc.lineSep=r;if(!r){return}var n=[],i=t.doc.first;t.doc.iter((function(t){for(var e=0;;){var a=t.text.indexOf(r,e);if(a==-1){break}e=a+r.length;n.push(fr(i,a))}i++}));for(var e=n.length-1;e>=0;e--){ou(t.doc,r,n[e],fr(n[e].line,n[e].ch+r.length))}}));n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test("\t")?"":"|\t"),"g");if(n!=Io){t.refresh()}}));n("specialCharPlaceholder",yn,(function(t){return t.refresh()}),true);n("electricChars",true);n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);n("spellcheck",false,(function(t,r){return t.getInputField().spellcheck=r}),true);n("autocorrect",false,(function(t,r){return t.getInputField().autocorrect=r}),true);n("autocapitalize",false,(function(t,r){return t.getInputField().autocapitalize=r}),true);n("rtlMoveVisually",!k);n("wholeLineUpdateBefore",true);n("theme","default",(function(t){Bo(t);ra(t)}),true);n("keyMap","default",(function(t,r,n){var i=Zu(r);var e=n!=Io&&Zu(n);if(e&&e.detach){e.detach(t,i)}if(i.attach){i.attach(t,e||null)}}));n("extraKeys",null);n("configureMouse",null);n("lineWrapping",false,_o,true);n("gutters",[],(function(t,r){t.display.gutterSpecs=Je(r,t.options.lineNumbers);ra(t)}),true);n("fixedGutter",true,(function(t,r){t.display.gutters.style.left=r?qi(t.display)+"px":"0";t.refresh()}),true);n("coverGutterNextToScrollbar",false,(function(t){return Te(t)}),true);n("scrollbarStyle","native",(function(t){Le(t);Te(t);t.display.scrollbars.setScrollTop(t.doc.scrollTop);t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),true);n("lineNumbers",false,(function(t,r){t.display.gutterSpecs=Je(t.options.gutters,r);ra(t)}),true);n("firstLineNumber",1,ra,true);n("lineNumberFormatter",(function(t){return t}),ra,true);n("showCursorWhenSelecting",false,Wi,true);n("resetSelectionOnContextMenu",true);n("lineWiseCopyCut",true);n("pasteLinesPerSelection",true);n("selectionsMayTouch",false);n("readOnly",false,(function(t,r){if(r=="nocursor"){ne(t);t.display.input.blur()}t.display.input.readOnlyChanged(r)}));n("screenReaderLabel",null,(function(t,r){r=r===""?null:r;t.display.input.screenReaderLabelChanged(r)}));n("disableInput",false,(function(t,r){if(!r){t.display.input.reset()}}),true);n("dragDrop",true,jo);n("allowDropFileTypes",null);n("cursorBlinkRate",530);n("cursorScrollMargin",0);n("cursorHeight",1,Wi,true);n("singleCursorHeightPerLine",true,Wi,true);n("workTime",100);n("workDelay",100);n("flattenSpans",true,ma,true);n("addModeClass",false,ma,true);n("pollInterval",100);n("undoDepth",200,(function(t,r){return t.doc.history.undoDepth=r}));n("historyEventDelay",1250);n("viewportMargin",10,(function(t){return t.refresh()}),true);n("maxHighlightLength",1e4,ma,true);n("moveInputWithCursor",true,(function(t,r){if(!r){t.display.input.resetPosition()}}));n("tabindex",null,(function(t,r){return t.display.input.getField().tabIndex=r||""}));n("autofocus",null);n("direction","ltr",(function(t,r){return t.doc.setDirection(r)}),true);n("phrases",null)}function jo(t,r,n){var i=n&&n!=Io;if(!r!=!i){var e=t.display.dragFunctions;var a=r?wt:kt;a(t.display.scroller,"dragstart",e.start);a(t.display.scroller,"dragenter",e.enter);a(t.display.scroller,"dragover",e.over);a(t.display.scroller,"dragleave",e.leave);a(t.display.scroller,"drop",e.drop)}}function _o(t){if(t.options.lineWrapping){B(t.display.wrapper,"CodeMirror-wrap");t.display.sizer.style.minWidth="";t.display.sizerWidth=null}else{x(t.display.wrapper,"CodeMirror-wrap");hn(t)}Pi(t);Ui(t);pi(t);setTimeout((function(){return Te(t)}),100)}function Uo(t,r){var n=this;if(!(this instanceof Uo)){return new Uo(t,r)}this.options=r=r?H(r):{};H(qo,r,false);var i=r.value;if(typeof i=="string"){i=new xu(i,r.mode,null,r.lineSeparator,r.direction)}else if(r.mode){i.modeOption=r.mode}this.doc=i;var e=new Uo.inputStyles[r.inputStyle](this);var a=this.display=new na(t,i,e,r);a.wrapper.CodeMirror=this;Bo(this);if(r.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}Le(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new V,keySeq:null,specialChars:null};if(r.autofocus&&!m){a.input.focus()}if(u&&o<11){setTimeout((function(){return n.display.input.reset(true)}),20)}Ho(this);Bu();Ce(this);this.curOp.forceUpdate=true;Ta(this,i);if(r.autofocus&&!m||this.hasFocus()){setTimeout((function(){if(n.hasFocus()&&!n.state.focused){re(n)}}),20)}else{ne(this)}for(var f in Fo){if(Fo.hasOwnProperty(f)){Fo[f](this,r[f],Io)}}Xe(this);if(r.finishInit){r.finishInit(this)}for(var c=0;c<zo.length;++c){zo[c](this)}De(this);if(s&&r.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"){a.lineDiv.style.textRendering="auto"}}Uo.defaults=qo;Uo.optionHandlers=Fo;function Ho(t){var r=t.display;wt(r.scroller,"mousedown",qe(t,To));if(u&&o<11){wt(r.scroller,"dblclick",qe(t,(function(r){if(At(t,r)){return}var n=ji(t,r);if(!n||No(t,r)||Zn(t.display,r)){return}Ct(r);var i=t.findWordAt(n);ja(t.doc,i.anchor,i.head)})))}else{wt(r.scroller,"dblclick",(function(r){return At(t,r)||Ct(r)}))}wt(r.scroller,"contextmenu",(function(r){return Mo(t,r)}));wt(r.input.getField(),"contextmenu",(function(n){if(!r.scroller.contains(n.target)){Mo(t,n)}}));var n,i={end:0};function e(){if(r.activeTouch){n=setTimeout((function(){return r.activeTouch=null}),1e3);i=r.activeTouch;i.end=+new Date}}function a(t){if(t.touches.length!=1){return false}var r=t.touches[0];return r.radiusX<=1&&r.radiusY<=1}function s(t,r){if(r.left==null){return true}var n=r.left-t.left,i=r.top-t.top;return n*n+i*i>20*20}wt(r.scroller,"touchstart",(function(e){if(!At(t,e)&&!a(e)&&!No(t,e)){r.input.ensurePolled();clearTimeout(n);var u=+new Date;r.activeTouch={start:u,moved:false,prev:u-i.end<=300?i:null};if(e.touches.length==1){r.activeTouch.left=e.touches[0].pageX;r.activeTouch.top=e.touches[0].pageY}}}));wt(r.scroller,"touchmove",(function(){if(r.activeTouch){r.activeTouch.moved=true}}));wt(r.scroller,"touchend",(function(n){var i=r.activeTouch;if(i&&!Zn(r,n)&&i.left!=null&&!i.moved&&new Date-i.start<300){var a=t.coordsChar(r.activeTouch,"page"),u;if(!i.prev||s(i,i.prev)){u=new fa(a,a)}else if(!i.prev.prev||s(i,i.prev.prev)){u=t.findWordAt(a)}else{u=new fa(fr(a.line,0),gr(t.doc,fr(a.line+1,0)))}t.setSelection(u.anchor,u.head);t.focus();Ct(n)}e()}));wt(r.scroller,"touchcancel",e);wt(r.scroller,"scroll",(function(){if(r.scroller.clientHeight){ge(t,r.scroller.scrollTop);me(t,r.scroller.scrollLeft,true);Tt(t,"scroll",t)}}));wt(r.scroller,"mousewheel",(function(r){return oa(t,r)}));wt(r.scroller,"DOMMouseScroll",(function(r){return oa(t,r)}));wt(r.wrapper,"scroll",(function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}));r.dragFunctions={enter:function(r){if(!At(t,r)){St(r)}},over:function(r){if(!At(t,r)){Su(t,r);St(r)}},start:function(r){return Ou(t,r)},drop:qe(t,Du),leave:function(r){if(!At(t,r)){Nu(t)}}};var f=r.input.getField();wt(f,"keyup",(function(r){return po.call(t,r)}));wt(f,"keydown",qe(t,ho));wt(f,"keypress",qe(t,go));wt(f,"focus",(function(r){return re(t,r)}));wt(f,"blur",(function(r){return ne(t,r)}))}var zo=[];Uo.defineInitHook=function(t){return zo.push(t)};function Vo(t,r,n,i){var e=t.doc,a;if(n==null){n="add"}if(n=="smart"){if(!e.mode.indent){n="prev"}else{a=Ar(t,r).state}}var u=t.options.tabSize;var o=rr(e,r),s=z(o.text,null,u);if(o.stateAfter){o.stateAfter=null}var f=o.text.match(/^\s*/)[0],c;if(!i&&!/\S/.test(o.text)){c=0;n="not"}else if(n=="smart"){c=e.mode.indent(a,o.text.slice(f.length),o.text);if(c==W||c>150){if(!i){return}n="prev"}}if(n=="prev"){if(r>e.first){c=z(rr(e,r-1).text,null,u)}else{c=0}}else if(n=="add"){c=s+t.options.indentUnit}else if(n=="subtract"){c=s-t.options.indentUnit}else if(typeof n=="number"){c=s+n}c=Math.max(0,c);var l="",h=0;if(t.options.indentWithTabs){for(var v=Math.floor(c/u);v;--v){h+=u;l+="\t"}}if(h<c){l+=J(c-h)}if(l!=f){ou(e,l,fr(r,0),fr(r,f.length),"+input");o.stateAfter=null;return true}else{for(var d=0;d<e.sel.ranges.length;d++){var p=e.sel.ranges[d];if(p.head.line==r&&p.head.ch<f.length){var g=fr(r,f.length);Ua(e,d,new fa(g,g));break}}}}var $o=null;function Go(t){$o=t}function Wo(t,r,n,i,e){var a=t.doc;t.display.shift=false;if(!i){i=a.sel}var u=+new Date-200;var o=e=="paste"||t.state.pasteIncoming>u;var s=Pt(r),f=null;if(o&&i.ranges.length>1){if($o&&$o.text.join("\n")==r){if(i.ranges.length%$o.text.length==0){f=[];for(var c=0;c<$o.text.length;c++){f.push(a.splitLines($o.text[c]))}}}else if(s.length==i.ranges.length&&t.options.pasteLinesPerSelection){f=rt(s,(function(t){return[t]}))}}var l=t.curOp.updateInput;for(var h=i.ranges.length-1;h>=0;h--){var v=i.ranges[h];var d=v.from(),p=v.to();if(v.empty()){if(n&&n>0){d=fr(d.line,d.ch-n)}else if(t.state.overwrite&&!o){p=fr(p.line,Math.min(rr(a,p.line).text.length,p.ch+tt(s).length))}else if(o&&$o&&$o.lineWise&&$o.text.join("\n")==s.join("\n")){d=p=fr(d.line,0)}}var g={from:d,to:p,text:f?f[h%f.length]:s,origin:e||(o?"paste":t.state.cutIncoming>u?"cut":"+input")};ru(t.doc,g);Rn(t,"inputRead",t,g)}if(r&&!o){Ko(t,r)}le(t);if(t.curOp.updateInput<2){t.curOp.updateInput=l}t.curOp.typing=true;t.state.pasteIncoming=t.state.cutIncoming=-1}function Zo(t,r){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n){t.preventDefault();if(!r.isReadOnly()&&!r.options.disableInput&&r.hasFocus()){Ie(r,(function(){return Wo(r,n,0,null,"paste")}))}return true}}function Ko(t,r){if(!t.options.electricChars||!t.options.smartIndent){return}var n=t.doc.sel;for(var i=n.ranges.length-1;i>=0;i--){var e=n.ranges[i];if(e.head.ch>100||i&&n.ranges[i-1].head.line==e.head.line){continue}var a=t.getModeAt(e.head);var u=false;if(a.electricChars){for(var o=0;o<a.electricChars.length;o++){if(r.indexOf(a.electricChars.charAt(o))>-1){u=Vo(t,e.head.line,"smart");break}}}else if(a.electricInput){if(a.electricInput.test(rr(t.doc,e.head.line).text.slice(0,e.head.ch))){u=Vo(t,e.head.line,"smart")}}if(u){Rn(t,"electricInput",t,e.head.line)}}}function Yo(t){var r=[],n=[];for(var i=0;i<t.doc.sel.ranges.length;i++){var e=t.doc.sel.ranges[i].head.line;var a={anchor:fr(e,0),head:fr(e+1,0)};n.push(a);r.push(t.getRange(a.anchor,a.head))}return{text:r,ranges:n}}function Qo(t,r,n,i){t.setAttribute("autocorrect",n?"on":"off");t.setAttribute("autocapitalize",i?"on":"off");t.setAttribute("spellcheck",!!r)}function Xo(){var t=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var r=O("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(s){t.style.width="1000px"}else{t.setAttribute("wrap","off")}if(g){t.style.border="1px solid black"}return r}function Jo(t){var r=t.optionHandlers;var n=t.helpers={};t.prototype={constructor:t,focus:function(){_(this).focus();this.display.input.focus()},setOption:function(t,n){var i=this.options,e=i[t];if(i[t]==n&&t!="mode"){return}i[t]=n;if(r.hasOwnProperty(t)){qe(this,r[t])(this,n,e)}Tt(this,"optionChange",this,t)},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,r){this.state.keyMaps[r?"push":"unshift"](Zu(t))},removeKeyMap:function(t){var r=this.state.keyMaps;for(var n=0;n<r.length;++n){if(r[n]==t||r[n].name==t){r.splice(n,1);return true}}},addOverlay:Fe((function(r,n){var i=r.token?r:t.getMode(this.options,r);if(i.startState){throw new Error("Overlays may not be stateful.")}nt(this.state.overlays,{mode:i,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority}));this.state.modeGen++;Ui(this)})),removeOverlay:Fe((function(t){var r=this.state.overlays;for(var n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==t||typeof t=="string"&&i.name==t){r.splice(n,1);this.state.modeGen++;Ui(this);return}}})),indentLine:Fe((function(t,r,n){if(typeof r!="string"&&typeof r!="number"){if(r==null){r=this.options.smartIndent?"smart":"prev"}else{r=r?"add":"subtract"}}if(or(this.doc,t)){Vo(this,t,r,n)}})),indentSelection:Fe((function(t){var r=this.doc.sel.ranges,n=-1;for(var i=0;i<r.length;i++){var e=r[i];if(!e.empty()){var a=e.from(),u=e.to();var o=Math.max(n,a.line);n=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var s=o;s<n;++s){Vo(this,s,t)}var f=this.doc.sel.ranges;if(a.ch==0&&r.length==f.length&&f[i].from().ch>0){Ua(this.doc,i,new fa(a,f[i].to()),Z)}}else if(e.head.line>n){Vo(this,e.head.line,t,true);n=e.head.line;if(i==this.doc.sel.primIndex){le(this)}}}})),getTokenAt:function(t,r){return Dr(this,t,r)},getLineTokens:function(t,r){return Dr(this,fr(t),r,true)},getTokenTypeAt:function(t){t=gr(this.doc,t);var r=Tr(this,rr(this.doc,t.line));var n=0,i=(r.length-1)/2,e=t.ch;var a;if(e==0){a=r[2]}else{for(;;){var u=n+i>>1;if((u?r[u*2-1]:0)>=e){i=u}else if(r[u*2+1]<e){n=u+1}else{a=r[u*2+2];break}}}var o=a?a.indexOf("overlay "):-1;return o<0?a:o==0?null:a.slice(0,o-1)},getModeAt:function(r){var n=this.doc.mode;if(!n.innerMode){return n}return t.innerMode(n,this.getTokenAt(r).state).mode},getHelper:function(t,r){return this.getHelpers(t,r)[0]},getHelpers:function(t,r){var i=[];if(!n.hasOwnProperty(r)){return i}var e=n[r],a=this.getModeAt(t);if(typeof a[r]=="string"){if(e[a[r]]){i.push(e[a[r]])}}else if(a[r]){for(var u=0;u<a[r].length;u++){var o=e[a[r][u]];if(o){i.push(o)}}}else if(a.helperType&&e[a.helperType]){i.push(e[a.helperType])}else if(e[a.name]){i.push(e[a.name])}for(var s=0;s<e._global.length;s++){var f=e._global[s];if(f.pred(a,this)&&$(i,f.val)==-1){i.push(f.val)}}return i},getStateAfter:function(t,r){var n=this.doc;t=pr(n,t==null?n.first+n.size-1:t);return Ar(this,t+1,r).state},cursorCoords:function(t,r){var n,i=this.doc.sel.primary();if(t==null){n=i.head}else if(typeof t=="object"){n=gr(this.doc,t)}else{n=t?i.from():i.to()}return Ti(this,n,r||"page")},charCoords:function(t,r){return ki(this,gr(this.doc,t),r||"page")},coordsChar:function(t,r){t=yi(this,t,r||"page");return Li(this,t.left,t.top)},lineAtHeight:function(t,r){t=yi(this,{top:t,left:0},r||"page").top;return ur(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,r,n){var i=false,e;if(typeof t=="number"){var a=this.doc.first+this.doc.size-1;if(t<this.doc.first){t=this.doc.first}else if(t>a){t=a;i=true}e=rr(this.doc,t)}else{e=t}return wi(this,e,{top:0,left:0},r||"page",n||i).top+(i?this.doc.height-cn(e):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,r,n,i,e){var a=this.display;t=Ti(this,gr(this.doc,t));var u=t.bottom,o=t.left;r.style.position="absolute";r.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(r);a.sizer.appendChild(r);if(i=="over"){u=t.top}else if(i=="above"||i=="near"){var s=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);if((i=="above"||t.bottom+r.offsetHeight>s)&&t.top>r.offsetHeight){u=t.top-r.offsetHeight}else if(t.bottom+r.offsetHeight<=s){u=t.bottom}if(o+r.offsetWidth>f){o=f-r.offsetWidth}}r.style.top=u+"px";r.style.left=r.style.right="";if(e=="right"){o=a.sizer.clientWidth-r.offsetWidth;r.style.right="0px"}else{if(e=="left"){o=0}else if(e=="middle"){o=(a.sizer.clientWidth-r.offsetWidth)/2}r.style.left=o+"px"}if(n){se(this,{left:o,top:u,right:o+r.offsetWidth,bottom:u+r.offsetHeight})}},triggerOnKeyDown:Fe(ho),triggerOnKeyPress:Fe(go),triggerOnKeyUp:po,triggerOnMouseDown:Fe(To),execCommand:function(t){if(to.hasOwnProperty(t)){return to[t].call(null,this)}},triggerElectric:Fe((function(t){Ko(this,t)})),findPosH:function(t,r,n,i){var e=1;if(r<0){e=-1;r=-r}var a=gr(this.doc,t);for(var u=0;u<r;++u){a=ts(this.doc,a,e,n,i);if(a.hitSide){break}}return a},moveH:Fe((function(t,r){var n=this;this.extendSelectionsBy((function(i){if(n.display.shift||n.doc.extend||i.empty()){return ts(n.doc,i.head,t,r,n.options.rtlMoveVisually)}else{return t<0?i.from():i.to()}}),Y)})),deleteH:Fe((function(t,r){var n=this.doc.sel,i=this.doc;if(n.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Ku(this,(function(n){var e=ts(i,n.head,t,r,false);return t<0?{from:e,to:n.head}:{from:n.head,to:e}}))}})),findPosV:function(t,r,n,i){var e=1,a=i;if(r<0){e=-1;r=-r}var u=gr(this.doc,t);for(var o=0;o<r;++o){var s=Ti(this,u,"div");if(a==null){a=s.left}else{s.left=a}u=rs(this,s,e,n);if(u.hitSide){break}}return u},moveV:Fe((function(t,r){var n=this;var i=this.doc,e=[];var a=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy((function(u){if(a){return t<0?u.from():u.to()}var o=Ti(n,u.head,"div");if(u.goalColumn!=null){o.left=u.goalColumn}e.push(o.left);var s=rs(n,o,t,r);if(r=="page"&&u==i.sel.primary()){ce(n,ki(n,s,"div").top-o.top)}return s}),Y);if(e.length){for(var u=0;u<i.sel.ranges.length;u++){i.sel.ranges[u].goalColumn=e[u]}}})),findWordAt:function(t){var r=this.doc,n=rr(r,t.line).text;var i=t.ch,e=t.ch;if(n){var a=this.getHelper(t,"wordChars");if((t.sticky=="before"||e==n.length)&&i){--i}else{++e}var u=n.charAt(i);var o=ot(u,a)?function(t){return ot(t,a)}:/\s/.test(u)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!ot(t)};while(i>0&&o(n.charAt(i-1))){--i}while(e<n.length&&o(n.charAt(e))){++e}}return new fa(fr(t.line,i),fr(t.line,e))},toggleOverwrite:function(t){if(t!=null&&t==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){B(this.display.cursorDiv,"CodeMirror-overwrite")}else{x(this.display.cursorDiv,"CodeMirror-overwrite")}Tt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==R(P(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Fe((function(t,r){he(this,t,r)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Xn(this)-this.display.barHeight,width:t.scrollWidth-Xn(this)-this.display.barWidth,clientHeight:ti(this),clientWidth:Jn(this)}},scrollIntoView:Fe((function(t,r){if(t==null){t={from:this.doc.sel.primary().head,to:null};if(r==null){r=this.options.cursorScrollMargin}}else if(typeof t=="number"){t={from:fr(t,0),to:null}}else if(t.from==null){t={from:t,to:null}}if(!t.to){t.to=t.from}t.margin=r||0;if(t.from.line!=null){ve(this,t)}else{pe(this,t.from,t.to,t.margin)}})),setSize:Fe((function(t,r){var n=this;var i=function(t){return typeof t=="number"||/^\d+$/.test(String(t))?t+"px":t};if(t!=null){this.display.wrapper.style.width=i(t)}if(r!=null){this.display.wrapper.style.height=i(r)}if(this.options.lineWrapping){di(this)}var e=this.display.viewFrom;this.doc.iter(e,this.display.viewTo,(function(t){if(t.widgets){for(var r=0;r<t.widgets.length;r++){if(t.widgets[r].noHScroll){Hi(n,e,"widget");break}}}++e}));this.curOp.forceUpdate=true;Tt(this,"refresh",this)})),operation:function(t){return Ie(this,t)},startOperation:function(){return Ce(this)},endOperation:function(){return De(this)},refresh:Fe((function(){var t=this.display.cachedTextHeight;Ui(this);this.curOp.forceUpdate=true;pi(this);he(this,this.doc.scrollLeft,this.doc.scrollTop);Ke(this.display);if(t==null||Math.abs(t-Ri(this.display))>.5||this.options.lineWrapping){Pi(this)}Tt(this,"refresh",this)})),swapDoc:Fe((function(t){var r=this.doc;r.cm=null;if(this.state.selectingText){this.state.selectingText()}Ta(this,t);pi(this);this.display.input.reset();he(this,t.scrollLeft,t.scrollTop);this.curOp.forceScroll=true;Rn(this,"swapDoc",this,r);return r})),phrase:function(t){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};xt(t);t.registerHelper=function(r,i,e){if(!n.hasOwnProperty(r)){n[r]=t[r]={_global:[]}}n[r][i]=e};t.registerGlobalHelper=function(r,i,e,a){t.registerHelper(r,i,a);n[r]._global.push({pred:e,val:a})}}function ts(t,r,n,i,e){var a=r;var u=n;var o=rr(t,r.line);var s=e&&t.direction=="rtl"?-n:n;function f(){var n=r.line+s;if(n<t.first||n>=t.first+t.size){return false}r=new fr(n,r.ch,r.sticky);return o=rr(t,n)}function c(a){var u;if(i=="codepoint"){var c=o.text.charCodeAt(r.ch+(n>0?0:-1));if(isNaN(c)){u=null}else{var l=n>0?c>=55296&&c<56320:c>=56320&&c<57343;u=new fr(r.line,Math.max(0,Math.min(o.text.length,r.ch+n*(l?2:1))),-n)}}else if(e){u=Ju(t.cm,o,r,n)}else{u=Qu(o,r,n)}if(u==null){if(!a&&f()){r=Xu(e,t.cm,o,r.line,s)}else{return false}}else{r=u}return true}if(i=="char"||i=="codepoint"){c()}else if(i=="column"){c(true)}else if(i=="word"||i=="group"){var l=null,h=i=="group";var v=t.cm&&t.cm.getHelper(r,"wordChars");for(var d=true;;d=false){if(n<0&&!c(!d)){break}var p=o.text.charAt(r.ch)||"\n";var g=ot(p,v)?"w":h&&p=="\n"?"n":!h||/\s/.test(p)?null:"p";if(h&&!d&&!g){g="s"}if(l&&l!=g){if(n<0){n=1;c();r.sticky="after"}break}if(g){l=g}if(n>0&&!c(!d)){break}}}var b=Qa(t,r,a,u,true);if(lr(a,b)){b.hitSide=true}return b}function rs(t,r,n,i){var e=t.doc,a=r.left,u;if(i=="page"){var o=Math.min(t.display.wrapper.clientHeight,_(t).innerHeight||e(t).documentElement.clientHeight);var s=Math.max(o-.5*Ri(t.display),3);u=(n>0?r.bottom:r.top)+n*s}else if(i=="line"){u=n>0?r.bottom+3:r.top-3}var f;for(;;){f=Li(t,a,u);if(!f.outside){break}if(n<0?u<=0:u>=e.height){f.hitSide=true;break}u+=n*5}return f}var ns=function(t){this.cm=t;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new V;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};ns.prototype.init=function(t){var r=this;var n=this,i=n.cm;var e=n.div=t.lineDiv;e.contentEditable=true;Qo(e,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function a(t){for(var r=t.target;r;r=r.parentNode){if(r==e){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(r.className)){break}}return false}wt(e,"paste",(function(t){if(!a(t)||At(i,t)||Zo(t,i)){return}if(o<=11){setTimeout(qe(i,(function(){return r.updateFromDOM()})),20)}}));wt(e,"compositionstart",(function(t){r.composing={data:t.data,done:false}}));wt(e,"compositionupdate",(function(t){if(!r.composing){r.composing={data:t.data,done:false}}}));wt(e,"compositionend",(function(t){if(r.composing){if(t.data!=r.composing.data){r.readFromDOMSoon()}r.composing.done=true}}));wt(e,"touchstart",(function(){return n.forceCompositionEnd()}));wt(e,"input",(function(){if(!r.composing){r.readFromDOMSoon()}}));function u(t){if(!a(t)||At(i,t)){return}if(i.somethingSelected()){Go({lineWise:false,text:i.getSelections()});if(t.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var r=Yo(i);Go({lineWise:true,text:r.text});if(t.type=="cut"){i.operation((function(){i.setSelections(r.ranges,0,Z);i.replaceSelection("",null,"cut")}))}}if(t.clipboardData){t.clipboardData.clearData();var u=$o.text.join("\n");t.clipboardData.setData("Text",u);if(t.clipboardData.getData("Text")==u){t.preventDefault();return}}var o=Xo(),s=o.firstChild;Qo(s);i.display.lineSpace.insertBefore(o,i.display.lineSpace.firstChild);s.value=$o.text.join("\n");var f=R(j(e));q(s);setTimeout((function(){i.display.lineSpace.removeChild(o);f.focus();if(f==e){n.showPrimarySelection()}}),50)}wt(e,"copy",u);wt(e,"cut",u)};ns.prototype.screenReaderLabelChanged=function(t){if(t){this.div.setAttribute("aria-label",t)}else{this.div.removeAttribute("aria-label")}};ns.prototype.prepareSelection=function(){var t=Zi(this.cm,false);t.focus=R(j(this.div))==this.div;return t};ns.prototype.showSelection=function(t,r){if(!t||!this.cm.display.view.length){return}if(t.focus||r){this.showPrimarySelection()}this.showMultipleSelections(t)};ns.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ns.prototype.showPrimarySelection=function(){var t=this.getSelection(),r=this.cm,i=r.doc.sel.primary();var e=i.from(),a=i.to();if(r.display.viewTo==r.display.viewFrom||e.line>=r.display.viewTo||a.line<r.display.viewFrom){t.removeAllRanges();return}var u=os(r,t.anchorNode,t.anchorOffset);var o=os(r,t.focusNode,t.focusOffset);if(u&&!u.bad&&o&&!o.bad&&cr(dr(u,o),e)==0&&cr(vr(u,o),a)==0){return}var s=r.display.view;var f=e.line>=r.display.viewFrom&&is(r,e)||{node:s[0].measure.map[2],offset:0};var c=a.line<r.display.viewTo&&is(r,a);if(!c){var l=s[s.length-1].measure;var h=l.maps?l.maps[l.maps.length-1]:l.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!f||!c){t.removeAllRanges();return}var v=t.rangeCount&&t.getRangeAt(0),d;try{d=N(f.node,f.offset,c.offset,c.node)}catch(t){}if(d){if(!n&&r.state.focused){t.collapse(f.node,f.offset);if(!d.collapsed){t.removeAllRanges();t.addRange(d)}}else{t.removeAllRanges();t.addRange(d)}if(v&&t.anchorNode==null){t.addRange(v)}else if(n){this.startGracePeriod()}}this.rememberSelection()};ns.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout((function(){t.gracePeriod=false;if(t.selectionChanged()){t.cm.operation((function(){return t.cm.curOp.selectionChanged=true}))}}),20)};ns.prototype.showMultipleSelections=function(t){D(this.cm.display.cursorDiv,t.cursors);D(this.cm.display.selectionDiv,t.selection)};ns.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode;this.lastAnchorOffset=t.anchorOffset;this.lastFocusNode=t.focusNode;this.lastFocusOffset=t.focusOffset};ns.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount){return false}var r=t.getRangeAt(0).commonAncestorContainer;return M(this.div,r)};ns.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||R(j(this.div))!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};ns.prototype.blur=function(){this.div.blur()};ns.prototype.getField=function(){return this.div};ns.prototype.supportsTouch=function(){return true};ns.prototype.receivedFocus=function(){var t=this;var r=this;if(this.selectionInEditor()){setTimeout((function(){return t.pollSelection()}),20)}else{Ie(this.cm,(function(){return r.cm.curOp.selectionChanged=true}))}function n(){if(r.cm.state.focused){r.pollSelection();r.polling.set(r.cm.options.pollInterval,n)}}this.polling.set(this.cm.options.pollInterval,n)};ns.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset};ns.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var t=this.getSelection(),r=this.cm;if(b&&c&&this.cm.display.gutterSpecs.length&&es(t.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var n=os(r,t.anchorNode,t.anchorOffset);var i=os(r,t.focusNode,t.focusOffset);if(n&&i){Ie(r,(function(){$a(r.doc,la(n,i),Z);if(n.bad||i.bad){r.curOp.selectionChanged=true}}))}};ns.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var t=this.cm,r=t.display,n=t.doc.sel.primary();var i=n.from(),e=n.to();if(i.ch==0&&i.line>t.firstLine()){i=fr(i.line-1,rr(t.doc,i.line-1).length)}if(e.ch==rr(t.doc,e.line).text.length&&e.line<t.lastLine()){e=fr(e.line+1,0)}if(i.line<r.viewFrom||e.line>r.viewTo-1){return false}var a,u,o;if(i.line==r.viewFrom||(a=_i(t,i.line))==0){u=ar(r.view[0].line);o=r.view[0].node}else{u=ar(r.view[a].line);o=r.view[a-1].node.nextSibling}var s=_i(t,e.line);var f,c;if(s==r.view.length-1){f=r.viewTo-1;c=r.lineDiv.lastChild}else{f=ar(r.view[s+1].line)-1;c=r.view[s+1].node.previousSibling}if(!o){return false}var l=t.doc.splitLines(us(t,o,c,u,f));var h=nr(t.doc,fr(u,0),fr(f,rr(t.doc,f).text.length));while(l.length>1&&h.length>1){if(tt(l)==tt(h)){l.pop();h.pop();f--}else if(l[0]==h[0]){l.shift();h.shift();u++}else{break}}var v=0,d=0;var p=l[0],g=h[0],b=Math.min(p.length,g.length);while(v<b&&p.charCodeAt(v)==g.charCodeAt(v)){++v}var m=tt(l),w=tt(h);var y=Math.min(m.length-(l.length==1?v:0),w.length-(h.length==1?v:0));while(d<y&&m.charCodeAt(m.length-d-1)==w.charCodeAt(w.length-d-1)){++d}if(l.length==1&&h.length==1&&u==i.line){while(v&&v>i.ch&&m.charCodeAt(m.length-d-1)==w.charCodeAt(w.length-d-1)){v--;d++}}l[l.length-1]=m.slice(0,m.length-d).replace(/^\u200b+/,"");l[0]=l[0].slice(v).replace(/\u200b+$/,"");var k=fr(u,v);var T=fr(f,h.length?tt(h).length-d:0);if(l.length>1||l[0]||cr(k,T)){ou(t.doc,l,k,T,"+input");return true}};ns.prototype.ensurePolled=function(){this.forceCompositionEnd()};ns.prototype.reset=function(){this.forceCompositionEnd()};ns.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};ns.prototype.readFromDOMSoon=function(){var t=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout((function(){t.readDOMTimeout=null;if(t.composing){if(t.composing.done){t.composing=null}else{return}}t.updateFromDOM()}),80)};ns.prototype.updateFromDOM=function(){var t=this;if(this.cm.isReadOnly()||!this.pollContent()){Ie(this.cm,(function(){return Ui(t.cm)}))}};ns.prototype.setUneditable=function(t){t.contentEditable="false"};ns.prototype.onKeyPress=function(t){if(t.charCode==0||this.composing){return}t.preventDefault();if(!this.cm.isReadOnly()){qe(this.cm,Wo)(this.cm,String.fromCharCode(t.charCode==null?t.keyCode:t.charCode),0)}};ns.prototype.readOnlyChanged=function(t){this.div.contentEditable=String(t!="nocursor")};ns.prototype.onContextMenu=function(){};ns.prototype.resetPosition=function(){};ns.prototype.needsContentAttribute=true;function is(t,r){var n=ai(t,r.line);if(!n||n.hidden){return null}var i=rr(t.doc,r.line);var e=ni(n,i,r.line);var a=bt(i,t.doc.direction),u="left";if(a){var o=pt(a,r.ch);u=o%2?"right":"left"}var s=fi(e.map,r.ch,u);s.offset=s.collapse=="right"?s.end:s.start;return s}function es(t){for(var r=t;r;r=r.parentNode){if(/CodeMirror-gutter-wrapper/.test(r.className)){return true}}return false}function as(t,r){if(r){t.bad=true}return t}function us(t,r,n,i,e){var a="",u=false,o=t.doc.lineSeparator(),s=false;function f(t){return function(r){return r.id==t}}function c(){if(u){a+=o;if(s){a+=o}u=s=false}}function l(t){if(t){c();a+=t}}function h(r){if(r.nodeType==1){var n=r.getAttribute("cm-text");if(n){l(n);return}var a=r.getAttribute("cm-marker"),v;if(a){var d=t.findMarks(fr(i,0),fr(e+1,0),f(+a));if(d.length&&(v=d[0].find(0))){l(nr(t.doc,v.from,v.to).join(o))}return}if(r.getAttribute("contenteditable")=="false"){return}var p=/^(pre|div|p|li|table|br)$/i.test(r.nodeName);if(!/^br$/i.test(r.nodeName)&&r.textContent.length==0){return}if(p){c()}for(var g=0;g<r.childNodes.length;g++){h(r.childNodes[g])}if(/^(pre|p)$/i.test(r.nodeName)){s=true}if(p){u=true}}else if(r.nodeType==3){l(r.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){h(r);if(r==n){break}r=r.nextSibling;s=false}return a}function os(t,r,n){var i;if(r==t.display.lineDiv){i=t.display.lineDiv.childNodes[n];if(!i){return as(t.clipPos(fr(t.display.viewTo-1)),true)}r=null;n=0}else{for(i=r;;i=i.parentNode){if(!i||i==t.display.lineDiv){return null}if(i.parentNode&&i.parentNode==t.display.lineDiv){break}}}for(var e=0;e<t.display.view.length;e++){var a=t.display.view[e];if(a.node==i){return ss(a,r,n)}}}function ss(t,r,n){var i=t.text.firstChild,e=false;if(!r||!M(i,r)){return as(fr(ar(t.line),0),true)}if(r==i){e=true;r=i.childNodes[n];n=0;if(!r){var a=t.rest?tt(t.rest):t.line;return as(fr(ar(a),a.text.length),e)}}var u=r.nodeType==3?r:null,o=r;if(!u&&r.childNodes.length==1&&r.firstChild.nodeType==3){u=r.firstChild;if(n){n=u.nodeValue.length}}while(o.parentNode!=i){o=o.parentNode}var s=t.measure,f=s.maps;function c(r,n,i){for(var e=-1;e<(f?f.length:0);e++){var a=e<0?s.map:f[e];for(var u=0;u<a.length;u+=3){var o=a[u+2];if(o==r||o==n){var c=ar(e<0?t.line:t.rest[e]);var l=a[u]+i;if(i<0||o!=r){l=a[u+(i?1:0)]}return fr(c,l)}}}}var l=c(u,o,n);if(l){return as(l,e)}for(var h=o.nextSibling,v=u?u.nodeValue.length-n:0;h;h=h.nextSibling){l=c(h,h.firstChild,0);if(l){return as(fr(l.line,l.ch-v),e)}else{v+=h.textContent.length}}for(var d=o.previousSibling,p=n;d;d=d.previousSibling){l=c(d,d.firstChild,-1);if(l){return as(fr(l.line,l.ch+p),e)}else{p+=d.textContent.length}}}var fs=function(t){this.cm=t;this.prevInput="";this.pollingFast=false;this.polling=new V;this.hasSelection=false;this.composing=null;this.resetting=false};fs.prototype.init=function(t){var r=this;var n=this,i=this.cm;this.createField(t);var e=this.textarea;t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild);if(g){e.style.width="0px"}wt(e,"input",(function(){if(u&&o>=9&&r.hasSelection){r.hasSelection=null}n.poll()}));wt(e,"paste",(function(t){if(At(i,t)||Zo(t,i)){return}i.state.pasteIncoming=+new Date;n.fastPoll()}));function a(t){if(At(i,t)){return}if(i.somethingSelected()){Go({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var r=Yo(i);Go({lineWise:true,text:r.text});if(t.type=="cut"){i.setSelections(r.ranges,null,Z)}else{n.prevInput="";e.value=r.text.join("\n");q(e)}}if(t.type=="cut"){i.state.cutIncoming=+new Date}}wt(e,"cut",a);wt(e,"copy",a);wt(t.scroller,"paste",(function(r){if(Zn(t,r)||At(i,r)){return}if(!e.dispatchEvent){i.state.pasteIncoming=+new Date;n.focus();return}var a=new Event("paste");a.clipboardData=r.clipboardData;e.dispatchEvent(a)}));wt(t.lineSpace,"selectstart",(function(r){if(!Zn(t,r)){Ct(r)}}));wt(e,"compositionstart",(function(){var t=i.getCursor("from");if(n.composing){n.composing.range.clear()}n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}));wt(e,"compositionend",(function(){if(n.composing){n.poll();n.composing.range.clear();n.composing=null}}))};fs.prototype.createField=function(t){this.wrapper=Xo();this.textarea=this.wrapper.firstChild;var r=this.cm.options;Qo(this.textarea,r.spellcheck,r.autocorrect,r.autocapitalize)};fs.prototype.screenReaderLabelChanged=function(t){if(t){this.textarea.setAttribute("aria-label",t)}else{this.textarea.removeAttribute("aria-label")}};fs.prototype.prepareSelection=function(){var t=this.cm,r=t.display,n=t.doc;var i=Zi(t);if(t.options.moveInputWithCursor){var e=Ti(t,n.sel.primary().head,"div");var a=r.wrapper.getBoundingClientRect(),u=r.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,e.top+u.top-a.top));i.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,e.left+u.left-a.left))}return i};fs.prototype.showSelection=function(t){var r=this.cm,n=r.display;D(n.cursorDiv,t.cursors);D(n.selectionDiv,t.selection);if(t.teTop!=null){this.wrapper.style.top=t.teTop+"px";this.wrapper.style.left=t.teLeft+"px"}};fs.prototype.reset=function(t){if(this.contextMenuPending||this.composing&&t){return}var r=this.cm;this.resetting=true;if(r.somethingSelected()){this.prevInput="";var n=r.getSelection();this.textarea.value=n;if(r.state.focused){q(this.textarea)}if(u&&o>=9){this.hasSelection=n}}else if(!t){this.prevInput=this.textarea.value="";if(u&&o>=9){this.hasSelection=null}}this.resetting=false};fs.prototype.getField=function(){return this.textarea};fs.prototype.supportsTouch=function(){return false};fs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!m||R(j(this.textarea))!=this.textarea)){try{this.textarea.focus()}catch(t){}}};fs.prototype.blur=function(){this.textarea.blur()};fs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};fs.prototype.receivedFocus=function(){this.slowPoll()};fs.prototype.slowPoll=function(){var t=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,(function(){t.poll();if(t.cm.state.focused){t.slowPoll()}}))};fs.prototype.fastPoll=function(){var t=false,r=this;r.pollingFast=true;function n(){var i=r.poll();if(!i&&!t){t=true;r.polling.set(60,n)}else{r.pollingFast=false;r.slowPoll()}}r.polling.set(20,n)};fs.prototype.poll=function(){var t=this;var r=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!r.state.focused||jt(n)&&!i&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq){return false}var e=n.value;if(e==i&&!r.somethingSelected()){return false}if(u&&o>=9&&this.hasSelection===e||w&&/[\uf700-\uf7ff]/.test(e)){r.display.input.reset();return false}if(r.doc.sel==r.display.selForContextMenu){var a=e.charCodeAt(0);if(a==8203&&!i){i=""}if(a==8666){this.reset();return this.cm.execCommand("undo")}}var s=0,f=Math.min(i.length,e.length);while(s<f&&i.charCodeAt(s)==e.charCodeAt(s)){++s}Ie(r,(function(){Wo(r,e.slice(s),i.length-s,null,t.composing?"*compose":null);if(e.length>1e3||e.indexOf("\n")>-1){n.value=t.prevInput=""}else{t.prevInput=e}if(t.composing){t.composing.range.clear();t.composing.range=r.markText(t.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};fs.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};fs.prototype.onKeyPress=function(){if(u&&o>=9){this.hasSelection=null}this.fastPoll()};fs.prototype.onContextMenu=function(t){var r=this,n=r.cm,i=n.display,e=r.textarea;if(r.contextMenuPending){r.contextMenuPending()}var a=ji(n,t),f=i.scroller.scrollTop;if(!a||h){return}var c=n.options.resetSelectionOnContextMenu;if(c&&n.doc.sel.contains(a)==-1){qe(n,$a)(n.doc,la(a),Z)}var l=e.style.cssText,v=r.wrapper.style.cssText;var d=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static";e.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(u?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var p;if(s){p=e.ownerDocument.defaultView.scrollY}i.input.focus();if(s){e.ownerDocument.defaultView.scrollTo(null,p)}i.input.reset();if(!n.somethingSelected()){e.value=r.prevInput=" "}r.contextMenuPending=b;i.selForContextMenu=n.doc.sel;clearTimeout(i.detectingSelectAll);function g(){if(e.selectionStart!=null){var t=n.somethingSelected();var a=""+(t?e.value:"");e.value="⇚";e.value=a;r.prevInput=t?"":"";e.selectionStart=1;e.selectionEnd=a.length;i.selForContextMenu=n.doc.sel}}function b(){if(r.contextMenuPending!=b){return}r.contextMenuPending=false;r.wrapper.style.cssText=v;e.style.cssText=l;if(u&&o<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=f)}if(e.selectionStart!=null){if(!u||u&&o<9){g()}var t=0,a=function(){if(i.selForContextMenu==n.doc.sel&&e.selectionStart==0&&e.selectionEnd>0&&r.prevInput==""){qe(n,Ja)(n)}else if(t++<10){i.detectingSelectAll=setTimeout(a,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(a,200)}}if(u&&o>=9){g()}if(E){St(t);var m=function(){kt(window,"mouseup",m);setTimeout(b,20)};wt(window,"mouseup",m)}else{setTimeout(b,50)}};fs.prototype.readOnlyChanged=function(t){if(!t){this.reset()}this.textarea.disabled=t=="nocursor";this.textarea.readOnly=!!t};fs.prototype.setUneditable=function(){};fs.prototype.needsContentAttribute=false;function cs(t,r){r=r?H(r):{};r.value=t.value;if(!r.tabindex&&t.tabIndex){r.tabindex=t.tabIndex}if(!r.placeholder&&t.placeholder){r.placeholder=t.placeholder}if(r.autofocus==null){var n=R(j(t));r.autofocus=n==t||t.getAttribute("autofocus")!=null&&n==document.body}function i(){t.value=o.getValue()}var e;if(t.form){wt(t.form,"submit",i);if(!r.leaveSubmitMethodAlone){var a=t.form;e=a.submit;try{var u=a.submit=function(){i();a.submit=e;a.submit();a.submit=u}}catch(t){}}}r.finishInit=function(n){n.save=i;n.getTextArea=function(){return t};n.toTextArea=function(){n.toTextArea=isNaN;i();t.parentNode.removeChild(n.getWrapperElement());t.style.display="";if(t.form){kt(t.form,"submit",i);if(!r.leaveSubmitMethodAlone&&typeof t.form.submit=="function"){t.form.submit=e}}}};t.style.display="none";var o=Uo((function(r){return t.parentNode.insertBefore(r,t.nextSibling)}),r);return o}function ls(t){t.off=kt;t.on=wt;t.wheelEventPixels=ua;t.Doc=xu;t.splitLines=Pt;t.countColumn=z;t.findColumn=Q;t.isWordChar=ut;t.Pass=W;t.signal=Tt;t.Line=vn;t.changeEnd=ha;t.scrollbarModel=Ee;t.Pos=fr;t.cmpPos=cr;t.modes=zt;t.mimeModes=Vt;t.resolveMode=Wt;t.getMode=Zt;t.modeExtensions=Kt;t.extendMode=Yt;t.copyState=Qt;t.startState=Jt;t.innerMode=Xt;t.commands=to;t.keyMap=Uu;t.keyName=Wu;t.isModifierKey=$u;t.lookupKey=Vu;t.normalizeKeyMap=zu;t.StringStream=tr;t.SharedTextMarker=yu;t.TextMarker=mu;t.LineWidget=du;t.e_preventDefault=Ct;t.e_stopPropagation=Dt;t.e_stop=St;t.addClass=B;t.contains=M;t.rmClass=x;t.keyNames=Fu}Po(Uo);Jo(Uo);var hs="iter insert remove copy getEditor constructor".split(" ");for(var vs in xu.prototype){if(xu.prototype.hasOwnProperty(vs)&&$(hs,vs)<0){Uo.prototype[vs]=function(t){return function(){return t.apply(this.doc,arguments)}}(xu.prototype[vs])}}xt(xu);Uo.inputStyles={textarea:fs,contenteditable:ns};Uo.defineMode=function(t){if(!Uo.defaults.mode&&t!="null"){Uo.defaults.mode=t}$t.apply(this,arguments)};Uo.defineMIME=Gt;Uo.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}}));Uo.defineMIME("text/plain","null");Uo.defineExtension=function(t,r){Uo.prototype[t]=r};Uo.defineDocExtension=function(t,r){xu.prototype[t]=r};Uo.fromTextArea=cs;ls(Uo);Uo.version="5.65.17";return Uo}))})(v);
|
|
2
2
|
/*!
|
|
3
3
|
* @toast-ui/editor
|
|
4
4
|
* @version 2.5.4 | Tue Nov 30 2021
|
|
@@ -51,4 +51,4 @@ var i;if(Object.defineProperty(r,"__esModule",{value:!0}),String.fromCodePoint)i
|
|
|
51
51
|
* @version 1.0.1 | Tue Apr 13 2021
|
|
52
52
|
*/
|
|
53
53
|
(function r(n,i){t.exports=i()})(window,(function(){return function(t){var r={};function n(i){if(r[i]){return r[i].exports}var e=r[i]={i,l:false,exports:{}};t[i].call(e.exports,e,e.exports,n);e.l=true;return e.exports}n.m=t;n.c=r;n.d=function(t,r,i){if(!n.o(t,r)){Object.defineProperty(t,r,{enumerable:true,get:i})}};n.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};n.t=function(t,r){if(r&1)t=n(t);if(r&8)return t;if(r&4&&typeof t==="object"&&t&&t.__esModule)return t;var i=Object.create(null);n.r(i);Object.defineProperty(i,"default",{enumerable:true,value:t});if(r&2&&typeof t!="string")for(var e in t)n.d(i,e,function(r){return t[r]}.bind(null,e));return i};n.n=function(t){var r=t&&t.__esModule?function r(){return t["default"]}:function r(){return t};n.d(r,"a",r);return r};n.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)};n.p="";return n(n.s=0)}([function(t,r,n){n.r(r);function i(t,r,n){if(r in t){Object.defineProperty(t,r,{value:n,enumerable:true,configurable:true,writable:true})}else{t[r]=n}return t}var e={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3};var a=function(){function t(t){this._normalizeTextChildren(t);this._root=t;this._current=t}var r=t.prototype;r.next=function t(){var r=this._current;var n;if(this._current){n=this._getNextNode(r);while(this._isNeedNextSearch(n,r)){r=r.parentNode;n=r.nextSibling}this._current=n}return this._current};r.getNode=function t(){this._normalizeTextChildren(this._current);return this._current};r._normalizeTextChildren=function t(r){if(!r||r.childNodes.length<2){return}var n=r.firstChild;var i;while(n.nextSibling){i=n.nextSibling;if(n.nodeType===e.TEXT_NODE&&i.nodeType===e.TEXT_NODE){n.nodeValue+=i.nodeValue;r.removeChild(i)}else{n=i}}};r.getNodeText=function t(){var r=this.getNode();var n;if(r.nodeType===e.TEXT_NODE){n=r.nodeValue}else{n=r.textContent||r.innerText}return n};r._isNeedNextSearch=function t(r,n){return!r&&n!==this._root&&n.parentNode!==this._root};r._getNextNode=function t(r){return r.firstChild||r.nextSibling};return t}();i(a,"NODE_TYPE",e);var u=/^[\s\r\n\t]+|[\s\r\n\t]+$/g;var o=/>[\r\n\t]+</g;var s=/>[ ]+</g;function f(t){var r;if(Object.prototype.toString.call(t)==="[object String]"){r=document.createElement("div");r.innerHTML=c(t)}else{r=t}r.__htmlRootByToMark=true;return r}function c(t){t=t.replace(u,"");t=t.replace(o,"><");t=t.replace(s,"> <");return t}f.preProcess=c;function l(t,r,n){if(r in t){Object.defineProperty(t,r,{value:n,enumerable:true,configurable:true,writable:true})}else{t[r]=n}return t}var h=/^\u0020/;var v=/.+\u0020$/;var d=/[\n\s\t]+/g;var p=/^[\u0020\r\n\t]+|[\u0020\r\n\t]+$/g;var g=/[\u0020]+/g;var b=/[>(){}[\]+-.!#|]/g;var m=/[[\]]/g;var w=/!\[.*\]\(.*\)/g;var y=3;function k(t,r,n){var i;n=n||null;for(i in t){if(t.hasOwnProperty(i)){if(r.call(n,t[i],i,t)===false){break}}}}function T(t){var r=t.tagName;return r==="S"||r==="B"||r==="I"||r==="EM"||r==="STRONG"||r==="A"||r==="IMG"||r==="CODE"}function A(t,r){var n=t.cloneNode(false);n.innerHTML=r;return n.outerHTML}function E(t,r){k(r,(function(r,n){if(n!=="converter"){if(!t[n]){t[n]={}}E(t[n],r)}else{t[n]=r}}))}var L=function(){function t(t){this.rules={};this.lineFeedReplacement="";if(t){this.addRules(t)}}var r=t.prototype;r.addRule=function t(r,n){var i=r.split(", ");var e=i.pop();n.fname=r;while(e){this._setConverterWithSelector(e,n);e=i.pop()}};r.addRules=function t(r){k(r,(function(t,r){this.addRule(r,t)}),this)};r.getSpaceControlled=function t(r,n){var i="";var e="";var a;if(n.previousSibling&&(n.previousSibling.nodeType===y||T(n.previousSibling))){a=n.previousSibling.innerHTML||n.previousSibling.nodeValue;if(v.test(a)||h.test(n.innerHTML||n.nodeValue)){i=" "}}if(n.nextSibling&&(n.nextSibling.nodeType===y||T(n.nextSibling))){a=n.nextSibling.innerHTML||n.nextSibling.nodeValue;if(h.test(a)||v.test(n.innerHTML||n.nodeValue)){e=" "}}return i+r+e};r.convert=function t(r,n){var i;var e=this._getConverter(r);if(r&&r.nodeType===Node.ELEMENT_NODE&&r.hasAttribute("data-tomark-pass")){r.removeAttribute("data-tomark-pass");i=A(r,n)}else if(e){i=e.call(this,r,n)}else if(r){i=this.getSpaceControlled(this._getInlineHtml(r,n),r)}return i||""};r._getInlineHtml=function t(r,n){var i=r.outerHTML;var e=r.tagName;var a=n.replace(/\$/g,"$$$$");return i.replace(new RegExp("(<"+e+" ?.*?>).*(</"+e+">)","i"),"$1"+a+"$2")};r._getConverter=function t(r){var n=this.rules;var i;while(r&&n){n=this._getNextRule(n,this._getRuleNameFromNode(r));r=this._getPrevNode(r);if(n&&n.converter){i=n.converter}}return i};r._getNextRule=function t(r,n){return r[n]};r._getRuleNameFromNode=function t(r){return r.tagName||"TEXT_NODE"};r._getPrevNode=function t(r){var n=r.parentNode;var i;if(n&&!n.__htmlRootByToMark){i=n}return i};r._setConverterWithSelector=function t(r,n){var i=this.rules;this._eachSelector(r,(function(t){if(!i[t]){i[t]={}}i=i[t]}));i.converter=n};r._eachSelector=function t(r,n){var i=r.split(" ");var e=i.length-1;while(e>=0){n(i[e]);e-=1}};r.trim=function t(r){return r.replace(p,"")};r.isEmptyText=function t(r){return r.replace(d,"")===""};r.getSpaceCollapsedText=function t(r){return r.replace(g," ")};r.escapeText=function t(r){return r.replace(b,(function(t){return"\\"+t}))};r.escapeTextForLink=function t(r){var n=[];var i=w.exec(r);while(i){n.push([i.index,i.index+i[0].length]);i=w.exec(r)}return r.replace(m,(function(t,r){var i=n.some((function(t){return r>t[0]&&r<t[1]}));return i?t:"\\"+t}))};r.escapeTextHtml=function r(n){return n.replace(new RegExp(t.markdownTextToEscapeHtmlRx.source,"g"),(function(t){return"\\"+t}))};r.escapeTextBackSlash=function r(n){return n.replace(new RegExp(t.markdownTextToEscapeBackSlashRx.source,"g"),(function(t){return"\\"+t}))};r.escapePairedCharacters=function r(n){return n.replace(new RegExp(t.markdownTextToEscapePairedCharsRx.source,"g"),(function(t){return"\\"+t}))};r._isNeedEscape=function r(n){var i=false;var e=t.markdownTextToEscapeRx;var a;for(a in e){if(e.hasOwnProperty(a)&&e[a].test(n)){i=true;break}}return i};r._isNeedEscapeHtml=function r(n){return t.markdownTextToEscapeHtmlRx.test(n)};r._isNeedEscapeBackSlash=function r(n){return t.markdownTextToEscapeBackSlashRx.test(n)};r.mix=function t(r){E(this.rules,r.rules)};t.factory=function r(n,i){var e=new t;if(!i){i=n}else{e.mix(n)}e.addRules(i);return e};return t}();l(L,"markdownTextToEscapeRx",{codeblock:/(^ {4}[^\n]+\n*)+/,hr:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,heading:/^(#{1,6}) +[\s\S]+/,lheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,codeblockGfm:/^(`{3,})/,codeblockTildes:/^(~{3,})/});l(L,"markdownTextToEscapeHtmlRx",/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\/>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/);l(L,"markdownTextToEscapeBackSlashRx",/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/);l(L,"markdownTextToEscapePairedCharsRx",/[*_~`]/);var x=/\n$/g;var C=/[ \xA0]+\n\n/g;var D=/([ \xA0]+\n){2,}/g;var O=/href="(.*?)"/;var S=/^/gm;var N=L.factory({TEXT_NODE:function t(r){var n=this.trim(this.getSpaceCollapsedText(r.nodeValue));if(this._isNeedEscapeBackSlash(n)){n=this.escapeTextBackSlash(n)}n=this.escapePairedCharacters(n);if(this._isNeedEscapeHtml(n)){n=this.escapeTextHtml(n)}if(this._isNeedEscape(n)){n=this.escapeText(n)}return this.getSpaceControlled(n,r)},"CODE TEXT_NODE":function t(r){return r.nodeValue},"EM, I":function t(r,n){var i="";if(!this.isEmptyText(n)){i="*"+n+"*"}return i},"STRONG, B":function t(r,n){var i="";if(!this.isEmptyText(n)){i="**"+n+"**"}return i},A:function t(r,n){var i=n;var e="";var a;var u=O.exec(r.outerHTML);if(u){a=u[1].replace(/&/g,"&")}if(r.title){e=' "'+r.title+'"'}if(!this.isEmptyText(n)&&a){i="["+this.escapeTextForLink(n)+"]("+a+e+")"}return i},IMG:function t(r){var n=r.getAttribute("src");var i=r.alt;if(n){return""}return""},BR:function t(){return" \n"},CODE:function t(r,n){var i,e;var a="";if(!this.isEmptyText(n)){e=parseInt(r.getAttribute("data-backticks"),10);i=isNaN(e)?"`":Array(e+1).join("`");a=i+n+i}return a},P:function t(r,n){var i="";n=n.replace(D," \n");if(!this.isEmptyText(n)){i="\n\n"+n+"\n\n"}return i},"BLOCKQUOTE P":function t(r,n){return n},"LI P":function t(r,n){var i="";if(!this.isEmptyText(n)){i=n}return i},"H1, H2, H3, H4, H5, H6":function t(r,n){var i="";var e=parseInt(r.tagName.charAt(1),10);while(e){i+="#";e-=1}i+=" ";i+=n;return"\n\n"+i+"\n\n"},"LI H1, LI H2, LI H3, LI H4, LI H5, LI H6":function t(r,n){var i=parseInt(r.tagName.charAt(1),10);return Array(i+1).join("#")+" "+n},"UL, OL":function t(r,n){return"\n\n"+n+"\n\n"},"LI OL, LI UL":function t(r,n){var i;i=n.replace(C,"\n");i=i.replace(x,"");var e=i.replace(S," ");return"\n"+e},"UL LI":function t(r,n){var i="";n=n.replace(D," \n");if(r.firstChild&&r.firstChild.tagName==="P"){i+="\n"}i+="* "+n+"\n";return i},"OL LI":function t(r,n){var i="";var e=parseInt(r.parentNode.getAttribute("start")||1,10);while(r.previousSibling){r=r.previousSibling;if(r.nodeType===1&&r.tagName==="LI"){e+=1}}n=n.replace(D," \n");if(r.firstChild&&r.firstChild.tagName==="P"){i+="\n"}i+=e+". "+n+"\n";return i},HR:function t(){return"\n\n- - -\n\n"},BLOCKQUOTE:function t(r,n){n=n.replace(D,"\n\n");var i=this.trim(n);var e=i.replace(S,"> ");return"\n\n"+e+"\n\n"},"PRE CODE":function t(r,n){var i=n.replace(x,"");var e=i.replace(S," ");return"\n\n"+e+"\n\n"}});var M=L.factory(N,{"DEL, S":function t(r,n){return"~~"+n+"~~"},"PRE CODE":function t(r,n){var i="";var e=r.getAttribute("data-backticks");if(r.getAttribute("data-language")){i=" "+r.getAttribute("data-language")}e=parseInt(e,10);var a=isNaN(e)?"```":Array(e+1).join("`");n=n.replace(/(\r\n)|(\r)|(\n)/g,this.lineFeedReplacement);return"\n\n"+a+i+"\n"+n+"\n"+a+"\n\n"},PRE:function t(r,n){return n},"UL LI":function t(r,n){return N.convert(r,R(r,n))},"OL LI":function t(r,n){return N.convert(r,R(r,n))},TABLE:function t(r,n){return"\n\n"+n+"\n\n"},"TBODY, TFOOT":function t(r,n){return n},"TR TD, TR TH":function t(r,n){n=n.replace(/(\r\n)|(\r)|(\n)/g,"");return" "+n+" |"},"TD BR, TH BR":function t(){return"<br>"},TR:function t(r,n){return"|"+n+"\n"},THEAD:function t(r,n){var i="";var e=I(I(r,"TR")[0],"TH");for(var a=0,u=e.length;a<u;a+=1){i+=" "+B(e[a])+" |"}return n?n+"|"+i+"\n":""}});function R(t,r){var n;if(t.className.indexOf("task-list-item")!==-1){n=t.className.indexOf("checked")!==-1?"x":" ";r="["+n+"] "+r}return r}function B(t){var r,n,i;var e=t.align;i=t.textContent?t.textContent.length:t.innerText.length;r="";n="";if(e){if(e==="left"){r=":";i-=1}else if(e==="right"){n=":";i-=1}else if(e==="center"){n=":";r=":";i-=2}}return r+q("-",i)+n}function I(t,r){var n=t.childNodes;var i=[];for(var e=0,a=n.length;e<a;e+=1){if(n[e].tagName&&n[e].tagName===r){i.push(n[e])}}return i}function q(t,r){var n=t;r=Math.max(r,3);while(r>1){n+=t;r-=1}return n}var F=/[ \xA0]+(\n\n)/g;var P=/^[\n]+|[\s\n]+$/g;var j=/([ \xA0]+\n){2,}/g;var _=/([ \xA0]){2,}\n/g;var U=/[ \xA0\n]+/g;function H(t,r){var n=true;var i;if(!t){return""}i=M;if(r){n=r.gfm;if(n===false){i=N}i=r.renderer||i}var e=new a(f(t));return V(z(e,i),n,i.lineFeedReplacement)}function z(t,r){var n="";while(t.next()){n+=$(t,r)}return n}function V(t,r,n){t=t.replace(F,"\n");t=t.replace(j,"\n\n");t=t.replace(U,(function(t){var r=(t.match(/\n/g)||[]).length;if(r>=3){return"\n\n"}if(t>=1){return"\n"}return t}));t=t.replace(P,"");t=t.replace(new RegExp(n,"g"),"\n");if(r){t=t.replace(_,"\n")}return t}function $(t,r){var n="";var i=t.getNode();for(var e=0,a=i.childNodes.length;e<a;e+=1){t.next();n+=$(t,r)}return r.convert(i,n)}H.Renderer=L;H.basicRenderer=N;H.gfmRenderer=M;r["default"]=H}])["default"]}))},function(t,r,n){var i=n(8);function e(t){if(!t||!t.className){return""}if(i(t.className.baseVal)){return t.className}return t.className.baseVal}t.exports=e},function(t,r,n){function i(t){return typeof t==="number"||t instanceof Number}t.exports=i},function(t,r,n){var i=n(19);var e=n.n(i);var a=n(20);var u=n.n(a);var o=n(5);var s=n.n(o);var f=n(6);var c=n.n(f);var l=n(22);var h=n(38);var v=n(0);var d=n(29);var p=n(18);var g=n(25);var b=n(2);function m(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function w(t,r){t.prototype=Object.create(r.prototype);t.prototype.constructor=t;t.__proto__=r}var y="te-preview-highlight";function k(t,r){var n=r.ch;var i=t.firstChild;while(i&&i.next){if(Object(b["e"])(i.next)>n+1){break}i=i.next}return i}var T=function(t){w(r,t);function r(r,n,i,e){var a;a=t.call(this,r,n,i,e.isViewer)||this;a.lazyRunner.registerLazyRunFunction("invokeCodeBlock",a.invokeCodeBlockPlugins,a.delayCodeBlockTime,m(a));var u=e.linkAttribute,o=e.customHTMLRenderer,s=e.highlight,f=s===void 0?false:s;a.renderHTML=Object(l["createRenderHTML"])({gfm:true,nodeId:true,convertors:Object(d["a"])(u,o)});a.cursorNodeId=null;a._initEvent(f);return a}var n=r.prototype;n._initEvent=function t(r){var n=this;this.eventManager.listen("contentChangedFromMarkdown",this.update.bind(this));if(r){this.eventManager.listen("cursorActivity",(function(t){var r=t.markdownNode,i=t.cursor;n._updateCursorNode(r,i)}));this.eventManager.listen("blur",(function(){n._removeHighlight()}))}e()(this.el,"scroll",(function(t){n.eventManager.emit("scroll",{source:"preview",data:Object(p["a"])(t.target.scrollTop,n._previewContent)})}))};n._removeHighlight=function t(){if(this.cursorNodeId){var r=this._getElementByNodeId(this.cursorNodeId);if(r){c()(r,y)}}};n._updateCursorNode=function t(r,n){if(r){r=Object(b["b"])(r,(function(t){return!Object(b["h"])(t)}));if(r.type==="tableRow"){r=k(r,n)}else if(r.type==="tableBody"){r=null}}var i=r?r.id:null;if(this.cursorNodeId===i){return}var e=r&&r.customType==="frontMatter";var a=this._getElementByNodeId(this.cursorNodeId);var u=this._getElementByNodeId(i);if(a){c()(a,y)}if(u&&!e){s()(u,y)}this.cursorNodeId=i};n._getElementByNodeId=function t(r){if(!r){return null}return this._previewContent.querySelector('[data-nodeid="'+r+'"]')};n.update=function t(r){var n=this;r.forEach((function(t){return n.replaceRangeNodes(t)}));this.eventManager.emit("previewRenderAfter",this)};n.replaceRangeNodes=function t(r){var n=this;var i=r.nodes,e=r.removedNodeRange;var a=this._previewContent;var u=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",i.map((function(t){return n.renderHTML(t)})).join(""));if(!e){a.insertAdjacentHTML("afterbegin",u)}else{var o=e.id,s=o[0],f=o[1];var c=this._getElementByNodeId(s);var l=this._getElementByNodeId(f);if(c){var h;c.insertAdjacentHTML("beforebegin",u);var d=c;while(d&&d!==l){var p=d.nextElementSibling;d.parentNode.removeChild(d);Object(g["c"])(d);d=p}if((h=d)==null?void 0:h.parentNode){v["a"].remove(d);Object(g["c"])(d)}}}var b=this.getCodeBlockElements(i.map((function(t){return t.id})));if(b.length){this.lazyRunner.run("invokeCodeBlock",b)}};n.render=function r(n){t.prototype.render.call(this,n);this.eventManager.emit("previewRenderAfter",this)};n.remove=function t(){u()(this.el,"scroll");this.el=null};return r}(h["a"]);r["a"]=T},function(t,r,n){var i=n(10);var e=n.n(i);var a=n(8);var u=n.n(a);var o=n(44);var s=n.n(o);var f=n(45);var c=n.n(f);var l=n(24);var h=["previewBeforeHook","previewRenderAfter","previewNeedsRefresh","addImageBlobHook","setMarkdownAfter","contentChangedFromWysiwyg","changeFromWysiwyg","contentChangedFromMarkdown","changeFromMarkdown","change","changeModeToWysiwyg","changeModeToMarkdown","changeModeBefore","changeMode","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","openPopupAddLink","openPopupAddImage","openPopupAddTable","openPopupTableUtils","openHeadingSelect","openPopupCodeBlockLanguages","openPopupCodeBlockEditor","openDropdownToolbar","closePopupCodeBlockLanguages","closePopupCodeBlockEditor","closeAllPopup","command","addCommandBefore","htmlUpdate","markdownUpdate","renderedHtmlUpdated","removeEditor","convertorAfterMarkdownToHtmlConverted","convertorBeforeHtmlToMarkdownConverted","convertorAfterHtmlToMarkdownConverted","stateChange","wysiwygSetValueAfter","wysiwygSetValueBefore","wysiwygGetValueBefore","wysiwygProcessHTMLText","wysiwygRangeChangeAfter","wysiwygKeyEvent","scroll","click","mousedown","mouseover","mouseout","mouseup","contextmenu","keydown","keyup","keyMap","load","focus","blur","paste","pasteBefore","willPaste","copy","copyBefore","copyAfter","cut","cutAfter","drop","show","hide","changeLanguage","cursorActivity","requireScrollSync","requireScrollIntoView","setCodeBlockLanguages"];var v=function(){function t(){this.events=new l["a"];this.TYPE=new c.a(h)}var r=t.prototype;r.listen=function t(r,n){var i=this._getTypeInfo(r);var e=this.events.get(i.type)||[];if(!this._hasEventType(i.type)){throw new Error("There is no event type "+i.type)}if(i.namespace){n.namespace=i.namespace}e.push(n);this.events.set(i.type,e)};r.emit=function t(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=n.shift();var o=this._getTypeInfo(a);var s=this.events.get(o.type);var f;if(s){e()(s,(function(t){var r=t.apply(void 0,n);if(!u()(r)){f=f||[];f.push(r)}}))}return f};r.emitReduce=function t(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++){n[i]=arguments[i]}var a=n.shift();var u=this.events.get(a);if(u){e()(u,(function(t){var r=t.apply(void 0,n);if(!s()(r)){n[0]=r}}))}return n[0]};r._getTypeInfo=function t(r){var n=r.split(".");return{type:n[0],namespace:n[1]}};r._hasEventType=function t(r){return!u()(this.TYPE[this._getTypeInfo(r).type])};r.addEventType=function t(r){if(this._hasEventType(r)){throw new Error("There is already have event type "+r)}this.TYPE.set(r)};r.removeEventHandler=function t(r,n){var i=this;var e=this._getTypeInfo(r),a=e.type,u=e.namespace;if(a&&n){this._removeEventHandlerWithHandler(a,n)}else if(a&&!u){this.events.delete(a)}else if(!a&&u){this.events.forEach((function(t,r){i._removeEventHandlerWithTypeInfo(r,u)}))}else if(a&&u){this._removeEventHandlerWithTypeInfo(a,u)}};r._removeEventHandlerWithHandler=function t(r,n){var i=this.events.get(r)||[];var e=i.indexOf(n);if(e>=0){i.splice(e,1)}};r._removeEventHandlerWithTypeInfo=function t(r,n){var i=[];var e=this.events.get(r);if(!e){return}e.map((function(t){if(t.namespace!==n){i.push(t)}return null}));this.events.set(r,i)};return t}();r["a"]=v},function(t,r,n){var i=n(32);var e=n.n(i);var a=n(22);var u=n(29);var o=n(0);var s="[a-zA-Z_:][a-zA-Z0-9:._-]*";var f="[^\"'=<>`\\x00-\\x20]+";var c="'[^']*'";var l='"[^"]*"';var h="(?:"+f+"|"+c+"|"+l+")";var v="(?:\\s+"+s+"(?:\\s*=\\s*"+h+")?)*\\s*";var d="(\\\\<|<)([A-Za-z][A-Za-z0-9\\-]*"+v+")(\\/?>)";var p=new RegExp(d,"g");var g=/^\s?\\-\\-\\-([\s\S]+?)\\-\\-\\-/;var b=/ /g;var m=/^(\s*\*\s+\d+)\./g;var w=function(){function t(t,r){if(r===void 0){r={}}var n=r,i=n.linkAttribute,e=n.customHTMLRenderer,o=n.extendedAutolinks,s=n.referenceDefinition,f=n.customParser,c=n.frontMatter,l=n.customProp;this.options=r;this.mdReader=new a["Parser"]({extendedAutolinks:o,disallowedHtmlBlockTags:["br"],referenceDefinition:s,disallowDeepHeading:true,customParser:f,frontMatter:c});this.renderHTML=Object(a["createRenderHTML"])({gfm:true,convertors:Object(u["a"])(i,e),customProp:l});this.eventManager=t}var r=t.prototype;r._markdownToHtmlWithCodeHighlight=function t(r){return this.renderHTML(this.mdReader.parse(r))};r._markdownToHtml=function t(r){r=r.replace(p,(function(t,r,n,i){return t[0]!=="\\"?""+r+n+" data-tomark-pass "+i:t})).replace(m,"$1\\.");return this.renderHTML(this.mdReader.parse(r))};r._removeBrToMarkPassAttributeInCode=function t(r){var n=o["a"].createElementWith("<div>"+r+"</div>");o["a"].findAll(n,"code, pre").forEach((function(t){var r=t;r.innerHTML=r.innerHTML.replace(/\sdata-tomark-pass\s(\/?)>/g,"$1>")}));r=n.innerHTML;return r};r.toHTMLWithCodeHighlight=function t(r){var n=this._markdownToHtmlWithCodeHighlight(r);n=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",n);return n};r.toHTML=function t(r){var n=this._markdownToHtml(r);n=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",n);n=this._removeBrToMarkPassAttributeInCode(n);return n};r.initHtmlSanitizer=function t(r){this.eventManager.listen("convertorAfterMarkdownToHtmlConverted",(function(t){return r(t,true)}))};r.toMarkdown=function t(r,n){var i=[];r=this.eventManager.emitReduce("convertorBeforeHtmlToMarkdownConverted",r);r=this._appendAttributeForLinkIfNeed(r);r=this._appendAttributeForBrIfNeed(r);var a=e()(r,n);if(this.options.frontMatter){a=a.replace(g,"---$1---")}a=this.eventManager.emitReduce("convertorAfterHtmlToMarkdownConverted",a);a=this._removeNewlinesBeforeAfterAndBlockElement(a);a.split("\n").forEach((function(t,r){var n=/^(<br>)+\||\|[^|]*\|/gi;var e=/`[^`]*<br>[^`]*`/gi;var a=/^(<br>)+\|/gi;if(n.test(t)){t=t.replace(a,(function(t){return t.replace(/<br>/gi,"<br>\n")}))}else if(!e.test(t)){t=t.replace(/<br>/gi,"<br>\n")}i[r]=t}));return i.join("\n").replace(b," ")};r._removeNewlinesBeforeAfterAndBlockElement=function t(r){var n=/<br>\n\n(#{1,6} .*|```|\||(\*+|-+|\d+\.) .*| *>[^\n]+.*)/g;var i=/(#{1,6} .*|```|\|)\n\n<br>/g;r=r.replace(n,"<br>$1");r=r.replace(i,"$1\n<br>");return r};r._appendAttributeForLinkIfNeed=function t(r){var n=/!?\[.*\]\(<\s*a[^>]*>(.*?)<\s*\/\s*a>\)/gi;return r.replace(n,(function(t){return t.replace(/<a /gi,'<a data-tomark-pass="" ')}))};r._appendAttributeForBrIfNeed=function t(r){var n=/<br>/gi;var i=/<br \/><br \/>/gi;var e=/<br data-tomark-pass \/><br \/>(.)/gi;var a=/([^>]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|<img [^>]*>)/;var u=/<br data-tomark-pass \/><br data-tomark-pass \/>/;var o=new RegExp(a.source+u.source,"g");var s=/<br data-tomark-pass="">/gi;r=r.replace(n,"<br />");r=r.replace(i,"<br data-tomark-pass /><br data-tomark-pass />");r=r.replace(s,"<br data-tomark-pass />");r=r.replace(e,"<br data-tomark-pass /><br data-tomark-pass />$1");r=r.replace(o,"$1<br /><br />");r=r.replace(/(.)<br \/><br \/>(<h[1-6]>|<pre>|<table>|<ul>|<ol>|<blockquote>)/g,"$1<br /><br data-tomark-pass />$2");r=r.replace(/(<\/h[1-6]>|<\/pre>|<\/table>|<\/ul>|<\/ol>|<\/blockquote>)<br \/>(.)/g,"$1<br data-tomark-pass />$2");return r};return t}();r["a"]=w},function(t,r,n){var i=n(4);var e=n.n(i);var a=n(9);var u=n.n(a);var o=function(){function t(){this.globalTOID=null;this.lazyRunFunctions={}}var r=t.prototype;r.run=function t(r,n,i,e){var a;if(u()(r)){a=this._runRegisteredRun(r,n,i,e)}else{a=this._runSingleRun(r,n,i,e,this.globalTOID);this.globalTOID=a}return a};r.registerLazyRunFunction=function t(r,n,i,e){e=e||this;this.lazyRunFunctions[r]={fn:n,delay:i,context:e,TOID:null}};r._runSingleRun=function t(r,n,i,e,a){this._clearTOIDIfNeed(a);a=setTimeout((function(){r.call(i,n)}),e);return a};r._runRegisteredRun=function t(r,n,i,e){var a=this.lazyRunFunctions[r];var u=a.fn;var o=a.TOID;e=e||a.delay;i=i||a.context;o=this._runSingleRun(u,n,i,e,o);a.TOID=o;return o};r._clearTOIDIfNeed=function t(r){if(r){clearTimeout(r)}};return t}();var s=o;var f=n(0);var c=n(30);var l=function(){function t(t,r,n,i){this.eventManager=r;this.convertor=n;this.el=t;this.isViewer=!!i;this.delayCodeBlockTime=500;this._initContentSection();this.lazyRunner=new s}var r=t.prototype;r._initContentSection=function t(){this._previewContent=f["a"].createElementWith('<div class="tui-editor-contents"></div>');this.el.appendChild(this._previewContent)};r.getCodeBlockElements=function t(r){var n=this._previewContent;var i=[];var e;if(r){e=r.map((function(t){return n.querySelector('[data-nodeid="'+t+'"]')})).filter(Boolean)}else{e=[n]}e.forEach((function(t){i.push.apply(i,f["a"].findAll(t,"code[data-language]"))}));return i};r.invokeCodeBlockPlugins=function t(r){r.forEach((function(t){var r=t.getAttribute("data-language");var n=c["a"].createCodeBlockHtml(r,t.textContent);t.innerHTML=n}))};r.refresh=function t(r){if(r===void 0){r=""}this.render(this.convertor.toHTMLWithCodeHighlight(r));this.invokeCodeBlockPlugins(this.getCodeBlockElements())};r.getHTML=function t(){return this._previewContent.innerHTML};r.setHTML=function t(r){this._previewContent.innerHTML=r};r.render=function t(r){var n=this._previewContent;r=this.eventManager.emit("previewBeforeHook",r)||r;f["a"].empty(n);n.innerHTML=r};r.setHeight=function t(r){e()(this.el,{height:r+"px"})};r.setMinHeight=function t(r){e()(this.el,{minHeight:r+"px"})};r.isVisible=function t(){return this.el.style.display!=="none"};return t}();r["a"]=l},function(t,r,n){var i=n(17);var e=n(8);function a(t,r){r=i(r)?r.join(" "):r;r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");if(e(t.className.baseVal)){t.className=r;return}t.className.baseVal=r}t.exports=a},function(t,r,n){var i="_feEventKey";function e(t,r){var n=t[i];var e;if(!n){n=t[i]={}}e=n[r];if(!e){e=n[r]=[]}return e}t.exports=e},,function(t,r,n){var i=n(28);function e(t){return i(t)&&t!==false}t.exports=e},function(t,r,n){var i=n(8);var e=n(49);var a=7*24*60*60*1e3;function u(t){var r=(new Date).getTime();return r-t>a}function o(t,r){var n="https://www.google-analytics.com/collect";var a=location.hostname;var o="event";var s="use";var f="TOAST UI "+t+" for "+a+": Statistics";var c=window.localStorage.getItem(f);if(!i(window.tui)&&window.tui.usageStatistics===false){return}if(c&&!u(c)){return}window.localStorage.setItem(f,(new Date).getTime());setTimeout((function(){if(document.readyState==="interactive"||document.readyState==="complete"){e(n,{v:1,t:o,tid:r,cid:a,dp:a,dh:t,el:t,ec:s})}}),1e3)}t.exports=o},function(t,r,n){var i=n(42);function e(t){return!i(t)}t.exports=e},function(t,r,n){var i=n(34);var e=n(17);var a=n(3);var u=n(26);var o=function(){try{Object.defineProperty({},"x",{});return true}catch(t){return false}}();var s=0;function f(t){if(t){this.set.apply(this,arguments)}}f.prototype.set=function(t){var r=this;if(!e(t)){t=a(arguments)}u(t,(function t(n){r._addItem(n)}))};f.prototype.getName=function(t){var r=this;var n;u(this,(function(i,e){if(r._isEnumItem(e)&&t===i){n=e;return false}}));return n};f.prototype._addItem=function(t){var r;if(!this.hasOwnProperty(t)){r=this._makeEnumValue();if(o){Object.defineProperty(this,t,{enumerable:true,configurable:false,writable:false,value:r})}else{this[t]=r}}};f.prototype._makeEnumValue=function(){var t;t=s;s+=1;return t};f.prototype._isEnumItem=function(t){return i(this[t])};t.exports=f},function(t,r,n){var i=n(10);var e=n.n(i);var a=n(7);var u=n.n(a);var o=n(19);var s=n.n(o);var f=n(20);var c=n.n(f);var l=n(35);var h=n(36);var v=n(1);var d=n(37);var p=n(0);var g=n(30);var b=n(31);var m=n(12);var w=n(23);function y(){y=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var i in n){if(Object.prototype.hasOwnProperty.call(n,i)){t[i]=n[i]}}}return t};return y.apply(this,arguments)}var k="data-te-task";var T="data-te-task-disabled";var A="checked";var E=function(){function t(t){var r=this;this.options=u()({useDefaultHTMLSanitizer:true,linkAttribute:null,extendedAutolinks:false,customConvertor:null,customHTMLRenderer:null,referenceDefinition:false,customHTMLSanitizer:null,frontMatter:false},t);this.codeBlockLanguages=[];this.eventManager=new h["a"];this.commandManager=new v["a"](this);var n=Object(m["c"])(this.options.linkAttribute);var i=Object(b["a"])(this.options.plugins),a=i.renderer,o=i.parser,f=i.plugins;var c=this.options,p=c.customHTMLRenderer,g=c.customHTMLSanitizer,k=c.extendedAutolinks,T=c.referenceDefinition,A=c.frontMatter;var E={linkAttribute:n,customHTMLRenderer:y({},a,p),extendedAutolinks:k,referenceDefinition:T,customParser:o,frontMatter:A};if(this.options.customConvertor){this.convertor=new this.options.customConvertor(this.eventManager,E)}else{this.convertor=new d["a"](this.eventManager,E)}var L=g||(this.options.useDefaultHTMLSanitizer?w["a"]:null);if(L){this.convertor.initHtmlSanitizer(L)}if(this.options.hooks){e()(this.options.hooks,(function(t,n){r.addHook(n,t)}))}if(this.options.events){e()(this.options.events,(function(t,n){r.on(n,t)}))}var x=this.options,C=x.el,D=x.initialValue;var O=C.innerHTML;C.innerHTML="";this.preview=new l["a"](C,this.eventManager,this.convertor,y({},E,{isViewer:true}));s()(this.preview.el,"mousedown",this._toggleTask.bind(this));if(f){Object(b["b"])(f,this)}if(D){this.setMarkdown(D)}else if(O){this.preview.setHTML(O)}this.eventManager.emit("load",this)}var r=t.prototype;r._toggleTask=function t(r){var n=getComputedStyle(r.target,":before");if(!r.target.hasAttribute(T)&&r.target.hasAttribute(k)&&p["a"].isInsideButtonBox(n,r.offsetX,r.offsetY)){p["a"].toggleClass(r.target,A);this.eventManager.emit("change",{source:"viewer",data:r})}};r.setMarkdown=function t(r){this.markdownValue=r=r||"";this.preview.refresh(this.markdownValue);this.eventManager.emit("setMarkdownAfter",this.markdownValue)};r.on=function t(r,n){this.eventManager.listen(r,n)};r.off=function t(r){this.eventManager.removeEventHandler(r)};r.remove=function t(){this.eventManager.emit("removeEditor");c()(this.preview.el,"mousedown",this._toggleTask.bind(this));this.preview.remove();this.options=null;this.eventManager=null;this.commandManager=null;this.convertor=null;this.preview=null};r.addHook=function t(r,n){this.eventManager.removeEventHandler(r);this.eventManager.listen(r,n)};r.isViewer=function t(){return true};r.isMarkdownMode=function t(){return false};r.isWysiwygMode=function t(){return false};r.setCodeBlockLanguages=function t(r){var n=this;if(r===void 0){r=[]}r.forEach((function(t){if(n.codeBlockLanguages.indexOf(t)<0){n.codeBlockLanguages.push(t)}}))};return t}();E.isViewer=true;E.domUtils=p["a"];E.codeBlockManager=g["a"];E.WwCodeBlockManager=null;E.WwTableManager=null;E.WwTableSelectionManager=null;r["a"]=E},,function(t,r,n){function i(t){return t===null}t.exports=i},function(t,r,n){var i=n(10);function e(t,r){var n=document.createElement("img");var e="";i(r,(function(t,r){e+="&"+r+"="+t}));e=e.substring(1);n.src=t+"?"+e;n.style.display="none";document.body.appendChild(n);document.body.removeChild(n);return n}t.exports=e},,function(t,r,n){},,,,,,,,,function(t,r,n){n.r(r);var i=n(46);n(51);r["default"]=i["a"]}])["default"]}))})(g);const b=l(g.exports);var m=undefined&&undefined.__classPrivateFieldGet||function(t,r,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:r.get(t)};var w=undefined&&undefined.__classPrivateFieldSet||function(t,r,n,i,e){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!e)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!e:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?e.call(t,n):e?e.value=n:r.set(t,n),n};var y,k,T,A,E,L;const x=class{constructor(n){t(this,n);this.kupAutoSave=r(this,"kup-editor-autosave",6);this.kupReady=r(this,"kup-editor-ready",6);this.kupSave=r(this,"kup-editor-save",6);y.set(this,void 0);k.set(this,false);T.set(this,"");A.set(this,u());E.set(this,0);L.set(this,{options:{className:"kup-editor-unsaved-changes",el:this.createUnsavedChanges(),tooltip:"There are unsaved changes."},type:"button"});this.editor=null;this.editorRef=undefined;this.viewer=null;this.autosaveTimer=undefined;this.editorHeight="auto";this.initialEditType="markdown";this.initialValue="";this.isReadOnly=false;this.previewStyle="vertical";this.selectedTab="write";this.showSaveButton=true;this.showToolbar=true}onEditorRefUpdated(){if(this.editorRef&&!this.editor){if(!this.isReadOnly){this.createEditor()}else{this.createViewer()}}}onEditorUpdate(){if(this.editor){setTimeout((()=>{if(this.editor){this.editor.moveCursorToStart();if(this.initialEditType==="markdown"&&this.previewStyle==="tab"&&this.selectedTab==="preview"){this.updateMarkDownPreviewTab()}}}),100)}}onInitialEditTypeChanged(){if(this.initialEditType!="markdown"&&this.initialEditType!="wysiwyg"||!this.editor)return;this.editor.changeMode(this.initialEditType);this.updateToolbarVisiblity()}onIsReadOnlyChanged(){if(this.isReadOnly){this.editor.remove();this.editor=null;this.createViewer()}else{this.viewer.remove();this.viewer=null;this.createEditor()}}onPreviewStyleChanged(){if(this.previewStyle!="tab"&&this.previewStyle!="vertical"||!this.editor)return;this.editor.changePreviewStyle(this.previewStyle);if(this.previewStyle=="vertical"){this.editor.getUI().getToolbar().enableAllButton()}this.updateToolbarVisiblity()}onMarkdownPreviewTabChanged(){if(this.initialEditType!="markdown"&&this.previewStyle!="tab"||!this.editor)return;this.updateMarkDownPreviewTab()}onShowSaveButtonChanged(){if(this.editor){const t=this.editor.getUI().getToolbar();if(this.showSaveButton){t.insertItem(0,this.getToolBarWithSaveButton(false)[0])}else{t.removeItem(0)}}}onShowToolBarChanged(){if(this.editor){this.updateToolbarVisiblity()}}onAutosaveTimerChanged(){if(this.editor){m(this,y,"f")&&clearInterval(m(this,y,"f"));typeof this.autosaveTimer==="number"&&this.autosaveTimer>0&&this.setAutosaveInterval()}}async getProps(t){return o(this,p,t)}async getValueAsHTML(){var t,r;return(r=(t=this.editor)===null||t===void 0?void 0:t.getHtml())!==null&&r!==void 0?r:""}async getValueAsMarkdown(){var t,r;return(r=(t=this.editor)===null||t===void 0?void 0:t.getMarkdown())!==null&&r!==void 0?r:""}async refresh(){n(this)}async setProps(t){s(this,p,t)}createEditor(){var t;const r={el:this.editorRef,events:{change:()=>{if(m(this,T,"f")!==this.editor.getMarkdown()){if(!m(this,k,"f")){w(this,E,this.editor.getUI().getToolbar().getItems().length-1,"f");this.editor.getUI().getToolbar().insertItem(m(this,E,"f"),m(this,L,"f"))}w(this,k,true,"f")}else{if(m(this,k,"f")){this.editor.getUI().getToolbar().removeItem(m(this,E,"f"))}w(this,k,false,"f")}},focus:()=>{if(!this.isReadOnly&&!this.showToolbar){this.showToolbar=true}}},height:(t=this.editorHeight)!==null&&t!==void 0?t:"auto",hideModeSwitch:true,initialEditType:this.initialEditType,initialValue:this.initialValue,placeholder:"Type your text here...",previewStyle:this.previewStyle,usageStatistics:false};if(this.showSaveButton){r.toolbarItems=this.getToolBarWithSaveButton()}this.editor=new d(r);w(this,T,this.editor.getMarkdown(),"f");if(!this.showToolbar){this.updateToolbarVisiblity()}typeof this.autosaveTimer==="number"&&this.autosaveTimer>0&&this.setAutosaveInterval()}createViewer(){const t={el:this.editorRef,initialValue:this.initialValue};this.viewer=new b(t)}createSaveButton(){const t=document.createElement("button");t.className="kup-editor-save-button";t.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#585858" version="1.1" id="Capa_1" width="12px" height="12px" viewBox="0 0 407.096 407.096" xml:space="preserve">\n <g>\n <g>\n <path d="M402.115,84.008L323.088,4.981C319.899,1.792,315.574,0,311.063,0H17.005C7.613,0,0,7.614,0,17.005v373.086 c0,9.392,7.613,17.005,17.005,17.005h373.086c9.392,0,17.005-7.613,17.005-17.005V96.032 C407.096,91.523,405.305,87.197,402.115,84.008z M300.664,163.567H67.129V38.862h233.535V163.567z"/>\n <path d="M214.051,148.16h43.08c3.131,0,5.668-2.538,5.668-5.669V59.584c0-3.13-2.537-5.668-5.668-5.668h-43.08 c-3.131,0-5.668,2.538-5.668,5.668v82.907C208.383,145.622,210.92,148.16,214.051,148.16z"/>\n </g>\n </g>\n </svg>`;t.addEventListener("click",this.onEditorSave.bind(this));return t}createDivider(){const t=document.createElement("div");t.className="kup-editor-divider";const r={options:{className:"kup-editor-divider",el:t},type:"button"};return r}createUnsavedChanges(){const t=document.createElement("span");t.className="kup-editor-unsaved-changes";t.innerText="Unsaved changes.";return t}updateToolbarVisiblity(){const t=this.editor.getUI().getToolbar().el;const r=t.parentElement;t.style.display="";r.style.display="";if(!this.showToolbar){t.style.display="none";if(this.initialEditType!="markdown"||this.previewStyle!="tab"){r.style.display="none"}}}setAutosaveInterval(){w(this,y,setInterval((()=>{this.onEditorAutoSave()}),this.autosaveTimer),"f")}onEditorSave(){this.editor.getUI().getToolbar().removeItem(m(this,E,"f"));w(this,k,false,"f");this.kupSave.emit(this.getSaveAndAutoSaveProps())}onEditorAutoSave(){this.kupAutoSave.emit(this.getSaveAndAutoSaveProps())}updateMarkDownPreviewTab(){const t=this.rootElement.querySelector(".te-markdown-tab-section");if(!t)return;this.selectedTab==="preview"&&t.querySelector("button:last-child").click();this.selectedTab==="write"&&t.querySelector("button").click()}getToolBarWithSaveButton(t=true){const r={toolbarItems:[{options:{el:this.createSaveButton(),tooltip:"Save"},type:"button"},this.createDivider(),...t?this.getDefaultToolBarItems():[]]};return r.toolbarItems}getDefaultToolBarItems(){const t=["heading","bold","italic","strike",this.createDivider(),"hr","quote",this.createDivider(),"ul","ol","task","indent","outdent",this.createDivider(),"table","image","link",this.createDivider(),"code","codeblock"];if(this.initialEditType=="markdown"){t.push("scrollSync")}return t}getSaveAndAutoSaveProps(){var t,r;return{comp:this,id:this.rootElement.id,htmlValue:(t=this.editor.getHtml())!==null&&t!==void 0?t:"",markdownValue:(r=this.editor.getMarkdown())!==null&&r!==void 0?r:""}}componentWillLoad(){m(this,A,"f").debug.logLoad(this,false);m(this,A,"f").theme.register(this)}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id});m(this,A,"f").debug.logLoad(this,true)}componentWillRender(){m(this,A,"f").debug.logRender(this,false)}componentDidRender(){m(this,A,"f").debug.logRender(this,true)}render(){return i(e,{key:"e732ebc91b5f48c0bc515cfffa8cc2d1d6d7485f"},i("div",{key:"560b1ac7dcdab0bf90db09bb92e847a9e5d14f7e",id:f},i("div",{key:this.rootElement.id,ref:t=>this.editorRef=t,class:"kup-editor"})))}disconnectedCallback(){m(this,A,"f").theme.unregister(this);m(this,y,"f")&&clearInterval(m(this,y,"f"))}get rootElement(){return a(this)}static get watchers(){return{editorRef:["onEditorRefUpdated"],editor:["onEditorUpdate"],initialEditType:["onInitialEditTypeChanged"],isReadOnly:["onIsReadOnlyChanged"],previewStyle:["onPreviewStyleChanged"],selectedTab:["onMarkdownPreviewTabChanged"],showSaveButton:["onShowSaveButtonChanged"],showToolbar:["onShowToolBarChanged"],autosaveTimer:["onAutosaveTimerChanged"]}}};y=new WeakMap,k=new WeakMap,T=new WeakMap,A=new WeakMap,E=new WeakMap,L=new WeakMap;export{x as kup_editor};
|
|
54
|
-
//# sourceMappingURL=p-
|
|
54
|
+
//# sourceMappingURL=p-f9e43ad1.entry.js.map
|