react-filter-box-updated
Version:
Conditional filter supports OR/AND, bracket, Highlighting, Autocomplete, and high extensibility
10 lines • 303 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports["react-filter-box"]=e(require("react"),require("react-dom")):t["react-filter-box"]=e(t.React,t.ReactDOM)}(window,(function(t,e){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=9)}([function(t,e,r){(function(t,n){var i;
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Function]",p="[object GeneratorFunction]",v="[object Map]",g="[object Number]",m="[object Object]",y="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",C="[object WeakMap]",_="[object ArrayBuffer]",S="[object DataView]",k="[object Float32Array]",M="[object Float64Array]",L="[object Int8Array]",T="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",N="[object Uint16Array]",D="[object Uint32Array]",E=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,F=RegExp(R.source),I=RegExp(H.source),z=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,B=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,q=RegExp(K.source),$=/^\s+|\s+$/g,X=/^\s+/,Y=/\s+$/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,et=/\\(\\)?/g,rt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,lt=/^(?:0|[1-9]\d*)$/,ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ct=/($^)/,ft=/['\n\r\u2028\u2029\\]/g,ht="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",dt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pt="[\\ud800-\\udfff]",vt="["+dt+"]",gt="["+ht+"]",mt="\\d+",yt="[\\u2700-\\u27bf]",bt="[a-z\\xdf-\\xf6\\xf8-\\xff]",wt="[^\\ud800-\\udfff"+dt+mt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",xt="\\ud83c[\\udffb-\\udfff]",Ct="[^\\ud800-\\udfff]",_t="(?:\\ud83c[\\udde6-\\uddff]){2}",St="[\\ud800-\\udbff][\\udc00-\\udfff]",kt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Mt="(?:"+bt+"|"+wt+")",Lt="(?:"+kt+"|"+wt+")",Tt="(?:"+gt+"|"+xt+")"+"?",Ot="[\\ufe0e\\ufe0f]?"+Tt+("(?:\\u200d(?:"+[Ct,_t,St].join("|")+")[\\ufe0e\\ufe0f]?"+Tt+")*"),At="(?:"+[yt,_t,St].join("|")+")"+Ot,Nt="(?:"+[Ct+gt+"?",gt,_t,St,pt].join("|")+")",Dt=RegExp("['’]","g"),Et=RegExp(gt,"g"),Wt=RegExp(xt+"(?="+xt+")|"+Nt+Ot,"g"),Pt=RegExp([kt+"?"+bt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[vt,kt,"$"].join("|")+")",Lt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[vt,kt+Mt,"$"].join("|")+")",kt+"?"+Mt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",kt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mt,At].join("|"),"g"),Rt=RegExp("[\\u200d\\ud800-\\udfff"+ht+"\\ufe0e\\ufe0f]"),Ht=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ft=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],It=-1,zt={};zt[k]=zt[M]=zt[L]=zt[T]=zt[O]=zt[A]=zt["[object Uint8ClampedArray]"]=zt[N]=zt[D]=!0,zt[l]=zt[u]=zt[_]=zt[c]=zt[S]=zt[f]=zt[h]=zt[d]=zt[v]=zt[g]=zt[m]=zt[y]=zt[b]=zt[w]=zt[C]=!1;var jt={};jt[l]=jt[u]=jt[_]=jt[S]=jt[c]=jt[f]=jt[k]=jt[M]=jt[L]=jt[T]=jt[O]=jt[v]=jt[g]=jt[m]=jt[y]=jt[b]=jt[w]=jt[x]=jt[A]=jt["[object Uint8ClampedArray]"]=jt[N]=jt[D]=!0,jt[h]=jt[d]=jt[C]=!1;var Bt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ut=parseFloat,Vt=parseInt,Gt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,qt=Gt||Kt||Function("return this")(),$t=e&&!e.nodeType&&e,Xt=$t&&"object"==typeof n&&n&&!n.nodeType&&n,Yt=Xt&&Xt.exports===$t,Zt=Yt&&Gt.process,Jt=function(){try{var t=Xt&&Xt.require&&Xt.require("util").types;return t||Zt&&Zt.binding&&Zt.binding("util")}catch(t){}}(),Qt=Jt&&Jt.isArrayBuffer,te=Jt&&Jt.isDate,ee=Jt&&Jt.isMap,re=Jt&&Jt.isRegExp,ne=Jt&&Jt.isSet,ie=Jt&&Jt.isTypedArray;function oe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function ae(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(n,a,r(a),t)}return n}function se(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function le(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function ue(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function ce(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var a=t[r];e(a,r,t)&&(o[i++]=a)}return o}function fe(t,e){return!!(null==t?0:t.length)&&xe(t,e,0)>-1}function he(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function de(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function pe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function ve(t,e,r,n){var i=-1,o=null==t?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function ge(t,e,r,n){var i=null==t?0:t.length;for(n&&i&&(r=t[--i]);i--;)r=e(r,t[i],i,t);return r}function me(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var ye=ke("length");function be(t,e,r){var n;return r(t,(function(t,r,i){if(e(t,r,i))return n=r,!1})),n}function we(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function xe(t,e,r){return e==e?function(t,e,r){var n=r-1,i=t.length;for(;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):we(t,_e,r)}function Ce(t,e,r,n){for(var i=r-1,o=t.length;++i<o;)if(n(t[i],e))return i;return-1}function _e(t){return t!=t}function Se(t,e){var r=null==t?0:t.length;return r?Te(t,e)/r:NaN}function ke(t){return function(e){return null==e?void 0:e[t]}}function Me(t){return function(e){return null==t?void 0:t[e]}}function Le(t,e,r,n,i){return i(t,(function(t,i,o){r=n?(n=!1,t):e(r,t,i,o)})),r}function Te(t,e){for(var r,n=-1,i=t.length;++n<i;){var o=e(t[n]);void 0!==o&&(r=void 0===r?o:r+o)}return r}function Oe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ae(t){return function(e){return t(e)}}function Ne(t,e){return de(e,(function(e){return t[e]}))}function De(t,e){return t.has(e)}function Ee(t,e){for(var r=-1,n=t.length;++r<n&&xe(e,t[r],0)>-1;);return r}function We(t,e){for(var r=t.length;r--&&xe(e,t[r],0)>-1;);return r}function Pe(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var Re=Me({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),He=Me({"&":"&","<":"<",">":">",'"':""","'":"'"});function Fe(t){return"\\"+Bt[t]}function Ie(t){return Rt.test(t)}function ze(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function je(t,e){return function(r){return t(e(r))}}function Be(t,e){for(var r=-1,n=t.length,i=0,o=[];++r<n;){var s=t[r];s!==e&&s!==a||(t[r]=a,o[i++]=r)}return o}function Ue(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function Ve(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=[t,t]})),r}function Ge(t){return Ie(t)?function(t){var e=Wt.lastIndex=0;for(;Wt.test(t);)++e;return e}(t):ye(t)}function Ke(t){return Ie(t)?function(t){return t.match(Wt)||[]}(t):function(t){return t.split("")}(t)}var qe=Me({"&":"&","<":"<",">":">",""":'"',"'":"'"});var $e=function t(e){var r,n=(e=null==e?qt:$e.defaults(qt.Object(),e,$e.pick(qt,Ft))).Array,i=e.Date,ht=e.Error,dt=e.Function,pt=e.Math,vt=e.Object,gt=e.RegExp,mt=e.String,yt=e.TypeError,bt=n.prototype,wt=dt.prototype,xt=vt.prototype,Ct=e["__core-js_shared__"],_t=wt.toString,St=xt.hasOwnProperty,kt=0,Mt=(r=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Lt=xt.toString,Tt=_t.call(vt),Ot=qt._,At=gt("^"+_t.call(St).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=Yt?e.Buffer:void 0,Wt=e.Symbol,Rt=e.Uint8Array,Bt=Nt?Nt.allocUnsafe:void 0,Gt=je(vt.getPrototypeOf,vt),Kt=vt.create,$t=xt.propertyIsEnumerable,Xt=bt.splice,Zt=Wt?Wt.isConcatSpreadable:void 0,Jt=Wt?Wt.iterator:void 0,ye=Wt?Wt.toStringTag:void 0,Me=function(){try{var t=Qi(vt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Xe=e.clearTimeout!==qt.clearTimeout&&e.clearTimeout,Ye=i&&i.now!==qt.Date.now&&i.now,Ze=e.setTimeout!==qt.setTimeout&&e.setTimeout,Je=pt.ceil,Qe=pt.floor,tr=vt.getOwnPropertySymbols,er=Nt?Nt.isBuffer:void 0,rr=e.isFinite,nr=bt.join,ir=je(vt.keys,vt),or=pt.max,ar=pt.min,sr=i.now,lr=e.parseInt,ur=pt.random,cr=bt.reverse,fr=Qi(e,"DataView"),hr=Qi(e,"Map"),dr=Qi(e,"Promise"),pr=Qi(e,"Set"),vr=Qi(e,"WeakMap"),gr=Qi(vt,"create"),mr=vr&&new vr,yr={},br=Lo(fr),wr=Lo(hr),xr=Lo(dr),Cr=Lo(pr),_r=Lo(vr),Sr=Wt?Wt.prototype:void 0,kr=Sr?Sr.valueOf:void 0,Mr=Sr?Sr.toString:void 0;function Lr(t){if(Va(t)&&!Ea(t)&&!(t instanceof Nr)){if(t instanceof Ar)return t;if(St.call(t,"__wrapped__"))return To(t)}return new Ar(t)}var Tr=function(){function t(){}return function(e){if(!Ua(e))return{};if(Kt)return Kt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Or(){}function Ar(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Nr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Dr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Er(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Pr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Wr;++e<r;)this.add(t[e])}function Rr(t){var e=this.__data__=new Er(t);this.size=e.size}function Hr(t,e){var r=Ea(t),n=!r&&Da(t),i=!r&&!n&&Ha(t),o=!r&&!n&&!i&&Ja(t),a=r||n||i||o,s=a?Oe(t.length,mt):[],l=s.length;for(var u in t)!e&&!St.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ao(u,l))||s.push(u);return s}function Fr(t){var e=t.length;return e?t[Rn(0,e-1)]:void 0}function Ir(t,e){return So(mi(t),$r(e,0,t.length))}function zr(t){return So(mi(t))}function jr(t,e,r){(void 0!==r&&!Oa(t[e],r)||void 0===r&&!(e in t))&&Kr(t,e,r)}function Br(t,e,r){var n=t[e];St.call(t,e)&&Oa(n,r)&&(void 0!==r||e in t)||Kr(t,e,r)}function Ur(t,e){for(var r=t.length;r--;)if(Oa(t[r][0],e))return r;return-1}function Vr(t,e,r,n){return Qr(t,(function(t,i,o){e(n,t,r(t),o)})),n}function Gr(t,e){return t&&yi(e,ws(e),t)}function Kr(t,e,r){"__proto__"==e&&Me?Me(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function qr(t,e){for(var r=-1,i=e.length,o=n(i),a=null==t;++r<i;)o[r]=a?void 0:vs(t,e[r]);return o}function $r(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t}function Xr(t,e,r,n,i,o){var a,s=1&e,u=2&e,h=4&e;if(r&&(a=i?r(t,n,i,o):r(t)),void 0!==a)return a;if(!Ua(t))return t;var C=Ea(t);if(C){if(a=function(t){var e=t.length,r=new t.constructor(e);e&&"string"==typeof t[0]&&St.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!s)return mi(t,a)}else{var E=ro(t),W=E==d||E==p;if(Ha(t))return fi(t,s);if(E==m||E==l||W&&!i){if(a=u||W?{}:io(t),!s)return u?function(t,e){return yi(t,eo(t),e)}(t,function(t,e){return t&&yi(e,xs(e),t)}(a,t)):function(t,e){return yi(t,to(t),e)}(t,Gr(a,t))}else{if(!jt[E])return i?t:{};a=function(t,e,r){var n=t.constructor;switch(e){case _:return hi(t);case c:case f:return new n(+t);case S:return function(t,e){var r=e?hi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case k:case M:case L:case T:case O:case A:case"[object Uint8ClampedArray]":case N:case D:return di(t,r);case v:return new n;case g:case w:return new n(t);case y:return function(t){var e=new t.constructor(t.source,nt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return new n;case x:return i=t,kr?vt(kr.call(i)):{}}var i}(t,E,s)}}o||(o=new Rr);var P=o.get(t);if(P)return P;o.set(t,a),Xa(t)?t.forEach((function(n){a.add(Xr(n,e,r,n,t,o))})):Ga(t)&&t.forEach((function(n,i){a.set(i,Xr(n,e,r,i,t,o))}));var R=C?void 0:(h?u?Ki:Gi:u?xs:ws)(t);return se(R||t,(function(n,i){R&&(n=t[i=n]),Br(a,i,Xr(n,e,r,i,t,o))})),a}function Yr(t,e,r){var n=r.length;if(null==t)return!n;for(t=vt(t);n--;){var i=r[n],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Zr(t,e,r){if("function"!=typeof t)throw new yt(o);return wo((function(){t.apply(void 0,r)}),e)}function Jr(t,e,r,n){var i=-1,o=fe,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;r&&(e=de(e,Ae(r))),n?(o=he,a=!1):e.length>=200&&(o=De,a=!1,e=new Pr(e));t:for(;++i<s;){var c=t[i],f=null==r?c:r(c);if(c=n||0!==c?c:0,a&&f==f){for(var h=u;h--;)if(e[h]===f)continue t;l.push(c)}else o(e,f,n)||l.push(c)}return l}Lr.templateSettings={escape:z,evaluate:j,interpolate:B,variable:"",imports:{_:Lr}},Lr.prototype=Or.prototype,Lr.prototype.constructor=Lr,Ar.prototype=Tr(Or.prototype),Ar.prototype.constructor=Ar,Nr.prototype=Tr(Or.prototype),Nr.prototype.constructor=Nr,Dr.prototype.clear=function(){this.__data__=gr?gr(null):{},this.size=0},Dr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Dr.prototype.get=function(t){var e=this.__data__;if(gr){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return St.call(e,t)?e[t]:void 0},Dr.prototype.has=function(t){var e=this.__data__;return gr?void 0!==e[t]:St.call(e,t)},Dr.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=gr&&void 0===e?"__lodash_hash_undefined__":e,this},Er.prototype.clear=function(){this.__data__=[],this.size=0},Er.prototype.delete=function(t){var e=this.__data__,r=Ur(e,t);return!(r<0)&&(r==e.length-1?e.pop():Xt.call(e,r,1),--this.size,!0)},Er.prototype.get=function(t){var e=this.__data__,r=Ur(e,t);return r<0?void 0:e[r][1]},Er.prototype.has=function(t){return Ur(this.__data__,t)>-1},Er.prototype.set=function(t,e){var r=this.__data__,n=Ur(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Dr,map:new(hr||Er),string:new Dr}},Wr.prototype.delete=function(t){var e=Zi(this,t).delete(t);return this.size-=e?1:0,e},Wr.prototype.get=function(t){return Zi(this,t).get(t)},Wr.prototype.has=function(t){return Zi(this,t).has(t)},Wr.prototype.set=function(t,e){var r=Zi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Pr.prototype.add=Pr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Pr.prototype.has=function(t){return this.__data__.has(t)},Rr.prototype.clear=function(){this.__data__=new Er,this.size=0},Rr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Rr.prototype.get=function(t){return this.__data__.get(t)},Rr.prototype.has=function(t){return this.__data__.has(t)},Rr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Er){var n=r.__data__;if(!hr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(t,e),this.size=r.size,this};var Qr=xi(ln),tn=xi(un,!0);function en(t,e){var r=!0;return Qr(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function rn(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],a=e(o);if(null!=a&&(void 0===s?a==a&&!Za(a):r(a,s)))var s=a,l=o}return l}function nn(t,e){var r=[];return Qr(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function on(t,e,r,n,i){var o=-1,a=t.length;for(r||(r=oo),i||(i=[]);++o<a;){var s=t[o];e>0&&r(s)?e>1?on(s,e-1,r,n,i):pe(i,s):n||(i[i.length]=s)}return i}var an=Ci(),sn=Ci(!0);function ln(t,e){return t&&an(t,e,ws)}function un(t,e){return t&&sn(t,e,ws)}function cn(t,e){return ce(e,(function(e){return za(t[e])}))}function fn(t,e){for(var r=0,n=(e=si(e,t)).length;null!=t&&r<n;)t=t[Mo(e[r++])];return r&&r==n?t:void 0}function hn(t,e,r){var n=e(t);return Ea(t)?n:pe(n,r(t))}function dn(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ye&&ye in vt(t)?function(t){var e=St.call(t,ye),r=t[ye];try{t[ye]=void 0;var n=!0}catch(t){}var i=Lt.call(t);n&&(e?t[ye]=r:delete t[ye]);return i}(t):function(t){return Lt.call(t)}(t)}function pn(t,e){return t>e}function vn(t,e){return null!=t&&St.call(t,e)}function gn(t,e){return null!=t&&e in vt(t)}function mn(t,e,r){for(var i=r?he:fe,o=t[0].length,a=t.length,s=a,l=n(a),u=1/0,c=[];s--;){var f=t[s];s&&e&&(f=de(f,Ae(e))),u=ar(f.length,u),l[s]=!r&&(e||o>=120&&f.length>=120)?new Pr(s&&f):void 0}f=t[0];var h=-1,d=l[0];t:for(;++h<o&&c.length<u;){var p=f[h],v=e?e(p):p;if(p=r||0!==p?p:0,!(d?De(d,v):i(c,v,r))){for(s=a;--s;){var g=l[s];if(!(g?De(g,v):i(t[s],v,r)))continue t}d&&d.push(v),c.push(p)}}return c}function yn(t,e,r){var n=null==(t=go(t,e=si(e,t)))?t:t[Mo(Io(e))];return null==n?void 0:oe(n,t,r)}function bn(t){return Va(t)&&dn(t)==l}function wn(t,e,r,n,i){return t===e||(null==t||null==e||!Va(t)&&!Va(e)?t!=t&&e!=e:function(t,e,r,n,i,o){var a=Ea(t),s=Ea(e),d=a?u:ro(t),p=s?u:ro(e),C=(d=d==l?m:d)==m,k=(p=p==l?m:p)==m,M=d==p;if(M&&Ha(t)){if(!Ha(e))return!1;a=!0,C=!1}if(M&&!C)return o||(o=new Rr),a||Ja(t)?Ui(t,e,r,n,i,o):function(t,e,r,n,i,o,a){switch(r){case S:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _:return!(t.byteLength!=e.byteLength||!o(new Rt(t),new Rt(e)));case c:case f:case g:return Oa(+t,+e);case h:return t.name==e.name&&t.message==e.message;case y:case w:return t==e+"";case v:var s=ze;case b:var l=1&n;if(s||(s=Ue),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;n|=2,a.set(t,e);var d=Ui(s(t),s(e),n,i,o,a);return a.delete(t),d;case x:if(kr)return kr.call(t)==kr.call(e)}return!1}(t,e,d,r,n,i,o);if(!(1&r)){var L=C&&St.call(t,"__wrapped__"),T=k&&St.call(e,"__wrapped__");if(L||T){var O=L?t.value():t,A=T?e.value():e;return o||(o=new Rr),i(O,A,r,n,o)}}if(!M)return!1;return o||(o=new Rr),function(t,e,r,n,i,o){var a=1&r,s=Gi(t),l=s.length,u=Gi(e).length;if(l!=u&&!a)return!1;var c=l;for(;c--;){var f=s[c];if(!(a?f in e:St.call(e,f)))return!1}var h=o.get(t),d=o.get(e);if(h&&d)return h==e&&d==t;var p=!0;o.set(t,e),o.set(e,t);var v=a;for(;++c<l;){f=s[c];var g=t[f],m=e[f];if(n)var y=a?n(m,g,f,e,t,o):n(g,m,f,t,e,o);if(!(void 0===y?g===m||i(g,m,r,n,o):y)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,r,n,i,o)}(t,e,r,n,wn,i))}function xn(t,e,r,n){var i=r.length,o=i,a=!n;if(null==t)return!o;for(t=vt(t);i--;){var s=r[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){var l=(s=r[i])[0],u=t[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in t))return!1}else{var f=new Rr;if(n)var h=n(u,c,l,t,e,f);if(!(void 0===h?wn(c,u,3,n,f):h))return!1}}return!0}function Cn(t){return!(!Ua(t)||(e=t,Mt&&Mt in e))&&(za(t)?At:at).test(Lo(t));var e}function _n(t){return"function"==typeof t?t:null==t?Ks:"object"==typeof t?Ea(t)?On(t[0],t[1]):Tn(t):el(t)}function Sn(t){if(!fo(t))return ir(t);var e=[];for(var r in vt(t))St.call(t,r)&&"constructor"!=r&&e.push(r);return e}function kn(t){if(!Ua(t))return function(t){var e=[];if(null!=t)for(var r in vt(t))e.push(r);return e}(t);var e=fo(t),r=[];for(var n in t)("constructor"!=n||!e&&St.call(t,n))&&r.push(n);return r}function Mn(t,e){return t<e}function Ln(t,e){var r=-1,i=Pa(t)?n(t.length):[];return Qr(t,(function(t,n,o){i[++r]=e(t,n,o)})),i}function Tn(t){var e=Ji(t);return 1==e.length&&e[0][2]?po(e[0][0],e[0][1]):function(r){return r===t||xn(r,t,e)}}function On(t,e){return lo(t)&&ho(e)?po(Mo(t),e):function(r){var n=vs(r,t);return void 0===n&&n===e?gs(r,t):wn(e,n,3)}}function An(t,e,r,n,i){t!==e&&an(e,(function(o,a){if(i||(i=new Rr),Ua(o))!function(t,e,r,n,i,o,a){var s=yo(t,r),l=yo(e,r),u=a.get(l);if(u)return void jr(t,r,u);var c=o?o(s,l,r+"",t,e,a):void 0,f=void 0===c;if(f){var h=Ea(l),d=!h&&Ha(l),p=!h&&!d&&Ja(l);c=l,h||d||p?Ea(s)?c=s:Ra(s)?c=mi(s):d?(f=!1,c=fi(l,!0)):p?(f=!1,c=di(l,!0)):c=[]:qa(l)||Da(l)?(c=s,Da(s)?c=as(s):Ua(s)&&!za(s)||(c=io(l))):f=!1}f&&(a.set(l,c),i(c,l,n,o,a),a.delete(l));jr(t,r,c)}(t,e,a,r,An,n,i);else{var s=n?n(yo(t,a),o,a+"",t,e,i):void 0;void 0===s&&(s=o),jr(t,a,s)}}),xs)}function Nn(t,e){var r=t.length;if(r)return ao(e+=e<0?r:0,r)?t[e]:void 0}function Dn(t,e,r){e=e.length?de(e,(function(t){return Ea(t)?function(e){return fn(e,1===t.length?t[0]:t)}:t})):[Ks];var n=-1;return e=de(e,Ae(Yi())),function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(Ln(t,(function(t,r,i){return{criteria:de(e,(function(e){return e(t)})),index:++n,value:t}})),(function(t,e){return function(t,e,r){var n=-1,i=t.criteria,o=e.criteria,a=i.length,s=r.length;for(;++n<a;){var l=pi(i[n],o[n]);if(l){if(n>=s)return l;var u=r[n];return l*("desc"==u?-1:1)}}return t.index-e.index}(t,e,r)}))}function En(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var a=e[n],s=fn(t,a);r(s,a)&&jn(o,si(a,t),s)}return o}function Wn(t,e,r,n){var i=n?Ce:xe,o=-1,a=e.length,s=t;for(t===e&&(e=mi(e)),r&&(s=de(t,Ae(r)));++o<a;)for(var l=0,u=e[o],c=r?r(u):u;(l=i(s,c,l,n))>-1;)s!==t&&Xt.call(s,l,1),Xt.call(t,l,1);return t}function Pn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;ao(i)?Xt.call(t,i,1):Qn(t,i)}}return t}function Rn(t,e){return t+Qe(ur()*(e-t+1))}function Hn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Qe(e/2))&&(t+=t)}while(e);return r}function Fn(t,e){return xo(vo(t,e,Ks),t+"")}function In(t){return Fr(Os(t))}function zn(t,e){var r=Os(t);return So(r,$r(e,0,r.length))}function jn(t,e,r,n){if(!Ua(t))return t;for(var i=-1,o=(e=si(e,t)).length,a=o-1,s=t;null!=s&&++i<o;){var l=Mo(e[i]),u=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=a){var c=s[l];void 0===(u=n?n(c,l,s):void 0)&&(u=Ua(c)?c:ao(e[i+1])?[]:{})}Br(s,l,u),s=s[l]}return t}var Bn=mr?function(t,e){return mr.set(t,e),t}:Ks,Un=Me?function(t,e){return Me(t,"toString",{configurable:!0,enumerable:!1,value:Us(e),writable:!0})}:Ks;function Vn(t){return So(Os(t))}function Gn(t,e,r){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=n(o);++i<o;)a[i]=t[i+e];return a}function Kn(t,e){var r;return Qr(t,(function(t,n,i){return!(r=e(t,n,i))})),!!r}function qn(t,e,r){var n=0,i=null==t?n:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=t[o];null!==a&&!Za(a)&&(r?a<=e:a<e)?n=o+1:i=o}return i}return $n(t,e,Ks,r)}function $n(t,e,r,n){var i=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=r(e))!=e,s=null===e,l=Za(e),u=void 0===e;i<o;){var c=Qe((i+o)/2),f=r(t[c]),h=void 0!==f,d=null===f,p=f==f,v=Za(f);if(a)var g=n||p;else g=u?p&&(n||h):s?p&&h&&(n||!d):l?p&&h&&!d&&(n||!v):!d&&!v&&(n?f<=e:f<e);g?i=c+1:o=c}return ar(o,4294967294)}function Xn(t,e){for(var r=-1,n=t.length,i=0,o=[];++r<n;){var a=t[r],s=e?e(a):a;if(!r||!Oa(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function Yn(t){return"number"==typeof t?t:Za(t)?NaN:+t}function Zn(t){if("string"==typeof t)return t;if(Ea(t))return de(t,Zn)+"";if(Za(t))return Mr?Mr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Jn(t,e,r){var n=-1,i=fe,o=t.length,a=!0,s=[],l=s;if(r)a=!1,i=he;else if(o>=200){var u=e?null:Hi(t);if(u)return Ue(u);a=!1,i=De,l=new Pr}else l=e?[]:s;t:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||0!==c?c:0,a&&f==f){for(var h=l.length;h--;)if(l[h]===f)continue t;e&&l.push(f),s.push(c)}else i(l,f,r)||(l!==s&&l.push(f),s.push(c))}return s}function Qn(t,e){return null==(t=go(t,e=si(e,t)))||delete t[Mo(Io(e))]}function ti(t,e,r,n){return jn(t,e,r(fn(t,e)),n)}function ei(t,e,r,n){for(var i=t.length,o=n?i:-1;(n?o--:++o<i)&&e(t[o],o,t););return r?Gn(t,n?0:o,n?o+1:i):Gn(t,n?o+1:0,n?i:o)}function ri(t,e){var r=t;return r instanceof Nr&&(r=r.value()),ve(e,(function(t,e){return e.func.apply(e.thisArg,pe([t],e.args))}),r)}function ni(t,e,r){var i=t.length;if(i<2)return i?Jn(t[0]):[];for(var o=-1,a=n(i);++o<i;)for(var s=t[o],l=-1;++l<i;)l!=o&&(a[o]=Jr(a[o]||s,t[l],e,r));return Jn(on(a,1),e,r)}function ii(t,e,r){for(var n=-1,i=t.length,o=e.length,a={};++n<i;){var s=n<o?e[n]:void 0;r(a,t[n],s)}return a}function oi(t){return Ra(t)?t:[]}function ai(t){return"function"==typeof t?t:Ks}function si(t,e){return Ea(t)?t:lo(t,e)?[t]:ko(ss(t))}var li=Fn;function ui(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:Gn(t,e,r)}var ci=Xe||function(t){return qt.clearTimeout(t)};function fi(t,e){if(e)return t.slice();var r=t.length,n=Bt?Bt(r):new t.constructor(r);return t.copy(n),n}function hi(t){var e=new t.constructor(t.byteLength);return new Rt(e).set(new Rt(t)),e}function di(t,e){var r=e?hi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function pi(t,e){if(t!==e){var r=void 0!==t,n=null===t,i=t==t,o=Za(t),a=void 0!==e,s=null===e,l=e==e,u=Za(e);if(!s&&!u&&!o&&t>e||o&&a&&l&&!s&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!o&&!u&&t<e||u&&r&&i&&!n&&!o||s&&r&&i||!a&&i||!l)return-1}return 0}function vi(t,e,r,i){for(var o=-1,a=t.length,s=r.length,l=-1,u=e.length,c=or(a-s,0),f=n(u+c),h=!i;++l<u;)f[l]=e[l];for(;++o<s;)(h||o<a)&&(f[r[o]]=t[o]);for(;c--;)f[l++]=t[o++];return f}function gi(t,e,r,i){for(var o=-1,a=t.length,s=-1,l=r.length,u=-1,c=e.length,f=or(a-l,0),h=n(f+c),d=!i;++o<f;)h[o]=t[o];for(var p=o;++u<c;)h[p+u]=e[u];for(;++s<l;)(d||o<a)&&(h[p+r[s]]=t[o++]);return h}function mi(t,e){var r=-1,i=t.length;for(e||(e=n(i));++r<i;)e[r]=t[r];return e}function yi(t,e,r,n){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=n?n(r[s],t[s],s,r,t):void 0;void 0===l&&(l=t[s]),i?Kr(r,s,l):Br(r,s,l)}return r}function bi(t,e){return function(r,n){var i=Ea(r)?ae:Vr,o=e?e():{};return i(r,t,Yi(n,2),o)}}function wi(t){return Fn((function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&so(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=vt(e);++n<i;){var s=r[n];s&&t(e,s,n,o)}return e}))}function xi(t,e){return function(r,n){if(null==r)return r;if(!Pa(r))return t(r,n);for(var i=r.length,o=e?i:-1,a=vt(r);(e?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ci(t){return function(e,r,n){for(var i=-1,o=vt(e),a=n(e),s=a.length;s--;){var l=a[t?s:++i];if(!1===r(o[l],l,o))break}return e}}function _i(t){return function(e){var r=Ie(e=ss(e))?Ke(e):void 0,n=r?r[0]:e.charAt(0),i=r?ui(r,1).join(""):e.slice(1);return n[t]()+i}}function Si(t){return function(e){return ve(zs(Ds(e).replace(Dt,"")),t,"")}}function ki(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=Tr(t.prototype),n=t.apply(r,e);return Ua(n)?n:r}}function Mi(t){return function(e,r,n){var i=vt(e);if(!Pa(e)){var o=Yi(r,3);e=ws(e),r=function(t){return o(i[t],t,i)}}var a=t(e,r,n);return a>-1?i[o?e[a]:a]:void 0}}function Li(t){return Vi((function(e){var r=e.length,n=r,i=Ar.prototype.thru;for(t&&e.reverse();n--;){var a=e[n];if("function"!=typeof a)throw new yt(o);if(i&&!s&&"wrapper"==$i(a))var s=new Ar([],!0)}for(n=s?n:r;++n<r;){var l=$i(a=e[n]),u="wrapper"==l?qi(a):void 0;s=u&&uo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?s[$i(u[0])].apply(s,u[3]):1==a.length&&uo(a)?s[l]():s.thru(a)}return function(){var t=arguments,n=t[0];if(s&&1==t.length&&Ea(n))return s.plant(n).value();for(var i=0,o=r?e[i].apply(this,t):n;++i<r;)o=e[i].call(this,o);return o}}))}function Ti(t,e,r,i,o,a,s,l,u,c){var f=128&e,h=1&e,d=2&e,p=24&e,v=512&e,g=d?void 0:ki(t);return function m(){for(var y=arguments.length,b=n(y),w=y;w--;)b[w]=arguments[w];if(p)var x=Xi(m),C=Pe(b,x);if(i&&(b=vi(b,i,o,p)),a&&(b=gi(b,a,s,p)),y-=C,p&&y<c){var _=Be(b,x);return Pi(t,e,Ti,m.placeholder,r,b,_,l,u,c-y)}var S=h?r:this,k=d?S[t]:t;return y=b.length,l?b=mo(b,l):v&&y>1&&b.reverse(),f&&u<y&&(b.length=u),this&&this!==qt&&this instanceof m&&(k=g||ki(k)),k.apply(S,b)}}function Oi(t,e){return function(r,n){return function(t,e,r,n){return ln(t,(function(t,i,o){e(n,r(t),i,o)})),n}(r,t,e(n),{})}}function Ai(t,e){return function(r,n){var i;if(void 0===r&&void 0===n)return e;if(void 0!==r&&(i=r),void 0!==n){if(void 0===i)return n;"string"==typeof r||"string"==typeof n?(r=Zn(r),n=Zn(n)):(r=Yn(r),n=Yn(n)),i=t(r,n)}return i}}function Ni(t){return Vi((function(e){return e=de(e,Ae(Yi())),Fn((function(r){var n=this;return t(e,(function(t){return oe(t,n,r)}))}))}))}function Di(t,e){var r=(e=void 0===e?" ":Zn(e)).length;if(r<2)return r?Hn(e,t):e;var n=Hn(e,Je(t/Ge(e)));return Ie(e)?ui(Ke(n),0,t).join(""):n.slice(0,t)}function Ei(t){return function(e,r,i){return i&&"number"!=typeof i&&so(e,r,i)&&(r=i=void 0),e=rs(e),void 0===r?(r=e,e=0):r=rs(r),function(t,e,r,i){for(var o=-1,a=or(Je((e-t)/(r||1)),0),s=n(a);a--;)s[i?a:++o]=t,t+=r;return s}(e,r,i=void 0===i?e<r?1:-1:rs(i),t)}}function Wi(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=os(e),r=os(r)),t(e,r)}}function Pi(t,e,r,n,i,o,a,s,l,u){var c=8&e;e|=c?32:64,4&(e&=~(c?64:32))||(e&=-4);var f=[t,e,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,s,l,u],h=r.apply(void 0,f);return uo(t)&&bo(h,f),h.placeholder=n,Co(h,t,e)}function Ri(t){var e=pt[t];return function(t,r){if(t=os(t),(r=null==r?0:ar(ns(r),292))&&rr(t)){var n=(ss(t)+"e").split("e");return+((n=(ss(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}var Hi=pr&&1/Ue(new pr([,-0]))[1]==1/0?function(t){return new pr(t)}:Zs;function Fi(t){return function(e){var r=ro(e);return r==v?ze(e):r==b?Ve(e):function(t,e){return de(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ii(t,e,r,i,s,l,u,c){var f=2&e;if(!f&&"function"!=typeof t)throw new yt(o);var h=i?i.length:0;if(h||(e&=-97,i=s=void 0),u=void 0===u?u:or(ns(u),0),c=void 0===c?c:ns(c),h-=s?s.length:0,64&e){var d=i,p=s;i=s=void 0}var v=f?void 0:qi(t),g=[t,e,r,i,s,d,p,l,u,c];if(v&&function(t,e){var r=t[1],n=e[1],i=r|n,o=i<131,s=128==n&&8==r||128==n&&256==r&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==r;if(!o&&!s)return t;1&n&&(t[2]=e[2],i|=1&r?0:4);var l=e[3];if(l){var u=t[3];t[3]=u?vi(u,l,e[4]):l,t[4]=u?Be(t[3],a):e[4]}(l=e[5])&&(u=t[5],t[5]=u?gi(u,l,e[6]):l,t[6]=u?Be(t[5],a):e[6]);(l=e[7])&&(t[7]=l);128&n&&(t[8]=null==t[8]?e[8]:ar(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(g,v),t=g[0],e=g[1],r=g[2],i=g[3],s=g[4],!(c=g[9]=void 0===g[9]?f?0:t.length:or(g[9]-h,0))&&24&e&&(e&=-25),e&&1!=e)m=8==e||16==e?function(t,e,r){var i=ki(t);return function o(){for(var a=arguments.length,s=n(a),l=a,u=Xi(o);l--;)s[l]=arguments[l];var c=a<3&&s[0]!==u&&s[a-1]!==u?[]:Be(s,u);if((a-=c.length)<r)return Pi(t,e,Ti,o.placeholder,void 0,s,c,void 0,void 0,r-a);var f=this&&this!==qt&&this instanceof o?i:t;return oe(f,this,s)}}(t,e,c):32!=e&&33!=e||s.length?Ti.apply(void 0,g):function(t,e,r,i){var o=1&e,a=ki(t);return function e(){for(var s=-1,l=arguments.length,u=-1,c=i.length,f=n(c+l),h=this&&this!==qt&&this instanceof e?a:t;++u<c;)f[u]=i[u];for(;l--;)f[u++]=arguments[++s];return oe(h,o?r:this,f)}}(t,e,r,i);else var m=function(t,e,r){var n=1&e,i=ki(t);return function e(){var o=this&&this!==qt&&this instanceof e?i:t;return o.apply(n?r:this,arguments)}}(t,e,r);return Co((v?Bn:bo)(m,g),t,e)}function zi(t,e,r,n){return void 0===t||Oa(t,xt[r])&&!St.call(n,r)?e:t}function ji(t,e,r,n,i,o){return Ua(t)&&Ua(e)&&(o.set(e,t),An(t,e,void 0,ji,o),o.delete(e)),t}function Bi(t){return qa(t)?void 0:t}function Ui(t,e,r,n,i,o){var a=1&r,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var f=-1,h=!0,d=2&r?new Pr:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],v=e[f];if(n)var g=a?n(v,p,f,e,t,o):n(p,v,f,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!me(e,(function(t,e){if(!De(d,e)&&(p===t||i(p,t,r,n,o)))return d.push(e)}))){h=!1;break}}else if(p!==v&&!i(p,v,r,n,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Vi(t){return xo(vo(t,void 0,Wo),t+"")}function Gi(t){return hn(t,ws,to)}function Ki(t){return hn(t,xs,eo)}var qi=mr?function(t){return mr.get(t)}:Zs;function $i(t){for(var e=t.name+"",r=yr[e],n=St.call(yr,e)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==t)return i.name}return e}function Xi(t){return(St.call(Lr,"placeholder")?Lr:t).placeholder}function Yi(){var t=Lr.iteratee||qs;return t=t===qs?_n:t,arguments.length?t(arguments[0],arguments[1]):t}function Zi(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ji(t){for(var e=ws(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,ho(i)]}return e}function Qi(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Cn(r)?r:void 0}var to=tr?function(t){return null==t?[]:(t=vt(t),ce(tr(t),(function(e){return $t.call(t,e)})))}:il,eo=tr?function(t){for(var e=[];t;)pe(e,to(t)),t=Gt(t);return e}:il,ro=dn;function no(t,e,r){for(var n=-1,i=(e=si(e,t)).length,o=!1;++n<i;){var a=Mo(e[n]);if(!(o=null!=t&&r(t,a)))break;t=t[a]}return o||++n!=i?o:!!(i=null==t?0:t.length)&&Ba(i)&&ao(a,i)&&(Ea(t)||Da(t))}function io(t){return"function"!=typeof t.constructor||fo(t)?{}:Tr(Gt(t))}function oo(t){return Ea(t)||Da(t)||!!(Zt&&t&&t[Zt])}function ao(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&<.test(t))&&t>-1&&t%1==0&&t<e}function so(t,e,r){if(!Ua(r))return!1;var n=typeof e;return!!("number"==n?Pa(r)&&ao(e,r.length):"string"==n&&e in r)&&Oa(r[e],t)}function lo(t,e){if(Ea(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Za(t))||(V.test(t)||!U.test(t)||null!=e&&t in vt(e))}function uo(t){var e=$i(t),r=Lr[e];if("function"!=typeof r||!(e in Nr.prototype))return!1;if(t===r)return!0;var n=qi(r);return!!n&&t===n[0]}(fr&&ro(new fr(new ArrayBuffer(1)))!=S||hr&&ro(new hr)!=v||dr&&"[object Promise]"!=ro(dr.resolve())||pr&&ro(new pr)!=b||vr&&ro(new vr)!=C)&&(ro=function(t){var e=dn(t),r=e==m?t.constructor:void 0,n=r?Lo(r):"";if(n)switch(n){case br:return S;case wr:return v;case xr:return"[object Promise]";case Cr:return b;case _r:return C}return e});var co=Ct?za:ol;function fo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||xt)}function ho(t){return t==t&&!Ua(t)}function po(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in vt(r)))}}function vo(t,e,r){return e=or(void 0===e?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=or(i.length-e,0),s=n(a);++o<a;)s[o]=i[e+o];o=-1;for(var l=n(e+1);++o<e;)l[o]=i[o];return l[e]=r(s),oe(t,this,l)}}function go(t,e){return e.length<2?t:fn(t,Gn(e,0,-1))}function mo(t,e){for(var r=t.length,n=ar(e.length,r),i=mi(t);n--;){var o=e[n];t[n]=ao(o,r)?i[o]:void 0}return t}function yo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bo=_o(Bn),wo=Ze||function(t,e){return qt.setTimeout(t,e)},xo=_o(Un);function Co(t,e,r){var n=e+"";return xo(t,function(t,e){var r=e.length;if(!r)return t;var n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Z,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return se(s,(function(r){var n="_."+r[0];e&r[1]&&!fe(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(J);return e?e[1].split(Q):[]}(n),r)))}function _o(t){var e=0,r=0;return function(){var n=sr(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function So(t,e){var r=-1,n=t.length,i=n-1;for(e=void 0===e?n:e;++r<e;){var o=Rn(r,i),a=t[o];t[o]=t[r],t[r]=a}return t.length=e,t}var ko=function(t){var e=_a(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(G,(function(t,r,n,i){e.push(n?i.replace(et,"$1"):r||t)})),e}));function Mo(t){if("string"==typeof t||Za(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Lo(t){if(null!=t){try{return _t.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function To(t){if(t instanceof Nr)return t.clone();var e=new Ar(t.__wrapped__,t.__chain__);return e.__actions__=mi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Oo=Fn((function(t,e){return Ra(t)?Jr(t,on(e,1,Ra,!0)):[]})),Ao=Fn((function(t,e){var r=Io(e);return Ra(r)&&(r=void 0),Ra(t)?Jr(t,on(e,1,Ra,!0),Yi(r,2)):[]})),No=Fn((function(t,e){var r=Io(e);return Ra(r)&&(r=void 0),Ra(t)?Jr(t,on(e,1,Ra,!0),void 0,r):[]}));function Do(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ns(r);return i<0&&(i=or(n+i,0)),we(t,Yi(e,3),i)}function Eo(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n-1;return void 0!==r&&(i=ns(r),i=r<0?or(n+i,0):ar(i,n-1)),we(t,Yi(e,3),i,!0)}function Wo(t){return(null==t?0:t.length)?on(t,1):[]}function Po(t){return t&&t.length?t[0]:void 0}var Ro=Fn((function(t){var e=de(t,oi);return e.length&&e[0]===t[0]?mn(e):[]})),Ho=Fn((function(t){var e=Io(t),r=de(t,oi);return e===Io(r)?e=void 0:r.pop(),r.length&&r[0]===t[0]?mn(r,Yi(e,2)):[]})),Fo=Fn((function(t){var e=Io(t),r=de(t,oi);return(e="function"==typeof e?e:void 0)&&r.pop(),r.length&&r[0]===t[0]?mn(r,void 0,e):[]}));function Io(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var zo=Fn(jo);function jo(t,e){return t&&t.length&&e&&e.length?Wn(t,e):t}var Bo=Vi((function(t,e){var r=null==t?0:t.length,n=qr(t,e);return Pn(t,de(e,(function(t){return ao(t,r)?+t:t})).sort(pi)),n}));function Uo(t){return null==t?t:cr.call(t)}var Vo=Fn((function(t){return Jn(on(t,1,Ra,!0))})),Go=Fn((function(t){var e=Io(t);return Ra(e)&&(e=void 0),Jn(on(t,1,Ra,!0),Yi(e,2))})),Ko=Fn((function(t){var e=Io(t);return e="function"==typeof e?e:void 0,Jn(on(t,1,Ra,!0),void 0,e)}));function qo(t){if(!t||!t.length)return[];var e=0;return t=ce(t,(function(t){if(Ra(t))return e=or(t.length,e),!0})),Oe(e,(function(e){return de(t,ke(e))}))}function $o(t,e){if(!t||!t.length)return[];var r=qo(t);return null==e?r:de(r,(function(t){return oe(e,void 0,t)}))}var Xo=Fn((function(t,e){return Ra(t)?Jr(t,e):[]})),Yo=Fn((function(t){return ni(ce(t,Ra))})),Zo=Fn((function(t){var e=Io(t);return Ra(e)&&(e=void 0),ni(ce(t,Ra),Yi(e,2))})),Jo=Fn((function(t){var e=Io(t);return e="function"==typeof e?e:void 0,ni(ce(t,Ra),void 0,e)})),Qo=Fn(qo);var ta=Fn((function(t){var e=t.length,r=e>1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,$o(t,r)}));function ea(t){var e=Lr(t);return e.__chain__=!0,e}function ra(t,e){return e(t)}var na=Vi((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,i=function(e){return qr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Nr&&ao(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ra,args:[i],thisArg:void 0}),new Ar(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var ia=bi((function(t,e,r){St.call(t,r)?++t[r]:Kr(t,r,1)}));var oa=Mi(Do),aa=Mi(Eo);function sa(t,e){return(Ea(t)?se:Qr)(t,Yi(e,3))}function la(t,e){return(Ea(t)?le:tn)(t,Yi(e,3))}var ua=bi((function(t,e,r){St.call(t,r)?t[r].push(e):Kr(t,r,[e])}));var ca=Fn((function(t,e,r){var i=-1,o="function"==typeof e,a=Pa(t)?n(t.length):[];return Qr(t,(function(t){a[++i]=o?oe(e,t,r):yn(t,e,r)})),a})),fa=bi((function(t,e,r){Kr(t,r,e)}));function ha(t,e){return(Ea(t)?de:Ln)(t,Yi(e,3))}var da=bi((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var pa=Fn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&so(t,e[0],e[1])?e=[]:r>2&&so(e[0],e[1],e[2])&&(e=[e[0]]),Dn(t,on(e,1),[])})),va=Ye||function(){return qt.Date.now()};function ga(t,e,r){return e=r?void 0:e,Ii(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function ma(t,e){var r;if("function"!=typeof e)throw new yt(o);return t=ns(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}var ya=Fn((function(t,e,r){var n=1;if(r.length){var i=Be(r,Xi(ya));n|=32}return Ii(t,n,e,r,i)})),ba=Fn((function(t,e,r){var n=3;if(r.length){var i=Be(r,Xi(ba));n|=32}return Ii(e,n,t,r,i)}));function wa(t,e,r){var n,i,a,s,l,u,c=0,f=!1,h=!1,d=!0;if("function"!=typeof t)throw new yt(o);function p(e){var r=n,o=i;return n=i=void 0,c=e,s=t.apply(o,r)}function v(t){return c=t,l=wo(m,e),f?p(t):s}function g(t){var r=t-u;return void 0===u||r>=e||r<0||h&&t-c>=a}function m(){var t=va();if(g(t))return y(t);l=wo(m,function(t){var r=e-(t-u);return h?ar(r,a-(t-c)):r}(t))}function y(t){return l=void 0,d&&n?p(t):(n=i=void 0,s)}function b(){var t=va(),r=g(t);if(n=arguments,i=this,u=t,r){if(void 0===l)return v(u);if(h)return ci(l),l=wo(m,e),p(u)}return void 0===l&&(l=wo(m,e)),s}return e=os(e)||0,Ua(r)&&(f=!!r.leading,a=(h="maxWait"in r)?or(os(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d),b.cancel=function(){void 0!==l&&ci(l),c=0,n=u=i=l=void 0},b.flush=function(){return void 0===l?s:y(va())},b}var xa=Fn((function(t,e){return Zr(t,1,e)})),Ca=Fn((function(t,e,r){return Zr(t,os(e)||0,r)}));function _a(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new yt(o);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(_a.Cache||Wr),r}function Sa(t){if("function"!=typeof t)throw new yt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}_a.Cache=Wr;var ka=li((function(t,e){var r=(e=1==e.length&&Ea(e[0])?de(e[0],Ae(Yi())):de(on(e,1),Ae(Yi()))).length;return Fn((function(n){for(var i=-1,o=ar(n.length,r);++i<o;)n[i]=e[i].call(this,n[i]);return oe(t,this,n)}))})),Ma=Fn((function(t,e){return Ii(t,32,void 0,e,Be(e,Xi(Ma)))})),La=Fn((function(t,e){return Ii(t,64,void 0,e,Be(e,Xi(La)))})),Ta=Vi((function(t,e){return Ii(t,256,void 0,void 0,void 0,e)}));function Oa(t,e){return t===e||t!=t&&e!=e}var Aa=Wi(pn),Na=Wi((function(t,e){return t>=e})),Da=bn(function(){return arguments}())?bn:function(t){return Va(t)&&St.call(t,"callee")&&!$t.call(t,"callee")},Ea=n.isArray,Wa=Qt?Ae(Qt):function(t){return Va(t)&&dn(t)==_};function Pa(t){return null!=t&&Ba(t.length)&&!za(t)}function Ra(t){return Va(t)&&Pa(t)}var Ha=er||ol,Fa=te?Ae(te):function(t){return Va(t)&&dn(t)==f};function Ia(t){if(!Va(t))return!1;var e=dn(t);return e==h||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!qa(t)}function za(t){if(!Ua(t))return!1;var e=dn(t);return e==d||e==p||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ja(t){return"number"==typeof t&&t==ns(t)}function Ba(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ua(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Va(t){return null!=t&&"object"==typeof t}var Ga=ee?Ae(ee):function(t){return Va(t)&&ro(t)==v};function Ka(t){return"number"==typeof t||Va(t)&&dn(t)==g}function qa(t){if(!Va(t)||dn(t)!=m)return!1;var e=Gt(t);if(null===e)return!0;var r=St.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&_t.call(r)==Tt}var $a=re?Ae(re):function(t){return Va(t)&&dn(t)==y};var Xa=ne?Ae(ne):function(t){return Va(t)&&ro(t)==b};function Ya(t){return"string"==typeof t||!Ea(t)&&Va(t)&&dn(t)==w}function Za(t){return"symbol"==typeof t||Va(t)&&dn(t)==x}var Ja=ie?Ae(ie):function(t){return Va(t)&&Ba(t.length)&&!!zt[dn(t)]};var Qa=Wi(Mn),ts=Wi((function(t,e){return t<=e}));function es(t){if(!t)return[];if(Pa(t))return Ya(t)?Ke(t):mi(t);if(Jt&&t[Jt])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Jt]());var e=ro(t);return(e==v?ze:e==b?Ue:Os)(t)}function rs(t){return t?(t=os(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ns(t){var e=rs(t),r=e%1;return e==e?r?e-r:e:0}function is(t){return t?$r(ns(t),0,4294967295):0}function os(t){if("number"==typeof t)return t;if(Za(t))return NaN;if(Ua(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ua(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace($,"");var r=ot.test(t);return r||st.test(t)?Vt(t.slice(2),r?2:8):it.test(t)?NaN:+t}function as(t){return yi(t,xs(t))}function ss(t){return null==t?"":Zn(t)}var ls=wi((function(t,e){if(fo(e)||Pa(e))yi(e,ws(e),t);else for(var r in e)St.call(e,r)&&Br(t,r,e[r])})),us=wi((function(t,e){yi(e,xs(e),t)})),cs=wi((function(t,e,r,n){yi(e,xs(e),t,n)})),fs=wi((function(t,e,r,n){yi(e,ws(e),t,n)})),hs=Vi(qr);var ds=Fn((function(t,e){t=vt(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&so(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],a=xs(o),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(void 0===c||Oa(c,xt[u])&&!St.call(t,u))&&(t[u]=o[u])}return t})),ps=Fn((function(t){return t.push(void 0,ji),oe(_s,void 0,t)}));function vs(t,e,r){var n=null==t?void 0:fn(t,e);return void 0===n?r:n}function gs(t,e){return null!=t&&no(t,e,gn)}var ms=Oi((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=r}),Us(Ks)),ys=Oi((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),St.call(t,e)?t[e].push(r):t[e]=[r]}),Yi),bs=Fn(yn);function ws(t){return Pa(t)?Hr(t):Sn(t)}function xs(t){return Pa(t)?Hr(t,!0):kn(t)}var Cs=wi((function(t,e,r){An(t,e,r)})),_s=wi((function(t,e,r,n){An(t,e,r,n)})),Ss=Vi((function(t,e){var r={};if(null==t)return r;var n=!1;e=de(e,(function(e){return e=si(e,t),n||(n=e.length>1),e})),yi(t,Ki(t),r),n&&(r=Xr(r,7,Bi));for(var i=e.length;i--;)Qn(r,e[i]);return r}));var ks=Vi((function(t,e){return null==t?{}:function(t,e){return En(t,e,(function(e,r){return gs(t,r)}))}(t,e)}));function Ms(t,e){if(null==t)return{};var r=de(Ki(t),(function(t){return[t]}));return e=Yi(e),En(t,r,(function(t,r){return e(t,r[0])}))}var Ls=Fi(ws),Ts=Fi(xs);function Os(t){return null==t?[]:Ne(t,ws(t))}var As=Si((function(t,e,r){return e=e.toLowerCase(),t+(r?Ns(e):e)}));function Ns(t){return Is(ss(t).toLowerCase())}function Ds(t){return(t=ss(t))&&t.replace(ut,Re).replace(Et,"")}var Es=Si((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ws=Si((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ps=_i("toLowerCase");var Rs=Si((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var Hs=Si((function(t,e,r){return t+(r?" ":"")+Is(e)}));var Fs=Si((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Is=_i("toUpperCase");function zs(t,e,r){return t=ss(t),void 0===(e=r?void 0:e)?function(t){return Ht.test(t)}(t)?function(t){return t.match(Pt)||[]}(t):function(t){return t.match(tt)||[]}(t):t.match(e)||[]}var js=Fn((function(t,e){try{return oe(t,void 0,e)}catch(t){return Ia(t)?t:new ht(t)}})),Bs=Vi((function(t,e){return se(e,(function(e){e=Mo(e),Kr(t,e,ya(t[e],t))})),t}));function Us(t){return function(){return t}}var Vs=Li(),Gs=Li(!0);function Ks(t){return t}function qs(t){return _n("function"==typeof t?t:Xr(t,1))}var $s=Fn((function(t,e){return function(r){return yn(r,t,e)}})),Xs=Fn((function(t,e){return function(r){return yn(t,r,e)}}));function Ys(t,e,r){var n=ws(e),i=cn(e,n);null!=r||Ua(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=cn(e,ws(e)));var o=!(Ua(r)&&"chain"in r&&!r.chain),a=za(t);return se(i,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__),i=r.__actions__=mi(this.__actions__);return i.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,pe([this.value()],arguments))})})),t}function Zs(){}var Js=Ni(de),Qs=Ni(ue),tl=Ni(me);function el(t){return lo(t)?ke(Mo(t)):function(t){return function(e){return fn(e,t)}}(t)}var rl=Ei(),nl=Ei(!0);function il(){return[]}function ol(){return!1}var al=Ai((function(t,e){return t+e}),0),sl=Ri("ceil"),ll=Ai((function(t,e){return t/e}),1),ul=Ri("floor");var cl,fl=Ai((function(t,e){return t*e}),1),hl=Ri("round"),dl=Ai((function(t,e){return t-e}),0);return Lr.after=function(t,e){if("function"!=typeof e)throw new yt(o);return t=ns(t),function(){if(--t<1)return e.apply(this,arguments)}},Lr.ary=ga,Lr.assign=ls,Lr.assignIn=us,Lr.assignInWith=cs,Lr.assignWith=fs,Lr.at=hs,Lr.before=ma,Lr.bind=ya,Lr.bindAll=Bs,Lr.bindKey=ba,Lr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ea(t)?t:[t]},Lr.chain=ea,Lr.chunk=function(t,e,r){e=(r?so(t,e,r):void 0===e)?1:or(ns(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=n(Je(i/e));o<i;)s[a++]=Gn(t,o,o+=e);return s},Lr.compact=function(t){for(var e=-1,r=null==t?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i},Lr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=n(t-1),r=arguments[0],i=t;i--;)e[i-1]=arguments[i];return pe(Ea(r)?mi(r):[r],on(e,1))},Lr.cond=function(t){var e=null==t?0:t.length,r=Yi();return t=e?de(t,(function(t){if("function"!=typeof t[1])throw new yt(o);return[r(t[0]),t[1]]})):[],Fn((function(r){for(var n=-1;++n<e;){var i=t[n];if(oe(i[0],this,r))return oe(i[1],this,r)}}))},Lr.conforms=function(t){return function(t){var e=ws(t);return function(r){return Yr(r,t,e)}}(Xr(t,1))},Lr.constant=Us,Lr.countBy=ia,Lr.create=function(t,e){var r=Tr(t);return null==e?r:Gr(r,e)},Lr.curry=function t(e,r,n){var i=Ii(e,8,void 0,void 0,void 0,void 0,void 0,r=n?void 0:r);return i.placeholder=t.placeholder,i},Lr.curryRight=function t(e,r,n){var i=Ii(e,16,void 0,void 0,void 0,void 0,void 0,r=n?void 0:r);return i.placeholder=t.placeholder,i},Lr.debounce=wa,Lr.defaults=ds,Lr.defaultsDeep=ps,Lr.defer=xa,Lr.delay=Ca,Lr.difference=Oo,Lr.differenceBy=Ao,Lr.differenceWith=No,Lr.drop=function(t,e,r){var n=null==t?0:t.length;return n?Gn(t,(e=r||void 0===e?1:ns(e))<0?0:e,n):[]},Lr.dropRight=function(t,e,r){var n=null==t?0:t.length;return n?Gn(t,0,(e=n-(e=r||void 0===e?1:ns(e)))<0?0:e):[]},Lr.dropRightWhile=function(t,e){return t&&t.length?ei(t,Yi(e,3),!0,!0):[]},Lr.dropWhile=function(t,e){return t&&t.length?ei(t,Yi(e,3),!0):[]},Lr.fill=function(t,e,r,n){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&so(t,e,r)&&(r=0,n=i),function(t,e,r,n){var i=t.length;for((r=ns(r))<0&&(r=-r>i?0:i+r),(n=void 0===n||n>i?i:ns(n))<0&&(n+=i),n=r>n?0:is(n);r<n;)t[r++]=e;return t}(t,e,r,n)):[]},Lr.filter=function(t,e){return(Ea(t)?ce:nn)(t,Yi(e,3))},Lr.flatMap=function(t,e){return on(ha(t,e),1)},Lr.flatMapDeep=function(t,e){return on(ha(t,e),1/0)},Lr.flatMapDepth=function(t,e,r){return r=void 0===r?1:ns(r),on(ha(t,e),r)},Lr.flatten=Wo,Lr.flattenDeep=function(t){return(null==t?0:t.length)?on(t,1/0):[]},Lr.flattenDepth=function(t,e){return(null==t?0:t.length)?on(t,e=void 0===e?1:ns(e)):[]},Lr.flip=function(t){return Ii(t,512)},Lr.flow=Vs,Lr.flowRight=Gs,Lr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,n={};++e<r;){var i=t[e];n[i[0]]=i[1]}return n},Lr.functions=function(t){return null==t?[]:cn(t,ws(t))},Lr.functionsIn=function(t){return null==t?[]:cn(t,xs(t))},Lr.groupBy=ua,Lr.initial=function(t){return(null==t?0:t.length)?Gn(t,0,-1):[]},Lr.intersection=Ro,Lr.intersectionBy=Ho,Lr.intersectionWith=Fo,Lr.invert=ms,Lr.invertBy=ys,Lr.invokeMap=ca,Lr.iteratee=qs,Lr.keyBy=fa,Lr.keys=ws,Lr.keysIn=xs,Lr.map=ha,Lr.mapKeys=function(t,e){var r={};return e=Yi(e,3),ln(t,(function(t,n,i){Kr(r,e(t,n,i),t)})),r},Lr.mapValues=function(t,e){var r={};return e=Yi(e,3),ln(t,(function(t,n,i){Kr(r,n,e(t,n,i))})),r},Lr.matches=function(t){return Tn(Xr(t,1))},Lr.matchesProperty=function(t,e){return On(t,Xr(e,1))},Lr.memoize=_a,Lr.merge=Cs,Lr.mergeWith=_s,Lr.method=$s,Lr.methodOf=Xs,Lr.mixin=Ys,Lr.negate=Sa,Lr.nthArg=function(t){return t=ns(t),Fn((function(e){return Nn(e,t)}))},Lr.omit=Ss,Lr.omitBy=function(t,e){return Ms(t,Sa(Yi(e)))},Lr.once=function(t){return ma(2,t)},Lr.orderBy=function(t,e,r,n){return null==t?[]:(Ea(e)||(e=null==e?[]:[e]),Ea(r=n?void 0:r)||(r=null==r?[]:[r]),Dn(t,e,r))},Lr.over=Js,Lr.overArgs=ka,Lr.overEvery=Qs,Lr.overSome=tl,Lr.partial=Ma,Lr.partialRight=La,Lr.partition=da,Lr.pick=ks,Lr.pickBy=Ms,Lr.property=el,Lr.propertyOf=function(t){return function(e){return null==t?void 0:fn(t,e)}},Lr.pull=zo,Lr.pullAll=jo,Lr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Wn(t,e,Yi(r,2)):t},Lr.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Wn(t,e,void 0,r):t},Lr.pullAt=Bo,Lr.range=rl,Lr.rangeRight=nl,Lr.rearg=Ta,Lr.reject=function(t,e){return(Ea(t)?ce:nn)(t,Sa(Yi(e,3)))},Lr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var n=-1,i=[],o=t.length;for(e=Yi(e,3);++n<o;){var a=t[n];e(a,n,t)&&(r.push(a),i.push(n))}return Pn(t,i),r},Lr.rest=function(t,e){if("function"!=typeof t)throw new yt(o);return Fn(t,e=void 0===e?e:ns(e))},Lr.reverse=Uo,Lr.sampleSize=function(t,e,r){return e=(r?so(t,e,r):void 0===e)?1:ns(e),(Ea(t)?Ir:zn)(t,e)},Lr.set=function(t,e,r){return null==t?t:jn(t,e,r)},Lr.setWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:jn(t,e,r,n)},Lr.shuffle=function(t){return(Ea(t)?zr:Vn)(t)},Lr.slice=function(t,e,r){var n=null==t?0:t.length;return n?(r&&"number"!=typeof r&&so(t,e,r)?(e=0,r=n):(e=null==e?0:ns(e),r=void 0===r?n:ns(r)),Gn(t,e,r)):[]},Lr.sortBy=pa,Lr.sortedUniq=function(t){return t&&t.length?Xn(t):[]},Lr.sortedUniqBy=function(t,e){return t&&t.length?Xn(t,Yi(e,2)):[]},Lr.split=function(t,e,r){return r&&"number"!=typeof r&&so(t,e,r)&&(e=r=void 0),(r=void 0===r?4294967295:r>>>0)?(t=ss(t))&&("string"==typeof e||null!=e&&!$a(e))&&!(e=Zn(e))&&Ie(t)?ui(Ke(t),0,r):t.split(e,r):[]},Lr.spread=function(t,e){if("function"!=typeof t)throw new yt(o);return e=null==e?0:or(ns(e),0),Fn((function(r){var n=r[e],i=ui(r,0,e);return n&&pe(i,n),oe(t,this,i)}))},Lr.tail=function(t){var e=null==t?0:t.length;return e?Gn(t,1,e):[]},Lr.take=function(t,e,r){return t&&t.length?Gn(t,0,(e=r||void 0===e?1:ns(e))<0?0:e):[]},Lr.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Gn(t,(e=n-(e=r||void 0===e?1:ns(e)))<0?0:e,n):[]},Lr.takeRightWhile=function(t,e){return t&&t.length?ei(t,Yi(e,3),!1,!0):[]},Lr.takeWhile=function(t,e){return t&&t.length?ei(t,Yi(e,3)):[]},Lr.tap=function(t,e){return e(t),t},Lr.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new yt(o);return Ua(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),wa(t,e,{leading:n,maxWait:e,trailing:i})},Lr.thru=ra,Lr.toArray=es,Lr.toPairs=Ls,Lr.toPairsIn=Ts,Lr.toPath=function(t){return Ea(t)?de(t,Mo):Za(t)?[t]:mi(ko(ss(t)))},Lr.toPlainObject=as,Lr.transform=function(t,e,r){var n=Ea(t),i=n||Ha(t)||Ja(t);if(e=Yi(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:Ua(t)&&za(o)?Tr(Gt(t)):{}}return(i?se:ln)(t,(function(t,n,i){return e(r,t,n,i)})),r},Lr.unary=function(t){return ga(t,1)},Lr.union=Vo,Lr.unionBy=Go,Lr.unionWith=Ko,Lr.uniq=function(t){return t&&t.length?Jn(t):[]},Lr.uniqBy=function(t,e){return t&&t.length?Jn(t,Yi(e,2)):[]},Lr.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},Lr.unset=function(t,e){return null==t||Qn(t,e)},Lr.unzip=qo,Lr.unzipWith=$o,Lr.update=function(t,e,r){return null==t?t:ti(t,e,ai(r))},Lr.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:ti(t,e,ai(r),n)},Lr.values=Os,Lr.valuesIn=function(t){return null==t?[]:Ne(t,xs(t))},Lr.without=Xo,Lr.words=zs,Lr.wrap=function(t,e){return Ma(ai(e),t)},Lr.xor=Yo,Lr.xorBy=Zo,Lr.xorWith=Jo,Lr.zip=Qo,Lr.zipObject=function(t,e){return ii(t||[],e||[],Br)},Lr.zipObjectDeep=function(t,e){return ii(t||[],e||[],jn)},Lr.zipWith=ta,Lr.entries=Ls,Lr.entriesIn=Ts,Lr.extend=us,Lr.extendWith=cs,Ys(Lr,Lr),Lr.add=al,Lr.attempt=js,Lr.camelCase=As,Lr.capitalize=Ns,Lr.ceil=sl,Lr.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=os(r))==r?r:0),void 0!==e&&(e=(e=os(e))==e?e:0),$r(os(t),e,r)},Lr.clone=function(t){return Xr(t,4)},Lr.cloneDeep=function(t){return Xr(t,5)},Lr.cloneDeepWith=function(t,e){return Xr(t,5,e="function"==typeof e?e:void 0)},Lr.cloneWith=function(t,e){return Xr(t,4,e="function"==typeof e?e:void 0)},Lr.conformsTo=function(t,e){return null==e||Yr(t,e,ws(e))},Lr.deburr=Ds,Lr.defaultTo=function(t,e){return null==t||t!=t?e:t},Lr.divide=ll,Lr.endsWith=function(t,e,r){t=ss(t),e=Zn(e);var n=t.length,i=r=void 0===r?n:$r(ns(r),0,n);return(r-=e.length)>=0&&t.slice(r,i)==e},Lr.eq=Oa,Lr.escape=function(t){return(t=ss(t))&&I.test(t)?t.replace(H,He):t},Lr.escapeRegExp=function(t){return(t=ss(t))&&q.test(t)?t.replace(K,"\\$&"):t},Lr.every=function(t,e,r){var n=Ea(t)?ue:en;return r&&so(t,e,r)&&(e=void 0),n(t,Yi(e,3))},Lr.find=oa,Lr.findIndex=Do,Lr.findKey=function(t,e){return be(t,Yi(e,3),ln)},Lr.findLast=aa,Lr.findLastIndex=Eo,Lr.findLastKey=function(t,e){return be(t,Yi(e,3),un)},Lr.floor=ul,Lr.forEach=sa,Lr.forEachRight=la,Lr.forIn=function(t,e){return null==t?t:an(t,Yi(e,3),xs)},Lr.forInRight=function(t,e){return null==t?t:sn(t,Yi(e,3),xs)},Lr.forOwn=function(t,e){return t&&ln(t,Yi(e,3))},Lr.forOwnRight=function(t,e){return t&&un(t,Yi(e,3))},Lr.get=vs,Lr.gt=Aa,Lr.gte=Na,Lr.has=function(t,e){return null!=t&&no(t,e,vn)},Lr.hasIn=gs,Lr.head=Po,Lr.identity=Ks,Lr.includes=function(t,e,r,n){t=Pa(t)?t:Os(t),r=r&&!n?ns(r):0;var i=t.length;return r<0&&(r=or(i+r,0)),Ya(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&xe(t,e,r)>-1},Lr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ns(r);return i<0&&(i=or(n+i,0)),xe(t,e,i)},Lr.inRange=function(t,e,r){return e=rs(e),void 0===r?(r=e,e=0):r=rs(r),function(t,e,r){return t>=ar(e,r)&&t<or(e,r)}(t=os(t),e,r)},Lr.invoke=bs,Lr.isArguments=Da,Lr.isArray=Ea,Lr.isArrayBuffer=Wa,Lr.isArrayLike=Pa,Lr.isArrayLikeObject=Ra,Lr.isBoolean=function(t){return!0===t||!1===t||Va(t)&&dn(t)==c},Lr.isBuffer=Ha,Lr.isDate=Fa,Lr.isElement=function(t){return Va(t)&&1===t.nodeType&&!qa(t)},Lr.isEmpty=function(t){if(null==t)return!0;if(Pa(t)&&(Ea(t)||"string"==typeof t||"function"==typeof t.splice||Ha(t)||Ja(t)||Da(t)))return!t.length;var e=ro(t);if(e==v||e==b)return!t.size;if(fo(t))return!Sn(t).length;for(var r in t)if(St.call(t,r))return!1;return!0},Lr.isEqual=function(t,e){return wn(t,e)},Lr.isEqualWith=function(t,e,r){var n=(r="function"==typeof r?r:void 0)?r(t,e):void 0;return void 0===n?wn(t,e,void 0,r):!!n},Lr.isError=Ia,Lr.isFinite=function(t){return"number"==typeof t&&rr(t)},Lr.isFunction=za,Lr.isInteger=ja,Lr.isLength=Ba,Lr.isMap=Ga,Lr.isMatch=function(t,e){return t===e||xn(t,e,Ji(e))},Lr.isMatchWith=function(t,e,r){return r="function"==typeof r?r:void 0,xn(t,e,Ji(e),r)},Lr.isNaN=function(t){return Ka(t)&&t!=+t},Lr.isNative=function(t){if(co(t))throw new ht("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Cn(t)},Lr.isNil=function(t){return null==t},Lr.isNull=function(t){return null===t},Lr.isNumber=Ka,Lr.isObject=Ua,Lr.isObjectLike=Va,Lr.isPlainObject=qa,Lr.isRegExp=$a,Lr.isSafeInteger=function(t){return ja(t)&&t>=-9007199254740991&&t<=9007199254740991},Lr.isSet=Xa,Lr.isString=Ya,Lr.isSymbol=Za,Lr.isTypedArray=Ja,Lr.isUndefined=function(t){return void 0===t},Lr.isWeakMap=function(t){return Va(t)&&ro(t)==C},Lr.isWeakSet=function(t){return Va(t)&&"[object WeakSet]"==dn(t)},Lr.join=function(t,e){return null==t?"":nr.call(t,e)},Lr.kebabCase=Es,Lr.last=Io,Lr.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=ns(r))<0?or(n+i,0):ar(i,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,i):we(t,_e,i,!0)},Lr.lowerCase=Ws,Lr.lowerFirst=Ps,Lr.lt=Qa,Lr.lte=ts,Lr.max=function(t){return t&&t.length?rn(t,Ks,pn):void 0},Lr.maxBy=function(t,e){return t&&t.length?rn(t,Yi(e,2),pn):void 0},Lr.mean=function(t){return Se(t,Ks)},Lr.meanBy=function(t,e){return Se(t,Yi(e,2))},Lr.min=function(t){return t&&t.length?rn(t,Ks,Mn):void 0},Lr.minBy=function(t,e){return t&&t.length?rn(t,Yi(e,2),Mn):void 0},Lr.stubArray=il,Lr.stubFalse=ol,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=fl,Lr.nth=function(t,e){return t&&t.length?Nn(t,ns(e)):void 0},Lr.noConflict=function(){return qt._===this&&(qt._=Ot),this},Lr.noop=Zs,Lr.now=va,Lr.pad=function(t,e,r){t=ss(t);var n=(e=ns(e))?Ge(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Di(Qe(i),r)+t+Di(Je(i),r)},Lr.padEnd=function(t,e,r){t=ss(t);var n=(e=ns(e))?Ge(t):0;return e&&n<e?t+Di(e-n,r):t},Lr.padStart=function(t,e,r){t=ss(t);var n=(e=ns(e))?Ge(t):0;return e&&n<e?Di(e-n,r)+t:t},Lr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),lr(ss(t).replace(X,""),e||0)},Lr.random=function(t,e,r){if(r&&"boolean"!=typeof r&&so(t,e,r)&&(e=r=void 0),void 0===r&&("boolean"==typeof e?(r=e,e=void 0):"boolean"==typeof t&&(r=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=rs(t),void 0===e?(e=t,t=0):e=rs(e)),t>e){var n=t;t=e,e=n}if(r||t%1||e%1){var i=ur();return ar(t+i*(e-t+Ut("1e-"+((i+"").length-1))),e)}return Rn(t,e)},Lr.reduce=function(t,e,r){var n=Ea(t)?ve:Le,i=arguments.length<3;return n(t,Yi(e,4),r,i,Qr)},Lr.reduceRight=function(t,e,r){var n=Ea(t)?ge:Le,i=arguments.length<3;return n(t,Yi(e,4),r,i,tn)},Lr.repeat=function(t,e,r){return e=(r?so(t,e,r):void 0===e)?1:ns(e),Hn(ss(t),e)},Lr.replace=function(){var t=arguments,e=ss(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Lr.result=function(t,e,r){var n=-1,i=(e=si(e,t)).length;for(i||(i=1,t=void 0);++n<i;){var o=null==t?void 0:t[Mo(e[n])];void 0===o&&(n=i,o=r),t=za(o)?o.call(t):o}return t},Lr.round=hl,Lr.runInContext=t,Lr.sample=function(t){return(Ea(t)?Fr:In)(t)},Lr.size=function(t){if(null==t)return 0;if(Pa(t))return Ya(t)?Ge(t):t.length;var e=ro(t);return e==v||e==b?t.size:Sn(t).length},Lr.snakeCase=Rs,Lr.some=function(t,e,r){var n=Ea(t)?me:Kn;return r&&so(t,e,r)&&(e=void 0),n(t,Yi(e,3))},Lr.sortedIndex=function(t,e){return qn(t,e)},Lr.sortedIndexBy=function(t,e,r){return $n(t,e,Yi(r,2))},Lr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var n=qn(t,e);if(n<r&&Oa(t[n],e))return n}return-1},Lr.sortedLastIndex=function(t,e){return qn(t,e,!0)},Lr.sortedLastIndexBy=function(t,e,r){return $n(t,e,Yi(r,2),!0)},Lr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var r=qn(t,e,!0)-1;if(Oa(t[r],e))return r}return-1},Lr.startCase=Hs,Lr.startsWith=function(t,e,r){return t=ss(t),r=null==r?0:$r(ns(r),0,t.length),e=Zn(e),t.slice(r,r+e.length)==e},Lr.subtract=dl,Lr.sum=function(t){return t&&t.length?Te(t,Ks):0},Lr.sumBy=function(t,e){return t&&t.length?Te(t,Yi(e,2)):0},Lr.template=function(t,e,r){var n=Lr.templateSettings;r&&so(t,e,r)&&(e=void 0),t=ss(t),e=cs({},e,n,zi);var i,o,a=cs({},e.imports,n.imports,zi),s=ws(a),l=Ne(a,s),u=0,c=e.interpolate||ct,f="__p += '",h=gt((e.escape||ct).source+"|"+c.source+"|"+(c===B?rt:ct).source+"|"+(e.evaluate||ct).source+"|$","g"),d="//# sourceURL="+(St.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++It+"]")+"\n";t.replace(h,(function(e,r,n,a,s,l){return n||(n=a),f+=t.slice(u,l).replace(ft,Fe),r&&(i=!0,f+="' +\n__e("+r+") +\n'"),s&&(o=!0,f+="';\n"+s+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),f+="';\n";var p=St.call(e,"variable")&&e.variable;p||(f="with (obj) {\n"+f+"\n}\n"),f=(o?f.replace(E,""):f).replace(W,"$1").replace(P,"$1;"),f="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=js((function(){return dt(s,d+"return "+f).apply(void 0,l)}));if(v.source=f,Ia(v))throw v;return v},Lr.times=function(t,e){if((t=ns(t))<1||t>9007199254740991)return[];var r=4294967295,n=ar(t,4294967295);t-=4294967295;for(var i=Oe(n,e=Yi(e));++r<t;)e(r);return i},Lr.toFinite=rs,Lr.toInteger=ns,Lr.toLength=is,Lr.toLower=function(t){return ss(t).toLowerCase()},Lr.toNumber=os,Lr.toSafeInteger=function(t){return t?$r(ns(t),-9007199254740991,9007199254740991):0===t?t:0},Lr.toString=ss,Lr.toUpper=function(t){return ss(t).toUpperCase()},Lr.trim=function(t,e,r){if((t=ss(t))&&(r||void 0===e))return t.replace($,"");if(!t||!(e=Zn(e)))return t;var n=Ke(t),i=Ke(e);return ui(n,Ee(n,i),We(n,i)+1).join("")},Lr.trimEnd=function(t,e,r){if((t=ss(t))&&(r||void 0===e))return t.replace(Y,"");if(!t||!(e=Zn(e)))return t;var n=Ke(t);return ui(n,0,We(n,Ke(e))+1).join("")},Lr.trimStart=function(t,e,r){if((t=ss(t))&&(r||void 0===e))return t.replace(X,"");if(!t||!(e=Zn(e)))return t;var n=Ke(t);return ui(n,Ee(n,Ke(e))).join("")},Lr.truncate=function(t,e){var r=30,n="...";if(Ua(e)){var i="separator"in e?e.separator:i;r="length"in e?ns(e.length):r,n="omission"in e?Zn(e.omission):n}var o=(t=ss(t)).length;if(Ie(t)){var a=Ke(t);o=a.length}if(r>=o)return t;var s=r-Ge(n);if(s<1)return n;var l=a?ui(a,0,s).join(""):t.slice(0,s);if(void 0===i)return l+n;if(a&&(s+=l.length-s),$a(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=gt(i.source,ss(nt.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var f=u.index;l=l.slice(0,void 0===f?s:f)}}else if(t.indexOf(Zn(i),s)!=s){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+n},Lr.unescape=function(t){return(t=ss(t))&&F.test(t)?t.replace(R,qe):t},Lr.uniqueId=function(t){var e=++kt;return ss(t)+e},Lr.upperCase=Fs,Lr.upperFirst=Is,Lr.each=sa,Lr.eachRight=la,Lr.first=Po,Ys(Lr,(cl={},ln(Lr,(function(t,e){St.call(Lr.prototype,e)||(cl[e]=t)})),cl),{chain:!1}),Lr.VERSION="4.17.20",se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Lr[t].placeholder=Lr})),se(["drop","take"],(function(t,e){Nr.prototype[t]=function(r){r=void 0===r?1:or(ns(r),0);var n=this.__filtered__&&!e?new Nr(this):this.clone();return n.__filtered__?n.__takeCount__=ar(r,n.__takeCount__):n.__views__.push({size:ar(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Nr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),se(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Nr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Yi(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),se(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Nr.prototype[t]=function(){return this[r](1).value()[0]}})),se(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Nr.prototype[t]=function(){return this.__filtered__?new Nr(this):this[r](1)}})),Nr.prototype.compact=function(){return this.filter(Ks)},Nr.prototype.find=function(t){return this.filter(t).head()},Nr.prototype.findLast=function(t){return this.reverse().find(t)},Nr.prototype.invokeMap=Fn((function(t,e){return"function"==typeof t?new Nr(this):this.map((function(r){return yn(r,t,e)}))})),Nr.prototype.reject=function(t){return this.filter(Sa(Yi(t)))},Nr.prototype.slice=function(t,e){t=ns(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Nr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=ns(e))<0?r.dropRight(-e):r.take(e-t)),r)},Nr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Nr.prototype.toArray=function(){return this.take(4294967295)},ln(Nr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=Lr[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);i&&(Lr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,s=e instanceof Nr,l=a[0],u=s||Ea(e),c=function(t){var e=i.apply(Lr,pe([t],a));return n&&f?e[0]:e};u&&r&&"function"==typeof l&&1!=l.length&&(s=u=!1);var f=this.__chain__,h=!!this.__actions__.length,d=o&&!f,p=s&&!h;if(!o&&u){e=p?e:new Nr(this);var v=t.apply(e,a);return v.__actions__.push({func:ra,args:[c],thisArg:void 0}),new Ar(v,f)}return d&&p?t.apply(this,a):(v=this.thru(c),d?n?v.value()[0]:v.value():v)})})),se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=bt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Lr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Ea(i)?i:[],t)}return this[r]((function(r){return e.apply(Ea(r)?r:[],t)}))}})),ln(Nr.prototype,(function(t,e){var r=Lr[e];if(r){var n=r.name+"";St.call(yr,n)||(yr[n]=[]),yr[n].push({name:e,func:r})}})),yr[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],Nr.prototype.clone=function(){var t=new Nr(this.__wrapped__);return t.__actions__=mi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mi(this.__views__),t},Nr.prototype.reverse=function(){if(this.__filtered__){var t=new Nr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Nr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ea(t),n=e<0,i=r?t.length:0,o=function(t,e,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=ar(e,t+a);break;case"takeRight":t=or(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=n?s:a-1,c=this.__iteratees__,f=c.length,h=0,d=ar(l,this.__takeCount__);if(!r||!n&&i==l&&d==l)return ri(t,this.__actions__);var p=[];t:for(;l--&&h<d;){for(var v=-1,g=t[u+=e];++v<f;){var m=c[v],y=m.iteratee,b=m.type,w=y(g);if(2==b)g=w;else if(!w){if(1==b)continue t;break t}}p[h++]=g}return p},Lr.prototype.at=na,Lr.prototype.chain=function(){return ea(this)},Lr.prototype.commit=function(){return new Ar(this.value(),this.__chain__)},Lr.prototype.next=function(){void 0===this.__values__&&(this.__values__=es(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Lr.prototype.plant=function(t){for(var e,r=this;r instanceof Or;){var n=To(r);n.__index__=0,n.__values__=void 0,e?i.__wrapped__=n:e=n;var i=n;r=r.__wrapped__}return i.__wrapped__=t,e},Lr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Nr){var e=t;return this.__actions__.length&&(e=new Nr(this)),(e=e.reverse()).__actions__.push({func:ra,args:[Uo],thisArg:void 0}),new Ar(e,this.__chain__)}return this.thru(Uo)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Jt&&(Lr.prototype[Jt]=function(){return this}),Lr}();qt._=$e,void 0===(i=function(){return $e}.call(e,r,e,n))||(n.exports=i)}).call(this)}).call(this,r(7),r(21)(t))},function(e,r){e.exports=t},function(t,e,r){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,r=/gecko\/\d/i.test(t),n=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=n||i||o,s=a&&(n?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),c=!o&&/Chrome\//.test(t),f=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),v=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),g=/Android/.test(t),m=v||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=v||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),x=f&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,l=!0);var C=y&&(u||f&&(null==x||x<12.11)),_=r||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var k,M=function(t,e){var r=t.className,n=S(e).exec(r);if(n){var i=r.slice(n.index+n[0].length);t.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function L(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function T(t,e){return L(t).appendChild(e)}function O(t,e,r,n){var i=document.createElement(t);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function A(t,e,r,n){var i=O(t,e,r,n);return i.setAttribute("role","presentation"),i}function N(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function D(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function E(t,e){var r=t.className;S(e).test(r)||(t.className+=(r?" ":"")+e)}function W(t,e){for(var r=t.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(e)&&(e+=" "+r[n]);return e}k=document.createRange?function(t,e,r,n){var i=document.createRange();return i.setEnd(n||t,r),i.setStart(t,e),i}:function(t,e,r){var n=document.body.createTextRange();try{n.moveToElementText(t.parentNode)}catch(t){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",e),n};var P=function(t){t.select()};function R(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function H(t,e,r){for(var n in e||(e={}),t)!t.hasOwnProperty(n)||!1===r&&e.hasOwnProperty(n)||(e[n]=t[n]);return e}function F(t,e,r,n,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=n||0,a=i||0;;){var s=t.indexOf("\t",o);if(s<0||s>=e)return a+(e-o);a+=s-o,a+=r-a%r,o=s+1}}v?P=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(P=function(t){try{t.select()}catch(t){}});var I=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function z(t,e){for(var r=0;r<t.length;++r)if(t[r]==e)return r;return-1}I.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},I.prototype.set=function(t,e){this.f=e;var r=+new Date+t;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=r)};var j={toString:function(){return"CodeMirror.Pass"}},B={scroll:!1},U={origin:"*mouse"},V={origin:"+move"};function G(t,e,r){for(var n=0,i=0;;){var o=t.indexOf("\t",n);-1==o&&(o=t.length);var a=o-n;if(o==t.length||i+a>=e)return n+Math.min(a,e-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=e)return n}}var K=[""];function q(t){for(;K.length<=t;)K.push($(K)+" ");return K[t]}function $(t){return t[t.length-1]}function X(t,e){for(var r=[],n=0;n<t.length;n++)r[n]=e(t[n],n);return r}function Y(){}function Z(t,e){var r;return Object.create?r=Object.create(t):(Y.prototype=t,r=new Y),e&&H(e,r),r}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||J.test(t))}function tt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&Q(t))||e.test(t):Q(t)}function et(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\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 nt(t){return t.charCodeAt(0)>=768&&rt.test(t)}function it(t,e,r){for(;(r<0?e>0:e<t.length)&&nt(t.charAt(e));)e+=r;return e}function ot(t,e,r){for(var n=e>r?-1:1;;){if(e==r)return e;var i=(e+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:r;t(o)?r=o:e=o+n}}var at=null;function st(t,e,r){var n;at=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==r?n=i:at=i),o.from==e&&(o.from!=o.to&&"before"!=r?n=i:at=i)}return null!=n?n:at}var lt=function(){var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(t,e,r){this.level=t,this.from=e,this.to=r}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!t.test(a))return!1;for(var u,c=a.length,f=[],h=0;h<c;++h)f.push((u=a.charCodeAt(h))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L");for(var d=0,p=l;d<c;++d){var v=f[d];"m"==v?f[d]=p:p=v}for(var g=0,m=l;g<c;++g){var y=f[g];"1"==y&&"r"==m?f[g]="n":r.test(y)&&(m=y,"r"==y&&(f[g]="R"))}for(var b=1,w=f[0];b<c-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<c;++C){var _=f[C];if(","==_)f[C]="N";else if("%"==_){var S=void 0;for(S=C+1;S<c&&"%"==f[S];++S);for(var k=C&&"!"==f[C-1]||S<c&&"1"==f[S]?"1":"N",M=C;M<S;++M)f[M]=k;C=S-1}}for(var L=0,T=l;L<c;++L){var O=f[L];"L"==T&&"1"==O?f[L]="L":r.test(O)&&(T=O)}for(var A=0;A<c;++A)if(e.test(f[A])){var N=void 0;for(N=A+1;N<c&&e.test(f[N]);++N);for(var D="L"==(A?f[A-1]:l),E=D==("L"==(N<c?f[N]:l))?D?"L":"R":l,W=A;W<N;++W)f[W]=E;A=N-1}for(var P,R=[],H=0;H<c;)if(n.test(f[H])){var F=H;for(++H;H<c&&n.test(f[H]);++H);R.push(new o(0,F,H))}else{var I=H,z=R.length,j="rtl"==s?1:0;for(++H;H<c&&"L"!=f[H];++H);for(var B=I;B<H;)if(i.test(f[B])){I<B&&(R.splice(z,0,new o(1,I,B)),z+=j);var U=B;for(++B;B<H&&i.test(f[B]);++B);R.splice(z,0,new o(2,U,B)),z+=j,I=B}else++B;I<H&&R.splice(z,0,new o(1,I,H))}return"ltr"==s&&(1==R[0].level&&(P=a.match(/^\s+/))&&(R[0].from=P[0].length,R.unshift(new o(0,0,P[0].length))),1==$(R).level&&(P=a.match(/\s+$/))&&($(R).to-=P[0].length,R.push(new o(0,c-P[0].length,c)))),"rtl"==s?R.reverse():R}}();function ut(t,e){var r=t.order;return null==r&&(r=t.order=lt(t.text,e)),r}var ct=[],ft=function(t,e,r){if(t.addEventListener)t.addEventListener(e,r,!1);else if(t.attachEvent)t.attachEvent("on"+e,r);else{var n=t._handlers||(t._handlers={});n[e]=(n[e]||ct).concat(r)}};function ht(t,e){return t._handlers&&t._handlers[e]||ct}function dt(t,e,r){if(t.removeEventListener)t.removeEventListener(e,r,!1);else if(t.detachEvent)t.detachEvent("on"+e,r);else{var n=t._handlers,i=n&&n[e];if(i){var o=z(i,r);o>-1&&(n[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function pt(t,e){var r=ht(t,e);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function vt(t,e,r){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),pt(t,r||e.type,t,e),xt(e)||e.codemirrorIgnore}function gt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var r=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),n=0;n<e.length;++n)-1==z(r,e[n])&&r.push(e[n])}function mt(t,e){return ht(t,e).length>0}function yt(t){t.prototype.on=function(t,e){ft(this,t,e)},t.prototype.off=function(t,e){dt(this,t,e)}}function bt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function wt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function xt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Ct(t){bt(t),wt(t)}function _t(t){return t.target||t.srcElement}function St(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var kt,Mt,Lt=function(){if(a&&s<9)return!1;var t=O("div");return"draggable"in t||"dragDrop"in t}();function Tt(t){if(null==kt){var e=O("span","");T(t,O("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(kt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var r=kt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ot(t){if(null!=Mt)return Mt;var e=T(t,document.createTextNode("AخA")),r=k(e,0,1).getBoundingClientRect(),n=k(e,1,2).getBoundingClientRect();return L(t),!(!r||r.left==r.right)&&(Mt=n.right-r.right<3)}var At,Nt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,r=[],n=t.length;e<=n;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),e+=a+1):(r.push(o),e=i+1)}return r}:function(t){return t.split(/\r\n?|\n/)},Dt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Et="oncopy"in(At=O("div"))||(At.setAttribute("oncopy","return;"),"function"==typeof At.oncopy),Wt=null,Pt={},Rt={};function Ht(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Pt[t]=e}function Ft(t){if("string"==typeof t&&Rt.hasOwnProperty(t))t=Rt[t];else if(t&&"string"==typeof t.name&&Rt.hasOwnProperty(t.name)){var e=Rt[t.name];"string"==typeof e&&(e={name:e}),(t=Z(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ft("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ft("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function It(t,e){e=Ft(e);var r=Pt[e.name];if(!r)return It(t,"text/plain");var n=r(t,e);if(zt.hasOwnProperty(e.name)){var i=zt[e.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=e.name,e.helperType&&(n.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)n[a]=e.modeProps[a];return n}var zt={};function jt(t,e){H(e,zt.hasOwnProperty(t)?zt[t]:zt[t]={})}function Bt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var r={};for(var n in e){var i=e[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ut(t,e){for(var r;t.innerMode&&(r=t.innerMode(e))&&r.mode!=t;)e=r.state,t=r.mode;return r||{mode:t,state:e}}function Vt(t,e,r){return!t.startState||t.startState(e,r)}var Gt=function(t,e,r){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Kt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var r=t;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(e<o){r=i;break}e-=o}return r.lines[e]}function qt(t,e,r){var n=[],i=e.line;return t.iter(e.line,r.line+1,(function(t){var o=t.text;i==r.line&&(o=o.slice(0,r.ch)),i==e.line&&(o=o.slice(e.ch)),n.push(o),++i})),n}function $t(t,e,r){var n=[];return t.iter(e,r,(function(t){n.push(t.text)})),n}function Xt(t,e){var r=e-t.height;if(r)for(var n=t;n;n=n.parent)n.height+=r}function Yt(t){if(null==t.parent)return null;for(var e=t.parent,r=z(e.lines,t),n=e.parent;n;e=n,n=n.parent)for(var i=0;n.children[i]!=e;++i)r+=n.children[i].chunkSize();return r+e.first}function Zt(t,e){var r=t.first;t:do{for(var n=0;n<t.children.length;++n){var i=t.children[n],o=i.height;if(e<o){t=i;continue t}e-=o,r+=i.chunkSize()}return r}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a].height;if(e<s)break;e-=s}return r+a}function Jt(t,e){return e>=t.first&&e<t.first+t.size}function Qt(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function te(t,e,r){if(void 0===r&&(r=null),!(this instanceof te))return new te(t,e,r);this.line=t,this.ch=e,this.sticky=r}function ee(t,e){return t.line-e.line||t.ch-e.ch}function re(t,e){return t.sticky==e.sticky&&0==ee(t,e)}function ne(t){return te(t.line,t.ch)}function ie(t,e){return ee(t,e)<0?e:t}function oe(t,e){return ee(t,e)<0?t:e}function ae(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function se(t,e){if(e.line<t.first)return te(t.first,0);var r=t.first+t.size-1;return e.line>r?te(r,Kt(t,r).text.length):function(t,e){var r=t.ch;return null==r||r>e?te(t.line,e):r<0?te(t.line,0):t}(e,Kt(t,e.line).text.length)}function le(t,e){for(var r=[],n=0;n<e.length;n++)r[n]=se(t,e[n]);return r}Gt.prototype.eol=function(){return this.pos>=this.string.length},Gt.prototype.sol=function(){return this.pos==this.lineStart},Gt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Gt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Gt.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},Gt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},Gt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Gt.prototype.skipToEnd=function(){this.pos=this.string.length},Gt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Gt.prototype.backUp=function(t){this.pos-=t},Gt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.match=function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}var i=function(t){return r?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Gt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Gt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Gt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Gt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ue=function(t,e){this.state=t,this.lookAhead=e},ce=function(t,e,r,n){this.state=e,this.doc=t,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function fe(t,e,r,n){var i=[t.state.modeGen],o={};we(t,e.text,t.doc.mode,r,(function(t,e){return i.push(t,e)}),o,n);for(var a=r.state,s=function(n){r.baseTokens=i;var s=t.state.overlays[n],l=1,u=0;r.state=!0,we(t,e.text,s.mode,r,(function(t,e){for(var r=l;u<t;){var n=i[l];n>t&&i.splice(l,1,t,i[l+1],n),l+=2,u=Math.min(t,n)}if(e)if(s.opaque)i.splice(r,l-r,t,"overlay "+e),l=r+2;else for(;r<l;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+e}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function he(t,e,r){if(!e.styles||e.styles[0]!=t.state.modeGen){var n=de(t,Yt(e)),i=e.text.length>t.options.maxHighlightLength&&Bt(t.doc.mode,n.state),o=fe(t,e,n);i&&(n.state=i),e.stateAfter=n.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),r===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function de(t,e,r){var n=t.doc,i=t.display;if(!n.mode.startState)return new ce(n,!0,e);var o=function(t,e,r){for(var n,i,o=t.doc,a=r?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Kt(o,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof ue?u.lookAhead:0)<=o.modeFrontier))return s;var c=F(l.text,null,t.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}(t,e,r),a=o>n.first&&Kt(n,o-1).stateAfter,s=a?ce.fromSaved(n,a,o):new ce(n,Vt(n.mode),o);return n.iter(o,e,(function(r){pe(t,r.text,s);var n=s.line;r.stateAfter=n==e-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function pe(t,e,r,n){var i=t.doc.mode,o=new Gt(e,t.options.tabSize,r);for(o.start=o.pos=n||0,""==e&&ve(i,r.state);!o.eol();)ge(i,o,r.state),o.start=o.pos}function ve(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var r=Ut(t,e);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function ge(t,e,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ut(t,r).mode);var o=t.token(e,r);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ce.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ce.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ce.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ce.fromSaved=function(t,e,r){return e instanceof ue?new ce(t,Bt(t.mode,e.state),r,e.lookAhead):new ce(t,Bt(t.mode,e),r)},ce.prototype.save=function(t){var e=!1!==t?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ue(e,this.maxLookAhead):e};var me=function(t,e,r){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=r};function ye(t,e,r,n){var i,o,a=t.doc,s=a.mode,l=Kt(a,(e=se(a,e)).line),u=de(t,e.line,r),c=new Gt(l.text,t.options.tabSize,u);for(n&&(o=[]);(n||c.pos<e.ch)&&!c.eol();)c.start=c.pos,i=ge(s,c,u.state),n&&o.push(new me(c,i,Bt(a.mode,u.state)));return n?o:new me(c,i,u.state)}function be(t,e){if(t)for(;;){var r=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;t=t.slice(0,r.index)+t.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==e[n]?e[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(e[n])||(e[n]+=" "+r[2])}return t}function we(t,e,r,n,i,o,a){var s=r.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,u=0,c=null,f=new Gt(e,t.options.tabSize,n),h=t.options.addModeClass&&[null];for(""==e&&be(ve(r,n.state),o);!f.eol();){if(f.pos>t.options.maxHighlightLength?(s=!1,a&&pe(t,e,n,f.pos),f.pos=e.length,l=null):l=be(ge(r,f,n.state,h),o),h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u<f.start;)i(u=Math.min(f.start,u+5e3),c);c=l}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}var xe=!1,Ce=!1;function _e(t,e,r){this.marker=t,this.from=e,this.to=r}function Se(t,e){if(t)for(var r=0;r<t.length;++r){var n=t[r];if(n.marker==e)return n}}function ke(t,e){for(var r,n=0;n<t.length;++n)t[n]!=e&&(r||(r=[])).push(t[n]);return r}function Me(t,e){if(e.full)return null;var r=Jt(t,e.from.line)&&Kt(t,e.from.line).markedSpans,n=Jt(t,e.to.line)&&Kt(t,e.to.line).markedSpans;if(!r&&!n)return null;var i=e.from.ch,o=e.to.ch,a=0==ee(e.from,e.to),s=function(t,e,r){var n;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e)||o.from==e&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(n||(n=[])).push(new _e(a,o.from,s?null:o.to))}}return n}(r,i,a),l=function(t,e,r){var n;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(n||(n=[])).push(new _e(a,s?null:o.from-e,null==o.to?null:o.to-e))}}return n}(n,o,a),u=1==e.text.length,c=$(e.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=Se(l,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(l)for(var p=0;p<l.length;++p){var v=l[p];null!=v.to&&(v.to+=c),null==v.from?Se(s,v.marker)||(v.from=c,u&&(s||(s=[])).push(v)):(v.from+=c,u&&(s||(s=[])).push(v))}s&&(s=Le(s)),l&&l!=s&&(l=Le(l));var g=[s];if(!u){var m,y=e.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new _e(s[b].marker,null,null));for(var w=0;w<y;++w)g.push(m);g.push(l)}return g}function Le(t){for(var e=0;e<t.length;++e){var r=t[e];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function Te(t){var e=t.markedSpans;if(e){for(var r=0;r<e.length;++r)e[r].marker.detachLine(t);t.markedSpans=null}}function Oe(t,e){if(e){for(var r=0;r<e.length;++r)e[r].marker.attachLine(t);t.markedSpans=e}}function Ae(t){return t.inclusiveLeft?-1:0}function Ne(t){return t.inclusiveRight?1:0}function De(t,e){var r=t.lines.length-e.lines.length;if(0!=r)return r;var n=t.find(),i=e.find(),o=ee(n.from,i.from)||Ae(t)-Ae(e);if(o)return-o;var a=ee(n.to,i.to)||Ne(t)-Ne(e);return a||e.id-t.id}function Ee(t,e){var r,n=Ce&&t.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(e?i.from:i.to)&&(!r||De(r,i.marker)<0)&&(r=i.marker);return r}function We(t){return Ee(t,!0)}function Pe(t){return Ee(t,!1)}function Re(t,e){var r,n=Ce&&t.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!r||De(r,o.marker)<0)&&(r=o.marker)}return r}function He(t,e,r,n,i){var o=Kt(t,e),a=Ce&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=ee(u.from,r)||Ae(l.marker)-Ae(i),f=ee(u.to,n)||Ne(l.marker)-Ne(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(u.to,r)>=0:ee(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(u.from,n)<=0:ee(u.from,n)<0)))return!0}}}function Fe(t){for(var e;e=We(t);)t=e.find(-1,!0).line;return t}function Ie(t,e){var r=Kt(t,e),n=Fe(r);return r==n?e:Yt(n)}function ze(t,e){if(e>t.lastLine())return e;var r,n=Kt(t,e);if(!je(t,n))return e;for(;r=Pe(n);)n=r.find(1,!0).line;return Yt(n)+1}function je(t,e){var r=Ce&&e.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Be(t,e,n))return!0}}function Be(t,e,r){if(null==r.to){var n=r.marker.find(1,!0);return Be(t,n.line,Se(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==e.text.length)return!0;for(var i=void 0,o=0;o<e.markedSpans.length;++o)if((i=e.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Be(t,e,i))return!0}function Ue(t){for(var e=0,r=(t=Fe(t)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==t)break;e+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==r)break;e+=s.height}return e}function Ve(t){if(0==t.height)return 0;for(var e,r=t.text.length,n=t;e=We(n);){var i=e.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=t;e=Pe(n);){var o=e.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Ge(t){var e=t.display,r=t.doc;e.maxLine=Kt(r,r.first),e.maxLineLength=Ve(e.maxLine),e.maxLineChanged=!0,r.iter((function(t){var r=Ve(t);r>e.maxLineLength&&(e.maxLineLength=r,e.maxLine=t)}))}var Ke=function(t,e,r){this.text=t,Oe(this,e),this.height=r?r(this):1};function qe(t){t.parent=null,Te(t)}Ke.prototype.lineNo=function(){return Yt(this)},yt(Ke);var $e={},Xe={};function Ye(t,e){if(!t||/^\s*$/.test(t))return null;var r=e.addModeClass?Xe:$e;return r[t]||(r[t]=t.replace(/\S+/g,"cm-$&"))}function Ze(t,e){var r=A("span",null,null,l?"padding-right: .1px":null),n={pre:A("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;n.pos=0,n.addToken=Qe,Ot(t.display.measure)&&(a=ut(o,t.doc.direction))&&(n.addToken=tr(n.addToken,a)),n.map=[],rr(o,n,he(t,o,e!=t.display.externalMeasured&&Yt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=W(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=W(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Tt(t.display.measure))),0==i?(e.measure.map=n.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(n.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return pt(t,"renderLine",t,e.line,n.pre),n.pre.className&&(n.textClass=W(n.pre.className,n.textClass||"")),n}function Je(t){var e=O("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function Qe(t,e,r,n,i,o,l){if(e){var u,c=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var r=e,n="",i=0;i<t.length;i++){var o=t.charAt(i);" "!=o||!r||i!=t.length-1&&32!=t.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(e,t.trailingSpace):e,f=t.cm.state.specialChars,h=!1;if(f.test(e)){u=document.createDocumentFragment();for(var d=0;;){f.lastIndex=d;var p=f.exec(e),v=p?p.index-d:e.length-d;if(v){var g=document.createTextNode(c.slice(d,d+v));a&&s<9?u.appendChild(O("span",[g])):u.appendChild(g),t.map.push(t.pos,t.pos+v,g),t.col+=v,t.pos+=v}if(!p)break;d+=v+1;var m=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=u.appendChild(O("span",q(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=u.appendChild(O("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?u.appendChild(O("span",[m])):u.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,u=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,u),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),r||n||i||h||o||l){var w=r||"";n&&(w+=n),i&&(w+=i);var x=O("span",[u],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return t.content.appendChild(x)}t.content.appendChild(u)}}function tr(t,e){return function(r,n,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var f=void 0,h=0;h<e.length&&!((f=e[h]).to>u&&f.from<=u);h++);if(f.to>=c)return t(r,n,i,o,a,s,l);t(r,n.slice(0,f.to-u),i,o,null,s,l),o=null,n=n.slice(f.to-u),u=f.to}}}function er(t,e,r,n){var i=!n&&r.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!n&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function rr(t,e,r){var n=t.markedSpans,i=t.text,o=0;if(n)for(var a,s,l,u,c,f,h,d=i.length,p=0,v=1,g="",m=0;;){if(m==p){l=u=c=s="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var _ in C.attributes)(h||(h={}))[_]=C.attributes[_];C.collapsed&&(!f||De(f.marker,C)<0)&&(f=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(u+=" "+b[S]);if(!f||f.from==p)for(var k=0;k<y.length;++k)er(e,0,y[k]);if(f&&(f.from||0)==p){if(er(e,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var M=Math.min(d,m);;){if(g){var L=p+g.length;if(!f){var T=L>M?g.slice(0,M-p):g;e.addToken(e,T,a?a+l:l,c,p+T.length==m?u:"",s,h)}if(L>=M){g=g.slice(M-p),p=M;break}p=L,c=""}g=i.slice(o,o=r[v++]),a=Ye(r[v++],e.cm.options)}}else for(var O=1;O<r.length;O+=2)e.addToken(e,i.slice(o,o=r[O]),Ye(r[O+1],e.cm.options))}function nr(t,e,r){this.line=e,this.rest=function(t){for(var e,r;e=Pe(t);)t=e.find(1,!0).line,(r||(r=[])).push(t);return r}(e),this.size=this.rest?Yt($(this.rest))-r+1:1,this.node=this.text=null,this.hidden=je(t,e)}function ir(t,e,r){for(var n,i=[],o=e;o<r;o=n){var a=new nr(t.doc,Kt(t.doc,o),o);n=o+a.size,i.push(a)}return i}var or=null,ar=null;function sr(t,e){var r=ht(t,e);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(lr,0));for(var o=function(t){n.push((function(){return r[t].apply(null,i)}))},a=0;a<r.length;++a)o(a)}}function lr(){var t=ar;ar=null;for(var e=0;e<t.length;++e)t[e]()}function ur(t,e,r,n){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?hr(t,e):"gutter"==o?pr(t,e,r,n):"class"==o?dr(t,e):"widget"==o&&vr(t,e,n)}e.changes=null}function cr(t){return t.node==t.text&&(t.node=O("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),a&&s<8&&(t.node.style.zIndex=2)),t.node}function fr(t,e){var r=t.display.externalMeasured;return r&&r.line==e.line?(t.display.externalMeasured=null,e.measure=r.measure,r.built):Ze(t,e)}function hr(t,e){var r=e.text.className,n=fr(t,e);e.text==e.node&&(e.node=n.pre),e.text.parentNode.replaceChild(n.pre,e.text),e.text=n.pre,n.bgClass!=e.bgClass||n.textClass!=e.textClass?(e.bgClass=n.bgClass,e.textClass=n.textClass,dr(t,e)):r&&(e.text.className=r)}function dr(t,e){!function(t,e){var r=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),e.background)r?e.background.className=r:(e.background.parentNode.removeChild(e.background),e.background=null);else if(r){var n=cr(e);e.background=n.insertBefore(O("div",null,r),n.firstChild),t.display.input.setUneditable(e.background)}}(t,e),e.line.wrapClass?cr(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var r=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=r||""}function pr(t,e,r,n){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var i=cr(e);e.gutterBackground=O("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),i.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var a=cr(e),s=e.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(O("div",Qt(t.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var u=t.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function vr(t,e,r){e.alignable&&(e.alignable=null);for(var n=S("CodeMirror-linewidget"),i=e.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&e.node.removeChild(i);mr(t,e,r)}function gr(t,e,r,n){var i=fr(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),dr(t,e),pr(t,e,r,n),mr(t,e,n),e.node}function mr(t,e,r){if(yr(t,e.line,e,r,!0),e.rest)for(var n=0;n<e.rest.length;n++)yr(t,e.rest[n],e,r,!1)}function yr(t,e,r,n,i){if(e.widgets)for(var o=cr(r),a=0,s=e.widgets;a<s.length;++a){var l=s[a],u=O("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),br(l,u,r,n),t.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),sr(l,"redraw")}}function br(t,e,r,n){if(t.noHScroll){(r.alignable||(r.alignable=[])).push(e);var i=n.wrapperWidth;e.style.left=n.fixedPos+"px",t.coverGutter||(i-=n.gutterTotalWidth,e.style.paddingLeft=n.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-n.gutterTotalWidth+"px"))}function wr(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!N(document.body,t.node)){var r="position: relative;";t.coverGutter&&(r+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(r+="width: "+e.display.wrapper.clientWidth+"px;"),T(e.display.measure,O("div",[t.node],null,r))}return t.height=t.node.parentNode.offsetHeight}function xr(t,e){for(var r=_t(e);r!=t.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==t.sizer&&r!=t.mover)return!0}function Cr(t){return t.lineSpace.offsetTop}function _r(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Sr(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=T(t.measure,O("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(t.cachedPaddingH=n),n}function kr(t){return 50-t.display.nativeBarWidth}function Mr(t){return t.display.scroller.clientWidth-kr(t)-t.display.barWidth}function Lr(t){return t.display.scroller.clientHeight-kr(t)-t.display.barHeight}function Tr(t,e,r){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var n=0;n<t.rest.length;n++)if(t.rest[n]==e)return{map:t.measure.maps[n],cache:t.measure.caches[n]};for(var i=0;i<t.rest.length;i++)if(Yt(t.rest[i])>r)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Or(t,e,r,n){return Dr(t,Nr(t,e),r,n)}function Ar(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[cn(t,e)];var r=t.display.externalMeasured;return r&&e>=r.lineN&&e<r.lineN+r.size?r:void 0}function Nr(t,e){var r=Yt(e),n=Ar(t,r);n&&!n.text?n=null:n&&n.changes&&(ur(t,n,r,on(t)),t.curOp.forceUpdate=!0),n||(n=function(t,e){var r=Yt(e=Fe(e)),n=t.display.externalMeasured=new nr(t.doc,e,r);n.lineN=r;var i=n.built=Ze(t,n);return n.text=i.pre,T(t.display.lineMeasure,i.pre),n}(t,e));var i=Tr(n,e,r);return{line:e,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Dr(t,e,r,n,i){e.before&&(r=-1);var o,l=r+(n||"");return e.cache.hasOwnProperty(l)?o=e.cache[l]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,r){var n=t.options.lineWrapping,i=n&&Mr(t);if(!e.measure.heights||n&&e.measure.width!=i){var o=e.measure.heights=[];if(n){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,r,n){var i,o=Pr(e.map,r,n),l=o.node,u=o.start,c=o.end,f=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;u&&nt(e.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&nt(e.line.text.charAt(o.coverStart+c));)++c;if((i=a&&s<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Rr(k(l,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,f="right"}a&&s<11&&(i=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=Wt)return Wt;var e=T(t,O("span","x")),r=e.getBoundingClientRect(),n=k(e,0,1).getBoundingClientRect();return Wt=Math.abs(r.left-n.left)>1}(t))return e;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*r,right:e.right*r,top:e.top*n,bottom:e.bottom*n}}(t.display.measure,i))}else{var d;u>0&&(f=n="right"),i=t.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==n?d.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nn(t.display),top:p.top,bottom:p.bottom}:Wr}for(var v=i.top-e.rect.top,g=i.bottom-e.rect.top,m=(v+g)/2,y=e.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==f?i.right:i.left)-e.rect.left,right:("left"==f?i.left:i.right)-e.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=v,C.rbottom=g),C}(t,e,r,n)).bogus||(e.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Er,Wr={left:0,right:0,top:0,bottom:0};function Pr(t,e,r){for(var n,i,o,a,s,l,u=0;u<t.length;u+=3)if(s=t[u],l=t[u+1],e<s?(i=0,o=1,a="left"):e<l?o=1+(i=e-s):(u==t.length-3||e==l&&t[u+3]>e)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(n=t[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)n=t[2+(u-=3)],a="left";if("right"==r&&i==l-s)for(;u<t.length-3&&t[u+3]==t[u+4]&&!t[u+5].insertLeft;)n=t[(u+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function Rr(t,e){var r=Wr;if("left"==e)for(var n=0;n<t.length&&(r=t[n]).left==r.right;n++);else for(var i=t.length-1;i>=0&&(r=t[i]).left==r.right;i--);return r}function Hr(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function Fr(t){t.display.externalMeasure=null,L(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Hr(t.display.view[e])}function Ir(t){Fr(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function zr(){return c&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jr(){return c&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Br(t){var e=0;if(t.widgets)for(var r=0;r<t.widgets.length;++r)t.widgets[r].above&&(e+=wr(t.widgets[r]));return e}function Ur(t,e,r,n,i){if(!i){var o=Br(e);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=Ue(e);if("local"==n?a+=Cr(t.display):a-=t.display.viewOffset,"page"==n||"window"==n){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==n?0:jr());var l=s.left+("window"==n?0:zr());r.left+=l,r.right+=l}return r.top+=a,r.bottom+=a,r}function Vr(t,e,r){if("div"==r)return e;var n=e.left,i=e.top;if("page"==r)n-=zr(),i-=jr();else if("local"==r||!r){var o=t.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Gr(t,e,r,n,i){return n||(n=Kt(t.doc,e.line)),Ur(t,n,Or(t,n,e.ch,i),r)}function Kr(t,e,r,n,i,o){function a(e,a){var s=Dr(t,i,e,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Ur(t,n,s,r)}n=n||Kt(t.doc,e.line),i||(i=Nr(t,n));var s=ut(n,t.doc.direction),l=e.ch,u=e.sticky;if(l>=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(t,e,r){return a(r?t-1:t,1==s[e].level!=r)}var f=st(s,l,u),h=at,d=c(l,f,"before"==u);return null!=h&&(d.other=c(l,h,"before"!=u)),d}function qr(t,e){var r=0;e=se(t.doc,e),t.options.lineWrapping||(r=nn(t.display)*e.ch);var n=Kt(t.doc,e.line),i=Ue(n)+Cr(t.display);return{left:r,right:r,top:i,bottom:i+n.height}}function $r(t,e,r,n,i){var o=te(t,e,r);return o.xRel=i,n&&(o.outside=n),o}function Xr(t,e,r){var n=t.doc;if((r+=t.display.viewOffset)<0)return $r(n.first,0,null,-1,-1);var i=Zt(n,r),o=n.first+n.size-1;if(i>o)return $r(n.first+n.size-1,Kt(n,o).text.length,null,1,1);e<0&&(e=0);for(var a=Kt(n,i);;){var s=Qr(t,a,i,e,r),l=Re(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Kt(n,i=u.line)}}function Yr(t,e,r,n){n-=Br(e);var i=e.text.length,o=ot((function(e){return Dr(t,r,e-1).bottom<=n}),i,0);return{begin:o,end:i=ot((function(e){return Dr(t,r,e).top>n}),o,i)}}function Zr(t,e,r,n){return r||(r=Nr(t,e)),Yr(t,e,r,Ur(t,e,Dr(t,r,n),"line").top)}function Jr(t,e,r,n){return!(t.bottom<=r)&&(t.top>r||(n?t.left:t.right)>e)}function Qr(t,e,r,n,i){i-=Ue(e);var o=Nr(t,e),a=Br(e),s=0,l=e.text.length,u=!0,c=ut(e,t.doc.direction);if(c){var f=(t.options.lineWrapping?en:tn)(t,e,r,o,c,n,i);s=(u=1!=f.level)?f.from:f.to-1,l=u?f.to:f.from-1}var h,d,p=null,v=null,g=ot((function(e){var r=Dr(t,o,e);return r.top+=a,r.bottom+=a,!!Jr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=e,v=r),!0)}),s,l),m=!1;if(v){var y=n-v.left<v.right-n,b=y==u;g=p+(b?0:1),d=b?"after":"before",h=y?v.left:v.right}else{u||g!=l&&g!=s||g++,d=0==g?"after":g==e.text.length?"before":Dr(t,o,g-(u?1:0)).bottom+a<=i==u?"after":"before";var w=Kr(t,te(r,g,d),"line",e,o);h=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return $r(r,g=it(e.text,g,1),d,m,n-h)}function tn(t,e,r,n,i,o,a){var s=ot((function(s){var l=i[s],u=1!=l.level;return Jr(Kr(t,te(r,u?l.to:l.from,u?"before":"after"),"line",e,n),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=Kr(t,te(r,u?l.from:l.to,u?"after":"before"),"line",e,n);Jr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function en(t,e,r,n,i,o,a){var s=Yr(t,e,n,a),l=s.begin,u=s.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=u||d.to<=l)){var p=Dr(t,n,1!=d.level?Math.min(u,d.to)-1:Math.max(l,d.from)).right,v=p<o?o-p+1e9:p-o;(!c||f>v)&&(c=d,f=v)}}return c||(c=i[i.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function rn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Er){Er=O("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Er.appendChild(document.createTextNode("x")),Er.appendChild(O("br"));Er.appendChild(document.createTextNode("x"))}T(t.measure,Er);var r=Er.offsetHeight/50;return r>3&&(t.cachedTextHeight=r),L(t.measure),r||1}function nn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=O("span","xxxxxxxxxx"),r=O("pre",[e],"CodeMirror-line-like");T(t.measure,r);var n=e.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function on(t){for(var e=t.display,r={},n={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:an(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:e.wrapper.clientWidth}}function an(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function sn(t){var e=rn(t.display),r=t.options.lineWrapping,n=r&&Math.max(5,t.display.scroller.clientWidth/nn(t.display)-3);return function(i){if(je(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*e:o+e}}function ln(t){var e=t.doc,r=sn(t);e.iter((function(t){var e=r(t);e!=t.height&&Xt(t,e)}))}function un(t,e,r,n){var i=t.display;if(!r&&"true"==_t(e).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left,a=e.clientY-s.top}catch(t){return null}var l,u=Xr(t,o,a);if(n&&u.xRel>0&&(l=Kt(t.doc,u.line).text).length==u.ch){var c=F(l,l.length,t.options.tabSize)-l.length;u=te(u.line,Math.max(0,Math.round((o-Sr(t.display).left)/nn(t.display))-c))}return u}function cn(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var r=t.display.view,n=0;n<r.length;n++)if((e-=r[n].size)<0)return n}function fn(t,e,r,n){null==e&&(e=t.doc.first),null==r&&(r=t.doc.first+t.doc.size),n||(n=0);var i=t.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Ce&&Ie(t.doc,e)<i.viewTo&&dn(t);else if(r<=i.viewFrom)Ce&&ze(t.doc,r+n)>i.viewFrom?dn(t):(i.viewFrom+=n,i.viewTo+=n);else if(e<=i.viewFrom&&r>=i.viewTo)dn(t);else if(e<=i.viewFrom){var o=pn(t,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):dn(t)}else if(r>=i.viewTo){var a=pn(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):dn(t)}else{var s=pn(t,e,e,-1),l=pn(t,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(ir(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):dn(t)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:e<u.lineN+u.size&&(i.externalMeasured=null))}function hn(t,e,r){t.curOp.viewChanged=!0;var n=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(n.externalMeasured=null),!(e<n.viewFrom||e>=n.viewTo)){var o=n.view[cn(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==z(a,r)&&a.push(r)}}}function dn(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function pn(t,e,r,n){var i,o=cn(t,e),a=t.display.view;if(!Ce||r==t.doc.first+t.doc.size)return{index:o,lineN:r};for(var s=t.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=e){if(n>0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,r+=i}for(;Ie(t.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function vn(t){for(var e=t.display.view,r=0,n=0;n<e.length;n++){var i=e[n];i.hidden||i.node&&!i.changes||++r}return r}function gn(t){t.display.input.showSelection(t.display.input.prepareSelection())}function mn(t,e){void 0===e&&(e=!0);for(var r=t.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(e||a!=r.sel.primIndex){var s=r.sel.ranges[a];if(!(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom)){var l=s.empty();(l||t.options.showCursorWhenSelecting)&&yn(t,s.head,i),l||wn(t,s,o)}}return n}function yn(t,e,r){var n=Kr(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=r.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*t.options.cursorHeight+"px",n.other){var o=r.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function bn(t,e){return t.top-e.top||t.left-e.left}function wn(t,e,r){var n=t.display,i=t.doc,o=document.createDocumentFragment(),a=Sr(t.display),s=a.left,l=Math.max(n.sizerWidth,Mr(t)-n.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(t,e,r,n){e<0&&(e=0),e=Math.round(e),n=Math.round(n),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==r?l-t:r)+"px;\n height: "+(n-e)+"px"))}function f(e,r,n){var o,a,f=Kt(i,e),h=f.text.length;function d(r,n){return Gr(t,te(e,r),"div",f,n)}function p(e,r,n){var i=Zr(t,f,null,e),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var v=ut(f,i.direction);return function(t,e,r,n){if(!t)return n(e,r,"ltr",0);for(var i=!1,o=0;o<t.length;++o){var a=t[o];(a.from<r&&a.to>e||e==r&&a.to==e)&&(n(Math.max(a.from,e),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(e,r,"ltr")}(v,r||0,null==n?h:n,(function(t,e,i,f){var g="ltr"==i,m=d(t,g?"left":"right"),y=d(e-1,g?"right":"left"),b=null==r&&0==t,w=null==n&&e==h,x=0==f,C=!v||f==v.length-1;if(y.top-m.top<=3){var _=(u?w:b)&&C,S=(u?b:w)&&x?s:(g?m:y).left,k=_?l:(g?y:m).right;c(S,m.top,k-S,m.bottom)}else{var M,L,T,O;g?(M=u&&b&&x?s:m.left,L=u?l:p(t,i,"before"),T=u?s:p(e,i,"after"),O=u&&w&&C?l:y.right):(M=u?p(t,i,"before"):s,L=!u&&b&&x?l:m.right,T=!u&&w&&C?s:y.left,O=u?p(e,i,"after"):l),c(M,m.top,L-M,m.bottom),m.bottom<y.top&&c(s,m.bottom,null,y.top),c(T,y.top,O-T,y.bottom)}(!o||bn(m,o)<0)&&(o=m),bn(y,o)<0&&(o=y),(!a||bn(m,a)<0)&&(a=m),bn(y,a)<0&&(a=y)})),{start:o,end:a}}var h=e.from(),d=e.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=Kt(i,h.line),v=Kt(i,d.line),g=Fe(p)==Fe(v),m=f(h.line,h.ch,g?p.text.length+1:null).end,y=f(d.line,g?0:null,d.ch).start;g&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(s,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(s,m.bottom,null,y.top)}r.appendChild(o)}function xn(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var r=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||kn(t),e.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Cn(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Sn(t))}function _n(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&kn(t))}),100)}function Sn(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(pt(t,"focus",t,e),t.state.focused=!0,E(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),xn(t))}function kn(t,e){t.state.delayingBlurEvent||(t.state.focused&&(pt(t,"blur",t,e),t.state.focused=!1,M(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Mn(t){for(var e=t.display,r=e.lineDiv.offsetTop,n=0;n<e.view.length;n++){var i=e.view[n],o=t.options.lineWrapping,l=void 0,u=0;if(!i.hidden){if(a&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;l=c-r,r=c}else{var f=i.node.getBoundingClientRect();l=f.bottom-f.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var h=i.line.height-l;if((h>.005||h<-.005)&&(Xt(i.line,l),Ln(i.line),i.rest))for(var d=0;d<i.rest.length;d++)Ln(i.rest[d]);if(u>t.display.sizerWidth){var p=Math.ceil(u/nn(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function Ln(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var r=t.widgets[e],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Tn(t,e,r){var n=r&&null!=r.top?Math.max(0,r.top):t.scroller.scrollTop;n=Math.floor(n-Cr(t));var i=r&&null!=r.bottom?r.bottom:n+t.wrapper.clientHeight,o=Zt(e,n),a=Zt(e,i);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<o?(o=s,a=Zt(e,Ue(Kt(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(o=Zt(e,Ue(Kt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function On(t,e){var r=t.display,n=rn(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:r.scroller.scrollTop,o=Lr(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+_r(r),l=e.top<n,u=e.bottom>s-n;if(e.top<i)a.scrollTop=l?0:e.top;else if(e.bottom>i+o){var c=Math.min(e.top,(u?s:e.bottom)-o);c!=i&&(a.scrollTop=c)}var f=t.options.fixedGutter?0:r.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:r.scroller.scrollLeft-f,d=Mr(t)-r.gutters.offsetWidth,p=e.right-e.left>d;return p&&(e.right=e.left+d),e.left<10?a.scrollLeft=0:e.left<h?a.scrollLeft=Math.max(0,e.left+f-(p?0:10)):e.right>d+h-3&&(a.scrollLeft=e.right+(p?0:10)-d),a}function An(t,e){null!=e&&(En(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Nn(t){En(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Dn(t,e,r){null==e&&null==r||En(t),null!=e&&(t.curOp.scrollLeft=e),null!=r&&(t.curOp.scrollTop=r)}function En(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Wn(t,qr(t,e.from),qr(t,e.to),e.margin))}function Wn(t,e,r,n){var i=On(t,{left:Math.min(e.left,r.left),top:Math.min(e.top,r.top)-n,right:Math.max(e.right,r.right),bottom:Math.max(e.bottom,r.bottom)+n});Dn(t,i.scrollLeft,i.scrollTop)}function Pn(t,e){Math.abs(t.doc.scrollTop-e)<2||(r||li(t,{top:e}),Rn(t,e,!0),r&&li(t),ni(t,100))}function Rn(t,e,r){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||r)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Hn(t,e,r,n){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(r?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!n||(t.doc.scrollLeft=e,fi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Fn(t){var e=t.display,r=e.gutters.offsetWidth,n=Math.round(t.doc.height+_r(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+kr(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:r}}var In=function(t,e,r){this.cm=r;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,t(n),t(i),ft(n,"scroll",(function(){n.clientHeight&&e(n.scrollTop,"vertical")})),ft(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};In.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,r=t.scrollHeight>t.clientHeight+1,n=t.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=e?n+"px":"0";var i=t.viewHeight-(e?n:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:e?n:0}},In.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},In.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},In.prototype.zeroWidthHack=function(){var t=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},In.prototype.enableZeroWidthBar=function(t,e,r){t.style.pointerEvents="auto",e.set(1e3,(function n(){var i=t.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,n)}))},In.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var zn=function(){};function jn(t,e){e||(e=Fn(t));var r=t.display.barWidth,n=t.display.barHeight;Bn(t,e);for(var i=0;i<4&&r!=t.display.barWidth||n!=t.display.barHeight;i++)r!=t.display.barWidth&&t.options.lineWrapping&&Mn(t),Bn(t,Fn(t)),r=t.display.barWidth,n=t.display.barHeight}function Bn(t,e){var r=t.display,n=r.scrollbars.update(e);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=e.gutterWidth+"px"):r.gutterFiller.style.display=""}zn.prototype.update=function(){return{bottom:0,right:0}},zn.prototype.setScrollLeft=function(){},zn.prototype.setScrollTop=function(){},zn.prototype.clear=function(){};var Un={native:In,null:zn};function Vn(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Un[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ft(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,r){"horizontal"==r?Hn(t,e):Pn(t,e)}),t),t.display.scrollbars.addClass&&E(t.display.wrapper,t.display.scrollbars.addClass)}var Gn=0;function Kn(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Gn},e=t.curOp,or?or.ops.push(e):e.ownsGroup=or={ops:[e],delayedCallbacks:[]}}function qn(t){var e=t.curOp;e&&function(t,e){var r=t.ownsGroup;if(r)try{!function(t){var e=t.delayedCallbacks,r=0;do{for(;r<e.length;r++)e[r].call(null);for(var n=0;n<t.ops.length;n++){var i=t.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<e.length)}(r)}finally{or=null,e(r)}}(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;!function(t){for(var e=t.ops,r=0;r<e.length;r++)$n(e[r]);for(var n=0;n<e.length;n++)Xn(e[n]);for(var i=0;i<e.length;i++)Yn(e[i]);for(var o=0;o<e.length;o++)Zn(e[o]);for(var a=0;a<e.length;a++)Jn(e[a])}(t)}))}function $n(t){var e=t.cm,r=e.display;!function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=kr(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=kr(t)+"px",e.scrollbarsClipped=!0)}(e),t.updateMaxLine&&Ge(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<r.viewFrom||t.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new oi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xn(t){t.updatedDisplay=t.mustUpdate&&ai(t.cm,t.update)}function Yn(t){var e=t.cm,r=e.display;t.updatedDisplay&&Mn(e),t.barMeasure=Fn(e),r.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Or(e,r.maxLine,r.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+t.adjustWidthTo+kr(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+t.adjustWidthTo-Mr(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=r.input.prepareSelection())}function Zn(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&Hn(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var r=t.focus&&t.focus==D();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,r),(t.updatedDisplay||t.startHeight!=e.doc.height)&&jn(e,t.barMeasure),t.updatedDisplay&&ci(e,t.barMeasure),t.selectionChanged&&xn(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),r&&Cn(t.cm)}function Jn(t){var e=t.cm,r=e.display,n=e.doc;t.updatedDisplay&&si(e,t.update),null==r.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=t.scrollTop&&Rn(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&Hn(e,t.scrollLeft,!0,!0),t.scrollToPos&&function(t,e){if(!vt(t,"scrollCursorIntoView")){var r=t.display,n=r.sizer.getBoundingClientRect(),i=null;if(e.top+n.top<0?i=!0:e.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=O("div","",null,"position: absolute;\n top: "+(e.top-r.viewOffset-Cr(t.display))+"px;\n height: "+(e.bottom-e.top+kr(t)+r.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}(e,function(t,e,r,n){var i;null==n&&(n=0),t.options.lineWrapping||e!=r||(r="before"==(e=e.ch?te(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?te(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=Kr(t,e),l=r&&r!=e?Kr(t,r):s,u=On(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),c=t.doc.scrollTop,f=t.doc.scrollLeft;if(null!=u.scrollTop&&(Pn(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Hn(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(e,se(n,t.scrollToPos.from),se(n,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||pt(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&pt(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&pt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Qn(t,e){if(t.curOp)return e();Kn(t);try{return e()}finally{qn(t)}}function ti(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Kn(t);try{return e.apply(t,arguments)}finally{qn(t)}}}function ei(t){return function(){if(this.curOp)return t.apply(this,arguments);Kn(this);try{return t.apply(this,arguments)}finally{qn(this)}}}function ri(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Kn(e);try{return t.apply(this,arguments)}finally{qn(e)}}}function ni(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,R(ii,t))}function ii(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var r=+new Date+t.options.workTime,n=de(t,e.highlightFrontier),i=[];e.iter(n.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(n.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Bt(e.mode,n.state):null,l=fe(t,o,n,!0);s&&(n.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=t.options.maxHighlightLength&&pe(t,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ni(t,t.options.workDelay),!0})),e.highlightFrontier=n.line,e.modeFrontier=Math.max(e.modeFrontier,n.line),i.length&&Qn(t,(function(){for(var e=0;e<i.length;e++)hn(t,i[e],"text")}))}}var oi=function(t,e,r){var n=t.display;this.viewport=e,this.visible=Tn(n,t.doc,e),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Mr(t),this.force=r,this.dims=on(t),this.events=[]};function ai(t,e){var r=t.display,n=t.doc;if(e.editorIsHidden)return dn(t),!1;if(!e.force&&e.visible.from>=r.viewFrom&&e.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==vn(t))return!1;hi(t)&&(dn(t),e.dims=on(t));var i=n.first+n.size,o=Math.max(e.visible.from-t.options.viewportMargin,n.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Ce&&(o=Ie(t.doc,o),a=ze(t.doc,a));var s=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=e.wrapperHeight||r.lastWrapWidth!=e.wrapperWidth;!function(t,e,r){var n=t.display;0==n.view.length||e>=n.viewTo||r<=n.viewFrom?(n.view=ir(t,e,r),n.viewFrom=e):(n.viewFrom>e?n.view=ir(t,e,n.viewFrom).concat(n.view):n.viewFrom<e&&(n.view=n.view.slice(cn(t,e))),n.viewFrom=e,n.viewTo<r?n.view=n.view.concat(ir(t,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,cn(t,r)))),n.viewTo=r}(t,o,a),r.viewOffset=Ue(Kt(t.doc,r.viewFrom)),t.display.mover.style.top=r.viewOffset+"px";var u=vn(t);if(!s&&0==u&&!e.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(t){if(t.hasFocus())return null;var e=D();if(!e||!N(t.display.lineDiv,e))return null;var r={activeElt:e};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&N(t.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(t);return u>4&&(r.lineDiv.style.display="none"),function(t,e,r){var n=t.display,i=t.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function s(e){var r=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),r}for(var u=n.view,c=n.viewFrom,f=0;f<u.length;f++){var h=u[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;a!=h.node;)a=s(a);var d=i&&null!=e&&e<=c&&h.lineNumber;h.changes&&(z(h.changes,"gutter")>-1&&(d=!1),ur(t,h,c,r)),d&&(L(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Qt(t.options,c)))),a=h.node.nextSibling}else{var p=gr(t,h,c,r);o.insertBefore(p,a)}c+=h.size}for(;a;)a=s(a)}(t,r.updateLineNumbers,e.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(t){if(t&&t.activeElt&&t.activeElt!=D()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&N(document.body,t.anchorNode)&&N(document.body,t.focusNode))){var e=window.getSelection(),r=document.createRange();r.setEnd(t.anchorNode,t.anchorOffset),r.collapse(!1),e.removeAllRanges(),e.addRange(r),e.extend(t.focusNode,t.focusOffset)}}(c),L(r.cursorDiv),L(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=e.wrapperHeight,r.lastWrapWidth=e.wrapperWidth,ni(t,400)),r.updateLineNumbers=null,!0}function si(t,e){for(var r=e.viewport,n=!0;;n=!1){if(n&&t.options.lineWrapping&&e.oldDisplayWidth!=Mr(t))n&&(e.visible=Tn(t.display,t.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(t.doc.height+_r(t.display)-Lr(t),r.top)}),e.visible=Tn(t.display,t.doc,r),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!ai(t,e))break;Mn(t);var i=Fn(t);gn(t),jn(t,i),ci(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function li(t,e){var r=new oi(t,e);if(ai(t,r)){Mn(t),si(t,r);var n=Fn(t);gn(t),jn(t,n),ci(t,n),r.finish()}}function ui(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function ci(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+kr(t)+"px"}function fi(t){var e=t.display,r=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var n=an(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){t.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=n+i+"px")}}function hi(t){if(!t.options.lineNumbers)return!1;var e=t.doc,r=Qt(t.options,e.first+e.size-1),n=t.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(O("div",[O("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ui(t.display),!0}return!1}function di(t,e){for(var r=[],n=!1,i=0;i<t.length;i++){var o=t[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;n=!0}r.push({className:o,style:a})}return e&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function pi(t){var e=t.gutters,r=t.gutterSpecs;L(e),t.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,s=e.appendChild(O("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=r.length?"":"none",ui(t)}function vi(t){pi(t.display),fn(t),fi(t)}function gi(t,e,n,i){var o=this;this.input=n,o.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=A("div",null,"CodeMirror-code"),o.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=O("div",null,"CodeMirror-cursors"),o.measure=O("div",null,"CodeMirror-measure"),o.lineMeasure=O("div",null,"CodeMirror-measure"),o.lineSpace=A("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=A("div",[o.lineSpace],"CodeMirror-lines");o.mover=O("div",[u],null,"position: relative"),o.sizer=O("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=O("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=O("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=O("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=O("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||r&&m||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=di(i.gutters,i.lineNumbers),pi(o),n.init(o)}oi.prototype.signal=function(t,e){mt(t,e)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var t=0;t<this.events.length;t++)pt.apply(null,this.events[t])};var mi=0,yi=null;function bi(t){var e=t.wheelDeltaX,r=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==r&&t.detail&&t.axis==t.VERTICAL_AXIS?r=t.detail:null==r&&(r=t.wheelDelta),{x:e,y:r}}function wi(t){var e=bi(t);return e.x*=yi,e.y*=yi,e}function xi(t,e){var n=bi(e),i=n.x,o=n.y,a=t.display,s=a.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)t:for(var h=e.target,d=a.view;h!=s;h=h.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==h){t.display.currentWheelTarget=h;break t}if(i&&!r&&!f&&null!=yi)return o&&c&&Pn(t,Math.max(0,s.scrollTop+o*yi)),Hn(t,Math.max(0,s.scrollLeft+i*yi)),(!o||o&&c)&&bt(e),void(a.wheelStartX=null);if(o&&null!=yi){var v=o*yi,g=t.doc.scrollTop,m=g+a.wrapper.clientHeight;v<0?g=Math.max(0,g+v-50):m=Math.min(t.doc.height,m+v+50),li(t,{top:g,bottom:m})}mi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var t=s.scrollLeft-a.wheelStartX,e=s.scrollTop-a.wheelStartY,r=e&&a.wheelDY&&e/a.wheelDY||t&&a.wheelDX&&t/a.wheelDX;a.wheelStartX=a.wheelStartY=null,r&&(yi=(yi*mi+r)/(mi+1),++mi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?yi=-.53:r?yi=15:c?yi=-.7:h&&(yi=-1/3);var Ci=function(t,e){this.ranges=t,this.primIndex=e};Ci.prototype.primary=function(){return this.ranges[this.primIndex]},Ci.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var r=this.ranges[e],n=t.ranges[e];if(!re(r.anchor,n.anchor)||!re(r.head,n.head))return!1}return!0},Ci.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new _i(ne(this.ranges[e].anchor),ne(this.ranges[e].head));return new Ci(t,this.primIndex)},Ci.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},Ci.prototype.contains=function(t,e){e||(e=t);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ee(e,n.from())>=0&&ee(t,n.to())<=0)return r}return-1};var _i=function(t,e){this.anchor=t,this.head=e};function Si(t,e,r){var n=t&&t.options.selectionsMayTouch,i=e[r];e.sort((function(t,e){return ee(t.from(),e.from())})),r=z(e,i);for(var o=1;o<e.length;o++){var a=e[o],s=e[o-1],l=ee(s.to(),a.from());if(n&&!a.empty()?l>0:l>=0){var u=oe(s.from(),a.from()),c=ie(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=r&&--r,e.splice(--o,2,new _i(f?c:u,f?u:c))}}return new Ci(e,r)}function ki(t,e){return new Ci([new _i(t,e||t)],0)}function Mi(t){return t.text?te(t.from.line+t.text.length-1,$(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Li(t,e){if(ee(t,e.from)<0)return t;if(ee(t,e.to)<=0)return Mi(e);var r=t.line+e.text.length-(e.to.line-e.from.line)-1,n=t.ch;return t.line==e.to.line&&(n+=Mi(e).ch-e.to.ch),te(r,n)}function Ti(t,e){for(var r=[],n=0;n<t.sel.ranges.length;n++){var i=t.sel.ranges[n];r.push(new _i(Li(i.anchor,e),Li(i.head,e)))}return Si(t.cm,r,t.sel.primIndex)}function Oi(t,e,r){return t.line==e.line?te(r.line,t.ch-e.ch+r.ch):te(r.line+(t.line-e.line),t.ch)}function Ai(t){t.doc.mode=It(t.options,t.doc.modeOption),Ni(t)}function Ni(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,ni(t,100),t.state.modeGen++,t.curOp&&fn(t)}function Di(t,e){return 0==e.from.ch&&0==e.to.ch&&""==$(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Ei(t,e,r,n){function i(t){return r?r[t]:null}function o(t,r,i){!function(t,e,r,n){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Te(t),Oe(t,r);var i=n?n(t):1;i!=t.height&&Xt(t,i)}(t,r,i,n),sr(t,"change",t,e)}function a(t,e){for(var r=[],o=t;o<e;++o)r.push(new Ke(u[o],i(o),n));return r}var s=e.from,l=e.to,u=e.text,c=Kt(t,s.line),f=Kt(t,l.line),h=$(u),d=i(u.length-1),p=l.line-s.line;if(e.full)t.insert(0,a(0,u.length)),t.remove(u.length,t.size-u.length);else if(Di(t,e)){var v=a(0,u.length-1);o(f,f.text,d),p&&t.remove(s.line,p),v.length&&t.insert(s.line,v)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(l.ch),d);else{var g=a(1,u.length-1);g.push(new Ke(h+c.text.slice(l.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),t.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0)),t.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(f,h+f.text.slice(l.ch),d);var m=a(1,u.length-1);p>1&&t.remove(s.line+1,p-1),t.insert(s.line+1,m)}sr(t,"change",t,e)}function Wi(t,e,r){!function t(n,i,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;r&&!l||(e(s.doc,l),t(s.doc,n,l))}}}(t,null,!0)}function Pi(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,ln(t),Ai(t),Ri(t),t.options.lineWrapping||Ge(t),t.options.mode=e.modeOption,fn(t)}function Ri(t){("rtl"==t.doc.direction?E:M)(t.display.lineDiv,"CodeMirror-rtl")}function Hi(t){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function Fi(t,e){var r={from:ne(e.from),to:Mi(e),text:qt(t,e.from,e.to)};return Ui(t,r,e.from.line,e.to.line+1),Wi(t,(function(t){return Ui(t,r,e.from.line,e.to.line+1)}),!0),r}function Ii(t){for(;t.length&&$(t).ranges;)t.pop()}function zi(t,e,r,n){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==n||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Ii(t.done),$(t.done)):t.done.length&&!$(t.done).ranges?$(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),$(t.done)):void 0}(i,i.lastOp==n)))a=$(o.changes),0==ee(e.from,e.to)&&0==ee(e.from,a.to)?a.to=Mi(e):o.changes.push(Fi(t,e));else{var l=$(i.done);for(l&&l.ranges||Bi(t.sel,i.done),o={changes:[Fi(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=e.origin,a||pt(t,"historyAdded")}function ji(t,e,r,n){var i=t.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(t,e,r,n){var i=e.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,$(i.done),e))?i.done[i.done.length-1]=e:Bi(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Ii(i.undone)}function Bi(t,e){var r=$(e);r&&r.ranges&&r.equals(t)||e.push(t)}function Ui(t,e,r,n){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,r),Math.min(t.first+t.size,n),(function(r){r.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=r.markedSpans),++o}))}function Vi(t){if(!t)return null;for(var e,r=0;r<t.length;++r)t[r].marker.explicitlyCleared?e||(e=t.slice(0,r)):e&&e.push(t[r]);return e?e.length?e:null:t}function Gi(t,e){var r=function(t,e){var r=e["spans_"+t.id];if(!r)return null;for(var n=[],i=0;i<e.text.length;++i)n.push(Vi(r[i]));return n}(t,e),n=Me(t,e);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue t;o.push(l)}else a&&(r[i]=a)}return r}function Ki(t,e,r){for(var n=[],i=0;i<t.length;++i){var o=t[i];if(o.ranges)n.push(r?Ci.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];n.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),e)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&z(e,Number(c[1]))>-1&&($(s)[f]=u[f],delete u[f])}}}return n}function qi(t,e,r,n){if(n){var i=t.anchor;if(r){var o=ee(e,i)<0;o!=ee(r,i)<0?(i=e,e=r):o!=ee(e,r)<0&&(e=r)}return new _i(i,e)}return new _i(r||e,e)}function $i(t,e,r,n,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Qi(t,new Ci([qi(t.sel.primary(),e,r,i)],0),n)}function Xi(t,e,r){for(var n=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)n[o]=qi(t.sel.ranges[o],e[o],null,i);Qi(t,Si(t.cm,n,t.sel.primIndex),r)}function Yi(t,e,r,n){var i=t.sel.ranges.slice(0);i[e]=r,Qi(t,Si(t.cm,i,t.sel.primIndex),n)}function Zi(t,e,r,n){Qi(t,ki(e,r),n)}function Ji(t,e,r){var n=t.history.done,i=$(n);i&&i.ranges?(n[n.length-1]=e,to(t,e,r)):Qi(t,e,r)}function Qi(t,e,r){to(t,e,r),ji(t,t.sel,t.cm?t.cm.curOp.id:NaN,r)}function to(t,e,r){(mt(t,"beforeSelectionChange")||t.cm&&mt(t.cm,"beforeSelectionChange"))&&(e=function(t,e,r){var n={ranges:e.ranges,update:function(e){this.ranges=[];for(var r=0;r<e.length;r++)this.ranges[r]=new _i(se(t,e[r].anchor),se(t,e[r].head))},origin:r&&r.origin};return pt(t,"beforeSelectionChange",t,n),t.cm&&pt(t.cm,"beforeSelectionChange",t.cm,n),n.ranges!=e.ranges?Si(t.cm,n.ranges,n.ranges.length-1):e}(t,e,r));var n=r&&r.bias||(ee(e.primary().head,t.sel.primary().head)<0?-1:1);eo(t,no(t,e,n,!0)),r&&!1===r.scroll||!t.cm||Nn(t.cm)}function eo(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,gt(t.cm)),sr(t,"cursorActivity",t))}function ro(t){eo(t,no(t,t.sel,null,!1))}function no(t,e,r,n){for(var i,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=oo(t,a.anchor,s&&s.anchor,r,n),u=oo(t,a.head,s&&s.head,r,n);(i||l!=a.anchor||u!=a.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new _i(l,u))}return i?Si(t.cm,i,e.primIndex):e}function io(t,e,r,n,i){var o=Kt(t,e.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(u?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(c?s.to>=e.ch:s.to>e.ch))){if(i&&(pt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var f=l.find(n<0?1:-1),h=void 0;if((n<0?c:u)&&(f=ao(t,f,-n,f&&f.line==e.line?o:null)),f&&f.line==e.line&&(h=ee(f,r))&&(n<0?h<0:h>0))return io(t,f,e,n,i)}var d=l.find(n<0?-1:1);return(n<0?u:c)&&(d=ao(t,d,n,d.line==e.line?o:null)),d?io(t,d,e,n,i):null}}return e}function oo(t,e,r,n,i){var o=n||1,a=io(t,e,r,o,i)||!i&&io(t,e,r,o,!0)||io(t,e,r,-o,i)||!i&&io(t,e,r,-o,!0);return a||(t.cantEdit=!0,te(t.first,0))}function ao(t,e,r,n){return r<0&&0==e.ch?e.line>t.first?se(t,te(e.line-1)):null:r>0&&e.ch==(n||Kt(t,e.line)).text.length?e.line<t.first+t.size-1?te(e.line+1,0):null:new te(e.line,e.ch+r)}function so(t){t.setSelection(te(t.firstLine(),0),te(t.lastLine()),B)}function lo(t,e,r){var n={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(e,r,i,o){e&&(n.from=se(t,e)),r&&(n.to=se(t,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),pt(t,"beforeChange",t,n),t.cm&&pt(t.cm,"beforeChange",t.cm,n),n.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function uo(t,e,r){if(t.cm){if(!t.cm.curOp)return ti(t.cm,uo)(t,e,r);if(t.cm.state.suppressEdits)return}if(!(mt(t,"beforeChange")||t.cm&&mt(t.cm,"beforeChange"))||(e=lo(t,e,!0))){var n=xe&&!r&&function(t,e,r){var n=null;if(t.iter(e.line,r.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var r=t.markedSpans[e].marker;!r.readOnly||n&&-1!=z(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:e,to:r}],o=0;o<n.length;++o)for(var a=n[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(ee(u.to,s.from)<0||ee(u.from,s.to)>0)){var c=[l,1],f=ee(u.from,s.from),h=ee(u.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(t,e.from,e.to);if(n)for(var i=n.length-1;i>=0;--i)co(t,{from:n[i].from,to:n[i].to,text:i?[""]:e.text,origin:e.origin});else co(t,e)}}function co(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ee(e.from,e.to)){var r=Ti(t,e);zi(t,e,r,t.cm?t.cm.curOp.id:NaN),po(t,e,r,Me(t,e));var n=[];Wi(t,(function(t,r){r||-1!=z(n,t.history)||(yo(t.history,e),n.push(t.history)),po(t,e,null,Me(t,e))}))}}function fo(t,e,r){var n=t.cm&&t.cm.state.suppressEdits;if(!n||r){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u<s.length&&(i=s[u],r?!i.ranges||i.equals(t.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(n)return void s.push(i);break}if(Bi(i,l),r&&!i.equals(t.sel))return void Qi(t,i,{clearRedo:!1});a=i}var c=[];Bi(a,l),l.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=mt(t,"beforeChange")||t.cm&&mt(t.cm,"beforeChange"),h=function(r){var n=i.changes[r];if(n.origin=e,f&&!lo(t,n,!1))return s.length=0,{};c.push(Fi(t,n));var o=r?Ti(t,n):$(s);po(t,n,o,Gi(t,n)),!r&&t.cm&&t.cm.scrollIntoView({from:n.from,to:Mi(n)});var a=[];Wi(t,(function(t,e){e||-1!=z(a,t.history)||(yo(t.history,n),a.push(t.history)),po(t,n,null,Gi(t,n))}))},d=i.changes.length-1;d>=0;--d){var p=h(d);if(p)return p.v}}}}function ho(t,e){if(0!=e&&(t.first+=e,t.sel=new Ci(X(t.sel.ranges,(function(t){return new _i(te(t.anchor.line+e,t.anchor.ch),te(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){fn(t.cm,t.first,t.first-e,e);for(var r=t.cm.display,n=r.viewFrom;n<r.viewTo;n++)hn(t.cm,n,"gutter")}}function po(t,e,r,n){if(t.cm&&!t.cm.curOp)return ti(t.cm,po)(t,e,r,n);if(e.to.line<t.first)ho(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);ho(t,i),e={from:te(t.first,0),to:te(e.to.line+i,e.to.ch),text:[$(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:te(o,Kt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=qt(t,e.from,e.to),r||(r=Ti(t,e)),t.cm?function(t,e,r){var n=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=Yt(Fe(Kt(n,o.line))),n.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),n.sel.contains(e.from,e.to)>-1&>(t),Ei(n,e,r,sn(t)),t.options.lineWrapping||(n.iter(l,o.line+e.text.length,(function(t){var e=Ve(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var r=t.first,n=e-1;n>r;n--){var i=Kt(t,n).stateAfter;if(i&&(!(i instanceof ue)||n+i.lookAhead<e)){r=n+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,r)}}(n,o.line),ni(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?fn(t):o.line!=a.line||1!=e.text.length||Di(t.doc,e)?fn(t,o.line,a.line+1,u):hn(t,o.line,"text");var c=mt(t,"changes"),f=mt(t,"change");if(f||c){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};f&&sr(t,"change",t,h),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}(t.cm,e,n):Ei(t,e,n),to(t,r,B),t.cantEdit&&oo(t,te(t.firstLine(),0))&&(t.cantEdit=!1)}}function vo(t,e,r,n,i){var o;n||(n=r),ee(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof e&&(e=t.splitLines(e)),uo(t,{from:r,to:n,text:e,origin:i})}function go(t,e,r,n){r<t.line?t.line+=n:e<t.line&&(t.line=e,t.ch=0)}function mo(t,e,r,n){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){o.copied||((o=t[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)go(o.ranges[s].anchor,e,r,n),go(o.ranges[s].head,e,r,n)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(r<u.from.line)u.from=te(u.from.line+n,u.from.ch),u.to=te(u.to.line+n,u.to.ch);else if(e<=u.to.line){a=!1;break}}a||(t.splice(0,i+1),i=0)}}}function yo(t,e){var r=e.from.line,n=e.to.line,i=e.text.length-(n-r)-1;mo(t.done,r,n,i),mo(t.undone,r,n,i)}function bo(t,e,r,n){var i=e,o=e;return"number"==typeof e?o=Kt(t,ae(t,e)):i=Yt(e),null==i?null:(n(o,i)&&t.cm&&hn(t.cm,i,r),o)}function wo(t){this.lines=t,this.parent=null;for(var e=0,r=0;r<t.length;++r)t[r].parent=this,e+=t[r].height;this.height=e}function xo(t){this.children=t;for(var e=0,r=0,n=0;n<t.length;++n){var i=t[n];e+=i.chunkSize(),r+=i.height,i.parent=this}this.size=e,this.height=r,this.parent=null}_i.prototype.from=function(){return oe(this.anchor,this.head)},_i.prototype.to=function(){return ie(this.anchor,this.head)},_i.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var r=t,n=t+e;r<n;++r){var i=this.lines[r];this.height-=i.height,qe(i),sr(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,r){this.height+=r,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var n=0;n<e.length;++n)e[n].parent=this},iterN:function(t,e,r){for(var n=t+e;t<n;++t)if(r(this.lines[t]))return!0}},xo.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(t<i){var o=Math.min(e,i-t),a=n.height;if(n.removeInner(t,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof wo))){var s=[];this.collapse(s),this.children=[new wo(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,r){this.size+=e.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(t<=o){if(i.insertInner(t,e,r),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new wo(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new xo(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var r=z(t.parent.children,t);t.parent.children.splice(r+1,0,e)}else{var n=new xo(t.children);n.parent=t,t.children=[n,e],t=n}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(t<o){var a=Math.min(e,o-t);if(i.iterN(t,a,r))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var Co=function(t,e,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=t,this.node=e};function _o(t,e,r){Ue(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&An(t,r)}Co.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,r=this.line,n=Yt(r);if(null!=n&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(r.widgets=null);var o=wr(this);Xt(r,Math.max(0,r.height-o)),t&&(Qn(t,(function(){_o(t,r,-o),hn(t,n,"widget")})),sr(t,"lineWidgetCleared",t,this,n))}},Co.prototype.changed=function(){var t=this,e=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=wr(this)-e;i&&(je(this.doc,n)||Xt(n,n.height+i),r&&Qn(r,(function(){r.curOp.forceUpdate=!0,_o(r,n,i),sr(r,"lineWidgetChanged",r,t,Yt(n))})))},yt(Co);var So=0,ko=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++So};function Mo(t,e,r,n,i){if(n&&n.shared)return function(t,e,r,n,i){(n=H(n)).shared=!1;var o=[Mo(t,e,r,n,i)],a=o[0],s=n.widgetNode;return Wi(t,(function(t){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Mo(t,se(t,e),se(t,r),n,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=$(o)})),new Lo(o,a)}(t,e,r,n,i);if(t.cm&&!t.cm.curOp)return ti(t.cm,Mo)(t,e,r,n,i);var o=new ko(t,i),a=ee(e,r);if(n&&H(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(He(t,e.line,e,r,o)||e.line!=r.line&&He(t,r.line,e,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ce=!0}o.addToHistory&&zi(t,{from:e,to:r,origin:"markText"},t.sel,NaN);var s,l=e.line,u=t.cm;if(t.iter(l,r.line+1,(function(t){u&&o.collapsed&&!u.options.lineWrapping&&Fe(t)==u.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&Xt(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new _e(o,l==e.line?e.ch:null,l==r.line?r.ch:null)),++l})),o.collapsed&&t.iter(e.line,r.line+1,(function(e){je(t,e)&&Xt(e,0)})),o.clearOnEnter&&ft(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xe=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)fn(u,e.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=e.line;c<=r.line;c++)hn(u,c,"text");o.atomic&&ro(u.doc),sr(u,"markerAdded",u,o)}return o}ko.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Kn(t),mt(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Se(a.markedSpans,this);t&&!this.collapsed?hn(t,Yt(a),"text"):t&&(null!=s.to&&(i=Yt(a)),null!=s.from&&(n=Yt(a))),a.markedSpans=ke(a.markedSpans,s),null==s.from&&this.collapsed&&!je(this.doc,a)&&t&&Xt(a,rn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Fe(this.lines[l]),c=Ve(u);c>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=n&&t&&this.collapsed&&fn(t,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ro(t.doc)),t&&sr(t,"markerCleared",t,this,n,i),e&&qn(t),this.parent&&this.parent.clear()}},ko.prototype.find=function(t,e){var r,n;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Se(o.markedSpans,this);if(null!=a.from&&(r=te(e?o:Yt(o),a.from),-1==t))return r;if(null!=a.to&&(n=te(e?o:Yt(o),a.to),1==t))return n}return r&&{from:r,to:n}},ko.prototype.changed=function(){var t=this,e=this.find(-1,!0),r=this,n=this.doc.cm;e&&n&&Qn(n,(function(){var i=e.line,o=Yt(e.line),a=Ar(n,o);if(a&&(Hr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!je(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var l=wr(r)-s;l&&Xt(i,i.height+l)}sr(n,"markerChanged",n,t)}))},ko.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=z(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},ko.prototype.detachLine=function(t){if(this.lines.splice(z(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},yt(ko);var Lo=function(t,e){this.markers=t,this.primary=e;for(var r=0;r<t.length;++r)t[r].parent=this};function To(t){return t.findMarks(te(t.first,0),t.clipPos(te(t.lastLine())),(function(t){return t.parent}))}function Oo(t){for(var e=function(e){var r=t[e],n=[r.primary.doc];Wi(r.primary.doc,(function(t){return n.push(t)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==z(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<t.length;r++)e(r)}Lo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();sr(this,"clear")}},Lo.prototype.find=function(t,e){return this.primary.find(t,e)},yt(Lo);var Ao=0,No=function(t,e,r,n,i){if(!(this instanceof No))return new No(t,e,r,n,i);null==r&&(r=0),xo.call(this,[new wo([new Ke("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=te(r,0);this.sel=ki(o),this.history=new Hi(null),this.id=++Ao,this.modeOption=e,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Ei(this,{from:o,to:o,text:t}),Qi(this,ki(o),B)};No.prototype=Z(xo.prototype,{constructor:No,iter:function(t,e,r){r?this.iterN(t-this.first,e-t,r):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var r=0,n=0;n<e.length;++n)r+=e[n].height;this.insertInner(t-this.first,e,r)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=$t(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:ri((function(t){var e=te(this.first,0),r=this.first+this.size-1;uo(this,{from:e,to:te(r,Kt(this,r).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Dn(this.cm,0,0),Qi(this,ki(e),B)})),replaceRange:function(t,e,r,n){vo(this,t,e=se(this,e),r=r?se(this,r):e,n)},getRange:function(t,e,r){var n=qt(this,se(this,t),se(this,e));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(Jt(this,t))return Kt(this,t)},getLineNumber:function(t){return Yt(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Kt(this,t)),Fe(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return se(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ri((function(t,e,r){Zi(this,se(this,"number"==typeof t?te(t,e||0):t),null,r)})),setSelection:ri((function(t,e,r){Zi(this,se(this,t),se(this,e||t),r)})),extendSelection:ri((function(t,e,r){$i(this,se(this,t),e&&se(this,e),r)})),extendSelections:ri((function(t,e){Xi(this,le(this,t),e)})),extendSelectionsBy:ri((function(t,e){Xi(this,le(this,X(this.sel.ranges,t)),e)})),setSelections:ri((function(t,e,r){if(t.length){for(var n=[],i=0;i<t.length;i++)n[i]=new _i(se(this,t[i].anchor),se(this,t[i].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Qi(this,Si(this.cm,n,e),r)}})),addSelection:ri((function(t,e,r){var n=this.sel.ranges.slice(0);n.push(new _i(se(this,t),se(this,e||t))),Qi(this,Si(this.cm,n,n.length-1),r)})),getSelection:function(t){for(var e,r=this.sel.ranges,n=0;n<r.length;n++){var i=qt(this,r[n].from(),r[n].to());e=e?e.concat(i):i}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=qt(this,r[n].from(),r[n].to());!1!==t&&(i=i.join(t||this.lineSeparator())),e[n]=i}return e},replaceSelection:function(t,e,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=t;this.replaceSelections(n,e,r||"+input")},replaceSelections:ri((function(t,e,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(t[o]),origin:r}}for(var s=e&&"end"!=e&&function(t,e,r){for(var n=[],i=te(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],l=Oi(s.from,i,o),u=Oi(Mi(s),i,o);if(i=s.to,o=u,"around"==r){var c=t.sel.ranges[a],f=ee(c.head,c.anchor)<0;n[a]=new _i(f?u:l,f?l:u)}else n[a]=new _i(l,l)}return new Ci(n,t.sel.primIndex)}(this,n,e),l=n.length-1;l>=0;l--)uo(this,n[l]);s?Ji(this,s):this.cm&&Nn(this.cm)})),undo:ri((function(){fo(this,"undo")})),redo:ri((function(){fo(this,"redo")})),undoSelection:ri((function(){fo(this,"undo",!0)})),redoSelection:ri((function(){fo(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,r=0,n=0;n<t.done.length;n++)t.done[n].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++r;return{undo:e,redo:r}},clearHistory:function(){var t=this;this.history=new Hi(this.history.maxGeneration),Wi(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(t){var e=this.history=new Hi(this.history.maxGeneration);e.done=Ki(t.done.slice(0),null,!0),e.undone=Ki(t.undone.slice(0),null,!0)},setGutterMarker:ri((function(t,e,r){return bo(this,t,"gutter",(function(t){var n=t.gutterMarkers||(t.gutterMarkers={});return n[e]=r,!r&&et(n)&&(t.gutterMarkers=null),!0}))})),clearGutter:ri((function(t){var e=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[t]&&bo(e,r,"gutter",(function(){return r.gutterMarkers[t]=null,et(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!Jt(this,t))return null;if(e=t,!(t=Kt(this,t)))return null}else if(null==(e=Yt(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:ri((function(t,e,r){return bo(this,t,"gutter"==e?"gutter":"class",(function(t){var n="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[n]){if(S(r).test(t[n]))return!1;t[n]+=" "+r}else t[n]=r;return!0}))})),removeLineClass:ri((function(t,e,r){return bo(this,t,"gutter"==e?"gutter":"class",(function(t){var n="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[n];if(!i)return!1;if(null==r)t[n]=null;else{var o=i.match(S(r));if(!o)return!1;var a=o.index+o[0].length;t[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ri((function(t,e,r){return function(t,e,r,n){var i=new Co(t,r,n),o=t.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(t,e,"widget",(function(e){var r=e.widgets||(e.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!je(t,e)){var n=Ue(e)<t.scrollTop;Xt(e,e.height+wr(i)),n&&An(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&sr(o,"lineWidgetAdded",o,i,"number"==typeof e?e:Yt(e)),i}(this,t,e,r)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,r){return Mo(this,se(this,t),se(this,e),r,r&&r.type||"range")},setBookmark:function(t,e){var r={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return Mo(this,t=se(this,t),t,r,"bookmark")},findMarksAt:function(t){var e=[],r=Kt(this,(t=se(this,t)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,r){t=se(this,t),e=se(this,e);var n=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var t=[];return this.iter((function(e){var r=e.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&t.push(r[n].marker)})),t},posFromIndex:function(t){var e,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>t)return e=t,!0;t-=o,++r})),se(this,te(r,e))},indexFromPos:function(t){var e=(t=se(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+r})),e},copy:function(t){var e=new No($t(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,r=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<r&&(r=t.to);var n=new No($t(this,e,r),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:t.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=n.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(ee(o,a)){var s=Mo(t,o,a,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,To(this)),n},unlinkDoc:function(t){if(t instanceof La&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),Oo(To(this));break}if(t.history==this.history){var r=[t.id];Wi(t,(function(t){return r.push(t.id)}),!0),t.history=new Hi(null),t.history.done=Ki(this.history.done,r),t.history.undone=Ki(this.history.undone,r)}},iterLinkedDocs:function(t){Wi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Nt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ri((function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Qn(e=this.cm,(function(){Ri(e),fn(e)})))}))}),No.prototype.eachLine=No.prototype.iter;var Do=0;function Eo(t){var e=this;if(Wo(e),!vt(e,t)&&!xr(e.display,t)){bt(t),a&&(Do=+new Date);var r=un(e,t,!0),n=t.dataTransfer.files;if(r&&!e.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,l=function(){++s==i&&ti(e,(function(){var t={from:r=se(e.doc,r),to:r,text:e.doc.splitLines(o.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};uo(e.doc,t),Ji(e.doc,ki(se(e.doc,r),se(e.doc,Mi(t))))}))()},u=function(t,r){if(e.options.allowDropFileTypes&&-1==z(e.options.allowDropFileTypes,t.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var t=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(o[r]=t),l()},n.readAsText(t)}},c=0;c<n.length;c++)u(n[c],c);else{if(e.state.draggingText&&e.doc.sel.contains(r)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var f=t.dataTransfer.getData("Text");if(f){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),to(e.doc,ki(r,r)),h)for(var d=0;d<h.length;++d)vo(e.doc,"",h[d].anchor,h[d].head,"drag");e.replaceSelection(f,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Wo(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Po(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation((function(){for(var e=0;e<r.length;e++)t(r[e])}))}}var Ro=!1;function Ho(){var t;Ro||(ft(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Po(Fo)}),100))})),ft(window,"blur",(function(){return Po(kn)})),Ro=!0)}function Fo(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Io={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"},zo=0;zo<10;zo++)Io[zo+48]=Io[zo+96]=String(zo);for(var jo=65;jo<=90;jo++)Io[jo]=String.fromCharCode(jo);for(var Bo=1;Bo<=12;Bo++)Io[Bo+111]=Io[Bo+63235]="F"+Bo;var Uo={};function Vo(t){var e,r,n,i,o=t.split(/-(?!$)/);t=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return e&&(t="Alt-"+t),r&&(t="Ctrl-"+t),i&&(t="Cmd-"+t),n&&(t="Shift-"+t),t}function Go(t){var e={};for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete t[r];continue}for(var i=X(r.split(" "),Vo),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=n):(s=i.slice(0,o+1).join(" "),a="...");var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[r]}for(var u in e)t[u]=e[u];return t}function Ko(t,e,r,n){var i=(e=Yo(e)).call?e.call(t,n):e[t];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Ko(t,e.fallthrough,r,n);for(var o=0;o<e.fallthrough.length;o++){var a=Ko(t,e.fallthrough[o],r,n);if(a)return a}}}function qo(t){var e="string"==typeof t?t:Io[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function $o(t,e,r){var n=t;return e.altKey&&"Alt"!=n&&(t="Alt-"+t),(C?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(t="Ctrl-"+t),(C?e.ctrlKey:e.metaKey)&&"Mod"!=n&&(t="Cmd-"+t),!r&&e.shiftKey&&"Shift"!=n&&(t="Shift-"+t),t}function Xo(t,e){if(f&&34==t.keyCode&&t.char)return!1;var r=Io[t.keyCode];return null!=r&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(r=t.code),$o(r,t,e))}function Yo(t){return"string"==typeof t?Uo[t]:t}function Zo(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ee(o.from,$(n).to)<=0;){var a=n.pop();if(ee(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Qn(t,(function(){for(var e=n.length-1;e>=0;e--)vo(t.doc,"",n[e].from,n[e].to,"+delete");Nn(t)}))}function Jo(t,e,r){var n=it(t.text,e+r,r);return n<0||n>t.text.length?null:n}function Qo(t,e,r){var n=Jo(t,e.ch,r);return null==n?null:new te(e.line,n,r<0?"after":"before")}function ta(t,e,r,n,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ut(r,e.doc.direction);if(o){var a,s=i<0?$(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var u=Nr(e,r);a=i<0?r.text.length-1:0;var c=Dr(e,u,a).top;a=ot((function(t){return Dr(e,u,t).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Jo(r,a,1))}else a=i<0?s.to:s.from;return new te(n,a,l)}}return new te(n,i<0?r.text.length:0,i<0?"before":"after")}Uo.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"},Uo.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"},Uo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Uo.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"]},Uo.default=y?Uo.macDefault:Uo.pcDefault;var ea={selectAll:so,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),B)},killLine:function(t){return Zo(t,(function(e){if(e.empty()){var r=Kt(t.doc,e.head.line).text.length;return e.head.ch==r&&e.head.line<t.lastLine()?{from:e.head,to:te(e.head.line+1,0)}:{from:e.head,to:te(e.head.line,r)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Zo(t,(function(e){return{from:te(e.from().line,0),to:se(t.doc,te(e.to().line+1,0))}}))},delLineLeft:function(t){return Zo(t,(function(t){return{from:te(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Zo(t,(function(e){var r=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:r},"div"),to:e.from()}}))},delWrappedLineRight:function(t){return Zo(t,(function(e){var r=t.charCoords(e.head,"div").top+5,n=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:r},"div");return{from:e.from(),to:n}}))},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(te(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(te(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return ra(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return na(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return function(t,e){var r=Kt(t.doc,e),n=function(t){for(var e;e=Pe(t);)t=e.find(1,!0).line;return t}(r);return n!=r&&(e=Yt(n)),ta(!0,t,r,e,-1)}(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var r=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:r},"div")}),V)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var r=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:r},"div")}),V)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var r=t.cursorCoords(e.head,"div").top+5,n=t.coordsChar({left:0,top:r},"div");return n.ch<t.getLine(n.line).search(/\S/)?na(t,e.head):n}),V)},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){for(var e=[],r=t.listSelections(),n=t.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=F(t.getLine(o.line),o.ch,n);e.push(q(n-a%n))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Qn(t,(function(){for(var e=t.listSelections(),r=[],n=0;n<e.length;n++)if(e[n].empty()){var i=e[n].head,o=Kt(t.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new te(i.line,i.ch-1)),i.ch>0)i=new te(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),te(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Kt(t.doc,i.line-1).text;a&&(i=new te(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),te(i.line-1,a.length-1),i,"+transpose"))}r.push(new _i(i,i))}t.setSelections(r)}))},newlineAndIndent:function(t){return Qn(t,(function(){for(var e=t.listSelections(),r=e.length-1;r>=0;r--)t.replaceRange(t.doc.lineSeparator(),e[r].anchor,e[r].head,"+input");e=t.listSelections();for(var n=0;n<e.length;n++)t.indentLine(e[n].from().line,null,!0);Nn(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function ra(t,e){var r=Kt(t.doc,e),n=Fe(r);return n!=r&&(e=Yt(n)),ta(!0,t,n,e,1)}function na(t,e){var r=ra(t,e.line),n=Kt(t.doc,r.line),i=ut(n,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),a=e.line==r.line&&e.ch<=o&&e.ch;return te(r.line,a?0:o,r.sticky)}return r}function ia(t,e,r){if("string"==typeof e&&!(e=ea[e]))return!1;t.display.input.ensurePolled();var n=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r&&(t.display.shift=!1),i=e(t)!=j}finally{t.display.shift=n,t.state.suppressEdits=!1}return i}var oa=new I;function aa(t,e,r,n){var i=t.state.keySeq;if(i){if(qo(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:oa.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),sa(t,i+" "+e,r,n))return!0}return sa(t,e,r,n)}function sa(t,e,r,n){var i=function(t,e,r){for(var n=0;n<t.state.keyMaps.length;n++){var i=Ko(e,t.state.keyMaps[n],r,t);if(i)return i}return t.options.extraKeys&&Ko(e,t.options.extraKeys,r,t)||Ko(e,t.options.keyMap,r,t)}(t,e,n);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&sr(t,"keyHandled",t,e,r),"handled"!=i&&"multi"!=i||(bt(r),xn(t)),!!i}function la(t,e){var r=Xo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?aa(t,"Shift-"+r,e,(function(e){return ia(t,e,!0)}))||aa(t,r,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return ia(t,e)})):aa(t,r,e,(function(e){return ia(t,e)})))}var ua=null;function ca(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=D(),vt(e,t)))){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var i=la(e,t);f&&(ua=i?n:null,i||88!=n||Et||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),r&&!y&&!i&&46==n&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function r(t){18!=t.keyCode&&t.altKey||(M(e,"CodeMirror-crosshair"),dt(document,"keyup",r),dt(document,"mouseover",r))}E(e,"CodeMirror-crosshair"),ft(document,"keyup",r),ft(document,"mouseover",r)}(e)}}function fa(t){16==t.keyCode&&(this.doc.sel.shift=!1),vt(this,t)}function ha(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||xr(e.display,t)||vt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var r=t.keyCode,n=t.charCode;if(f&&r==ua)return ua=null,void bt(t);if(!f||t.which&&!(t.which<10)||!la(e,t)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(function(t,e,r){return aa(t,"'"+r+"'",e,(function(e){return ia(t,e,!0)}))}(e,t,i)||e.display.input.onKeyPress(t))}}}var da,pa,va=function(t,e,r){this.time=t,this.pos=e,this.button=r};function ga(t){var e=this,r=e.display;if(!(vt(e,t)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=t.shiftKey,xr(r,t))l||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!ba(e,t)){var n=un(e,t),i=St(t),o=n?function(t,e){var r=+new Date;return pa&&pa.compare(r,t,e)?(da=pa=null,"triple"):da&&da.compare(r,t,e)?(pa=new va(r,t,e),da=null,"double"):(da=new va(r,t,e),pa=null,"single")}(n,i):"single";window.focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),n&&function(t,e,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),aa(t,$o(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,(function(e){if("string"==typeof e&&(e=ea[e]),!e)return!1;var n=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n=e(t,r)!=j}finally{t.state.suppressEdits=!1}return n}))}(e,i,n,o,t)||(1==i?n?function(t,e,r,n){a?setTimeout(R(Cn,t),0):t.curOp.focus=D();var i,o=function(t,e,r){var n=t.getOption("configureMouse"),i=n?n(t,e,r):{};if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey)),i}(t,r,n),u=t.doc.sel;t.options.dragDrop&&Lt&&!t.isReadOnly()&&"single"==r&&(i=u.contains(e))>-1&&(ee((i=u.ranges[i]).from(),e)<0||e.xRel>0)&&(ee(i.to(),e)>0||e.xRel<0)?function(t,e,r,n){var i=t.display,o=!1,u=ti(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:_n(t)),dt(i.wrapper.ownerDocument,"mouseup",u),dt(i.wrapper.ownerDocument,"mousemove",c),dt(i.scroller,"dragstart",f),dt(i.scroller,"drop",u),o||(bt(e),n.addNew||$i(t.doc,r,null,null,n.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},f=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=u,u.copy=!n.moveOnDrag,ft(i.wrapper.ownerDocument,"mouseup",u),ft(i.wrapper.ownerDocument,"mousemove",c),ft(i.scroller,"dragstart",f),ft(i.scroller,"drop",u),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(t,n,e,o):function(t,e,r,n){a&&_n(t);var i=t.display,o=t.doc;bt(e);var s,l,u=o.sel,c=u.ranges;if(n.addNew&&!n.extend?(l=o.sel.contains(r),s=l>-1?c[l]:new _i(r,r)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new _i(r,r)),r=un(t,e,!0,!0),l=-1;else{var f=ma(t,r,n.unit);s=n.extend?qi(s,f.anchor,f.head,n.extend):f}n.addNew?-1==l?(l=c.length,Qi(o,Si(t,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==n.unit&&!n.extend?(Qi(o,Si(t,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Yi(o,l,s,U):(l=0,Qi(o,new Ci([s],0),U),u=o.sel);var h=r;function d(e){if(0!=ee(h,e))if(h=e,"rectangle"==n.unit){for(var i=[],a=t.options.tabSize,c=F(Kt(o,r.line).text,r.ch,a),f=F(Kt(o,e.line).text,e.ch,a),d=Math.min(c,f),p=Math.max(c,f),v=Math.min(r.line,e.line),g=Math.min(t.lastLine(),Math.max(r.line,e.line));v<=g;v++){var m=Kt(o,v).text,y=G(m,d,a);d==p?i.push(new _i(te(v,y),te(v,y))):m.length>y&&i.push(new _i(te(v,y),te(v,G(m,p,a))))}i.length||i.push(new _i(r,r)),Qi(o,Si(t,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,x=ma(t,e,n.unit),C=w.anchor;ee(x.anchor,C)>0?(b=x.head,C=oe(w.from(),x.anchor)):(b=x.anchor,C=ie(w.to(),x.head));var _=u.ranges.slice(0);_[l]=function(t,e){var r=e.anchor,n=e.head,i=Kt(t.doc,r.line);if(0==ee(r,n)&&r.sticky==n.sticky)return e;var o=ut(i);if(!o)return e;var a=st(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return e;var l,u=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return e;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=st(o,n.ch,n.sticky),f=c-a||(n.ch-r.ch)*(1==s.level?-1:1);l=c==u-1||c==u?f<0:f>0}var h=o[u+(l?-1:0)],d=l==(1==h.level),p=d?h.from:h.to,v=d?"after":"before";return r.ch==p&&r.sticky==v?e:new _i(new te(r.line,p,v),n)}(t,new _i(se(o,C),b)),Qi(o,Si(t,_,l),U)}}var p=i.wrapper.getBoundingClientRect(),v=0;function g(e){t.state.selectingText=!1,v=1/0,e&&(bt(e),i.input.focus()),dt(i.wrapper.ownerDocument,"mousemove",m),dt(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var m=ti(t,(function(e){0!==e.buttons&&St(e)?function e(r){var a=++v,s=un(t,r,!0,"rectangle"==n.unit);if(s)if(0!=ee(s,h)){t.curOp.focus=D(),d(s);var l=Tn(i,o);(s.line>=l.to||s.line<l.from)&&setTimeout(ti(t,(function(){v==a&&e(r)})),150)}else{var u=r.clientY<p.top?-20:r.clientY>p.bottom?20:0;u&&setTimeout(ti(t,(function(){v==a&&(i.scroller.scrollTop+=u,e(r))})),50)}}(e):g(e)})),y=ti(t,g);t.state.selectingText=y,ft(i.wrapper.ownerDocument,"mousemove",m),ft(i.wrapper.ownerDocument,"mouseup",y)}(t,n,e,o)}(e,n,o,t):_t(t)==r.scroller&&bt(t):2==i?(n&&$i(e.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(_?e.display.input.onContextMenu(t):_n(e)))}}function ma(t,e,r){if("char"==r)return new _i(e,e);if("word"==r)return t.findWordAt(e);if("line"==r)return new _i(te(e.line,0),se(t.doc,te(e.line+1,0)));var n=r(t,e);return new _i(n.from,n.to)}function ya(t,e,r,n){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;n&&bt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!mt(t,r))return xt(e);o-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i)return pt(t,r,t,Zt(t.doc,o),t.display.gutterSpecs[l].className,e),xt(e)}}function ba(t,e){return ya(t,e,"gutterClick",!0)}function wa(t,e){xr(t.display,e)||function(t,e){return!!mt(t,"gutterContextMenu")&&ya(t,e,"gutterContextMenu",!1)}(t,e)||vt(t,e,"contextmenu")||_||t.display.input.onContextMenu(e)}function xa(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ir(t)}va.prototype.compare=function(t,e,r){return this.time+400>t&&0==ee(e,this.pos)&&r==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},_a={},Sa={};function ka(t,e,r){if(!e!=!(r&&r!=Ca)){var n=t.display.dragFunctions,i=e?ft:dt;i(t.display.scroller,"dragstart",n.start),i(t.display.scroller,"dragenter",n.enter),i(t.display.scroller,"dragover",n.over),i(t.display.scroller,"dragleave",n.leave),i(t.display.scroller,"drop",n.drop)}}function Ma(t){t.options.lineWrapping?(E(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(M(t.display.wrapper,"CodeMirror-wrap"),Ge(t)),ln(t),fn(t),Ir(t),setTimeout((function(){return jn(t)}),100)}function La(t,e){var r=this;if(!(this instanceof La))return new La(t,e);this.options=e=e?H(e):{},H(_a,e,!1);var n=e.value;"string"==typeof n?n=new No(n,e.mode,null,e.lineSeparator,e.direction):e.mode&&(n.modeOption=e.mode),this.doc=n;var i=new La.inputStyles[e.inputStyle](this),o=this.display=new gi(t,n,i,e);for(var u in o.wrapper.CodeMirror=this,xa(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new I,keySeq:null,specialChars:null},e.autofocus&&!m&&o.input.focus(),a&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(t){var e=t.display;ft(e.scroller,"mousedown",ti(t,ga)),ft(e.scroller,"dblclick",a&&s<11?ti(t,(function(e){if(!vt(t,e)){var r=un(t,e);if(r&&!ba(t,e)&&!xr(t.display,e)){bt(e);var n=t.findWordAt(r);$i(t.doc,n.anchor,n.head)}}})):function(e){return vt(t,e)||bt(e)}),ft(e.scroller,"contextmenu",(function(e){return wa(t,e)})),ft(e.input.getField(),"contextmenu",(function(r){e.scroller.contains(r.target)||wa(t,r)}));var r,n={end:0};function i(){e.activeTouch&&(r=setTimeout((function(){return e.activeTouch=null}),1e3),(n=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var r=e.left-t.left,n=e.top-t.top;return r*r+n*n>400}ft(e.scroller,"touchstart",(function(i){if(!vt(t,i)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(i)&&!ba(t,i)){e.input.ensurePolled(),clearTimeout(r);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),ft(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ft(e.scroller,"touchend",(function(r){var n=e.activeTouch;if(n&&!xr(e,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,s=t.coordsChar(e.activeTouch,"page");a=!n.prev||o(n,n.prev)?new _i(s,s):!n.prev.prev||o(n,n.prev.prev)?t.findWordAt(s):new _i(te(s.line,0),se(t.doc,te(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),bt(r)}i()})),ft(e.scroller,"touchcancel",i),ft(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Pn(t,e.scroller.scrollTop),Hn(t,e.scroller.scrollLeft,!0),pt(t,"scroll",t))})),ft(e.scroller,"mousewheel",(function(e){return xi(t,e)})),ft(e.scroller,"DOMMouseScroll",(function(e){return xi(t,e)})),ft(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){vt(t,e)||Ct(e)},over:function(e){vt(t,e)||(function(t,e){var r=un(t,e);if(r){var n=document.createDocumentFragment();yn(t,r,n),t.display.dragCursor||(t.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),T(t.display.dragCursor,n)}}(t,e),Ct(e))},start:function(e){return function(t,e){if(a&&(!t.state.draggingText||+new Date-Do<100))Ct(e);else if(!vt(t,e)&&!xr(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!h)){var r=O("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,t.display.wrapper.appendChild(r),r._top=r.offsetTop),e.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}(t,e)},drop:ti(t,Eo),leave:function(e){vt(t,e)||Wo(t)}};var l=e.input.getField();ft(l,"keyup",(function(e){return fa.call(t,e)})),ft(l,"keydown",ti(t,ca)),ft(l,"keypress",ti(t,ha)),ft(l,"focus",(function(e){return Sn(t,e)})),ft(l,"blur",(function(e){return kn(t,e)}))}(this),Ho(),Kn(this),this.curOp.forceUpdate=!0,Pi(this,n),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&Sn(r)}),20):kn(this),Sa)Sa.hasOwnProperty(u)&&Sa[u](this,e[u],Ca);hi(this),e.finishInit&&e.finishInit(this);for(var c=0;c<Ta.length;++c)Ta[c](this);qn(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}La.defaults=_a,La.optionHandlers=Sa;var Ta=[];function Oa(t,e,r,n){var i,o=t.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=de(t,e).state:r="prev");var a=t.options.tabSize,s=Kt(o,e),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==j||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=e>o.first?F(Kt(o,e-1).text,null,a):0:"add"==r?u=l+t.options.indentUnit:"subtract"==r?u=l-t.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var f="",h=0;if(t.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d)h+=a,f+="\t";if(h<u&&(f+=q(u-h)),f!=c)return vo(o,f,te(e,0),te(e,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var v=o.sel.ranges[p];if(v.head.line==e&&v.head.ch<c.length){var g=te(e,c.length);Yi(o,p,new _i(g,g));break}}}La.defineInitHook=function(t){return Ta.push(t)};var Aa=null;function Na(t){Aa=t}function Da(t,e,r,n,i){var o=t.doc;t.display.shift=!1,n||(n=o.sel);var a=+new Date-200,s="paste"==i||t.state.pasteIncoming>a,l=Nt(e),u=null;if(s&&n.ranges.length>1)if(Aa&&Aa.text.join("\n")==e){if(n.ranges.length%Aa.text.length==0){u=[];for(var c=0;c<Aa.text.length;c++)u.push(o.splitLines(Aa.text[c]))}}else l.length==n.ranges.length&&t.options.pasteLinesPerSelection&&(u=X(l,(function(t){return[t]})));for(var f=t.curOp.updateInput,h=n.ranges.length-1;h>=0;h--){var d=n.ranges[h],p=d.from(),v=d.to();d.empty()&&(r&&r>0?p=te(p.line,p.ch-r):t.state.overwrite&&!s?v=te(v.line,Math.min(Kt(o,v.line).text.length,v.ch+$(l).length)):s&&Aa&&Aa.lineWise&&Aa.text.join("\n")==l.join("\n")&&(p=v=te(p.line,0)));var g={from:p,to:v,text:u?u[h%u.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};uo(t.doc,g),sr(t,"inputRead",t,g)}e&&!s&&Wa(t,e),Nn(t),t.curOp.updateInput<2&&(t.curOp.updateInput=f),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ea(t,e){var r=t.clipboardData&&t.clipboardData.getData("Text");if(r)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Qn(e,(function(){return Da(e,r,0,null,"paste")})),!0}function Wa(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var r=t.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(e.indexOf(o.electricChars.charAt(s))>-1){a=Oa(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Kt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Oa(t,i.head.line,"smart"));a&&sr(t,"electricInput",t,i.head.line)}}}function Pa(t){for(var e=[],r=[],n=0;n<t.doc.sel.ranges.length;n++){var i=t.doc.sel.ranges[n].head.line,o={anchor:te(i,0),head:te(i+1,0)};r.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:r}}function Ra(t,e,r,n){t.setAttribute("autocorrect",r?"":"off"),t.setAttribute("autocapitalize",n?"":"off"),t.setAttribute("spellcheck",!!e)}function Ha(){var t=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=O("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),v&&(t.style.border="1px solid black"),Ra(t),e}function Fa(t,e,r,n,i){var o=e,a=r,s=Kt(t,e.line),l=i&&"rtl"==t.direction?-r:r;function u(o){var a,u;if("codepoint"==n){var c=s.text.charCodeAt(e.ch+(n>0?0:-1));a=isNaN(c)?null:new te(e.line,Math.max(0,Math.min(s.text.length,e.ch+r*(c>=55296&&c<56320?2:1))),-r)}else a=i?function(t,e,r,n){var i=ut(e,t.doc.direction);if(!i)return Qo(e,r,n);r.ch>=e.text.length?(r.ch=e.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=st(i,r.ch,r.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Qo(e,r,n);var s,l=function(t,r){return Jo(e,t instanceof te?t.ch:t,r)},u=function(r){return t.options.lineWrapping?(s=s||Nr(t,e),Zr(t,e,s,r)):{begin:0,end:e.text.length}},c=u("before"==r.sticky?l(r,-1):r.ch);if("rtl"==t.doc.direction||1==a.level){var f=1==a.level==n<0,h=l(r,f?1:-1);if(null!=h&&(f?h<=a.to&&h<=c.end:h>=a.from&&h>=c.begin)){var d=f?"before":"after";return new te(r.line,h,d)}}var p=function(t,e,n){for(var o=function(t,e){return e?new te(r.line,l(t,1),"before"):new te(r.line,t,"after")};t>=0&&t<i.length;t+=e){var a=i[t],s=e>0==(1!=a.level),u=s?n.begin:l(n.end,-1);if(a.from<=u&&u<a.to)return o(u,s);if(u=s?a.from:l(a.to,-1),n.begin<=u&&u<n.end)return o(u,s)}},v=p(o+n,n,c);if(v)return v;var g=n>0?c.end:l(c.begin,-1);return null==g||n>0&&g==e.text.length||!(v=p(n>0?0:i.length-1,n,u(g)))?null:v}(t.cm,s,e,r):Qo(s,e,r);if(null==a){if(o||(u=e.line+l)<t.first||u>=t.first+t.size||(e=new te(u,e.ch,e.sticky),!(s=Kt(t,u))))return!1;e=ta(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,h=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var p=s.text.charAt(e.ch)||"\n",v=tt(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||v||(v="s"),c&&c!=v){r<0&&(r=1,u(),e.sticky="after");break}if(v&&(c=v),r>0&&!u(!d))break}var g=oo(t,e,o,a,!0);return re(o,g)&&(g.hitSide=!0),g}function Ia(t,e,r,n){var i,o,a=t.doc,s=e.left;if("page"==n){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*rn(t.display),3);i=(r>0?e.bottom:e.top)+r*u}else"line"==n&&(i=r>0?e.bottom+3:e.top-3);for(;(o=Xr(t,s,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var za=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function ja(t,e){var r=Ar(t,e.line);if(!r||r.hidden)return null;var n=Kt(t.doc,e.line),i=Tr(r,n,e.line),o=ut(n,t.doc.direction),a="left";o&&(a=st(o,e.ch)%2?"right":"left");var s=Pr(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ba(t,e){return e&&(t.bad=!0),t}function Ua(t,e,r){var n;if(e==t.display.lineDiv){if(!(n=t.display.lineDiv.childNodes[r]))return Ba(t.clipPos(te(t.display.viewTo-1)),!0);e=null,r=0}else for(n=e;;n=n.parentNode){if(!n||n==t.display.lineDiv)return null;if(n.parentNode&&n.parentNode==t.display.lineDiv)break}for(var i=0;i<t.display.view.length;i++){var o=t.display.view[i];if(o.node==n)return Va(o,e,r)}}function Va(t,e,r){var n=t.text.firstChild,i=!1;if(!e||!N(n,e))return Ba(te(Yt(t.line),0),!0);if(e==n&&(i=!0,e=n.childNodes[r],r=0,!e)){var o=t.rest?$(t.rest):t.line;return Ba(te(Yt(o),o.text.length),i)}var a=3==e.nodeType?e:null,s=e;for(a||1!=e.childNodes.length||3!=e.firstChild.nodeType||(a=e.firstChild,r&&(r=a.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var l=t.measure,u=l.maps;function c(e,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?l.map:u[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==e||s==r){var c=Yt(i<0?t.line:t.rest[i]),f=o[a]+n;return(n<0||s!=e)&&(f=o[a+(n?1:0)]),te(c,f)}}}var f=c(a,s,r);if(f)return Ba(f,i);for(var h=s.nextSibling,d=a?a.nodeValue.length-r:0;h;h=h.nextSibling){if(f=c(h,h.firstChild,0))return Ba(te(f.line,f.ch-d),i);d+=h.textContent.length}for(var p=s.previousSibling,v=r;p;p=p.previousSibling){if(f=c(p,p.firstChild,-1))return Ba(te(f.line,f.ch+v),i);v+=p.textContent.length}}za.prototype.init=function(t){var e=this,r=this,n=r.cm,i=r.div=t.lineDiv;function o(t){for(var e=t.target;e;e=e.parentNode){if(e==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(o(t)&&!vt(n,t)){if(n.somethingSelected())Na({lineWise:!1,text:n.getSelections()}),"cut"==t.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var e=Pa(n);Na({lineWise:!0,text:e.text}),"cut"==t.type&&n.operation((function(){n.setSelections(e.ranges,0,B),n.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var a=Aa.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Ha(),l=s.firstChild;n.display.lineSpace.insertBefore(s,n.display.lineSpace.firstChild),l.value=Aa.text.join("\n");var u=document.activeElement;P(l),setTimeout((function(){n.display.lineSpace.removeChild(s),u.focus(),u==i&&r.showPrimarySelection()}),50)}}Ra(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),ft(i,"paste",(function(t){!o(t)||vt(n,t)||Ea(t,n)||s<=11&&setTimeout(ti(n,(function(){return e.updateFromDOM()})),20)})),ft(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),ft(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),ft(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),ft(i,"touchstart",(function(){return r.forceCompositionEnd()})),ft(i,"input",(function(){e.composing||e.readFromDOMSoon()})),ft(i,"copy",a),ft(i,"cut",a)},za.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},za.prototype.prepareSelection=function(){var t=mn(this.cm,!1);return t.focus=document.activeElement==this.div,t},za.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},za.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},za.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,n=e.doc.sel.primary(),i=n.from(),o=n.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var a=Ua(e,t.anchorNode,t.anchorOffset),s=Ua(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=ee(oe(a,s),i)||0!=ee(ie(a,s),o)){var l=e.display.view,u=i.line>=e.display.viewFrom&&ja(e,i)||{node:l[0].measure.map[2],offset:0},c=o.line<e.display.viewTo&&ja(e,o);if(!c){var f=l[l.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(u&&c){var d,p=t.rangeCount&&t.getRangeAt(0);try{d=k(u.node,u.offset,c.offset,c.node)}catch(t){}d&&(!r&&e.state.focused?(t.collapse(u.node,u.offset),d.collapsed||(t.removeAllRanges(),t.addRange(d))):(t.removeAllRanges(),t.addRange(d)),p&&null==t.anchorNode?t.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},za.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},za.prototype.showMultipleSelections=function(t){T(this.cm.display.cursorDiv,t.cursors),T(this.cm.display.selectionDiv,t.selection)},za.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},za.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return N(this.div,e)},za.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},za.prototype.blur=function(){this.div.blur()},za.prototype.getField=function(){return this.div},za.prototype.supportsTouch=function(){return!0},za.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Qn(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},za.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},za.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Ua(e,t.anchorNode,t.anchorOffset),n=Ua(e,t.focusNode,t.focusOffset);r&&n&&Qn(e,(function(){Qi(e.doc,ki(r,n),B),(r.bad||n.bad)&&(e.curOp.selectionChanged=!0)}))}}},za.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=te(a.line-1,Kt(n.doc,a.line-1).length)),s.ch==Kt(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=te(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(t=cn(n,a.line))?(e=Yt(i.view[0].line),r=i.view[0].node):(e=Yt(i.view[t].line),r=i.view[t-1].node.nextSibling);var l,u,c=cn(n,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=Yt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(t,e,r,n,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function c(t){t&&(u(),o+=t)}function f(e){if(1==e.nodeType){var r=e.getAttribute("cm-text");if(r)return void c(r);var o,h=e.getAttribute("cm-marker");if(h){var d=t.findMarks(te(n,0),te(i+1,0),(g=+h,function(t){return t.id==g}));return void(d.length&&(o=d[0].find(0))&&c(qt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;p&&u();for(var v=0;v<e.childNodes.length;v++)f(e.childNodes[v]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),p&&(a=!0)}else 3==e.nodeType&&c(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;f(e),e!=r;)e=e.nextSibling,l=!1;return o}(n,r,u,e,l)),h=qt(n.doc,te(e,0),te(l,Kt(n.doc,l).text.length));f.length>1&&h.length>1;)if($(f)==$(h))f.pop(),h.pop(),l--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),e++}for(var d=0,p=0,v=f[0],g=h[0],m=Math.min(v.length,g.length);d<m&&v.charCodeAt(d)==g.charCodeAt(d);)++d;for(var y=$(f),b=$(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==h.length&&e==a.line)for(;d&&d>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var x=te(e,d),C=te(l,h.length?$(h).length-p:0);return f.length>1||f[0]||ee(x,C)?(vo(n.doc,f,x,C,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},za.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Qn(this.cm,(function(){return fn(t.cm)}))},za.prototype.setUneditable=function(t){t.contentEditable="false"},za.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Da)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},za.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0;var Ga=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};Ga.prototype.init=function(t){var e=this,r=this,n=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!vt(n,t)){if(n.somethingSelected())Na({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var e=Pa(n);Na({lineWise:!0,text:e.text}),"cut"==t.type?n.setSelections(e.ranges,null,B):(r.prevInput="",i.value=e.text.join("\n"),P(i))}"cut"==t.type&&(n.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(i.style.width="0px"),ft(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),r.poll()})),ft(i,"paste",(function(t){vt(n,t)||Ea(t,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),ft(i,"cut",o),ft(i,"copy",o),ft(t.scroller,"paste",(function(e){if(!xr(t,e)&&!vt(n,e)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),ft(t.lineSpace,"selectstart",(function(e){xr(t,e)||bt(e)})),ft(i,"compositionstart",(function(){var t=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:t,range:n.markText(t,n.getCursor("to"),{className:"CodeMirror-composing"})}})),ft(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Ga.prototype.createField=function(t){this.wrapper=Ha(),this.textarea=this.wrapper.firstChild},Ga.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},Ga.prototype.prepareSelection=function(){var t=this.cm,e=t.display,r=t.doc,n=mn(t);if(t.options.moveInputWithCursor){var i=Kr(t,r.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Ga.prototype.showSelection=function(t){var e=this.cm.display;T(e.cursorDiv,t.cursors),T(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Ga.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var r=e.getSelection();this.textarea.value=r,e.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=r)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ga.prototype.getField=function(){return this.textarea},Ga.prototype.supportsTouch=function(){return!1},Ga.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||D()!=this.textarea))try{this.textarea.focus()}catch(t){}},Ga.prototype.blur=function(){this.textarea.blur()},Ga.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ga.prototype.receivedFocus=function(){this.slowPoll()},Ga.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},Ga.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function r(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,r))}))},Ga.prototype.poll=function(){var t=this,e=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||Dt(r)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=r.value;if(i==n&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(n.length,i.length);l<u&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return Qn(e,(function(){Da(e,i.slice(l),n.length-l,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ga.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ga.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ga.prototype.onContextMenu=function(t){var e=this,r=e.cm,n=r.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=un(r,t),u=n.scroller.scrollTop;if(o&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&ti(r,Qi)(r.doc,ki(o),B);var c,h=i.style.cssText,d=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),n.input.focus(),l&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=m,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&s>=9&&g(),_){Ct(t);var v=function(){dt(window,"mouseup",v),setTimeout(m,20)};ft(window,"mouseup",v)}else setTimeout(m,50)}function g(){if(null!=i.selectionStart){var t=r.somethingSelected(),o=""+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=d,i.style.cssText=h,a&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&g();var t=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==e.prevInput?ti(r,so)(r):t++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Ga.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},Ga.prototype.setUneditable=function(){},Ga.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function r(r,n,i,o){t.defaults[r]=n,i&&(e[r]=o?function(t,e,r){r!=Ca&&i(t,e,r)}:i)}t.defineOption=r,t.Init=Ca,r("value","",(function(t,e){return t.setValue(e)}),!0),r("mode",null,(function(t,e){t.doc.modeOption=e,Ai(t)}),!0),r("indentUnit",2,Ai,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(t){Ni(t),Ir(t),fn(t)}),!0),r("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var r=[],n=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,r.push(te(n,o))}n++}));for(var i=r.length-1;i>=0;i--)vo(t.doc,e,r[i],te(r[i].line,r[i].ch+e.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,r){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),r!=Ca&&t.refresh()})),r("specialCharPlaceholder",Je,(function(t){return t.refresh()}),!0),r("electricChars",!0),r("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),r("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),r("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",(function(t){xa(t),vi(t)}),!0),r("keyMap","default",(function(t,e,r){var n=Yo(e),i=r!=Ca&&Yo(r);i&&i.detach&&i.detach(t,n),n.attach&&n.attach(t,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ma,!0),r("gutters",[],(function(t,e){t.display.gutterSpecs=di(e,t.options.lineNumbers),vi(t)}),!0),r("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?an(t.display)+"px":"0",t.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(t){return jn(t)}),!0),r("scrollbarStyle","native",(function(t){Vn(t),jn(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=di(t.options.gutters,e),vi(t)}),!0),r("firstLineNumber",1,vi,!0),r("lineNumberFormatter",(function(t){return t}),vi,!0),r("showCursorWhenSelecting",!1,gn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(t,e){"nocursor"==e&&(kn(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),r("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),r("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),r("dragDrop",!0,ka),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,gn,!0),r("singleCursorHeightPerLine",!0,gn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Ni,!0),r("addModeClass",!1,Ni,!0),r("pollInterval",100),r("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),r("historyEventDelay",1250),r("viewportMargin",10,(function(t){return t.refresh()}),!0),r("maxHighlightLength",1e4,Ni,!0),r("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),r("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),r("autofocus",null),r("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),r("phrases",null)}(La),function(t){var e=t.optionHandlers,r=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,r){var n=this.options,i=n[t];n[t]==r&&"mode"!=t||(n[t]=r,e.hasOwnProperty(t)&&ti(this,e[t])(this,r,i),pt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Yo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,r=0;r<e.length;++r)if(e[r]==t||e[r].name==t)return e.splice(r,1),!0},addOverlay:ei((function(e,r){var n=e.token?e:t.getMode(this.options,e);if(n.startState)throw new Error("Overlays may not be stateful.");!function(t,e,r){for(var n=0,i=r(e);n<t.length&&r(t[n])<=i;)n++;t.splice(n,0,e)}(this.state.overlays,{mode:n,modeSpec:e,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(t){return t.priority})),this.state.modeGen++,fn(this)})),removeOverlay:ei((function(t){for(var e=this.state.overlays,r=0;r<e.length;++r){var n=e[r].modeSpec;if(n==t||"string"==typeof t&&n.name==t)return e.splice(r,1),this.state.modeGen++,void fn(this)}})),indentLine:ei((function(t,e,r){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),Jt(this.doc,t)&&Oa(this,t,e,r)})),indentSelection:ei((function(t){for(var e=this.doc.sel.ranges,r=-1,n=0;n<e.length;n++){var i=e[n];if(i.empty())i.head.line>r&&(Oa(this,i.head.line,t,!0),r=i.head.line,n==this.doc.sel.primIndex&&Nn(this));else{var o=i.from(),a=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<r;++l)Oa(this,l,t);var u=this.doc.sel.ranges;0==o.ch&&e.length==u.length&&u[n].from().ch>0&&Yi(this.doc,n,new _i(o,u[n].to()),B)}}})),getTokenAt:function(t,e){return ye(this,t,e)},getLineTokens:function(t,e){return ye(this,te(t),e,!0)},getTokenTypeAt:function(t){t=se(this.doc,t);var e,r=he(this,Kt(this.doc,t.line)),n=0,i=(r.length-1)/2,o=t.ch;if(0==o)e=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){e=r[2*a+2];break}n=a+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var r=this.doc.mode;return r.innerMode?t.innerMode(r,this.getTokenAt(e).state).mode:r},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var n=[];if(!r.hasOwnProperty(e))return n;var i=r[e],o=this.getModeAt(t);if("string"==typeof o[e])i[o[e]]&&n.push(i[o[e]]);else if(o[e])for(var a=0;a<o[e].length;a++){var s=i[o[e][a]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var l=0;l<i._global.length;l++){var u=i._global[l];u.pred(o,this)&&-1==z(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(t,e){var r=this.doc;return de(this,(t=ae(r,null==t?r.first+r.size-1:t))+1,e).state},cursorCoords:function(t,e){var r=this.doc.sel.primary();return Kr(this,null==t?r.head:"object"==typeof t?se(this.doc,t):t?r.from():r.to(),e||"page")},charCoords:function(t,e){return Gr(this,se(this.doc,t),e||"page")},coordsChar:function(t,e){return Xr(this,(t=Vr(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=Vr(this,{top:t,left:0},e||"page").top,Zt(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,r){var n,i=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,i=!0),n=Kt(this.doc,t)}else n=t;return Ur(this,n,{top:0,left:0},e||"page",r||i).top+(i?this.doc.height-Ue(n):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,r,n,i){var o,a,s,l=this.display,u=(t=Kr(this,se(this.doc,t))).bottom,c=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==n)u=t.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),h=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||t.bottom+e.offsetHeight>f)&&t.top>e.offsetHeight?u=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=f&&(u=t.bottom),c+e.offsetWidth>h&&(c=h-e.offsetWidth)}e.style.top=u+"px",e.style.left=e.style.right="","right"==i?(c=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=c+"px"),r&&(o=this,a={left:c,top:u,right:c+e.offsetWidth,bottom:u+e.offsetHeight},null!=(s=On(o,a)).scrollTop&&Pn(o,s.scrollTop),null!=s.scrollLeft&&Hn(o,s.scrollLeft))},triggerOnKeyDown:ei(ca),triggerOnKeyPress:ei(ha),triggerOnKeyUp:fa,triggerOnMouseDown:ei(ga),execCommand:function(t){if(ea.hasOwnProperty(t))return ea[t].call(null,this)},triggerElectric:ei((function(t){Wa(this,t)})),findPosH:function(t,e,r,n){var i=1;e<0&&(i=-1,e=-e);for(var o=se(this.doc,t),a=0;a<e&&!(o=Fa(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:ei((function(t,e){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Fa(r.doc,n.head,t,e,r.options.rtlMoveVisually):t<0?n.from():n.to()}),V)})),deleteH:ei((function(t,e){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Zo(this,(function(r){var i=Fa(n,r.head,t,e,!1);return t<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(t,e,r,n){var i=1,o=n;e<0&&(i=-1,e=-e);for(var a=se(this.doc,t),s=0;s<e;++s){var l=Kr(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Ia(this,l,i,r)).hitSide)break}return a},moveV:ei((function(t,e){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return t<0?a.from():a.to();var s=Kr(r,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Ia(r,s,t,e);return"page"==e&&a==n.sel.primary()&&An(r,Gr(r,l,"div").top-s.top),l}),V),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(t){var e=Kt(this.doc,t.line).text,r=t.ch,n=t.ch;if(e){var i=this.getHelper(t,"wordChars");"before"!=t.sticky&&n!=e.length||!r?++n:--r;for(var o=e.charAt(r),a=tt(o,i)?function(t){return tt(t,i)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!tt(t)};r>0&&a(e.charAt(r-1));)--r;for(;n<e.length&&a(e.charAt(n));)++n}return new _i(te(t.line,r),te(t.line,n))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?E(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),pt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ei((function(t,e){Dn(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-kr(this)-this.display.barHeight,width:t.scrollWidth-kr(this)-this.display.barWidth,clientHeight:Lr(this),clientWidth:Mr(this)}},scrollIntoView:ei((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:te(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?function(t,e){En(t),t.curOp.scrollToPos=e}(this,t):Wn(this,t.from,t.to,t.margin)})),setSize:ei((function(t,e){var r=this,n=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=n(t)),null!=e&&(this.display.wrapper.style.height=n(e)),this.options.lineWrapping&&Fr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){hn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,pt(this,"refresh",this)})),operation:function(t){return Qn(this,t)},startOperation:function(){return Kn(this)},endOperation:function(){return qn(this)},refresh:ei((function(){var t=this.display.cachedTextHeight;fn(this),this.curOp.forceUpdate=!0,Ir(this),Dn(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==t||Math.abs(t-rn(this.display))>.5||this.options.lineWrapping)&&ln(this),pt(this,"refresh",this)})),swapDoc:ei((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Pi(this,t),Ir(this),this.display.input.reset(),Dn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[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}},yt(t),t.registerHelper=function(e,n,i){r.hasOwnProperty(e)||(r[e]=t[e]={_global:[]}),r[e][n]=i},t.registerGlobalHelper=function(e,n,i,o){t.registerHelper(e,n,o),r[e]._global.push({pred:i,val:o})}}(La);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var qa in No.prototype)No.prototype.hasOwnProperty(qa)&&z(Ka,qa)<0&&(La.prototype[qa]=function(t){return function(){return t.apply(this.doc,arguments)}}(No.prototype[qa]));return yt(No),La.inputStyles={textarea:Ga,contenteditable:za},La.defineMode=function(t){La.defaults.mode||"null"==t||(La.defaults.mode=t),Ht.apply(this,arguments)},La.defineMIME=function(t,e){Rt[t]=e},La.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),La.defineMIME("text/plain","null"),La.defineExtension=function(t,e){La.prototype[t]=e},La.defineDocExtension=function(t,e){No.prototype[t]=e},La.fromTextArea=function(t,e){if((e=e?H(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=D();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}function n(){t.value=s.getValue()}var i;if(t.form&&(ft(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(r){r.save=n,r.getTextArea=function(){return t},r.toTextArea=function(){r.toTextArea=isNaN,n(),t.parentNode.removeChild(r.getWrapperElement()),t.style.display="",t.form&&(dt(t.form,"submit",n),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=La((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s},function(t){t.off=dt,t.on=ft,t.wheelEventPixels=wi,t.Doc=No,t.splitLines=Nt,t.countColumn=F,t.findColumn=G,t.isWordChar=Q,t.Pass=j,t.signal=pt,t.Line=Ke,t.changeEnd=Mi,t.scrollbarModel=Un,t.Pos=te,t.cmpPos=ee,t.modes=Pt,t.mimeModes=Rt,t.resolveMode=Ft,t.getMode=It,t.modeExtensions=zt,t.extendMode=jt,t.copyState=Bt,t.startState=Vt,t.innerMode=Ut,t.commands=ea,t.keyMap=Uo,t.keyName=Xo,t.isModifierKey=qo,t.lookupKey=Ko,t.normalizeKeyMap=Go,t.StringStream=Gt,t.SharedTextMarker=Lo,t.TextMarker=ko,t.LineWidget=Co,t.e_preventDefault=bt,t.e_stopPropagation=wt,t.e_stop=Ct,t.addClass=E,t.contains=N,t.rmClass=M,t.keyNames=Io}(La),La.version="5.58.3",La}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(){}return t.prototype.isSeparator=function(t){return" "==t||"\r"==t||"\n"==t||"\t"==t||"("==t||")"==t},t.prototype.isWhiteSpace=function(t){return" "==t||"\r"==t||"\n"==t||"\t"==t},t.prototype.findLastSeparatorIndex=function(t){var e=this;return n.findLastIndex(t,(function(t){return e.isSeparator(t)}))},t.prototype.needSpaceAfter=function(t){return!("("==t)},t.prototype.isLastCharacterWhiteSpace=function(t){return!!t&&this.isWhiteSpace(t[t.length-1])},t.prototype.stripEndWithNonSeparatorCharacters=function(t){if(!t)return t;if(this.isSeparator(t[t.length-1]))return t;var e=this.findLastSeparatorIndex(t);return e<0?"":t.substr(0,e+1)},t.prototype.getEndNotSeparatorCharacers=function(t){if(!t)return t;if(this.isSeparator(t[t.length-1]))return"";var e=this.findLastSeparatorIndex(t);return e<0?t:t.substr(e+1)},t}();e.default=new i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(){}return t.prototype.quote=function(t){return/\s/g.test(t)?'"'+t+'"':t},t.prototype.buildDefaultObjOrGetOriginal=function(t,e){return n.isString(t)?{value:this.quote(t),type:e}:{value:t,type:e}},t.prototype.handleParseError=function(t,e,r){var i=this,o=e;return n.flatMap(r.expected,(function(t){var e=[];if("literal"==t.type&&(e=n.map([t.text||t.value],(function(t){return{value:t,type:"literal"}}))),"other"==t.type){var r=o.getLastTokenType()||"value";"value"==r&&(e=n.map(i.needCategories(),(function(t){return i.buildDefaultObjOrGetOriginal(t,"category")}))),"category"==r&&(e=n.map(i.needOperators(o.getLastCategory()),(function(t){return i.buildDefaultObjOrGetOriginal(t,"operator")}))),"operator"==r&&(e=n.map(i.needValues(o.getLastCategory(),o.getLastOperator()),(function(t){return i.buildDefaultObjOrGetOriginal(t,"value")})))}return e}))},t.prototype.hasCategory=function(t){return!1},t.prototype.hasOperator=function(t,e){return!1},t.prototype.needCategories=function(){return[]},t.prototype.needOperators=function(t){return[]},t.prototype.needValues=function(t,e){return[]},t}();e.default=i},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=function(t,e){var r=t[1]||"",n=t[3];if(!n)return r;if(e&&"function"==typeof btoa){var i=(a=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=n.sources.map((function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"}));return[r].concat(o).concat([i]).join("\n")}var a;return[r].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r})).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(n[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="("+a[2]+") and ("+r+")"),e.push(a))}},e}},function(t,e,r){var n,i,o={},a=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=n.apply(this,arguments)),i}),s=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,r){if("function"==typeof t)return t();if(void 0===e[t]){var n=s.call(this,t,r);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),u=null,c=0,f=[],h=r(17);function d(t,e){for(var r=0;r<t.length;r++){var n=t[r],i=o[n.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](n.parts[a]);for(;a<n.parts.length;a++)i.parts.push(b(n.parts[a],e))}else{var s=[];for(a=0;a<n.parts.length;a++)s.push(b(n.parts[a],e));o[n.id]={id:n.id,refs:1,parts:s}}}}function p(t,e){for(var r=[],n={},i=0;i<t.length;i++){var o=t[i],a=e.base?o[0]+e.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};n[a]?n[a].parts.push(s):r.push(n[a]={id:a,parts:[s]})}return r}function v(t,e){var r=l(t.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=f[f.length-1];if("top"===t.insertAt)n?n.nextSibling?r.insertBefore(e,n.nextSibling):r.appendChild(e):r.insertBefore(e,r.firstChild),f.push(e);else if("bottom"===t.insertAt)r.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=l(t.insertAt.before,r);r.insertBefore(e,i)}}function g(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=f.indexOf(t);e>=0&&f.splice(e,1)}function m(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var n=function(){0;return r.nc}();n&&(t.attrs.nonce=n)}return y(e,t.attrs),v(t,e),e}function y(t,e){Object.keys(e).forEach((function(r){t.setAttribute(r,e[r])}))}function b(t,e){var r,n,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=c++;r=u||(u=m(e)),n=C.bind(null,r,a,!1),i=C.bind(null,r,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),v(t,e),e}(e),n=S.bind(null,r,e),i=function(){g(r),r.href&&URL.revokeObjectURL(r.href)}):(r=m(e),n=_.bind(null,r),i=function(){g(r)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var r=p(t,e);return d(r,e),function(t){for(var n=[],i=0;i<r.length;i++){var a=r[i];(s=o[a.id]).refs--,n.push(s)}t&&d(p(t,e),e);for(i=0;i<n.length;i++){var s;if(0===(s=n[i]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete o[s.id]}}}};var w,x=(w=[],function(t,e){return w[t]=e,w.filter(Boolean).join("\n")});function C(t,e,r,n){var i=r?"":n.css;if(t.styleSheet)t.styleSheet.cssText=x(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function _(t,e){var r=e.css,n=e.media;if(n&&t.setAttribute("media",n),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function S(t,e,r){var n=r.css,i=r.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(n=h(n)),i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([n],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(){}return t.prototype.process=function(t,e){var r=this;return n.filter(t,(function(t){return r.predicate(t,e)}))},t.prototype.predicateSingle=function(t,e){return this.filter(t,e.category,e.operator,e.value)},t.prototype.predicate=function(t,e){var r=this,i=null;if(n.isArray(e))i=e;else{if(!n.isArray(e.expressions))return this.predicateSingle(t,e);i=e.expressions}var o=!0;return i.forEach((function(e){n.isUndefined(e.conditionType)?o=r.predicate(t,e):"and"==e.conditionType.toLowerCase()?o=o&&r.predicate(t,e):"or"==e.conditionType.toLowerCase()&&(o=o||r.predicate(t,e))})),o},t.prototype.filter=function(t,e,r,n){return!0},t}();e.default=i},function(t,e,r){t.exports=r(10)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.BaseAutoCompleteHandler=e.GridDataAutoCompleteHandler=e.BaseResultProcessing=e.SimpleResultProcessing=void 0;var o=r(1),a=r(11),s=r(25);e.SimpleResultProcessing=s.default;var l=r(26);e.GridDataAutoCompleteHandler=l.default;var u=r(27),c=r(8);e.BaseResultProcessing=c.default;var f=r(4);e.BaseAutoCompleteHandler=f.default;var h=r(30),d=function(t){function e(e){var r=t.call(this,e)||this;r.parser=new u.default;var n=r.props.autoCompleteHandler||new l.default(r.props.data,r.props.options);return r.parser.setAutoCompleteHandler(n),r.state={isFocus:!1,isError:!1},r}return i(e,t),e.prototype.needAutoCompleteValues=function(t,e){return this.parser.getSuggestions(e)},e.prototype.onSubmit=function(t){var e=this.parser.parse(t);if(e.isError)return this.props.onParseError(e,{isValid:!0});if(this.props.strictMode){var r=h.default(e,this.parser.autoCompleteHandler);if(!r.isValid)return this.props.onParseError(e,r)}return this.props.onParseOk(e)},e.prototype.onChange=function(t){var e={isValid:!0},r=this.parser.parse(t);r.isError?this.setState({isError:!0}):this.props.strictMode?(e=h.default(r,this.parser.autoCompleteHandler),this.setState({isError:!e.isValid})):this.setState({isError:!1}),this.props.onChange(t,r,e)},e.prototype.onBlur=function(){this.setState({isFocus:!1})},e.prototype.onFocus=function(){this.setState({isFocus:!0})},e.prototype.render=function(){var t="react-filter-box";return this.state.isFocus&&(t+=" focus"),this.state.isError&&(t+=" error"),o.createElement("div",{className:t},o.createElement(a.default,{autoCompletePick:this.props.autoCompletePick,customRenderCompletionItem:this.props.customRenderCompletionItem,onBlur:this.onBlur.bind(this),onFocus:this.onFocus.bind(this),value:this.props.query,needAutoCompleteValues:this.needAutoCompleteValues.bind(this),onSubmit:this.onSubmit.bind(this),onChange:this.onChange.bind(this),editorConfig:this.props.editorConfig}))},e.defaultProps={onParseOk:function(){},onParseError:function(){},onChange:function(){},onDataFiltered:function(){},autoCompleteHandler:null,onBlur:function(){},onFocus:function(){},editorConfig:{},strictMode:!1},e}(o.Component);e.default=d},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1);r(12),r(13),r(14),r(15),r(18);var s=r(20),l=r(3),u=r(22),c=function(t){function e(e){var r=t.call(this,e)||this;return e.editorConfig&&(r.options=o(o({},e.editorConfig),{mode:"filter-mode"})),r}return i(e,t),e.prototype.findLastSeparatorPositionWithEditor=function(){var t=this.codeMirror.getDoc(),e=t.getCursor(),r=t.getRange({line:0,ch:0},e),n=l.default.findLastSeparatorIndex(r);return{line:e.line,ch:e.ch-(r.length-n)+1}},e.prototype.handlePressingAnyCharacter=function(){this.autoCompletePopup.completionShow||this.autoCompletePopup.show()},e.prototype.onSubmit=function(t){this.props.onSubmit&&this.props.onSubmit(t)},e.prototype.codeMirrorRef=function(t){var e=this;null!=t&&this.codeMirror!=t.editor&&(this.codeMirror=t.editor,this.doc=t.editor.getDoc(),this.autoCompletePopup=new u.default(this.codeMirror,(function(t){return e.props.needAutoCompleteValues(e.codeMirror,t)})),this.autoCompletePopup.customRenderCompletionItem=this.props.customRenderCompletionItem,this.autoCompletePopup.pick=this.props.autoCompletePick,t.editor.on("beforeChange",(function(t,e){var r=e.text.join("").replace(/\n/g,"");return e.update(e.from,e.to,[r]),!0})),t.editor.on("changes",(function(){e.handlePressingAnyCharacter()})),t.editor.on("focus",(function(t,r){e.handlePressingAnyCharacter(),e.props.onFocus(r)})),t.editor.on("blur",(function(t,r){e.onSubmit(e.doc.getValue()),e.props.onBlur(r)})),t.editor.on("keyup",(function(t,r){13==r.keyCode&&e.onSubmit(e.doc.getValue())})))},e.prototype.handleEditorChange=function(t,e,r){this.props.onChange(r)},e.prototype.render=function(){return a.createElement(s.UnControlled,{ref:this.codeMirrorRef.bind(this),onChange:this.handleEditorChange.bind(this),options:this.options,value:this.props.value})},e.defaultProps={onBlur:function(){},onFocus:function(){},editorConfig:{}},e}(a.Component);e.default=c},function(t,e,r){!function(t){"use strict";function e(t,e){this.cm=t,this.options=e,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var r=this;t.on("cursorActivity",this.activityFunc=function(){r.cursorActivity()})}t.showHint=function(t,e,r){if(!e)return t.showHint(r);r&&r.async&&(e.async=!0);var n={hint:e};if(r)for(var i in r)n[i]=r[i];return t.showHint(n)},t.defineExtension("showHint",(function(r){r=function(t,e,r){var n=t.options.hintOptions,i={};for(var o in l)i[o]=l[o];if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);return i.hint.resolve&&(i.hint=i.hint.resolve(t,e)),i}(this,this.getCursor("start"),r);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!r.hint.supportsSelection)return;for(var i=0;i<n.length;i++)if(n[i].head.line!=n[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new e(this,r);o.options.hint&&(t.signal(this,"startCompletion",this),o.update(!0))}})),t.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var r=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function i(t){return"string"==typeof t?t:t.text}function o(t,e){for(;e&&e!=t;){if("LI"===e.nodeName.toUpperCase()&&e.parentNode==t)return e;e=e.parentNode}}function a(e,r){this.completion=e,this.data=r,this.picked=!1;var n=this,a=e.cm,s=a.getInputField().ownerDocument,l=s.defaultView||s.parentWindow,u=this.hints=s.createElement("ul"),c=e.cm.options.theme;u.className="CodeMirror-hints "+c,this.selectedHint=r.selectedHint||0;for(var f=r.list,h=0;h<f.length;++h){var d=u.appendChild(s.createElement("li")),p=f[h],v="CodeMirror-hint"+(h!=this.selectedHint?"":" CodeMirror-hint-active");null!=p.className&&(v=p.className+" "+v),d.className=v,p.render?p.render(d,r,p):d.appendChild(s.createTextNode(p.displayText||i(p))),d.hintId=h}var g=e.options.container||s.body,m=a.cursorCoords(e.options.alignWithWord?r.from:null),y=m.left,b=m.bottom,w=!0,x=0,C=0;if(g!==s.body){var _=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(g).position)?g:g.offsetParent,S=_.getBoundingClientRect(),k=s.body.getBoundingClientRect();x=S.left-k.left-_.scrollLeft,C=S.top-k.top-_.scrollTop}u.style.left=y-x+"px",u.style.top=b-C+"px";var M=l.innerWidth||Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),L=l.innerHeight||Math.max(s.body.offsetHeight,s.documentElement.offsetHeight);g.appendChild(u);var T=u.getBoundingClientRect(),O=T.bottom-L,A=u.scrollHeight>u.clientHeight+1,N=a.getScrollInfo();if(O>0){var D=T.bottom-T.top;if(m.top-(m.bottom-T.top)-D>0)u.style.top=(b=m.top-D-C)+"px",w=!1;else if(D>L){u.style.height=L-5+"px",u.style.top=(b=m.bottom-T.top-C)+"px";var E=a.getCursor();r.from.ch!=E.ch&&(m=a.cursorCoords(E),u.style.left=(y=m.left-x)+"px",T=u.getBoundingClientRect())}}var W,P=T.right-M;if(P>0&&(T.right-T.left>M&&(u.style.width=M-5+"px",P-=T.right-T.left-M),u.style.left=(y=m.left-P-x)+"px"),A)for(var R=u.firstChild;R;R=R.nextSibling)R.style.paddingRight=a.display.nativeBarWidth+"px";return a.addKeyMap(this.keyMap=function(t,e){var r={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(1-e.menuSize(),!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close};/Mac/.test(navigator.platform)&&(r["Ctrl-P"]=function(){e.moveFocus(-1)},r["Ctrl-N"]=function(){e.moveFocus(1)});var n=t.options.customKeys,i=n?{}:r;function o(t,n){var o;o="string"!=typeof n?function(t){return n(t,e)}:r.hasOwnProperty(n)?r[n]:n,i[t]=o}if(n)for(var a in n)n.hasOwnProperty(a)&&o(a,n[a]);var s=t.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&o(a,s[a]);return i}(e,{moveFocus:function(t,e){n.changeActive(n.selectedHint+t,e)},setFocus:function(t){n.changeActive(t)},menuSize:function(){return n.screenAmount()},length:f.length,close:function(){e.close()},pick:function(){n.pick()},data:r})),e.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){W=setTimeout((function(){e.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(W)})),a.on("scroll",this.onScroll=function(){var t=a.getScrollInfo(),r=a.getWrapperElement().getBoundingClientRect(),n=b+N.top-t.top,i=n-(l.pageYOffset||(s.documentElement||s.body).scrollTop);if(w||(i+=u.offsetHeight),i<=r.top||i>=r.bottom)return e.close();u.style.top=n+"px",u.style.left=y+N.left-t.left+"px"}),t.on(u,"dblclick",(function(t){var e=o(u,t.target||t.srcElement);e&&null!=e.hintId&&(n.changeActive(e.hintId),n.pick())})),t.on(u,"click",(function(t){var r=o(u,t.target||t.srcElement);r&&null!=r.hintId&&(n.changeActive(r.hintId),e.options.completeOnSingleClick&&n.pick())})),t.on(u,"mousedown",(function(){setTimeout((function(){a.focus()}),20)})),this.scrollToActive(),t.signal(r,"select",f[this.selectedHint],u.childNodes[this.selectedHint]),!0}function s(t,e,r,n){if(t.async)t(e,n,r);else{var i=t(e,r);i&&i.then?i.then(n):n(i)}}e.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(e,r){var n=e.list[r],o=this;this.cm.operation((function(){n.hint?n.hint(o.cm,e,n):o.cm.replaceRange(i(n),n.from||e.from,n.to||e.to,"complete"),t.signal(e,"pick",n),o.cm.scrollIntoView()})),this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var e=this.cm.getCursor(),i=this.cm.getLine(e.line);if(e.line!=this.startPos.line||i.length-e.ch!=this.startLen-this.startPos.ch||e.ch<t.ch||this.cm.somethingSelected()||!e.ch||this.options.closeCharacters.test(i.charAt(e.ch-1)))this.close();else{var o=this;this.debounce=r((function(){o.update()})),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick){var e=this,r=++this.tick;s(this.options.hint,this.cm,this.options,(function(n){e.tick==r&&e.finishUpdate(n,t)}))}},finishUpdate:function(e,r){this.data&&t.signal(this.data,"update");var n=this.widget&&this.widget.picked||r&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=e,e&&e.list.length&&(n&&1==e.list.length?this.pick(e,0):(this.widget=new a(this,e),t.signal(e,"shown")))}},a.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(e,r){if(e>=this.data.list.length?e=r?this.data.list.length-1:0:e<0&&(e=r?0:this.data.list.length-1),this.selectedHint!=e){var n=this.hints.childNodes[this.selectedHint];n&&(n.className=n.className.replace(" CodeMirror-hint-active","")),(n=this.hints.childNodes[this.selectedHint=e]).className+=" CodeMirror-hint-active",this.scrollToActive(),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},scrollToActive:function(){var t=this.completion.options.scrollMargin||0,e=this.hints.childNodes[Math.max(0,this.selectedHint-t)],r=this.hints.childNodes[Math.min(this.data.list.length-1,this.selectedHint+t)],n=this.hints.firstChild;e.offsetTop<this.hints.scrollTop?this.hints.scrollTop=e.offsetTop-n.offsetTop:r.offsetTop+r.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=r.offsetTop+r.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:function(e,r){var n,i=e.getHelpers(r,"hint");if(i.length){var o=function(t,e,r){var n=function(t,e){if(!t.somethingSelected())return e;for(var r=[],n=0;n<e.length;n++)e[n].supportsSelection&&r.push(e[n]);return r}(t,i);!function i(o){if(o==n.length)return e(null);s(n[o],t,r,(function(t){t&&t.list.length>0?e(t):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(n=e.getHelper(e.getCursor(),"hintWords"))?function(e){return t.hint.fromList(e,{words:n})}:t.hint.anyword?function(e,r){return t.hint.anyword(e,r)}:function(){}}}),t.registerHelper("hint","fromList",(function(e,r){var n,i=e.getCursor(),o=e.getTokenAt(i),a=t.Pos(i.line,o.start),s=i;o.start<i.ch&&/\w/.test(o.string.charAt(i.ch-o.start-1))?n=o.string.substr(0,i.ch-o.start):(n="",a=i);for(var l=[],u=0;u<r.words.length;u++){var c=r.words[u];c.slice(0,n.length)==n&&l.push(c)}if(l.length)return{list:l,from:a,to:s}})),t.commands.autocomplete=t.showHint;var l={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)}(r(2))},function(t,e,r){!function(t){function e(t){t.state.placeholder&&(t.state.placeholder.parentNode.removeChild(t.state.placeholder),t.state.placeholder=null)}function r(t){e(t);var r=t.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=t.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var n=t.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),r.appendChild(n),t.display.lineSpace.insertBefore(r,t.display.lineSpace.firstChild)}function n(t){o(t)&&r(t)}function i(t){var n=t.getWrapperElement(),i=o(t);n.className=n.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?r(t):e(t)}function o(t){return 1===t.lineCount()&&""===t.getLine(0)}t.defineOption("placeholder","",(function(o,a,s){var l=s&&s!=t.Init;if(a&&!l)o.on("blur",n),o.on("change",i),o.on("swapDoc",i),t.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(t){setTimeout((function(){var n=!1;if(1==t.lineCount()){var i=t.getInputField();n="TEXTAREA"==i.nodeName?!t.getLine(0).length:!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)}n?r(t):e(t)}),20)}(o)}),i(o);else if(!a&&l){o.off("blur",n),o.off("change",i),o.off("swapDoc",i),t.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),e(o);var u=o.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}a&&!o.hasFocus()&&n(o)}))}(r(2))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),r(2).defineMode("filter-mode",(function(t,e){function r(t){var e,r=(e=t.fieldState)==n.category?n.operator:e==n.operator?n.value:e==n.value?n.category:void 0,i=t.fieldState;return t.fieldState=r,i.toString()}return{startState:function(){return{inString:!1,fieldState:n.category}},token:function(t,e){return" "==(n=t.peek())||"\r"==n||"\n"==n||"\t"==n?(t.eatSpace(),null):"("==t.peek()||")"==t.peek()?(t.next(),"bracket"):t.match("AND",!0,!0)||t.match("OR",!0,!0)?"condition":(e.inString||'"'!=t.peek()||(t.next(),e.inString=!0),e.inString?(t.skipTo('"')?(t.next(),e.inString=!1):t.skipToEnd(),r(e)):(t.eatWhile(/[^\r\n\t\s\(\)]+/),r(e)));var n}}}));var n=function(){function t(){}return t.none="none",t.category="category",t.operator="operator",t.value="value",t}()},function(t,e,r){var n=r(16);"string"==typeof n&&(n=[[t.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(6)(n,i);n.locals&&(t.exports=n.locals)},function(t,e,r){(t.exports=r(5)(!1)).push([t.i,".CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var r=e.protocol+"//"+e.host,n=r+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,o=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?r+o:n+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(t,e,r){var n=r(19);"string"==typeof n&&(n=[[t.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(6)(n,i);n.locals&&(t.exports=n.locals)},function(t,e,r){(t.exports=r(5)(!1)).push([t.i,".CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,0.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,0.2);box-shadow:2px 3px 5px rgba(0,0,0,0.2);border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:black;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:white}",""])},function(t,e,r){"use strict";(function(t){function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o,a=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var s,l=r(1),u="undefined"==typeof navigator||!0===t.PREVENT_CODEMIRROR_RENDER;u||(s=r(2));var c=function(){function t(){}return t.equals=function(t,e){var r=this,n=Object.keys,o=i(t),a=i(e);return t&&e&&"object"===o&&o===a?n(t).length===n(e).length&&n(t).every((function(n){return r.equals(t[n],e[n])})):t===e},t}(),f=function(){function t(t,e){this.editor=t,this.props=e}return t.prototype.delegateCursor=function(t,e,r){var n=this.editor.getDoc();r&&this.editor.focus(),e?n.setCursor(t):n.setCursor(t,null,{scroll:!1})},t.prototype.delegateScroll=function(t){this.editor.scrollTo(t.x,t.y)},t.prototype.delegateSelection=function(t,e){this.editor.getDoc().setSelections(t),e&&this.editor.focus()},t.prototype.apply=function(t){t&&t.selection&&t.selection.ranges&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),t&&t.cursor&&this.delegateCursor(t.cursor,t.autoScroll||!1,this.editor.getOption("autofocus")||!1),t&&t.scroll&&this.delegateScroll(t.scroll)},t.prototype.applyNext=function(t,e,r){t&&t.selection&&t.selection.ranges&&e&&e.selection&&e.selection.ranges&&!c.equals(t.selection.ranges,e.selection.ranges)&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),t&&t.cursor&&e&&e.cursor&&!c.equals(t.cursor,e.cursor)&&this.delegateCursor(r.cursor||e.cursor,e.autoScroll||!1,e.autoCursor||!1),t&&t.scroll&&e&&e.scroll&&!c.equals(t.scroll,e.scroll)&&this.delegateScroll(e.scroll)},t.prototype.applyUserDefined=function(t,e){e&&e.cursor&&this.delegateCursor(e.cursor,t.autoScroll||!1,this.editor.getOption("autofocus")||!1)},t.prototype.wire=function(t){var e=this;Object.keys(t||{}).filter((function(t){return/^on/.test(t)})).forEach((function(t){switch(t){case"onBlur":e.editor.on("blur",(function(t,r){e.props.onBlur(e.editor,r)}));break;case"onContextMenu":e.editor.on("contextmenu",(function(t,r){e.props.onContextMenu(e.editor,r)}));break;case"onCopy":e.editor.on("copy",(function(t,r){e.props.onCopy(e.editor,r)}));break;case"onCursor":e.editor.on("cursorActivity",(function(t){e.props.onCursor(e.editor,e.editor.getDoc().getCursor())}));break;case"onCursorActivity":e.editor.on("cursorActivity",(function(t){e.props.onCursorActivity(e.editor)}));break;case"onCut":e.editor.on("cut",(function(t,r){e.props.onCut(e.editor,r)}));break;case"onDblClick":e.editor.on("dblclick",(function(t,r){e.props.onDblClick(e.editor,r)}));break;case"onDragEnter":e.editor.on("dragenter",(function(t,r){e.props.onDragEnter(e.editor,r)}));break;case"onDragLeave":e.editor.on("dragleave",(function(t,r){e.props.onDragLeave(e.editor,r)}));break;case"onDragOver":e.editor.on("dragover",(function(t,r){e.props.onDragOver(e.editor,r)}));break;case"onDragStart":e.editor.on("dragstart",(function(t,r){e.props.onDragStart(e.editor,r)}));break;case"onDrop":e.editor.on("drop",(function(t,r){e.props.onDrop(e.editor,r)}));break;case"onFocus":e.editor.on("focus",(function(t,r){e.props.onFocus(e.editor,r)}));break;case"onGutterClick":e.editor.on("gutterClick",(function(t,r,n,i){e.props.onGutterClick(e.editor,r,n,i)}));break;case"onKeyDown":e.editor.on("keydown",(function(t,r){e.props.onKeyDown(e.editor,r)}));break;case"onKeyPress":e.editor.on("keypress",(function(t,r){e.props.onKeyPress(e.editor,r)}));break;case"onKeyUp":e.editor.on("keyup",(function(t,r){e.props.onKeyUp(e.editor,r)}));break;case"onMouseDown":e.editor.on("mousedown",(function(t,r){e.props.onMouseDown(e.editor,r)}));break;case"onPaste":e.editor.on("paste",(function(t,r){e.props.onPaste(e.editor,r)}));break;case"onRenderLine":e.editor.on("renderLine",(function(t,r,n){e.props.onRenderLine(e.editor,r,n)}));break;case"onScroll":e.editor.on("scroll",(function(t){e.props.onScroll(e.editor,e.editor.getScrollInfo())}));break;case"onSelection":e.editor.on("beforeSelectionChange",(function(t,r){e.props.onSelection(e.editor,r)}));break;case"onTouchStart":e.editor.on("touchstart",(function(t,r){e.props.onTouchStart(e.editor,r)}));break;case"onUpdate":e.editor.on("update",(function(t){e.props.onUpdate(e.editor)}));break;case"onViewportChange":e.editor.on("viewportChange",(function(t,r,n){e.props.onViewportChange(e.editor,r,n)}))}}))},t}(),h=function(t){function e(e){var r=t.call(this,e)||this;return u||(r.applied=!1,r.appliedNext=!1,r.appliedUserDefined=!1,r.deferred=null,r.emulating=!1,r.hydrated=!1,r.initCb=function(){r.props.editorDidConfigure&&r.props.editorDidConfigure(r.editor)},r.mounted=!1),r}return a(e,t),e.prototype.hydrate=function(t){var e=this,r=t&&t.options?t.options:{},i=n({},s.defaults,this.editor.options,r);Object.keys(i).some((function(t){return e.editor.getOption(t)!==i[t]}))&&Object.keys(i).forEach((function(t){r.hasOwnProperty(t)&&e.editor.getOption(t)!==i[t]&&(e.editor.setOption(t,i[t]),e.mirror.setOption(t,i[t]))})),this.hydrated||(this.deferred?this.resolveChange():this.initChange(t.value||"")),this.hydrated=!0},e.prototype.initChange=function(t){this.emulating=!0;var e=this.editor.getDoc(),r=e.lastLine(),n=e.getLine(e.lastLine()).length;e.replaceRange(t||"",{line:0,ch:0},{line:r,ch:n}),this.mirror.setValue(t),e.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},e.prototype.resolveChange=function(){this.emulating=!0;var t=this.editor.getDoc();"undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),this.emulating=!1,this.deferred=null},e.prototype.mirrorChange=function(t){var e=this.editor.getDoc();return"undo"===t.origin?(e.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===t.origin?(e.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(t.text,t.from,t.to,t.origin),this.mirror.getValue()},e.prototype.componentDidMount=function(){var t=this;u||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref),this.shared=new f(this.editor,this.props),this.mirror=s((function(){})),this.editor.on("electricInput",(function(){t.mirror.setHistory(t.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(function(){t.mirror.setCursor(t.editor.getDoc().getCursor())})),this.editor.on("beforeChange",(function(e,r){if(!t.emulating){r.cancel(),t.deferred=r;var n=t.mirrorChange(t.deferred);t.props.onBeforeChange&&t.props.onBeforeChange(t.editor,t.deferred,n)}})),this.editor.on("change",(function(e,r){t.mounted&&t.props.onChange&&t.props.onChange(t.editor,r,t.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},e.prototype.componentDidUpdate=function(t){if(!u){var e={cursor:null};this.props.value!==t.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(e.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(t,this.props,e),this.appliedNext=!0),this.shared.applyUserDefined(t,e),this.appliedUserDefined=!0}},e.prototype.componentWillUnmount=function(){u||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},e.prototype.shouldComponentUpdate=function(t,e){return!u},e.prototype.render=function(){var t=this;if(u)return null;var e=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:e,ref:function(e){return t.ref=e}})},e}(l.Component);e.Controlled=h;var d=function(t){function e(e){var r=t.call(this,e)||this;return u||(r.applied=!1,r.appliedUserDefined=!1,r.continueChange=!1,r.detached=!1,r.hydrated=!1,r.initCb=function(){r.props.editorDidConfigure&&r.props.editorDidConfigure(r.editor)},r.mounted=!1,r.onBeforeChangeCb=function(){r.continueChange=!0}),r}return a(e,t),e.prototype.hydrate=function(t){var e=this,r=t&&t.options?t.options:{},i=n({},s.defaults,this.editor.options,r);if(Object.keys(i).some((function(t){return e.editor.getOption(t)!==i[t]}))&&Object.keys(i).forEach((function(t){r.hasOwnProperty(t)&&e.editor.getOption(t)!==i[t]&&e.editor.setOption(t,i[t])})),!this.hydrated){var o=this.editor.getDoc(),a=o.lastLine(),l=o.getLine(o.lastLine()).length;o.replaceRange(t.value||"",{line:0,ch:0},{line:a,ch:l})}this.hydrated=!0},e.prototype.componentDidMount=function(){var t=this;u||(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref),this.shared=new f(this.editor,this.props),this.editor.on("beforeChange",(function(e,r){t.props.onBeforeChange&&t.props.onBeforeChange(t.editor,r,t.editor.getValue(),t.onBeforeChangeCb)})),this.editor.on("change",(function(e,r){t.mounted&&t.props.onChange&&(t.props.onBeforeChange?t.continueChange&&t.props.onChange(t.editor,r,t.editor.getValue()):t.props.onChange(t.editor,r,t.editor.getValue()))})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},e.prototype.componentDidUpdate=function(t){if(this.detached&&!1===this.props.detach&&(this.detached=!1,t.editorDidAttach&&t.editorDidAttach(this.editor)),this.detached||!0!==this.props.detach||(this.detached=!0,t.editorDidDetach&&t.editorDidDetach(this.editor)),!u&&!this.detached){var e={cursor:null};this.props.value!==t.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),t.autoCursor||void 0===t.autoCursor||(e.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(t),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(t,e),this.appliedUserDefined=!0)}},e.prototype.componentWillUnmount=function(){u||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},e.prototype.shouldComponentUpdate=function(t,e){var r=!0;return u&&(r=!1),this.detached&&t.detach&&(r=!1),r},e.prototype.render=function(){var t=this;if(u)return null;var e=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:e,ref:function(e){return t.ref=e}})},e}(l.Component);e.UnControlled=d}).call(this,r(7))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(23),o=r(3),a=r(24),s=r(1),l=function(){function t(t,e){var r=this;this.cm=t,this.needAutoCompletevalues=e,this.completionShow=!1,this.appendSpace=!0,this.doc=t.getDoc(),t.on("endCompletion",(function(){r.completionShow=!1})),this.hintOptions=this.createHintOption()}return t.prototype.processText=function(t){return n.isString(t)&&o.default.needSpaceAfter(t)?t+" ":t},t.prototype.onPick=function(t,e,r){var n=r.value;this.pick&&(n=this.pick(t,e,r)),"string"==typeof n&&t.replaceRange(this.processText(n),e.from,e.to,"complete")},t.prototype.renderHintElement=function(t,e,r){var n=this,i=document.createElement("div"),o=" hint-value cm-"+r.type;this.customRenderCompletionItem?a.render(this.customRenderCompletionItem(e,r,(function(){return t.className+=" custom",setTimeout((function(){t.hintId=null}),0),n.manualPick.bind(n,e,r)})),i):a.render(s.createElement("div",{className:o},r.value),i),t.appendChild(i)},t.prototype.manualPick=function(t,e,r){var n=this,i=this.cm.state.completionActive;if(null!=i){var o=t.list.indexOf(e);e.hint=function(t,e,i){t.replaceRange(n.processText(r),e.from,e.to,"complete")},i.pick(t,o)}},t.prototype.buildComletionObj=function(t){return{value:t.value,type:t.type,hint:this.onPick.bind(this),render:this.renderHintElement.bind(this)}},t.prototype.findLastSeparatorPositionWithEditor=function(){var t=this.cm.getDoc(),e=t.getCursor(),r=t.getRange({line:0,ch:0},e),n=o.default.findLastSeparatorIndex(r);return{line:e.line,ch:e.ch-(r.length-n)+1}},t.prototype.show=function(){var t=this.doc.getCursor(),e=this.doc.getRange({line:0,ch:0},t);this.hintOptions.hintValues=this.needAutoCompletevalues(e),this.cm.showHint(this.hintOptions),this.completionShow=!0},t.prototype.createHintOption=function(){var t=this,e=new i.HintOptions;return e.hint=function(){var r=e.hintValues,i=t.cm.getDoc(),o=i.getCursor(),a=t.findLastSeparatorPositionWithEditor(),s=i.getRange(a,o),l=r;return s&&(l=n.filter(r,(function(t){var e=t.value;return!n.isString(t.value)||n.startsWith(e.toLowerCase(),s.toLowerCase())}))),{list:n.map(l,(function(e){return t.buildComletionObj(e)})),from:a,to:o}},e.hint.supportsSelection=!0,e},t}();e.default=l},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HintOptions=void 0;var n=function(){this.completeSingle=!1,this.hintValues=[]};e.HintOptions=n},function(t,r){t.exports=e},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),a=function(t){function e(e){var r=t.call(this)||this;return r.options=e,r}return i(e,t),e.prototype.tryToGetFieldCategory=function(t){var e=o.find(this.options,(function(e){return e.columnText==t}));return e?e.columnField:t},e.prototype.filter=function(t,e,r,n){var i=this.tryToGetFieldCategory(e);switch(r){case"==":return t[i]==n;case"!=":return t[i]!=n;case"contains":return t[i].toLowerCase().indexOf(n.toLowerCase())>=0;case"!contains":return t[i].toLowerCase().indexOf(n.toLowerCase())<0}return!1},e}(r(8).default);e.default=a},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=r(4),a=r(0),s=function(t){function e(e,r){var n=t.call(this)||this;return n.data=e,n.options=r,n.cache={},n.parseResult=null,n.categories=a.map(n.options,(function(t){return t.columnText?t.columnText:t.columnField})),n}return i(e,t),e.prototype.hasCategory=function(t){return void 0!==a.find(this.options,(function(e){return t===e.columnField||t===e.columnText}))},e.prototype.hasOperator=function(t,e){return this.needOperators(t).indexOf(e)>=0},e.prototype.needCategories=function(){return this.categories},e.prototype.needOperators=function(t){var e=a.find(this.options,(function(e){return null!=e.customOperatorFunc&&(e.columnText==t||e.columnField==t)}));return e?e.customOperatorFunc(t):["==","!=","contains","!contains"]},e.prototype.needValues=function(t,e){var r=a.find(this.options,(function(e){return e.columnField==t||e.columnText==t}));return null!=r&&"selection"==r.type&&null!=this.data?(this.cache[t]||(this.cache[t]=a.chain(this.data).map((function(e){return e[t]})).uniq().value()),this.cache[t]):null!=r&&r.customValuesFunc?r.customValuesFunc(t,e):[]},e}(o.default);e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(28),i=r(0),o=r(4),a=r(29),s=r(3),l=function(){function t(){this.autoCompleteHandler=new o.default,this.lastError=null,this.parseTrace=new a.default}return t.prototype.parse=function(t){if(t=i.trim(t),i.isEmpty(t))return[];try{return this.parseQuery(t)}catch(t){return t.isError=!0,t}},t.prototype.parseQuery=function(t){return this.parseTrace.clear(),n.parse(t,{parseTrace:this.parseTrace})},t.prototype.getSuggestions=function(t){t=s.default.stripEndWithNonSeparatorCharacters(t);try{return this.parseQuery(t),!t||s.default.isLastCharacterWhiteSpace(t)?i.map(["AND","OR"],(function(t){return{value:t,type:"literal"}})):[]}catch(t){return this.autoCompleteHandler.handleParseError(n,this.parseTrace,t)}},t.prototype.setAutoCompleteHandler=function(t){this.autoCompleteHandler=t},t}();e.default=l},function(t,e,r){"use strict";function n(t,e,r,i){this.message=t,this.expected=e,this.found=r,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,n)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(n,Error),n.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?o(t.parts[e][0])+"-"+o(t.parts[e][1]):o(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,i,o=new Array(t.length);for(e=0;e<t.length;e++)o[e]=(i=t[e],r[i.type](i));if(o.sort(),o.length>0){for(e=1,n=1;e<o.length;e++)o[e-1]!==o[e]&&(o[n]=o[e],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},t.exports={SyntaxError:n,parse:function(t,e){e=void 0!==e?e:{};var r,i={},o={Expression:R},a=R,s=O("AND",!0),l=O("OR",!0),u=O("(",!1),c=O(")",!1),f=N("operator"),h=N("value"),d=O('"',!1),p=/^[^"]/,v=A(['"'],!0,!1),g=N("category"),m=/^[^ ()"\t\n\r]/,y=A([" ","(",")",'"',"\t","\n","\r"],!0,!1),b=N("whitespace"),w=/^[ \t\n\r]/,x=A([" ","\t","\n","\r"],!1,!1),C=0,_=0,S=[{line:1,column:1}],k=0,M=[],L=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function T(){return t.substring(_,C)}function O(t,e){return{type:"literal",text:t,ignoreCase:e}}function A(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function N(t){return{type:"other",description:t}}function D(e){var r,n=S[e];if(n)return n;for(r=e-1;!S[r];)r--;for(n={line:(n=S[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return S[e]=n,n}function E(t,e){var r=D(t),n=D(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function W(t){C<k||(C>k&&(k=C,M=[]),M.push(t))}function P(t,e,r){return new n(n.buildMessage(t,e),t,e,r)}function R(){var e,r,n,o,a,u,c,f;if(e=C,z()!==i)if((r=H())!==i){for(n=[],o=C,(a=I())!==i?("and"===t.substr(C,3).toLowerCase()?(u=t.substr(C,3),C+=3):(u=i,0===L&&W(s)),u===i&&("or"===t.substr(C,2).toLowerCase()?(u=t.substr(C,2),C+=2):(u=i,0===L&&W(l))),u!==i&&(c=I())!==i&&(f=H())!==i?o=a=[a,u,c,f]:(C=o,o=i)):(C=o,o=i);o!==i;)n.push(o),o=C,(a=I())!==i?("and"===t.substr(C,3).toLowerCase()?(u=t.substr(C,3),C+=3):(u=i,0===L&&W(s)),u===i&&("or"===t.substr(C,2).toLowerCase()?(u=t.substr(C,2),C+=2):(u=i,0===L&&W(l))),u!==i&&(c=I())!==i&&(f=H())!==i?o=a=[a,u,c,f]:(C=o,o=i)):(C=o,o=i);n!==i&&(o=z())!==i?(_=e,e=function(t,e){for(var r=[t],n=0;n<e.length;n++){var i=e[n][3];i.conditionType=e[n][1],r.push(i)}return r}(r,n)):(C=e,e=i)}else C=e,e=i;else C=e,e=i;return e}function H(){var e,r,n,o;return e=C,40===t.charCodeAt(C)?(r="(",C++):(r=i,0===L&&W(u)),r!==i&&z()!==i&&(n=R())!==i&&z()!==i?(41===t.charCodeAt(C)?(o=")",C++):(o=i,0===L&&W(c)),o!==i?(_=e,e=r={expressions:n}):(C=e,e=i)):(C=e,e=i),e===i&&(e=function(){var e,r,n,o;e=C,(r=function(){var e,r,n,o;if(L++,e=C,r=[],(n=F())!==i)for(;n!==i;)r.push(n),n=F();else r=i;r!==i&&(_=e,j.pushCategory(T()),r=T());if((e=r)===i)if(e=C,34===t.charCodeAt(C)?(r='"',C++):(r=i,0===L&&W(d)),r!==i){for(n=[],p.test(t.charAt(C))?(o=t.charAt(C),C++):(o=i,0===L&&W(v));o!==i;)n.push(o),p.test(t.charAt(C))?(o=t.charAt(C),C++):(o=i,0===L&&W(v));n!==i?(34===t.charCodeAt(C)?(o='"',C++):(o=i,0===L&&W(d)),o!==i?(_=e,a=n.join(""),j.pushCategory(a),e=r=a):(C=e,e=i)):(C=e,e=i)}else C=e,e=i;var a;L--,e===i&&(r=i,0===L&&W(g));return e}())!==i&&I()!==i&&(n=function(){var t,e,r;if(L++,t=C,e=[],(r=F())!==i)for(;r!==i;)e.push(r),r=F();else e=i;e!==i&&(_=t,j.pushOperator(T()),e=T());L--,(t=e)===i&&(e=i,0===L&&W(f));return t}())!==i&&I()!==i&&(o=function(){var e,r,n,o;if(L++,e=C,r=[],(n=F())!==i)for(;n!==i;)r.push(n),n=F();else r=i;r!==i&&(_=e,j.pushValue(T()),r=T());if((e=r)===i)if(e=C,34===t.charCodeAt(C)?(r='"',C++):(r=i,0===L&&W(d)),r!==i){for(n=[],p.test(t.charAt(C))?(o=t.charAt(C),C++):(o=i,0===L&&W(v));o!==i;)n.push(o),p.test(t.charAt(C))?(o=t.charAt(C),C++):(o=i,0===L&&W(v));n!==i?(34===t.charCodeAt(C)?(o='"',C++):(o=i,0===L&&W(d)),o!==i?(_=e,a=n.join(""),j.pushValue(a),e=r=a):(C=e,e=i)):(C=e,e=i)}else C=e,e=i;var a;L--,e===i&&(r=i,0===L&&W(h));return e}())!==i?(_=e,e=r={category:r,operator:n,value:o}):(C=e,e=i);return e}()),e}function F(){var e;return m.test(t.charAt(C))?(e=t.charAt(C),C++):(e=i,0===L&&W(y)),e}function I(){var e,r;if(L++,e=[],w.test(t.charAt(C))?(r=t.charAt(C),C++):(r=i,0===L&&W(x)),r!==i)for(;r!==i;)e.push(r),w.test(t.charAt(C))?(r=t.charAt(C),C++):(r=i,0===L&&W(x));else e=i;return L--,e===i&&(r=i,0===L&&W(b)),e}function z(){var e,r;for(L++,e=[],w.test(t.charAt(C))?(r=t.charAt(C),C++):(r=i,0===L&&W(x));r!==i;)e.push(r),w.test(t.charAt(C))?(r=t.charAt(C),C++):(r=i,0===L&&W(x));return L--,e===i&&(r=i,0===L&&W(b)),e}var j=e.parseTrace;if((r=a())!==i&&C===t.length)return r;throw r!==i&&C<t.length&&W({type:"end"}),P(M,k<t.length?t.charAt(k):null,k<t.length?E(k,k+1):E(k,k))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(){this.arr=[],this.arr=[]}return t.prototype.push=function(t){this.arr.push(t)},t.prototype.clear=function(){this.arr=[]},t.prototype.getLastOperator=function(){return n.findLast(this.arr,(function(t){return"operator"==t.type})).value},t.prototype.getLastCategory=function(){return n.findLast(this.arr,(function(t){return"category"==t.type})).value},t.prototype.getLastTokenType=function(){return this.arr.length<=0?null:n.last(this.arr).type},t.prototype.pushOperator=function(t){this.push({type:"operator",value:t})},t.prototype.pushCategory=function(t){this.push({type:"category",value:t})},t.prototype.pushValue=function(t){this.push({type:"value",value:t})},t}();e.default=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(t,e){var r={isValid:!0},o=t.expressions;return void 0===o?!1===e.hasCategory(t.category)?r={isValid:!1,message:"Invalid category '"+t.category+"' in expression "+t.category+" "+t.operator+" "+t.value}:!1===e.hasOperator(t.category,t.operator)&&(r={isValid:!1,message:"Invalid operator '"+t.operator+"' in expression "+t.category+" "+t.operator+" "+t.value}):o&&n.find(o,(function(t){return!1===(r=i(t,e)).isValid})),r};e.default=function(t,e){var r={isValid:!0};return n.find(t,(function(t){return!1===(r=i(t,e)).isValid})),r}}])}));
//# sourceMappingURL=react-filter-box.js.map