![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/gg.corals.io/wp-content/plugins/essential-grid/admin/assets/js/plugins/ |
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.ESGMirror=t()}(this,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||n||o,l=a&&(i?document.documentMode||6:+(o||n)[1]),s=!o&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),y=/\bCrOS\b/.test(e),k=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);(w=w&&Number(w[1]))&&15<=w&&(s=!(d=!1));var x=b&&(c||d&&(null==w||w<12.11)),C=r||a&&9<=l;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var r,i=e.className,n=S(t).exec(i);n&&(r=i.slice(n.index+n[0].length),e.className=i.slice(0,n.index)+(r?n[1]+r:""))};function E(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function M(e,t){return E(e).appendChild(t)}function N(e,t,r,i){var n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function O(e,t,r,i){var n=N(e,t,r,i);return n.setAttribute("role","presentation"),n}function P(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function G(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function A(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function I(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!S(r[i]).test(t)&&(t+=" "+r[i]);return t}L=document.createRange?function(e,t,r,i){var n=document.createRange();return n.setEnd(i||e,r),n.setStart(e,t),n}:function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};var D=function(e){e.select()};function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,r){for(var i in t=t||{},e)!e.hasOwnProperty(i)||!1===r&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function H(e,t,r,i,n){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,a=n||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}g?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(D=function(e){try{e.select()}catch(e){}});var W=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};function z(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}W.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-new Date)},W.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var R=50,B={toString:function(){return"ESGMirror.Pass"}},j={scroll:!1},V={origin:"*mouse"},q={origin:"+move"};function U(e,t,r){for(var i=0,n=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var a=o-i;if(o==e.length||t<=n+a)return i+Math.min(a,t-n);if(n+=o-i,i=o+1,t<=(n+=r-n%r))return i}}var K=[""];function Q(e){for(;K.length<=e;)K.push($(K)+" ");return K[e]}function $(e){return e[e.length-1]}function X(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function Y(){}function Z(e,t){var r=Object.create?Object.create(e):(Y.prototype=e,new Y);return t&&F(t,r),r}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}var ie=/[\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 ne(e){return 768<=e.charCodeAt(0)&&ie.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var i=r<t?-1:1;;){if(t==r)return t;var n=(t+r)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+i}}var le=null;function se(e,t,r){var i;le=null;for(var n=0;n<e.length;++n){var o=e[n];if(o.from<t&&o.to>t)return n;o.to==t&&(o.from!=o.to&&"before"==r?i=n:le=n),o.from==t&&(o.from!=o.to&&"before"!=r?i=n:le=n)}return null!=i?i:le}var ce,ue,de,pe,he,fe=("bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN","nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",ce=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ue=/[stwN]/,de=/[LRr]/,pe=/[Lb1n]/,he=/[1n]/,function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!ce.test(e))return!1;for(var i,n=e.length,o=[],a=0;a<n;++a)o.push((i=e.charCodeAt(a))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(i):1424<=i&&i<=1524?"R":1536<=i&&i<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(i-1536):1774<=i&&i<=2220?"r":8192<=i&&i<=8203?"w":8204==i?"b":"L");for(var l=0,s=r;l<n;++l){var c=o[l];"m"==c?o[l]=s:s=c}for(var u=0,d=r;u<n;++u){var p=o[u];"1"==p&&"r"==d?o[u]="n":de.test(p)&&"r"==(d=p)&&(o[u]="R")}for(var h=1,f=o[0];h<n-1;++h){var g=o[h];"+"==g&&"1"==f&&"1"==o[h+1]?o[h]="1":","!=g||f!=o[h+1]||"1"!=f&&"n"!=f||(o[h]=f),f=g}for(var m=0;m<n;++m){var v=o[m];if(","==v)o[m]="N";else if("%"==v){var b=void 0;for(b=m+1;b<n&&"%"==o[b];++b);for(var y=m&&"!"==o[m-1]||b<n&&"1"==o[b]?"1":"N",k=m;k<b;++k)o[k]=y;m=b-1}}for(var w=0,x=r;w<n;++w){var C=o[w];"L"==x&&"1"==C?o[w]="L":de.test(C)&&(x=C)}for(var S=0;S<n;++S)if(ue.test(o[S])){var L=void 0;for(L=S+1;L<n&&ue.test(o[L]);++L);for(var T="L"==(S?o[S-1]:r),E=T==("L"==(L<n?o[L]:r))?T?"L":"R":r,M=S;M<L;++M)o[M]=E;S=L-1}for(var N,O=[],P=0;P<n;)if(pe.test(o[P])){var G=P;for(++P;P<n&&pe.test(o[P]);++P);O.push(new ge(0,G,P))}else{var A=P,I=O.length,D="rtl"==t?1:0;for(++P;P<n&&"L"!=o[P];++P);for(var _=A;_<P;)if(he.test(o[_])){A<_&&(O.splice(I,0,new ge(1,A,_)),I+=D);var F=_;for(++_;_<P&&he.test(o[_]);++_);O.splice(I,0,new ge(2,F,_)),I+=D,A=_}else++_;A<P&&O.splice(I,0,new ge(1,A,P))}return"ltr"==t&&(1==O[0].level&&(N=e.match(/^\s+/))&&(O[0].from=N[0].length,O.unshift(new ge(0,0,N[0].length))),1==$(O).level&&(N=e.match(/\s+$/))&&($(O).to-=N[0].length,O.push(new ge(0,n-N[0].length,n)))),"rtl"==t?O.reverse():O});function ge(e,t,r){this.level=e,this.from=t,this.to=r}function me(e,t){var r=e.order;return null==r&&(r=e.order=fe(e.text,t)),r}var ve=[],be=function(e,t,r){var i;e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent("on"+t,r):(i=e._handlers||(e._handlers={}))[t]=(i[t]||ve).concat(r)};function ye(e,t){return e._handlers&&e._handlers[t]||ve}function ke(e,t,r){var i,n,o;e.removeEventListener?e.removeEventListener(t,r,!1):e.detachEvent?e.detachEvent("on"+t,r):!(n=(i=e._handlers)&&i[t])||-1<(o=z(n,r))&&(i[t]=n.slice(0,o).concat(n.slice(o+1)))}function we(e,t){var r=ye(e,t);if(r.length)for(var i=Array.prototype.slice.call(arguments,2),n=0;n<r.length;++n)r[n].apply(null,i)}function xe(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,r||t.type,e,t),Me(t)||t.esgmirrorIgnore}function Ce(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==z(r,t[i])&&r.push(t[i])}function Se(e,t){return 0<ye(e,t).length}function Le(e){e.prototype.on=function(e,t){be(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Me(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ne(e){Te(e),Ee(e)}function Oe(e){return e.target||e.srcElement}function Pe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ge,Ae,Ie=function(){if(a&&l<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function De(e){var t;null==Ge&&(t=N("span",""),M(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ge=t.offsetWidth<=1&&2<t.offsetHeight&&!(a&&l<8)));var r=Ge?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function _e(e){if(null!=Ae)return Ae;var t=M(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),i=L(t,1,2).getBoundingClientRect();return E(e),r&&r.left!=r.right&&(Ae=i.right-r.right<3)}var Fe,He=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],i=e.length;t<=i;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var o=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=n+1)}return r}:function(e){return e.split(/\r\n?|\n/)},We=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},ze="oncopy"in(Fe=N("div"))||(Fe.setAttribute("oncopy","return;"),"function"==typeof Fe.oncopy),Re=null,Be={},je={};function Ve(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function qe(e,t){t=Ve(t);var r=Be[t.name];if(!r)return qe(e,"text/plain");var i=r(e,t);if(Ue.hasOwnProperty(t.name)){var n=Ue[t.name];for(var o in n)n.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=n[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var Ue={};function Ke(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var n=t[i];n instanceof Array&&(n=n.concat([])),r[i]=n}return r}function Qe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function $e(e,t,r){return!e.startState||e.startState(t,r)}var Xe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ye(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var i=0;;++i){var n=r.children[i],o=n.chunkSize();if(t<o){r=n;break}t-=o}return r.lines[t]}function Ze(e,t,r){var i=[],n=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;n==r.line&&(o=o.slice(0,r.ch)),n==t.line&&(o=o.slice(t.ch)),i.push(o),++n})),i}function Je(e,t,r){var i=[];return e.iter(t,r,(function(e){i.push(e.text)})),i}function et(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function tt(e){if(null==e.parent)return null;for(var t=e.parent,r=z(t.lines,e),i=t.parent;i;i=(t=i).parent)for(var n=0;i.children[n]!=t;++n)r+=i.children[n].chunkSize();return r+t.first}function rt(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var n=e.children[i],o=n.height;if(t<o){e=n;continue e}t-=o,r+=n.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function it(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,r){if(void 0===r&&(r=null),!(this instanceof ot))return new ot(e,t,r);this.line=e,this.ch=t,this.sticky=r}function at(e,t){return e.line-t.line||e.ch-t.ch}function lt(e,t){return e.sticky==t.sticky&&0==at(e,t)}function st(e){return ot(e.line,e.ch)}function ct(e,t){return at(e,t)<0?t:e}function ut(e,t){return at(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.line<e.first)return ot(e.first,0);var r,i,n,o=e.first+e.size-1;return t.line>o?ot(o,Ye(e,o).text.length):(i=Ye(e,(r=t).line).text.length,null==(n=r.ch)||i<n?ot(r.line,i):n<0?ot(r.line,0):r)}function ht(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=pt(e,t[i]);return r}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,r){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&0<i.index?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}function n(e){return r?e.toLowerCase():e}if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ft=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function mt(e,t,r,i){var n=[e.state.modeGen],o={};Lt(e,t.text,e.doc.mode,r,(function(e,t){return n.push(e,t)}),o,i);for(var a=r.state,l=function(i){r.baseTokens=n;var l=e.state.overlays[i],s=1,c=0;r.state=!0,Lt(e,t.text,l.mode,r,(function(e,t){for(var r=s;c<e;){var i=n[s];e<i&&n.splice(s,1,e,n[s+1],i),s+=2,c=Math.min(e,i)}if(t)if(l.opaque)n.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;r<s;r+=2){var o=n[r+1];n[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function vt(e,t,r){var i,n,o;return t.styles&&t.styles[0]==e.state.modeGen||(i=bt(e,tt(t)),n=t.text.length>e.options.maxHighlightLength&&Ke(e.doc.mode,i.state),o=mt(e,t,i),n&&(i.state=n),t.stateAfter=i.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function bt(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState)return new gt(i,!0,t);var o=function(e,t,r){for(var i,n,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=Ye(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof ft?c.lookAhead:0)<=o.modeFrontier))return l;var u=H(s.text,null,e.options.tabSize);(null==n||u<i)&&(n=l-1,i=u)}return n}(e,t,r),a=o>i.first&&Ye(i,o-1).stateAfter,l=a?gt.fromSaved(i,a,o):new gt(i,$e(i.mode),o);return i.iter(o,t,(function(r){yt(e,r.text,l);var i=l.line;r.stateAfter=i==t-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?l.save():null,l.nextLine()})),r&&(i.modeFrontier=l.line),l}function yt(e,t,r,i){var n=e.doc.mode,o=new Xe(t,e.options.tabSize,r);for(o.start=o.pos=i||0,""==t&&kt(n,r.state);!o.eol();)wt(n,o,r.state),o.start=o.pos}function kt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Qe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function wt(e,t,r,i){for(var n=0;n<10;n++){i&&(i[0]=Qe(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},gt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},gt.fromSaved=function(e,t,r){return t instanceof ft?new gt(e,Ke(e.mode,t.state),r,t.lookAhead):new gt(e,Ke(e.mode,t),r)},gt.prototype.save=function(e){var t=!1!==e?Ke(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new ft(t,this.maxLookAhead):t};var xt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ct(e,t,r,i){var n,o,a=e.doc,l=a.mode,s=Ye(a,(t=pt(a,t)).line),c=bt(e,t.line,r),u=new Xe(s.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,n=wt(l,u,c.state),i&&o.push(new xt(u,n,Ke(a.mode,c.state)));return i?o:new xt(u,n,c.state)}function St(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";null==t[i]?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function Lt(e,t,r,i,n,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s=0,c=null,u=new Xe(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&St(kt(r,i.state),o);!u.eol();){var p,h=u.pos>e.options.maxHighlightLength?(l=!1,a&&yt(e,t,i,u.pos),u.pos=t.length,null):St(wt(r,u,i.state,d),o);if(!d||(p=d[0].name)&&(h="m-"+(h?p+" "+h:p)),!l||c!=h){for(;s<u.start;)n(s=Math.min(u.start,s+5e3),c);c=h}u.start=u.pos}for(;s<u.pos;){var f=Math.min(u.pos,s+5e3);n(f,c),s=f}}var Tt=!1,Et=!1;function Mt(e,t,r){this.marker=e,this.from=t,this.to=r}function Nt(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function Ot(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r=r||[]).push(e[i]);return r}function Pt(e,t){if(t.full)return null;var r=it(e,t.from.line)&&Ye(e,t.from.line).markedSpans,i=it(e,t.to.line)&&Ye(e,t.to.line).markedSpans;if(!r&&!i)return null;var n=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),l=function(e,t,r){var i;if(e)for(var n=0;n<e.length;++n){var o,a=e[n],l=a.marker;null!=a.from&&!(l.inclusiveLeft?a.from<=t:a.from<t)&&(a.from!=t||"bookmark"!=l.type||r&&a.marker.insertLeft)||(o=null==a.to||(l.inclusiveRight?a.to>=t:a.to>t),(i=i||[]).push(new Mt(l,a.from,o?null:a.to)))}return i}(r,n,a),s=function(e,t,r){var i;if(e)for(var n=0;n<e.length;++n){var o,a=e[n],l=a.marker;null!=a.to&&!(l.inclusiveRight?a.to>=t:a.to>t)&&(a.from!=t||"bookmark"!=l.type||r&&!a.marker.insertLeft)||(o=null==a.from||(l.inclusiveLeft?a.from<=t:a.from<t),(i=i||[]).push(new Mt(l,o?null:a.from-t,null==a.to?null:a.to-t)))}return i}(i,o,a),c=1==t.text.length,u=$(t.text).length+(c?n:0);if(l)for(var d=0;d<l.length;++d){var p,h=l[d];null==h.to&&((p=Nt(s,h.marker))?c&&(h.to=null==p.to?null:p.to+u):h.to=n)}if(s)for(var f=0;f<s.length;++f){var g=s[f];null!=g.to&&(g.to+=u),null==g.from?Nt(l,g.marker)||(g.from=u,c&&(l=l||[]).push(g)):(g.from+=u,c&&(l=l||[]).push(g))}l=l&&Gt(l),s&&s!=l&&(s=Gt(s));var m=[l];if(!c){var v,b=t.text.length-2;if(0<b&&l)for(var y=0;y<l.length;++y)null==l[y].to&&(v=v||[]).push(new Mt(l[y].marker,null,null));for(var k=0;k<b;++k)m.push(v);m.push(s)}return m}function Gt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function At(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function It(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Dt(e){return e.inclusiveLeft?-1:0}function _t(e){return e.inclusiveRight?1:0}function Ft(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var i=e.find(),n=t.find(),o=at(i.from,n.from)||Dt(e)-Dt(t);return o?-o:at(i.to,n.to)||_t(e)-_t(t)||t.id-e.id}function Ht(e,t){var r,i=Et&&e.markedSpans;if(i)for(var n=void 0,o=0;o<i.length;++o)(n=i[o]).marker.collapsed&&null==(t?n.from:n.to)&&(!r||Ft(r,n.marker)<0)&&(r=n.marker);return r}function Wt(e){return Ht(e,!0)}function zt(e){return Ht(e,!1)}function Rt(e,t){var r,i=Et&&e.markedSpans;if(i)for(var n=0;n<i.length;++n){var o=i[n];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Ft(r,o.marker)<0)&&(r=o.marker)}return r}function Bt(e,t,r,i,n){var o=Ye(e,t),a=Et&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=at(c.from,r)||Dt(s.marker)-Dt(n),d=at(c.to,i)||_t(s.marker)-_t(n);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?0<=at(c.to,r):0<at(c.to,r))||0<=u&&(s.marker.inclusiveRight&&n.inclusiveLeft?at(c.from,i)<=0:at(c.from,i)<0)))return 1}}}function jt(e){for(var t;t=Wt(e);)e=t.find(-1,!0).line;return e}function Vt(e,t){var r=Ye(e,t),i=jt(r);return r==i?t:tt(i)}function qt(e,t){if(t>e.lastLine())return t;var r,i=Ye(e,t);if(!Ut(e,i))return t;for(;r=zt(i);)i=r.find(1,!0).line;return tt(i)+1}function Ut(e,t){var r=Et&&t.markedSpans;if(r)for(var i=void 0,n=0;n<r.length;++n)if((i=r[n]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&Kt(e,t,i))return!0}}function Kt(e,t,r){if(null==r.to){var i=r.marker.find(1,!0);return Kt(e,i.line,Nt(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var n=void 0,o=0;o<t.markedSpans.length;++o)if((n=t.markedSpans[o]).marker.collapsed&&!n.marker.widgetNode&&n.from==r.to&&(null==n.to||n.to!=r.from)&&(n.marker.inclusiveLeft||r.marker.inclusiveRight)&&Kt(e,t,n))return!0}function Qt(e){for(var t=0,r=(e=jt(e)).parent,i=0;i<r.lines.length;++i){var n=r.lines[i];if(n==e)break;t+=n.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function $t(e){if(0==e.height)return 0;for(var t,r=e.text.length,i=e;t=Wt(i);){var n=t.find(0,!0);i=n.from.line;r+=n.from.ch-n.to.ch}for(i=e;t=zt(i);){var o=t.find(0,!0);r-=i.text.length-o.from.ch,r+=(i=o.to.line).text.length-o.to.ch}return r}function Xt(e){var t=e.display,r=e.doc;t.maxLine=Ye(r,r.first),t.maxLineLength=$t(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=$t(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Yt=function(e,t,r){this.text=e,It(this,t),this.height=r?r(this):1};Yt.prototype.lineNo=function(){return tt(this)},Le(Yt);var Zt={},Jt={};function er(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Jt:Zt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function tr(e,t){var r=O("span",null,null,s?"padding-right: .1px":null),i={pre:O("pre",[r],"ESGMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n,o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,l=void 0;i.pos=0,i.addToken=rr,_e(e.display.measure)&&(l=me(a,e.doc.direction))&&(i.addToken=ir(i.addToken,l)),i.map=[],or(a,i,vt(e,a,t!=e.display.externalMeasured&&tt(a))),a.styleClasses&&(a.styleClasses.bgClass&&(i.bgClass=I(a.styleClasses.bgClass,i.bgClass||"")),a.styleClasses.textClass&&(i.textClass=I(a.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(De(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return s&&(n=i.content.lastChild,(/\bcm-tab\b/.test(n.className)||n.querySelector&&n.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")),we(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=I(i.pre.className,i.textClass||"")),i}function rr(e,t,r,i,n,o,s){if(t){var c,u=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.test(e))return e;for(var r=t,i="",n=0;n<e.length;n++){var o=e.charAt(n);" "!=o||!r||n!=e.length-1&&32!=e.charCodeAt(n+1)||(o=" "),i+=o,r=" "==o}return i}(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var f,g=d.exec(t),m=g?g.index-h:t.length-h;if(m&&(f=document.createTextNode(u.slice(h,h+m)),a&&l<9?c.appendChild(N("span",[f])):c.appendChild(f),e.map.push(e.pos,e.pos+m,f),e.col+=m,e.pos+=m),!g)break;h+=1+m;var v,b,y=void 0;"\t"==g[0]?(b=(v=e.cm.options.tabSize)-e.col%v,(y=c.appendChild(N("span",Q(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b):("\r"==g[0]||"\n"==g[0]?(y=c.appendChild(N("span","\r"==g[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",g[0]):((y=e.cm.options.specialCharPlaceholder(g[0])).setAttribute("cm-text",g[0]),a&&l<9?c.appendChild(N("span",[y])):c.appendChild(y)),e.col+=1),e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&l<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||n||p||o){var k=r||"";i&&(k+=i),n&&(k+=n);var w=N("span",[c],k,o);if(s)for(var x in s)s.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,s[x]);return e.content.appendChild(w)}e.content.appendChild(c)}}function ir(e,t){return function(r,i,n,o,a,l,s){n=n?n+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+i.length;;){for(var d=void 0,p=0;p<t.length&&!((d=t[p]).to>c&&d.from<=c);p++);if(d.to>=u)return e(r,i,n,o,a,l,s);e(r,i.slice(0,d.to-c),n,o,null,l,s),o=null,i=i.slice(d.to-c),c=d.to}}}function nr(e,t,r,i){var n=!i&&r.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!i&&e.cm.display.input.needsContentAttribute&&(n=n||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",r.id),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function or(e,t,r){var i=e.markedSpans,n=e.text,o=0;if(i)for(var a,l,s,c,u,d,p,h=n.length,f=0,g=1,m="",v=0;;){if(v==f){s=c=u=l="",d=p=null,v=1/0;for(var b=[],y=void 0,k=0;k<i.length;++k){var w=i[k],x=w.marker;if("bookmark"==x.type&&w.from==f&&x.widgetNode)b.push(x);else if(w.from<=f&&(null==w.to||w.to>f||x.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&v>w.to&&(v=w.to,c=""),x.className&&(s+=" "+x.className),x.css&&(l=(l?l+";":"")+x.css),x.startStyle&&w.from==f&&(u+=" "+x.startStyle),x.endStyle&&w.to==v&&(y=y||[]).push(x.endStyle,w.to),x.title&&((p=p||{}).title=x.title),x.attributes)for(var C in x.attributes)(p=p||{})[C]=x.attributes[C];x.collapsed&&(!d||Ft(d.marker,x)<0)&&(d=w)}else w.from>f&&v>w.from&&(v=w.from)}if(y)for(var S=0;S<y.length;S+=2)y[S+1]==v&&(c+=" "+y[S]);if(!d||d.from==f)for(var L=0;L<b.length;++L)nr(t,0,b[L]);if(d&&(d.from||0)==f){if(nr(t,(null==d.to?h+1:d.to)-f,d.marker,null==d.from),null==d.to)return;d.to==f&&(d=!1)}}if(h<=f)break;for(var T=Math.min(h,v);;){if(m){var E,M=f+m.length;if(d||(E=T<M?m.slice(0,T-f):m,t.addToken(t,E,a?a+s:s,u,f+E.length==v?c:"",l,p)),T<=M){m=m.slice(T-f),f=T;break}f=M,u=""}m=n.slice(o,o=r[g++]),a=er(r[g++],t.cm.options)}}else for(var N=1;N<r.length;N+=2)t.addToken(t,n.slice(o,o=r[N]),er(r[N+1],t.cm.options))}function ar(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=zt(e);)e=t.find(1,!0).line,(r=r||[]).push(e);return r}(t),this.size=this.rest?tt($(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function lr(e,t,r){for(var i=[],n=t;n<r;n=a){var o=new ar(e.doc,Ye(e.doc,n),n),a=n+o.size;i.push(o)}return i}var sr=null;var cr=null;function ur(e,t){var r=ye(e,t);if(r.length){var i,n=Array.prototype.slice.call(arguments,2);sr?i=sr.delayedCallbacks:cr?i=cr:(i=cr=[],setTimeout(dr,0));for(var o=function(e){i.push((function(){return r[e].apply(null,n)}))},a=0;a<r.length;++a)o(a)}}function dr(){var e=cr;cr=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,r,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];"text"==o?gr(e,t):"gutter"==o?vr(e,t,r,i):"class"==o?mr(e,t):"widget"==o&&br(e,t,i)}t.changes=null}function hr(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):tr(e,t)}function gr(e,t){var r=t.text.className,i=fr(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,mr(e,t)):r&&(t.text.className=r)}function mr(e,t){var r,i,n,o;r=e,(o=(i=t).bgClass?i.bgClass+" "+(i.line.bgClass||""):i.line.bgClass)&&(o+=" ESGMirror-linebackground"),i.background?o?i.background.className=o:(i.background.parentNode.removeChild(i.background),i.background=null):o&&(n=hr(i),i.background=n.insertBefore(N("div",null,o),n.firstChild),r.display.input.setUneditable(i.background)),t.line.wrapClass?hr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function vr(e,t,r,i){var n;t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(n=hr(t),t.gutterBackground=N("div",null,"ESGMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text));var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=hr(t),l=t.gutter=N("div",null,"ESGMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["ESGMirror-linenumbers"]||(t.lineNumber=l.appendChild(N("div",nt(e.options,r),"ESGMirror-linenumber ESGMirror-gutter-elt","left: "+i.gutterLeft["ESGMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(N("div",[u],"ESGMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function br(e,t,r){t.alignable&&(t.alignable=null);for(var i=S("ESGMirror-linewidget"),n=t.node.firstChild,o=void 0;n;n=o)o=n.nextSibling,i.test(n.className)&&t.node.removeChild(n);yr(e,t,r)}function yr(e,t,r){if(kr(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)kr(e,t.rest[i],t,r,!1)}function kr(e,t,r,i,n){if(t.widgets)for(var o=hr(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=N("div",[s.node],"ESGMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),wr(s,c,r,i),e.display.input.setUneditable(c),n&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),ur(s,"redraw")}}function wr(e,t,r,i){var n;e.noHScroll&&((r.alignable||(r.alignable=[])).push(t),n=i.wrapperWidth,t.style.left=i.fixedPos+"px",e.coverGutter||(n-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=n+"px"),e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function xr(e){if(null!=e.height)return e.height;var t,r=e.doc.cm;return r?(P(document.body,e.node)||(t="position: relative;",e.coverGutter&&(t+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),e.noHScroll&&(t+="width: "+r.display.wrapper.clientWidth+"px;"),M(r.display.measure,N("div",[e.node],null,t))),e.height=e.node.parentNode.offsetHeight):0}function Cr(e,t){for(var r=Oe(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return 1}function Sr(e){return e.lineSpace.offsetTop}function Lr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Tr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=M(e.measure,N("pre","x","ESGMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function Er(e){return R-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-Er(e)-e.display.barWidth}function Nr(e){return e.display.scroller.clientHeight-Er(e)-e.display.barHeight}function Or(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var n=0;n<e.rest.length;n++)if(tt(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Pr(e,t,r,i){return Ir(e,Ar(e,t),r,i)}function Gr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Ar(e,t){var r=tt(t),i=Gr(e,r);i&&!i.text?i=null:i&&i.changes&&(pr(e,i,r,ni(e)),e.curOp.forceUpdate=!0);var n=Or(i=i||function(e,t){var r=tt(t=jt(t)),i=e.display.externalMeasured=new ar(e.doc,t,r);i.lineN=r;var n=i.built=tr(e,i);return i.text=n.pre,M(e.display.lineMeasure,n.pre),i}(e,t),t,r);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Ir(e,t,r,i,n){t.before&&(r=-1);var o,s=r+(i||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var i=e.options.lineWrapping,n=i&&Mr(e);if(!t.measure.heights||i&&t.measure.width!=n){var o=t.measure.heights=[];if(i){t.measure.width=n;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];2<Math.abs(s.bottom-c.bottom)&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,i){var n,o,s,c=Fr(t.map,r,i),u=c.node,d=c.start,p=c.end,h=c.collapse;if(3==u.nodeType){for(var f=0;f<4;f++){for(;d&&ne(t.line.text.charAt(c.coverStart+d));)--d;for(;c.coverStart+p<c.coverEnd&&ne(t.line.text.charAt(c.coverStart+p));)++p;if((n=a&&l<9&&0==d&&p==c.coverEnd-c.coverStart?u.parentNode.getBoundingClientRect():Hr(L(u,d,p).getClientRects(),i)).left||n.right||0==d)break;p=d,--d,h="right"}a&&l<11&&(n=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Re)return Re;var t=M(e,N("span","x")),r=t.getBoundingClientRect(),i=L(t,0,1).getBoundingClientRect();return Re=1<Math.abs(r.left-i.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,n))}else 0<d&&(h=i="right"),n=e.options.lineWrapping&&1<(o=u.getClientRects()).length?o["right"==i?o.length-1:0]:u.getBoundingClientRect();!(a&&l<9)||d||n&&(n.left||n.right)||(n=(s=u.parentNode.getClientRects()[0])?{left:s.left,right:s.left+ii(e.display),top:s.top,bottom:s.bottom}:_r);for(var g=n.top-t.rect.top,m=n.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var k=y?b[y-1]:0,w=b[y],x={left:("right"==h?n.right:n.left)-t.rect.left,right:("left"==h?n.left:n.right)-t.rect.left,top:k,bottom:w};return n.left||n.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=g,x.rbottom=m),x}(e,t,r,i)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}}var Dr,_r={left:0,right:0,top:0,bottom:0};function Fr(e,t,r){for(var i,n,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(n=0,o=1,a="left"):t<s?o=1+(n=t-l):(c==e.length-3||t==s&&e[c+3]>t)&&(n=(o=s-l)-1,s<=t&&(a="right")),null!=n){if(i=e[c+2],l==s&&r==(i.insertLeft?"left":"right")&&(a=r),"left"==r&&0==n)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],a="left";if("right"==r&&n==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],a="right";break}return{node:i,start:n,end:o,collapse:a,coverStart:l,coverEnd:s}}function Hr(e,t){var r=_r;if("left"==t)for(var i=0;i<e.length&&(r=e[i]).left==r.right;i++);else for(var n=e.length-1;0<=n&&(r=e[n]).left==r.right;n--);return r}function Wr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function zr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Wr(e.display.view[t])}function Rr(e){zr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Br(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jr(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Vr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=xr(e.widgets[r]));return t}function qr(e,t,r,i,n){var o;if(n||(o=Vr(t),r.top+=o,r.bottom+=o),"line"==i)return r;i=i||"local";var a,l,s=Qt(t);return"local"==i?s+=Sr(e.display):s-=e.display.viewOffset,"page"!=i&&"window"!=i||(s+=(a=e.display.lineSpace.getBoundingClientRect()).top+("window"==i?0:jr()),l=a.left+("window"==i?0:Br()),r.left+=l,r.right+=l),r.top+=s,r.bottom+=s,r}function Ur(e,t,r){if("div"==r)return t;var i,n=t.left,o=t.top;"page"==r?(n-=Br(),o-=jr()):"local"!=r&&r||(n+=(i=e.display.sizer.getBoundingClientRect()).left,o+=i.top);var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:o-a.top}}function Kr(e,t,r,i,n){return qr(e,i=i||Ye(e.doc,t.line),Pr(e,i,t.ch,n),r)}function Qr(e,t,r,i,n,o){function a(t,a){var l=Ir(e,n,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,qr(e,i,l,r)}i=i||Ye(e.doc,t.line),n=n||Ar(e,i);var l=me(i,e.doc.direction),s=t.ch,c=t.sticky;if(s>=i.text.length?(s=i.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return a("before"==c?s-1:s,"before"==c);function u(e,t,r){return a(r?e-1:e,1==l[t].level!=r)}var d=se(l,s,c),p=le,h=u(s,d,"before"==c);return null!=p&&(h.other=u(s,p,"before"!=c)),h}function $r(e,t){var r=0;t=pt(e.doc,t),e.options.lineWrapping||(r=ii(e.display)*t.ch);var i=Ye(e.doc,t.line),n=Qt(i)+Sr(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function Xr(e,t,r,i,n){var o=ot(e,t,r);return o.xRel=n,i&&(o.outside=i),o}function Yr(e,t,r){var i=e.doc;if((r+=e.display.viewOffset)<0)return Xr(i.first,0,null,-1,-1);var n=rt(i,r),o=i.first+i.size-1;if(o<n)return Xr(i.first+i.size-1,Ye(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ye(i,n);;){var l=ti(e,a,n,t,r),s=Rt(a,l.ch+(0<l.xRel||0<l.outside?1:0));if(!s)return l;var c=s.find(1);if(c.line==n)return c;a=Ye(i,n=c.line)}}function Zr(e,t,r,i){i-=Vr(t);var n=t.text.length,o=ae((function(t){return Ir(e,r,t-1).bottom<=i}),n,0);return{begin:o,end:n=ae((function(t){return Ir(e,r,t).top>i}),o,n)}}function Jr(e,t,r,i){return Zr(e,t,r=r||Ar(e,t),qr(e,t,Ir(e,r,i),"line").top)}function ei(e,t,r,i){return!(e.bottom<=r)&&(e.top>r||(i?e.left:e.right)>t)}function ti(e,t,r,i,n){n-=Qt(t);var o,a=Ar(e,t),l=Vr(t),s=0,c=t.text.length,u=!0,d=me(t,e.doc.direction);d&&(s=(u=1!=(o=(e.options.lineWrapping?function(e,t,r,i,n,o,a){var l=Zr(e,t,i,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<n.length;p++){var h,f,g=n[p];g.from>=c||g.to<=s||(f=(h=Ir(e,i,1!=g.level?Math.min(c,g.to)-1:Math.max(s,g.from)).right)<o?o-h+1e9:h-o,(!u||f<d)&&(u=g,d=f))}return(u=u||n[n.length-1]).from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}:function(e,t,r,i,n,o,a){var l,s,c=ae((function(l){var s=n[l],c=1!=s.level;return ei(Qr(e,ot(r,c?s.to:s.from,c?"before":"after"),"line",t,i),o,a,!0)}),0,n.length-1),u=n[c];return 0<c&&(l=1!=u.level,ei(s=Qr(e,ot(r,l?u.from:u.to,l?"after":"before"),"line",t,i),o,a,!0)&&s.top>a&&(u=n[c-1])),u})(e,t,r,a,d,i,n)).level)?o.from:o.to-1,c=u?o.to:o.from-1);var p,h,f,g,m,v=null,b=null,y=ae((function(t){var r=Ir(e,a,t);return r.top+=l,r.bottom+=l,ei(r,i,n,!1)&&(r.top<=n&&r.left<=i&&(v=t,b=r),1)}),s,c),k=!1;return b?(p=i-b.left<b.right-i,y=v+((h=p==u)?0:1),f=h?"after":"before",g=p?b.left:b.right):(u||y!=c&&y!=s||y++,f=0==y||y!=t.text.length&&Ir(e,a,y-(u?1:0)).bottom+l<=n==u?"after":"before",g=(m=Qr(e,ot(r,y,f),"line",t,a)).left,k=n<m.top?-1:n>=m.bottom?1:0),Xr(r,y=oe(t.text,y,1),f,k,i-g)}function ri(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dr){Dr=N("pre",null,"ESGMirror-line-like");for(var t=0;t<49;++t)Dr.appendChild(document.createTextNode("x")),Dr.appendChild(N("br"));Dr.appendChild(document.createTextNode("x"))}M(e.measure,Dr);var r=Dr.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),E(e.measure),r||1}function ii(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),r=N("pre",[t],"ESGMirror-line-like");M(e.measure,r);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;return 2<n&&(e.cachedCharWidth=n),n||10}function ni(e){for(var t=e.display,r={},i={},n=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;r[l]=o.offsetLeft+o.clientLeft+n,i[l]=o.clientWidth}return{fixedPos:oi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function oi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ai(e){var t=ri(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/ii(e.display)-3);return function(n){if(Ut(e.doc,n))return 0;var o=0;if(n.widgets)for(var a=0;a<n.widgets.length;a++)n.widgets[a].height&&(o+=n.widgets[a].height);return r?o+(Math.ceil(n.text.length/i)||1)*t:o+t}}function li(e){var t=e.doc,r=ai(e);t.iter((function(e){var t=r(e);t!=e.height&&et(e,t)}))}function si(e,t,r,i){var n=e.display;if(!r&&"true"==Oe(t).getAttribute("cm-not-content"))return null;var o,a,l=n.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c,u=Yr(e,o,a);return i&&0<u.xRel&&(s=Ye(e.doc,u.line).text).length==u.ch&&(c=H(s,s.length,e.options.tabSize)-s.length,u=ot(u.line,Math.max(0,Math.round((o-Tr(e.display).left)/ii(e.display))-c))),u}function ci(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if((t-=r[i].size)<0)return i}function ui(e,t,r,i){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),i=i||0;var n,o,a,l,s=e.display;i&&r<s.viewTo&&(null==s.updateLineNumbers||s.updateLineNumbers>t)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo?Et&&Vt(e.doc,t)<s.viewTo&&pi(e):r<=s.viewFrom?Et&&qt(e.doc,r+i)>s.viewFrom?pi(e):(s.viewFrom+=i,s.viewTo+=i):t<=s.viewFrom&&r>=s.viewTo?pi(e):t<=s.viewFrom?(n=hi(e,r,r+i,1))?(s.view=s.view.slice(n.index),s.viewFrom=n.lineN,s.viewTo+=i):pi(e):r>=s.viewTo?(o=hi(e,t,t,-1))?(s.view=s.view.slice(0,o.index),s.viewTo=o.lineN):pi(e):(a=hi(e,t,t,-1),l=hi(e,r,r+i,1),a&&l?(s.view=s.view.slice(0,a.index).concat(lr(e,a.lineN,l.lineN)).concat(s.view.slice(l.index)),s.viewTo+=i):pi(e));var c=s.externalMeasured;c&&(r<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(s.externalMeasured=null))}function di(e,t,r){e.curOp.viewChanged=!0;var i,n,o=e.display,a=e.display.externalMeasured;a&&t>=a.lineN&&t<a.lineN+a.size&&(o.externalMeasured=null),t<o.viewFrom||t>=o.viewTo||null==(i=o.view[ci(e,t)]).node||-1==z(n=i.changes||(i.changes=[]),r)&&n.push(r)}function pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hi(e,t,r,i){var n,o=ci(e,t),a=e.display.view;if(!Et||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(0<i){if(o==a.length-1)return null;n=l+a[o].size-t,o++}else n=l-t;t+=n,r+=n}for(;Vt(e.doc,r)!=r;){if(o==(i<0?0:a.length-1))return null;r+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:r}}function fi(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var n=t[i];n.hidden||n.node&&!n.changes||++r}return r}function gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mi(e,t){void 0===t&&(t=!0);for(var r,i,n=e.doc,o={},a=o.cursors=document.createDocumentFragment(),l=o.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)!t&&s==n.sel.primIndex||(r=n.sel.ranges[s]).from().line>=e.display.viewTo||r.to().line<e.display.viewFrom||(((i=r.empty())||e.options.showCursorWhenSelecting)&&vi(e,r.head,a),i||yi(e,r,l));return o}function vi(e,t,r){var i,n=Qr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(N("div"," ","ESGMirror-cursor"));o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other&&((i=r.appendChild(N("div"," ","ESGMirror-cursor ESGMirror-secondarycursor"))).style.display="",i.style.left=n.other.left+"px",i.style.top=n.other.top+"px",i.style.height=.85*(n.other.bottom-n.other.top)+"px")}function bi(e,t){return e.top-t.top||e.left-t.left}function yi(e,t,r){var i=e.display,n=e.doc,o=document.createDocumentFragment(),a=Tr(e.display),l=a.left,s=Math.max(i.sizerWidth,Mr(e)-i.sizer.offsetLeft)-a.right,c="ltr"==n.direction;function u(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(N("div",null,"ESGMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?s-e:r)+"px;\n height: "+(i-t)+"px"))}function d(t,r,i){var o,a,d=Ye(n,t),p=d.text.length;function h(r,i){return Kr(e,ot(t,r),"div",d,i)}function f(t,r,i){var n=Jr(e,d,null,t),o="ltr"==r==("after"==i)?"left":"right";return h("after"==i?n.begin:n.end-(/\s/.test(d.text.charAt(n.end-1))?2:1),o)[o]}var g=me(d,n.direction);return function(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var n=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),n=!0)}n||i(t,r,"ltr")}(g,r||0,null==i?p:i,(function(e,t,n,d){var m,v,b,y,k,w,x,C="ltr"==n,S=h(e,C?"left":"right"),L=h(t-1,C?"right":"left"),T=null==r&&0==e,E=null==i&&t==p,M=0==d,N=!g||d==g.length-1;L.top-S.top<=3?(m=(c?E:T)&&N,v=(c?T:E)&&M?l:(C?S:L).left,b=m?s:(C?L:S).right,u(v,S.top,b-v,S.bottom)):(x=C?(y=c&&T&&M?l:S.left,k=c?s:f(e,n,"before"),w=c?l:f(t,n,"after"),c&&E&&N?s:L.right):(y=c?f(e,n,"before"):l,k=!c&&T&&M?s:S.right,w=!c&&E&&N?l:L.left,c?f(t,n,"after"):s),u(y,S.top,k-y,S.bottom),S.bottom<L.top&&u(l,S.bottom,null,L.top),u(w,L.top,x-w,L.bottom)),(!o||bi(S,o)<0)&&(o=S),bi(L,o)<0&&(o=L),(!a||bi(S,a)<0)&&(a=S),bi(L,a)<0&&(a=L)})),{start:o,end:a}}var p,h,f,g,m,v=t.from(),b=t.to();v.line==b.line?d(v.line,v.ch,b.ch):(p=Ye(n,v.line),h=Ye(n,b.line),f=jt(p)==jt(h),g=d(v.line,v.ch,f?p.text.length+1:null).end,m=d(b.line,f?0:null,b.ch).start,f&&(g.top<m.top-2?(u(g.right,g.top,null,g.bottom),u(l,m.top,m.left,m.bottom)):u(g.right,g.top,m.left-g.right,g.bottom)),g.bottom<m.top&&u(l,g.bottom,null,m.top)),r.appendChild(o)}function ki(e){var t,r;e.state.focused&&(t=e.display,clearInterval(t.blinker),r=!0,t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function wi(e){e.state.focused||(e.display.input.focus(),Ci(e))}function xi(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Si(e))}),100)}function Ci(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,A(e.display.wrapper,"ESGMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),ki(e))}function Si(e,t){e.state.delayingBlurEvent||(e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"ESGMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Li(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var n,o,s=t.view[i],c=e.options.lineWrapping,u=void 0,d=0;if(!s.hidden){a&&l<8?(u=(n=s.node.offsetTop+s.node.offsetHeight)-r,r=n):(u=(o=s.node.getBoundingClientRect()).bottom-o.top,!c&&s.text.firstChild&&(d=s.text.firstChild.getBoundingClientRect().right-o.left-1));var p,h=s.line.height-u;if((.005<h||h<-.005)&&(et(s.line,u),Ti(s.line),s.rest))for(var f=0;f<s.rest.length;f++)Ti(s.rest[f]);d>e.display.sizerWidth&&(p=Math.ceil(d/ii(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=s.line,e.display.maxLineChanged=!0)}}}function Ti(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Ei(e,t,r){var i,n,o=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop,a=(o=Math.floor(o-Sr(e)),r&&null!=r.bottom?r.bottom:o+e.wrapper.clientHeight),l=rt(t,o),s=rt(t,a);return r&&r.ensure&&(i=r.ensure.from.line,n=r.ensure.to.line,i<l?s=rt(t,Qt(Ye(t,l=i))+e.wrapper.clientHeight):Math.min(n,t.lastLine())>=s&&(l=rt(t,Qt(Ye(t,n))-e.wrapper.clientHeight),s=n)),{from:l,to:Math.max(s,l+1)}}function Mi(e,t){var r=e.display,i=ri(e.display);t.top<0&&(t.top=0);var n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Nr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l,s=e.doc.height+Lr(r),c=t.top<i,u=t.bottom>s-i;t.top<n?a.scrollTop=c?0:t.top:t.bottom>n+o&&(l=Math.min(t.top,(u?s:t.bottom)-o))!=n&&(a.scrollTop=l);var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=Mr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function Ni(e,t){null!=t&&(Gi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Oi(e){Gi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pi(e,t,r){null==t&&null==r||Gi(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Gi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Ai(e,$r(e,t.from),$r(e,t.to),t.margin))}function Ai(e,t,r,i){var n=Mi(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});Pi(e,n.scrollLeft,n.scrollTop)}function Ii(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||ln(e,{top:t}),Di(e,t,!0),r&&ln(e),tn(e,100))}function Di(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function _i(e,t,r,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,un(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fi(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+Lr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:i,scrollHeight:i+Er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Hi(e,t,r){this.cm=r;var i=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"ESGMirror-vscrollbar"),n=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"ESGMirror-hscrollbar");i.tabIndex=n.tabIndex=-1,e(i),e(n),be(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),be(n,"scroll",(function(){n.clientWidth&&t(n.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Wi(){}function zi(e,t){t=t||Fi(e);var r=e.display.barWidth,i=e.display.barHeight;Ri(e,t);for(var n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++)r!=e.display.barWidth&&e.options.lineWrapping&&Li(e),Ri(e,Fi(e)),r=e.display.barWidth,i=e.display.barHeight}function Ri(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Hi.prototype.update=function(e){var t,r,i=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return n?(this.vert.style.display="block",this.vert.style.bottom=i?o+"px":"0",t=e.viewHeight-(i?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),i?(this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=e.barLeft+"px",r=e.viewWidth-e.barLeft-(n?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+r)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0<e.clientHeight&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:i?o:0}},Hi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hi.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},Hi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function i(){var n=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},Hi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)},Wi.prototype.update=function(){return{bottom:0,right:0}},Wi.prototype.setScrollLeft=function(){},Wi.prototype.setScrollTop=function(){},Wi.prototype.clear=function(){};var Bi={native:Hi,null:Wi};function ji(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Bi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){("horizontal"==r?_i:Ii)(e,t)}),e),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)}var Vi=0;function qi(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vi},t=e.curOp,sr?sr.ops.push(t):t.ownsGroup=sr={ops:[t],delayedCallbacks:[]}}function Ui(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var n=e.ops[i];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(r<t.length)}(r)}finally{sr=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Ki(t[r]);for(var i=0;i<t.length;i++)(n=t[i]).updatedDisplay=n.mustUpdate&&on(n.cm,n.update);for(var n,o=0;o<t.length;o++)Qi(t[o]);for(var a=0;a<t.length;a++)$i(t[a]);for(var l=0;l<t.length;l++)Xi(t[l])}(e)}))}function Ki(e){var t,r,i=e.cm,n=i.display;!(r=(t=i).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Er(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Er(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Xt(i),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&i.options.lineWrapping,e.update=e.mustUpdate&&new nn(i,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qi(e){var t=e.cm,r=t.display;e.updatedDisplay&&Li(t),e.barMeasure=Fi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Er(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function $i(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&_i(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==G();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),!e.updatedDisplay&&e.startHeight==t.doc.height||zi(t,e.barMeasure),e.updatedDisplay&&cn(t,e.barMeasure),e.selectionChanged&&ki(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&wi(e.cm)}function Xi(e){var t,r,i,n,o,a,l,s=e.cm,c=s.display,u=s.doc;e.updatedDisplay&&an(s,e.update),null==c.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null!=e.scrollTop&&Di(s,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&_i(s,e.scrollLeft,!0,!0),e.scrollToPos&&(t=function(e,t,r,i){null==i&&(i=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var n=0;n<5;n++){var o,a=!1,l=Qr(e,t),s=r&&r!=t?Qr(e,r):l,c=Mi(e,o={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-i,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+i}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Ii(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(_i(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return o}(s,pt(u,e.scrollToPos.from),pt(u,e.scrollToPos.to),e.scrollToPos.margin),i=t,xe(r=s,"scrollCursorIntoView")||(o=(n=r.display).sizer.getBoundingClientRect(),a=null,i.top+o.top<0?a=!0:i.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null==a||f||(l=N("div","",null,"position: absolute;\n top: "+(i.top-n.viewOffset-Sr(r.display))+"px;\n height: "+(i.bottom-i.top+Er(r)+n.barHeight)+"px;\n left: "+i.left+"px; width: "+Math.max(2,i.right-i.left)+"px;"),r.display.lineSpace.appendChild(l),l.scrollIntoView(a),r.display.lineSpace.removeChild(l))));var d=e.maybeHiddenMarkers,p=e.maybeUnhiddenMarkers;if(d)for(var h=0;h<d.length;++h)d[h].lines.length||we(d[h],"hide");if(p)for(var g=0;g<p.length;++g)p[g].lines.length&&we(p[g],"unhide");c.wrapper.offsetHeight&&(u.scrollTop=s.display.scroller.scrollTop),e.changeObjs&&we(s,"changes",s,e.changeObjs),e.update&&e.update.finish()}function Yi(e,t){if(e.curOp)return t();qi(e);try{return t()}finally{Ui(e)}}function Zi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qi(e);try{return t.apply(e,arguments)}finally{Ui(e)}}}function Ji(e){return function(){if(this.curOp)return e.apply(this,arguments);qi(this);try{return e.apply(this,arguments)}finally{Ui(this)}}}function en(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qi(t);try{return e.apply(this,arguments)}finally{Ui(t)}}}function tn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(rn,e))}function rn(e){var t,r,i,n=e.doc;n.highlightFrontier>=e.display.viewTo||(t=+new Date+e.options.workTime,r=bt(e,n.highlightFrontier),i=[],n.iter(r.line,Math.min(n.first+n.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Ke(n.mode,r.state):null,s=mt(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<a.length;++p)d=a[p]!=o.styles[p];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&yt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>t)return tn(e,e.options.workDelay),!0})),n.highlightFrontier=r.line,n.modeFrontier=Math.max(n.modeFrontier,r.line),i.length&&Yi(e,(function(){for(var t=0;t<i.length;t++)di(e,i[t],"text")})))}var nn=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Ei(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=r,this.dims=ni(e),this.events=[]};function on(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return pi(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==fi(e))return!1;dn(e)&&(pi(e),t.dims=ni(e));var n=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(n,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(i.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(n,r.viewTo)),Et&&(o=Vt(e.doc,o),a=qt(e.doc,a));var l,c,u,d,p=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;c=o,u=a,0==(d=(l=e).display).view.length||c>=d.viewTo||u<=d.viewFrom?(d.view=lr(l,c,u),d.viewFrom=c):(d.viewFrom>c?d.view=lr(l,c,d.viewFrom).concat(d.view):d.viewFrom<c&&(d.view=d.view.slice(ci(l,c))),d.viewFrom=c,d.viewTo<u?d.view=d.view.concat(lr(l,d.viewTo,u)):d.viewTo>u&&(d.view=d.view.slice(0,ci(l,u)))),d.viewTo=u,r.viewOffset=Qt(Ye(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var h=fi(e);if(!p&&0==h&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var f,g,m,v=function(e){if(e.hasFocus())return null;var t=G();if(!t||!P(e.display.lineDiv,t))return null;var r,i={activeElt:t};return!window.getSelection||(r=window.getSelection()).anchorNode&&r.extend&&P(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset),i}(e);return 4<h&&(r.lineDiv.style.display="none"),function(e,t,r){var i,n,o,a,l,c=e.display,u=e.options.lineNumbers,d=c.lineDiv,p=d.firstChild;function h(t){var r=t.nextSibling;return s&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var f=c.view,g=c.viewFrom,m=0;m<f.length;m++){var v=f[m];if(!v.hidden)if(v.node&&v.node.parentNode==d){for(;p!=v.node;)p=h(p);var y=u&&null!=t&&t<=g&&v.lineNumber;v.changes&&(-1<z(v.changes,"gutter")&&(y=!1),pr(e,v,g,r)),y&&(E(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(nt(e.options,g)))),p=v.node.nextSibling}else{var k=(o=g,a=r,l=fr(i=e,n=v),n.text=n.node=l.pre,l.bgClass&&(n.bgClass=l.bgClass),l.textClass&&(n.textClass=l.textClass),mr(i,n),vr(i,n,o,a),yr(i,n,a),n.node);d.insertBefore(k,p)}g+=v.size}for(;p;)p=h(p)}(e,r.updateLineNumbers,t.dims),4<h&&(r.lineDiv.style.display=""),r.renderedView=r.view,(f=v)&&f.activeElt&&f.activeElt!=G()&&(f.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(f.activeElt.nodeName)&&f.anchorNode&&P(document.body,f.anchorNode)&&P(document.body,f.focusNode)&&(g=window.getSelection(),(m=document.createRange()).setEnd(f.anchorNode,f.anchorOffset),m.collapse(!1),g.removeAllRanges(),g.addRange(m),g.extend(f.focusNode,f.focusOffset))),E(r.cursorDiv),E(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,p&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,tn(e,400)),!(r.updateLineNumbers=null)}function an(e,t){for(var r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Mr(e))i&&(t.visible=Ei(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Lr(e.display)-Nr(e),r.top)}),t.visible=Ei(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!on(e,t))break;Li(e);var n=Fi(e);gi(e),zi(e,n),cn(e,n),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ln(e,t){var r,i=new nn(e,t);on(e,i)&&(Li(e),an(e,i),r=Fi(e),gi(e),zi(e,r),cn(e,r),i.finish())}function sn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Er(e)+"px"}function un(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=oi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=i+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+n+"px")}}function dn(e){if(e.options.lineNumbers){var t=e.doc,r=nt(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(N("div",[N("div",r)],"ESGMirror-linenumber ESGMirror-gutter-elt")),o=n.firstChild.offsetWidth,a=n.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",sn(e.display),1}}}function pn(e,t){for(var r=[],i=!1,n=0;n<e.length;n++){var o=e[n],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"ESGMirror-linenumbers"==o){if(!t)continue;i=!0}r.push({className:o,style:a})}return t&&!i&&r.push({className:"ESGMirror-linenumbers",style:null}),r}function hn(e){var t=e.gutters,r=e.gutterSpecs;E(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var n=r[i],o=n.className,a=n.style,l=t.appendChild(N("div",null,"ESGMirror-gutter "+o));a&&(l.style.cssText=a),"ESGMirror-linenumbers"==o&&((e.lineGutter=l).style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",sn(e)}function fn(e){hn(e.display),ui(e),un(e)}function gn(e,t,i,n){var o=this;this.input=i,o.scrollbarFiller=N("div",null,"ESGMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=N("div",null,"ESGMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=O("div",null,"ESGMirror-code"),o.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=N("div",null,"ESGMirror-cursors"),o.measure=N("div",null,"ESGMirror-measure"),o.lineMeasure=N("div",null,"ESGMirror-measure"),o.lineSpace=O("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=O("div",[o.lineSpace],"ESGMirror-lines");o.mover=N("div",[c],null,"position: relative"),o.sizer=N("div",[o.mover],"ESGMirror-sizer"),o.sizerWidth=null,o.heightForcer=N("div",null,null,"position: absolute; height: "+R+"px; width: 1px;"),o.gutters=N("div",null,"ESGMirror-gutters"),o.lineGutter=null,o.scroller=N("div",[o.sizer,o.heightForcer,o.gutters],"ESGMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=N("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"ESGMirror"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||r&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pn(n.gutters,n.lineNumbers),hn(o),i.init(o)}nn.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},nn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};var mn=0,vn=null;function bn(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function yn(e,t){var i,n,o,a=bn(t),l=a.x,c=a.y,u=e.display,p=u.scroller,h=p.scrollWidth>p.clientWidth,f=p.scrollHeight>p.clientHeight;if(l&&h||c&&f){if(c&&b&&s)e:for(var g=t.target,m=u.view;g!=p;g=g.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==g){e.display.currentWheelTarget=g;break e}if(l&&!r&&!d&&null!=vn)return c&&f&&Ii(e,Math.max(0,p.scrollTop+c*vn)),_i(e,Math.max(0,p.scrollLeft+l*vn)),(!c||c&&f)&&Te(t),void(u.wheelStartX=null);c&&null!=vn&&(i=c*vn,o=(n=e.doc.scrollTop)+u.wrapper.clientHeight,i<0?n=Math.max(0,n+i-50):o=Math.min(e.doc.height,o+i+50),ln(e,{top:n,bottom:o})),mn<20&&(null==u.wheelStartX?(u.wheelStartX=p.scrollLeft,u.wheelStartY=p.scrollTop,u.wheelDX=l,u.wheelDY=c,setTimeout((function(){var e,t,r;null!=u.wheelStartX&&(e=p.scrollLeft-u.wheelStartX,r=(t=p.scrollTop-u.wheelStartY)&&u.wheelDY&&t/u.wheelDY||e&&u.wheelDX&&e/u.wheelDX,u.wheelStartX=u.wheelStartY=null,r&&(vn=(vn*mn+r)/(mn+1),++mn))}),200)):(u.wheelDX+=l,u.wheelDY+=c))}}a?vn=-.53:r?vn=15:u?vn=-.7:p&&(vn=-1/3);var kn=function(e,t){this.ranges=e,this.primIndex=t};kn.prototype.primary=function(){return this.ranges[this.primIndex]},kn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(!lt(r.anchor,i.anchor)||!lt(r.head,i.head))return!1}return!0},kn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(st(this.ranges[t].anchor),st(this.ranges[t].head));return new kn(e,this.primIndex)},kn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},kn.prototype.contains=function(e,t){t=t||e;for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(0<=at(t,i.from())&&at(e,i.to())<=0)return r}return-1};var wn=function(e,t){this.anchor=e,this.head=t};function xn(e,t,r){var i=e&&e.options.selectionsMayTouch,n=t[r];t.sort((function(e,t){return at(e.from(),t.from())})),r=z(t,n);for(var o=1;o<t.length;o++){var a,l,s,c=t[o],u=t[o-1],d=at(u.to(),c.from());(i&&!c.empty()?0<d:0<=d)&&(a=ut(u.from(),c.from()),l=ct(u.to(),c.to()),s=u.empty()?c.from()==c.head:u.from()==u.head,o<=r&&--r,t.splice(--o,2,new wn(s?l:a,s?a:l)))}return new kn(t,r)}function Cn(e,t){return new kn([new wn(e,t||e)],0)}function Sn(e){return e.text?ot(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ln(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return Sn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Sn(t).ch-t.to.ch),ot(r,i)}function Tn(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var n=e.sel.ranges[i];r.push(new wn(Ln(n.anchor,t),Ln(n.head,t)))}return xn(e.cm,r,e.sel.primIndex)}function En(e,t,r){return e.line==t.line?ot(r.line,e.ch-t.ch+r.ch):ot(r.line+(e.line-t.line),e.ch)}function Mn(e){e.doc.mode=qe(e.options,e.doc.modeOption),Nn(e)}function Nn(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,tn(e,100),e.state.modeGen++,e.curOp&&ui(e)}function On(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Pn(e,t,r,i){function n(e){return r?r[e]:null}function o(e,r,n){!function(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),At(e),It(e,r);var n=i?i(e):1;n!=e.height&&et(e,n)}(e,r,n,i),ur(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Yt(p[o],n(o),i));return r}var l,s,c,u=t.from,d=t.to,p=t.text,h=Ye(e,u.line),f=Ye(e,d.line),g=$(p),m=n(p.length-1),v=d.line-u.line;t.full?(e.insert(0,a(0,p.length)),e.remove(p.length,e.size-p.length)):On(e,t)?(l=a(0,p.length-1),o(f,f.text,m),v&&e.remove(u.line,v),l.length&&e.insert(u.line,l)):h==f?1==p.length?o(h,h.text.slice(0,u.ch)+g+h.text.slice(d.ch),m):((s=a(1,p.length-1)).push(new Yt(g+h.text.slice(d.ch),m,i)),o(h,h.text.slice(0,u.ch)+p[0],n(0)),e.insert(u.line+1,s)):1==p.length?(o(h,h.text.slice(0,u.ch)+p[0]+f.text.slice(d.ch),n(0)),e.remove(u.line+1,v)):(o(h,h.text.slice(0,u.ch)+p[0],n(0)),o(f,g+f.text.slice(d.ch),m),c=a(1,p.length-1),1<v&&e.remove(u.line+1,v-1),e.insert(u.line+1,c)),ur(e,"change",e,t)}function Gn(e,t,r){!function e(i,n,o){if(i.linked)for(var a=0;a<i.linked.length;++a){var l,s=i.linked[a];s.doc!=n&&(l=o&&s.sharedHist,r&&!l||(t(s.doc,l),e(s.doc,i,l)))}}(e,null,!0)}function An(e,t){if(t.cm)throw new Error("This document is already in use.");li((e.doc=t).cm=e),Mn(e),In(e),e.options.lineWrapping||Xt(e),e.options.mode=t.modeOption,ui(e)}function In(e){("rtl"==e.doc.direction?A:T)(e.display.lineDiv,"ESGMirror-rtl")}function Dn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function _n(e,t){var r={from:st(t.from),to:Sn(t),text:Ze(e,t.from,t.to)};return zn(e,r,t.from.line,t.to.line+1),Gn(e,(function(e){return zn(e,r,t.from.line,t.to.line+1)}),!0),r}function Fn(e){for(;e.length&&$(e).ranges;)e.pop()}function Hn(e,t,r,i){var n=e.history;n.undone.length=0;var o,a,l,s=+new Date;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&n.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(l=n).lastOp==i?(Fn(l.done),$(l.done)):l.done.length&&!$(l.done).ranges?$(l.done):1<l.done.length&&!l.done[l.done.length-2].ranges?(l.done.pop(),$(l.done)):void 0))a=$(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=Sn(t):o.changes.push(_n(e,t));else{var c=$(n.done);for(c&&c.ranges||Wn(e.sel,n.done),o={changes:[_n(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(r),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=s,n.lastOp=n.lastSelOp=i,n.lastOrigin=n.lastSelOrigin=t.origin,a||we(e,"historyAdded")}function Wn(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function zn(e,t,r,i){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),(function(r){r.markedSpans&&((n=n||(t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Rn(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t=t||e.slice(0,r):t&&t.push(e[r]);return t?t.length?t:null:e}function Bn(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],n=0;n<t.text.length;++n)i.push(Rn(r[n]));return i}(e,t),i=Pt(e,t);if(!r)return i;if(!i)return r;for(var n=0;n<r.length;++n){var o=r[n],a=i[n];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[n]=a)}return r}function jn(e,t,r){for(var i=[],n=0;n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?kn.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&-1<z(t,Number(u[1]))&&($(l)[d]=c[d],delete c[d])}}}return i}function Vn(e,t,r,i){if(i){var n,o=e.anchor;return r&&((n=at(t,o)<0)!=at(r,o)<0?(o=t,t=r):n!=at(t,r)<0&&(t=r)),new wn(o,t)}return new wn(r||t,t)}function qn(e,t,r,i,n){null==n&&(n=e.cm&&(e.cm.display.shift||e.extend)),Xn(e,new kn([Vn(e.sel.primary(),t,r,n)],0),i)}function Un(e,t,r){for(var i=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=Vn(e.sel.ranges[o],t[o],null,n);Xn(e,xn(e.cm,i,e.sel.primIndex),r)}function Kn(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r,Xn(e,xn(e.cm,n,e.sel.primIndex),i)}function Qn(e,t,r,i){Xn(e,Cn(t,r),i)}function $n(e,t,r){var i=e.history.done,n=$(i);n&&n.ranges?Yn(e,i[i.length-1]=t,r):Xn(e,t,r)}function Xn(e,t,r){Yn(e,t,r),function(e,t,r,i){var n,o,a,l,s,c=e.history,u=i&&i.origin;r==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(n=e,o=u,a=$(c.done),l=t,"*"==(s=o.charAt(0))||"+"==s&&a.ranges.length==l.ranges.length&&a.somethingSelected()==l.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:Wn(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,i&&!1!==i.clearRedo&&Fn(c.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Yn(e,t,r){var i,n,o,a;(Se(e,"beforeSelectionChange")||e.cm&&Se(e.cm,"beforeSelectionChange"))&&(i=e,o=r,a={ranges:(n=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new wn(pt(i,e[t].anchor),pt(i,e[t].head))},origin:o&&o.origin},we(i,"beforeSelectionChange",i,a),i.cm&&we(i.cm,"beforeSelectionChange",i.cm,a),t=a.ranges!=n.ranges?xn(i.cm,a.ranges,a.ranges.length-1):n);var l=r&&r.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);Zn(e,eo(e,t,l,!0)),r&&!1===r.scroll||!e.cm||Oi(e.cm)}function Zn(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),ur(e,"cursorActivity",e))}function Jn(e){Zn(e,eo(e,e.sel,null,!1))}function eo(e,t,r,i){for(var n,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=ro(e,a.anchor,l&&l.anchor,r,i),c=ro(e,a.head,l&&l.head,r,i);!n&&s==a.anchor&&c==a.head||((n=n||t.ranges.slice(0,o))[o]=new wn(s,c))}return n?xn(e.cm,n,t.primIndex):t}function to(e,t,r,i,n){var o=Ye(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(n&&(we(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var d=s.find(i<0?1:-1),p=void 0;if((i<0?u:c)&&(d=io(e,d,-i,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(p=at(d,r))&&(i<0?p<0:0<p))return to(e,d,t,i,n)}var h=s.find(i<0?-1:1);return(i<0?c:u)&&(h=io(e,h,i,h.line==t.line?o:null)),h?to(e,h,t,i,n):null}}return t}function ro(e,t,r,i,n){var o=i||1;return to(e,t,r,o,n)||!n&&to(e,t,r,o,!0)||to(e,t,r,-o,n)||!n&&to(e,t,r,-o,!0)||(e.cantEdit=!0,ot(e.first,0))}function io(e,t,r,i){return r<0&&0==t.ch?t.line>e.first?pt(e,ot(t.line-1)):null:0<r&&t.ch==(i||Ye(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+r)}function no(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),j)}function oo(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(t,r,n,o){t&&(i.from=pt(e,t)),r&&(i.to=pt(e,r)),n&&(i.text=n),void 0!==o&&(i.origin=o)}),we(e,"beforeChange",e,i),e.cm&&we(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ao(e,t,r){if(e.cm){if(!e.cm.curOp)return Zi(e.cm,ao)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"))||(t=oo(e,t,!0))){var i=Tt&&!r&&function(e,t,r){var i=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||i&&-1!=z(i,r)||(i=i||[]).push(r)}})),!i)return null;for(var n=[{from:t,to:r}],o=0;o<i.length;++o)for(var a=i[o],l=a.find(0),s=0;s<n.length;++s){var c,u,d,p=n[s];at(p.to,l.from)<0||0<at(p.from,l.to)||(c=[s,1],u=at(p.from,l.from),d=at(p.to,l.to),(u<0||!a.inclusiveLeft&&!u)&&c.push({from:p.from,to:l.from}),(0<d||!a.inclusiveRight&&!d)&&c.push({from:l.to,to:p.to}),n.splice.apply(n,c),s+=c.length-3)}return n}(e,t.from,t.to);if(i)for(var n=i.length-1;0<=n;--n)lo(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin});else lo(e,t)}}function lo(e,t){var r,i;1==t.text.length&&""==t.text[0]&&0==at(t.from,t.to)||(r=Tn(e,t),Hn(e,t,r,e.cm?e.cm.curOp.id:NaN),uo(e,t,r,Pt(e,t)),i=[],Gn(e,(function(e,r){r||-1!=z(i,e.history)||(go(e.history,t),i.push(e.history)),uo(e,t,null,Pt(e,t))})))}function so(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(!i||r){for(var n,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,c=0;c<l.length&&(n=l[c],r?!n.ranges||n.equals(e.sel):n.ranges);c++);if(c!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(n=l.pop()).ranges){if(i)return void l.push(n);break}if(Wn(n,s),r&&!n.equals(e.sel))return void Xn(e,n,{clearRedo:!1});a=n}var u=[];Wn(a,s),s.push({changes:u,generation:o.generation}),o.generation=n.generation||++o.maxGeneration;for(var d=Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"),p=function(r){var i=n.changes[r];if(i.origin=t,d&&!oo(e,i,!1))return l.length=0,{};u.push(_n(e,i));var o=r?Tn(e,i):$(l);uo(e,i,o,Bn(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Sn(i)});var a=[];Gn(e,(function(e,t){t||-1!=z(a,e.history)||(go(e.history,i),a.push(e.history)),uo(e,i,null,Bn(e,i))}))},h=n.changes.length-1;0<=h;--h){var f=p(h);if(f)return f.v}}}}function co(e,t){if(0!=t&&(e.first+=t,e.sel=new kn(X(e.sel.ranges,(function(e){return new wn(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){ui(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)di(e.cm,i,"gutter")}}function uo(e,t,r,i){if(e.cm&&!e.cm.curOp)return Zi(e.cm,uo)(e,t,r,i);var n,o;t.to.line<e.first?co(e,t.text.length-1-(t.to.line-t.from.line)):t.from.line>e.lastLine()||(t.from.line<e.first&&(co(e,n=t.text.length-1-(e.first-t.from.line)),t={from:ot(e.first,0),to:ot(t.to.line+n,t.to.ch),text:[$(t.text)],origin:t.origin}),o=e.lastLine(),t.to.line>o&&(t={from:t.from,to:ot(o,Ye(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),r=r||Tn(e,t),e.cm?function(e,t,r){var i=e.doc,n=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=tt(jt(Ye(i,o.line))),i.iter(s,a.line+1,(function(e){if(e==n.maxLine)return l=!0}))),-1<i.sel.contains(t.from,t.to)&&Ce(e),Pn(i,t,r,ai(e)),e.options.lineWrapping||(i.iter(s,o.line+t.text.length,(function(e){var t=$t(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,i=t-1;r<i;i--){var n=Ye(e,i).stateAfter;if(n&&(!(n instanceof ft)||i+n.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(i,o.line),tn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?ui(e):o.line!=a.line||1!=t.text.length||On(e.doc,t)?ui(e,o.line,a.line+1,c):di(e,o.line,"text");var u,d=Se(e,"changes"),p=Se(e,"change");(p||d)&&(u={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin},p&&ur(e,"change",e,u),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(u)),e.display.selForContextMenu=null}(e.cm,t,i):Pn(e,t,i),Yn(e,r,j),e.cantEdit&&ro(e,ot(e.firstLine(),0))&&(e.cantEdit=!1))}function po(e,t,r,i,n){var o;at(i=i||r,r)<0&&(r=(o=[i,r])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ao(e,{from:r,to:i,text:t,origin:n})}function ho(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function fo(e,t,r,i){for(var n=0;n<e.length;++n){var o=e[n],a=!0;if(o.ranges){o.copied||((o=e[n]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)ho(o.ranges[l].anchor,t,r,i),ho(o.ranges[l].head,t,r,i)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=ot(c.from.line+i,c.from.ch),c.to=ot(c.to.line+i,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,n+1),n=0)}}}function go(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;fo(e.done,r,i,n),fo(e.undone,r,i,n)}function mo(e,t,r,i){var n=t,o=t;return"number"==typeof t?o=Ye(e,dt(e,t)):n=tt(t),null==n?null:(i(o,n)&&e.cm&&di(e.cm,n,r),o)}function vo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function bo(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var n=e[i];t+=n.chunkSize(),r+=n.height,n.parent=this}this.size=t,this.height=r,this.parent=null}function yo(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t}function ko(e,t,r){Qt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ni(e,r)}wn.prototype.from=function(){return ut(this.anchor,this.head)},wn.prototype.to=function(){return ct(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},vo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,i=e,n=e+t;i<n;++i){var o=this.lines[i];this.height-=o.height,(r=o).parent=null,At(r),ur(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}},bo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r,i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<o){var a=Math.min(t,o-e),l=n.height;if(n.removeInner(e,a),this.height-=l-n.height,o==a&&(this.children.splice(i--,1),n.parent=null),0==(t-=a))break;e=0}else e-=o}this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof vo))&&(r=[],this.collapse(r),this.children=[new vo(r)],this.children[0].parent=this)},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<=o){if(n.insertInner(e,t,r),n.lines&&50<n.lines.length){for(var a=n.lines.length%25+25,l=a;l<n.lines.length;){var s=new vo(n.lines.slice(l,l+=25));n.height-=s.height,this.children.splice(++i,0,s),s.parent=this}n.lines=n.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t,r,i=new bo(e.children.splice(e.children.length-5,5));e.parent?(e.size-=i.size,e.height-=i.height,t=z(e.parent.children,e),e.parent.children.splice(t+1,0,i)):(((r=new bo(e.children)).parent=e).children=[r,i],e=r),i.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<o){var a=Math.min(t,o-e);if(n.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}},yo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=tt(r);if(null!=i&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(r.widgets=null);var o=xr(this);et(r,Math.max(0,r.height-o)),e&&(Yi(e,(function(){ko(e,r,-o),di(e,i,"widget")})),ur(e,"lineWidgetCleared",e,this,i))}},yo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var n=xr(this)-t;n&&(Ut(this.doc,i)||et(i,i.height+n),r&&Yi(r,(function(){r.curOp.forceUpdate=!0,ko(r,i,n),ur(r,"lineWidgetChanged",r,e,tt(i))})))},Le(yo);var wo=0,xo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++wo};function Co(e,t,r,i,n){if(i&&i.shared)return function(e,t,r,i,n){(i=F(i)).shared=!1;var o=[Co(e,t,r,i,n)],a=o[0],l=i.widgetNode;return Gn(e,(function(e){l&&(i.widgetNode=l.cloneNode(!0)),o.push(Co(e,pt(e,t),pt(e,r),i,n));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=$(o)})),new So(o,a)}(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return Zi(e.cm,Co)(e,t,r,i,n);var o=new xo(e,n),a=at(t,r);if(i&&F(i,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"ESGMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Bt(e,t.line,t,r,o)||t.line!=r.line&&Bt(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Et=!0}o.addToHistory&&Hn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,r.line+1,(function(e){var i,n;c&&o.collapsed&&!c.options.lineWrapping&&jt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&et(e,0),i=e,n=new Mt(o,s==t.line?t.ch:null,s==r.line?r.ch:null),i.markedSpans=i.markedSpans?i.markedSpans.concat([n]):[n],n.marker.attachLine(i),++s})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Ut(e,t)&&et(t,0)})),o.clearOnEnter&&be(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++wo,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)ui(c,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=r.line;u++)di(c,u,"text");o.atomic&&Jn(c.doc),ur(c,"markerAdded",c,o)}return o}xo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t,r=this.doc.cm,i=r&&!r.curOp;i&&qi(r),!Se(this,"clear")||(t=this.find())&&ur(this,"clear",t.from,t.to);for(var n=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=Nt(l.markedSpans,e);r&&!e.collapsed?di(r,tt(l),"text"):r&&(null!=s.to&&(o=tt(l)),null!=s.from&&(n=tt(l))),l.markedSpans=Ot(l.markedSpans,s),null==s.from&&e.collapsed&&!Ut(e.doc,l)&&r&&et(l,ri(r.display))}if(r&&this.collapsed&&!r.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=jt(e.lines[c]),d=$t(u);d>r.display.maxLineLength&&(r.display.maxLine=u,r.display.maxLineLength=d,r.display.maxLineChanged=!0)}null!=n&&r&&this.collapsed&&ui(r,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,r&&Jn(r.doc)),r&&ur(r,"markerCleared",r,this,n,o),i&&Ui(r),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var r,i;null==e&&"bookmark"==this.type&&(e=1);for(var n=0;n<this.lines.length;++n){var o=this.lines[n],a=Nt(o.markedSpans,this);if(null!=a.from&&(r=ot(t?o:tt(o),a.from),-1==e))return r;if(null!=a.to&&(i=ot(t?o:tt(o),a.to),1==e))return i}return r&&{from:r,to:i}},xo.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;t&&i&&Yi(i,(function(){var n,o,a=t.line,l=tt(t.line),s=Gr(i,l);s&&(Wr(s),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,Ut(r.doc,a)||null==r.height||(n=r.height,r.height=null,(o=xr(r)-n)&&et(a,a.height+o)),ur(i,"markerChanged",i,e)}))},xo.prototype.attachLine=function(e){var t;!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers&&-1!=z(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)),this.lines.push(e)},xo.prototype.detachLine=function(e){var t;this.lines.splice(z(this.lines,e),1),!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)},Le(xo);var So=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Lo(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function To(e){for(var t=function(t){var r=e[t],i=[r.primary.doc];Gn(r.primary.doc,(function(e){return i.push(e)}));for(var n=0;n<r.markers.length;n++){var o=r.markers[n];-1==z(i,o.doc)&&(o.parent=null,r.markers.splice(n--,1))}},r=0;r<e.length;r++)t(r)}So.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ur(this,"clear")}},So.prototype.find=function(e,t){return this.primary.find(e,t)},Le(So);var Eo=0,Mo=function(e,t,r,i,n){if(!(this instanceof Mo))return new Mo(e,t,r,i,n);null==r&&(r=0),bo.call(this,[new vo([new Yt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ot(r,0);this.sel=Cn(o),this.history=new Dn(null),this.id=++Eo,this.modeOption=t,this.lineSep=i,this.direction="rtl"==n?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Pn(this,{from:o,to:o,text:e}),Xn(this,Cn(o),j)};Mo.prototype=Z(bo.prototype,{constructor:Mo,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Je(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:en((function(e){var t=ot(this.first,0),r=this.first+this.size-1;ao(this,{from:t,to:ot(r,Ye(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pi(this.cm,0,0),Xn(this,Cn(t),j)})),replaceRange:function(e,t,r,i){po(this,e,t=pt(this,t),r=r?pt(this,r):t,i)},getRange:function(e,t,r){var i=Ze(this,pt(this,e),pt(this,t));return!1===r?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(it(this,e))return Ye(this,e)},getLineNumber:tt,getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ye(this,e)),jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:en((function(e,t,r){Qn(this,pt(this,"number"==typeof e?ot(e,t||0):e),null,r)})),setSelection:en((function(e,t,r){Qn(this,pt(this,e),pt(this,t||e),r)})),extendSelection:en((function(e,t,r){qn(this,pt(this,e),t&&pt(this,t),r)})),extendSelections:en((function(e,t){Un(this,ht(this,e),t)})),extendSelectionsBy:en((function(e,t){Un(this,ht(this,X(this.sel.ranges,e)),t)})),setSelections:en((function(e,t,r){if(e.length){for(var i=[],n=0;n<e.length;n++)i[n]=new wn(pt(this,e[n].anchor),pt(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Xn(this,xn(this.cm,i,t),r)}})),addSelection:en((function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new wn(pt(this,e),pt(this,t||e))),Xn(this,xn(this.cm,i,i.length-1),r)})),getSelection:function(e){for(var t=this.sel.ranges,r=0;r<t.length;r++)var i=Ze(this,t[r].from(),t[r].to()),n=n?n.concat(i):i;return!1===e?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var n=Ze(this,r[i].from(),r[i].to());!1!==e&&(n=n.join(e||this.lineSeparator())),t[i]=n}return t},replaceSelection:function(e,t,r){for(var i=[],n=0;n<this.sel.ranges.length;n++)i[n]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:en((function(e,t,r){for(var i=[],n=this.sel,o=0;o<n.ranges.length;o++){var a=n.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var i=[],n=d=ot(e.first,0),o=0;o<t.length;o++){var a,l,s=t[o],c=En(s.from,d,n),u=En(Sn(s),d,n),d=s.to;n=u;"around"==r?(l=at((a=e.sel.ranges[o]).head,a.anchor)<0,i[o]=new wn(l?u:c,l?c:u)):i[o]=new wn(c,c)}return new kn(i,e.sel.primIndex)}(this,i,t),s=i.length-1;0<=s;s--)ao(this,i[s]);l?$n(this,l):this.cm&&Oi(this.cm)})),undo:en((function(){so(this,"undo")})),redo:en((function(){so(this,"redo")})),undoSelection:en((function(){so(this,"undo",!0)})),redoSelection:en((function(){so(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Dn(this.history.maxGeneration),Gn(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:jn(this.history.done),undone:jn(this.history.undone)}},setHistory:function(e){var t=this.history=new Dn(this.history.maxGeneration);t.done=jn(e.done.slice(0),null,!0),t.undone=jn(e.undone.slice(0),null,!0)},setGutterMarker:en((function(e,t,r){return mo(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return!(i[t]=r)&&re(i)&&(e.gutterMarkers=null),1}))})),clearGutter:en((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&mo(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,re(r.gutterMarkers)&&(r.gutterMarkers=null),1}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!it(this,e))return null;if(!(e=Ye(this,t=e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:en((function(e,t,r){return mo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(S(r).test(e[i]))return;e[i]+=" "+r}else e[i]=r;return 1}))})),removeLineClass:en((function(e,t,r){return mo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",n=e[i];if(n){if(null==r)e[i]=null;else{var o=n.match(S(r));if(!o)return;var a=o.index+o[0].length;e[i]=n.slice(0,o.index)+(o.index&&a!=n.length?" ":"")+n.slice(a)||null}return 1}}))})),addLineWidget:en((function(e,t,r){return n=e,o=new yo(i=this,t,r),(a=i.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),mo(i,n,"widget",(function(e){var t,r=e.widgets||(e.widgets=[]);return null==o.insertAt?r.push(o):r.splice(Math.min(r.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ut(i,e)&&(t=Qt(e)<i.scrollTop,et(e,e.height+xr(o)),t&&Ni(a,o.height),a.curOp.forceUpdate=!0),1})),a&&ur(a,"lineWidgetAdded",a,o,"number"==typeof n?n:tt(n)),o;var i,n,o,a})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Co(this,pt(this,e),pt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Co(this,e=pt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Ye(this,(e=pt(this,e)).line).markedSpans;if(r)for(var i=0;i<r.length;++i){var n=r[i];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var i=[],n=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&n==e.line&&e.ch>=s.to||null==s.from&&n!=e.line||null!=s.from&&n==t.line&&s.from>=t.ch||r&&!r(s.marker)||i.push(s.marker.parent||s.marker)}++n})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)null!=r[i].from&&e.push(r[i].marker)})),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter((function(n){var o=n.text.length+i;if(e<o)return t=e,!0;e-=o,++r})),pt(this,ot(r,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Mo(Je(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e=e||{};var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var i=new Mo(Je(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var i,n=t[r],o=n.find(),a=e.clipPos(o.from),l=e.clipPos(o.to);at(a,l)&&(i=Co(e,a,l,n.primary,n.primary.type),n.markers.push(i),i.parent=n)}}(i,Lo(this)),i},unlinkDoc:function(e){var t;if(e instanceof ka&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r)if(this.linked[r].doc==e){this.linked.splice(r,1),e.unlinkDoc(this),To(Lo(this));break}e.history==this.history&&(t=[e.id],Gn(e,(function(e){return t.push(e.id)}),!0),e.history=new Dn(null),e.history.done=jn(this.history.done,t),e.history.undone=jn(this.history.undone,t))},iterLinkedDocs:function(e){Gn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):He(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:en((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Yi(t=this.cm,(function(){In(t),ui(t)})))}))}),Mo.prototype.eachLine=Mo.prototype.iter;var No=0;function Oo(e){var t=this;if(Po(t),!xe(t,e)&&!Cr(t.display,e)){Te(e),a&&(No=+new Date);var r=si(t,e,!0),i=e.dataTransfer.files;if(r&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var n=i.length,o=Array(n),l=0,s=function(){++l==n&&Zi(t,(function(){var e={from:r=pt(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ao(t.doc,e),$n(t.doc,Cn(pt(t.doc,r),pt(t.doc,Sn(e))))}))()},c=function(e,r){var i;t.options.allowDropFileTypes&&-1==z(t.options.allowDropFileTypes,e.type)?s():((i=new FileReader).onerror=s,i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[r]=e),s()},i.readAsText(e))},u=0;u<i.length;u++)c(i[u],u);else{if(t.state.draggingText&&-1<t.doc.sel.contains(r))return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d,p=e.dataTransfer.getData("Text");if(p){if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Yn(t.doc,Cn(r,r)),d)for(var h=0;h<d.length;++h)po(t.doc,"",d[h].anchor,d[h].head,"drag");t.replaceSelection(p,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Po(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Go(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("ESGMirror"),r=[],i=0;i<t.length;i++){var n=t[i].ESGMirror;n&&r.push(n)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Ao=!1;function Io(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Do={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:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},_o=0;_o<10;_o++)Do[_o+48]=Do[_o+96]=String(_o);for(var Fo=65;Fo<=90;Fo++)Do[Fo]=String.fromCharCode(Fo);for(var Ho=1;Ho<=12;Ho++)Do[Ho+111]=Do[Ho+63235]="F"+Ho;var Wo={};function zo(e){var t,r,i,n,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))n=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),n&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ro(e,t,r,i){var n=(t=qo(t)).call?t.call(e,i):t[e];if(!1===n)return"nothing";if("..."===n)return"multi";if(null!=n&&r(n))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ro(e,t.fallthrough,r,i);for(var o=0;o<t.fallthrough.length;o++){var a=Ro(e,t.fallthrough[o],r,i);if(a)return a}}}function Bo(e){var t="string"==typeof e?e:Do[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function jo(e,t,r){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Cmd"!=i&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Vo(e,t){if(d&&34==e.keyCode&&e.char)return!1;var r=Do[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),jo(r,e,t))}function qo(e){return"string"==typeof e?Wo[e]:e}function Uo(e,t){for(var r=e.doc.sel.ranges,i=[],n=0;n<r.length;n++){for(var o=t(r[n]);i.length&&at(o.from,$(i).to)<=0;){var a=i.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Yi(e,(function(){for(var t=i.length-1;0<=t;t--)po(e.doc,"",i[t].from,i[t].to,"+delete");Oi(e)}))}function Ko(e,t,r){var i=oe(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Qo(e,t,r){var i=Ko(e,t.ch,r);return null==i?null:new ot(t.line,i,r<0?"after":"before")}function $o(e,t,r,i,n){if(e){"rtl"==t.doc.direction&&(n=-n);var o=me(r,t.doc.direction);if(o){var a,l,s,c=n<0?$(o):o[0],u=n<0==(1==c.level)?"after":"before";return 0<c.level||"rtl"==t.doc.direction?(a=Ar(t,r),l=n<0?r.text.length-1:0,s=Ir(t,a,l).top,l=ae((function(e){return Ir(t,a,e).top==s}),n<0==(1==c.level)?c.from:c.to-1,l),"before"==u&&(l=Ko(r,l,1))):l=n<0?c.to:c.from,new ot(i,l,u)}}return new ot(i,n<0?r.text.length:0,n<0?"before":"after")}Wo.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"},Wo.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"},Wo.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"},Wo.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"]},Wo.default=b?Wo.macDefault:Wo.pcDefault;var Xo={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return Uo(e,(function(t){if(t.empty()){var r=Ye(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Uo(e,(function(t){return{from:ot(t.from().line,0),to:pt(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return Uo(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Uo(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Uo(e,(function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Yo(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return Zo(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Ye(e.doc,t),i=function(e){for(var t;t=zt(e);)e=t.find(1,!0).line;return e}(r);return i!=r&&(t=tt(i)),$o(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),q)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),q)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?Zo(e,t.head):i}),q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),i=e.options.tabSize,n=0;n<r.length;n++){var o=r[n].from(),a=H(e.getLine(o.line),o.ch,i);t.push(Q(i-a%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Yi(e,(function(){for(var t,r,i,n=e.listSelections(),o=[],a=0;a<n.length;a++)n[a].empty()&&(t=n[a].head,(r=Ye(e.doc,t.line).text)&&(t.ch==r.length&&(t=new ot(t.line,t.ch-1)),0<t.ch?(t=new ot(t.line,t.ch+1),e.replaceRange(r.charAt(t.ch-1)+r.charAt(t.ch-2),ot(t.line,t.ch-2),t,"+transpose")):t.line>e.doc.first&&(i=Ye(e.doc,t.line-1).text)&&(t=new ot(t.line,1),e.replaceRange(r.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),ot(t.line-1,i.length-1),t,"+transpose"))),o.push(new wn(t,t)));e.setSelections(o)}))},newlineAndIndent:function(e){return Yi(e,(function(){for(var t=e.listSelections(),r=t.length-1;0<=r;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Oi(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Yo(e,t){var r=Ye(e.doc,t),i=jt(r);return i!=r&&(t=tt(i)),$o(!0,e,i,t,1)}function Zo(e,t){var r=Yo(e,t.line),i=Ye(e.doc,r.line),n=me(i,e.doc.direction);if(n&&0!=n[0].level)return r;var o=Math.max(r.ch,i.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ot(r.line,a?0:o,r.sticky)}function Jo(e,t,r){if("string"==typeof t&&!(t=Xo[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),n=t(e)!=B}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}var ea=new W;function ta(e,t,r,i){var n=e.state.keySeq;if(n){if(Bo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ea.set(50,(function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())})),ra(e,n+" "+t,r,i))return!0}return ra(e,t,r,i)}function ra(e,t,r,i){var n=function(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var n=Ro(t,e.state.keyMaps[i],r,e);if(n)return n}return e.options.extraKeys&&Ro(t,e.options.extraKeys,r,e)||Ro(t,e.options.keyMap,r,e)}(e,t,i);return"multi"==n&&(e.state.keySeq=t),"handled"==n&&ur(e,"keyHandled",e,t,r),"handled"!=n&&"multi"!=n||(Te(r),ki(e)),!!n}function ia(e,t){var r=Vo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ta(e,"Shift-"+r,t,(function(t){return Jo(e,t,!0)}))||ta(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Jo(e,t)})):ta(e,r,t,(function(t){return Jo(e,t)})))}var na=null;function oa(e){var t,i,n,o=this;function s(e){18!=e.keyCode&&e.altKey||(T(n,"ESGMirror-crosshair"),ke(document,"keyup",s),ke(document,"mouseover",s))}e.target&&e.target!=o.display.input.getField()||(o.curOp.focus=G(),xe(o,e)||(a&&l<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,o.display.shift=16==t||e.shiftKey,i=ia(o,e),d&&(na=i?t:null,!i&&88==t&&!ze&&(b?e.metaKey:e.ctrlKey)&&o.replaceSelection("",null,"cut")),r&&!b&&!i&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bESGMirror-crosshair\b/.test(o.display.lineDiv.className)||(A(n=o.display.lineDiv,"ESGMirror-crosshair"),be(document,"keyup",s),be(document,"mouseover",s))))}function aa(e){16==e.keyCode&&(this.doc.sel.shift=!1),xe(this,e)}function la(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Cr(t.display,e)||xe(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var r,i,n=e.keyCode,o=e.charCode;if(d&&n==na)return na=null,void Te(e);d&&(!e.which||e.which<10)&&ia(t,e)||"\b"!=(r=String.fromCharCode(null==o?n:o))&&(ta(i=t,"'"+r+"'",e,(function(e){return Jo(i,e,!0)}))||t.display.input.onKeyPress(e))}}var sa,ca,ua=function(e,t,r){this.time=e,this.pos=t,this.button=r};function da(e){var t,r,i,n,o,c,u=this,d=u.display;xe(u,e)||d.activeTouch&&d.input.supportsTouch()||(d.input.ensurePolled(),d.shift=e.shiftKey,Cr(d,e)?s||(d.scroller.draggable=!1,setTimeout((function(){return d.scroller.draggable=!0}),100)):fa(u,e)||(t=si(u,e),r=Pe(e),i=t?(n=t,o=r,c=+new Date,ca&&ca.compare(c,n,o)?(sa=ca=null,"triple"):sa&&sa.compare(c,n,o)?(ca=new ua(c,n,o),sa=null,"double"):(sa=new ua(c,n,o),ca=null,"single")):"single",window.focus(),1==r&&u.state.selectingText&&u.state.selectingText(e),t&&function(e,t,r,i,n){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),ta(e,jo(o=(1==t?"Left":2==t?"Middle":"Right")+o,n),n,(function(t){if("string"==typeof t&&(t=Xo[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,r)!=B}finally{e.state.suppressEdits=!1}return i}))}(u,r,t,i,e)||(1==r?t?function(e,t,r,i){a?setTimeout(_(wi,e),0):e.curOp.focus=G();var n,o=function(e,t,r){var i,n=e.getOption("configureMouse"),o=n?n(e,t,r):{};return null==o.unit&&(i=y?r.shiftKey&&r.metaKey:r.altKey,o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"),null!=o.extend&&!e.doc.extend||(o.extend=e.doc.extend||r.shiftKey),null==o.addNew&&(o.addNew=b?r.metaKey:r.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(b?r.altKey:r.ctrlKey)),o}(e,r,i),c=e.doc.sel;(e.options.dragDrop&&Ie&&!e.isReadOnly()&&"single"==r&&-1<(n=c.contains(t))&&(at((n=c.ranges[n]).from(),t)<0||0<t.xRel)&&(0<at(n.to(),t)||t.xRel<0)?function(e,t,r,i){var n=e.display,o=!1,c=Zi(e,(function(t){s&&(n.scroller.draggable=!1),e.state.draggingText=!1,ke(n.wrapper.ownerDocument,"mouseup",c),ke(n.wrapper.ownerDocument,"mousemove",u),ke(n.scroller,"dragstart",d),ke(n.scroller,"drop",c),o||(Te(t),i.addNew||qn(e.doc,r,null,null,i.extend),s&&!p||a&&9==l?setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()}),20):n.input.focus())})),u=function(e){o=o||10<=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)},d=function(){return o=!0};s&&(n.scroller.draggable=!0),(e.state.draggingText=c).copy=!i.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),be(n.wrapper.ownerDocument,"mouseup",c),be(n.wrapper.ownerDocument,"mousemove",u),be(n.scroller,"dragstart",d),be(n.scroller,"drop",c),xi(e),setTimeout((function(){return n.input.focus()}),20)}:function(e,t,r,i){var n=e.display,o=e.doc;Te(t);var a,l,s,c=o.sel,u=c.ranges;i.addNew&&!i.extend?(l=o.sel.contains(r),a=-1<l?u[l]:new wn(r,r)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit?(i.addNew||(a=new wn(r,r)),r=si(e,t,!0,!0),l=-1):(s=pa(e,r,i.unit),a=i.extend?Vn(a,s.anchor,s.head,i.extend):s),i.addNew?-1==l?(l=u.length,Xn(o,xn(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):1<u.length&&u[l].empty()&&"char"==i.unit&&!i.extend?(Xn(o,xn(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Kn(o,l,a,V):(Xn(o,new kn([a],l=0),V),c=o.sel);var d=r;var p=n.wrapper.getBoundingClientRect(),h=0;function f(t){e.state.selectingText=!1,h=1/0,t&&(Te(t),n.input.focus()),ke(n.wrapper.ownerDocument,"mousemove",g),ke(n.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var g=Zi(e,(function(t){(0!==t.buttons&&Pe(t)?function t(s){var u,f,g=++h,m=si(e,s,!0,"rectangle"==i.unit);m&&(0!=at(m,d)?(e.curOp.focus=G(),function(t){if(0!=at(d,t))if(d=t,"rectangle"==i.unit){for(var n=[],s=e.options.tabSize,u=H(Ye(o,r.line).text,r.ch,s),p=H(Ye(o,t.line).text,t.ch,s),h=Math.min(u,p),f=Math.max(u,p),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=Ye(o,g).text,b=U(v,h,s);h==f?n.push(new wn(ot(g,b),ot(g,b))):v.length>b&&n.push(new wn(ot(g,b),ot(g,U(v,f,s))))}n.length||n.push(new wn(r,r)),Xn(o,xn(e,c.ranges.slice(0,l).concat(n),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,k=a,w=pa(e,t,i.unit),x=k.anchor,C=(x=0<at(w.anchor,x)?(y=w.head,ut(k.from(),w.anchor)):(y=w.anchor,ct(k.to(),w.head)),c.ranges.slice(0));C[l]=function(e,t){var r=t.anchor,i=t.head,n=Ye(e.doc,r.line);if(0==at(r,i)&&r.sticky==i.sticky)return t;var o=me(n);if(!o)return t;var a=se(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,c,u,d=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==d||d==o.length)return t;var p=o[d+((s=i.line!=r.line?0<(i.line-r.line)*("ltr"==e.doc.direction?1:-1):(u=(c=se(o,i.ch,i.sticky))-a||(i.ch-r.ch)*(1==l.level?-1:1),c==d-1||c==d?u<0:0<u))?-1:0)],h=s==(1==p.level),f=h?p.from:p.to,g=h?"after":"before";return r.ch==f&&r.sticky==g?t:new wn(new ot(r.line,f,g),i)}(e,new wn(pt(o,x),y)),Xn(o,xn(e,C,l),V)}}(m),u=Ei(n,o),(m.line>=u.to||m.line<u.from)&&setTimeout(Zi(e,(function(){h==g&&t(s)})),150)):(f=s.clientY<p.top?-20:s.clientY>p.bottom?20:0)&&setTimeout(Zi(e,(function(){h==g&&(n.scroller.scrollTop+=f,t(s))})),50))}:f)(t)})),m=Zi(e,f);e.state.selectingText=m,be(n.wrapper.ownerDocument,"mousemove",g),be(n.wrapper.ownerDocument,"mouseup",m)})(e,i,t,o)}(u,t,i,e):Oe(e)==d.scroller&&Te(e):2==r?(t&&qn(u.doc,t),setTimeout((function(){return d.input.focus()}),20)):3==r&&(C?u.display.input.onContextMenu(e):xi(u)))))}function pa(e,t,r){if("char"==r)return new wn(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new wn(ot(t.line,0),pt(e.doc,ot(t.line+1,0)));var i=r(e,t);return new wn(i.from,i.to)}function ha(e,t,r,i){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch(t){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Te(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Se(e,r))return Me(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=n)return we(e,r,e,rt(e.doc,o),e.display.gutterSpecs[s].className,t),Me(t)}}function fa(e,t){return ha(e,t,"gutterClick",!0)}function ga(e,t){var r,i;Cr(e.display,t)||(i=t,Se(r=e,"gutterContextMenu")&&ha(r,i,"gutterContextMenu",!1))||xe(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rr(e)}ua.prototype.compare=function(e,t,r){return this.time+400>e&&0==at(t,this.pos)&&r==this.button};var va={toString:function(){return"ESGMirror.Init"}},ba={},ya={};function ka(e,t){var r=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?F(t):{},F(ba,t,!1);var i=t.value;"string"==typeof i?i=new Mo(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var n=new ka.inputStyles[t.inputStyle](this),o=this.display=new gn(e,i,n,t);for(var c in ma(o.wrapper.ESGMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" ESGMirror-wrap"),ji(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 W,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&l<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;be(t.scroller,"mousedown",Zi(e,da)),be(t.scroller,"dblclick",a&&l<11?Zi(e,(function(t){var r,i;xe(e,t)||!(r=si(e,t))||fa(e,t)||Cr(e.display,t)||(Te(t),i=e.findWordAt(r),qn(e.doc,i.anchor,i.head))})):function(t){return xe(e,t)||Te(t)}),be(t.scroller,"contextmenu",(function(t){return ga(e,t)})),be(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||ga(e,r)}));var r,i={end:0};function n(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return 1;var r=t.left-e.left,i=t.top-e.top;return 400<r*r+i*i}be(t.scroller,"touchstart",(function(n){var o;xe(e,n)||function(e){if(1==e.touches.length){var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}}(n)||fa(e,n)||(t.input.ensurePolled(),clearTimeout(r),o=+new Date,t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==n.touches.length&&(t.activeTouch.left=n.touches[0].pageX,t.activeTouch.top=n.touches[0].pageY))})),be(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),be(t.scroller,"touchend",(function(r){var i,a,l=t.activeTouch;l&&!Cr(t,r)&&null!=l.left&&!l.moved&&new Date-l.start<300&&(i=e.coordsChar(t.activeTouch,"page"),a=!l.prev||o(l,l.prev)?new wn(i,i):!l.prev.prev||o(l,l.prev.prev)?e.findWordAt(i):new wn(ot(i.line,0),pt(e.doc,ot(i.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Te(r)),n()})),be(t.scroller,"touchcancel",n),be(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ii(e,t.scroller.scrollTop),_i(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))})),be(t.scroller,"mousewheel",(function(t){return yn(e,t)})),be(t.scroller,"DOMMouseScroll",(function(t){return yn(e,t)})),be(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){xe(e,t)||Ne(t)},over:function(t){var r,i,n;xe(e,t)||((n=si(r=e,t))&&(vi(r,n,i=document.createDocumentFragment()),r.display.dragCursor||(r.display.dragCursor=N("div",null,"ESGMirror-cursors ESGMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),M(r.display.dragCursor,i)),Ne(t))},start:function(t){return r=e,i=t,void(a&&(!r.state.draggingText||new Date-No<100)?Ne(i):xe(r,i)||Cr(r.display,i)||(i.dataTransfer.setData("Text",r.getSelection()),i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setDragImage&&!p&&((n=N("img",null,null,"position: fixed; left: 0; top: 0;")).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,r.display.wrapper.appendChild(n),n._top=n.offsetTop),i.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n))));var r,i,n},drop:Zi(e,Oo),leave:function(t){xe(e,t)||Po(e)}};var s=t.input.getField();be(s,"keyup",(function(t){return aa.call(e,t)})),be(s,"keydown",Zi(e,oa)),be(s,"keypress",Zi(e,la)),be(s,"focus",(function(t){return Ci(e,t)})),be(s,"blur",(function(t){return Si(e,t)}))}(this),function(){var e;Ao||(be(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Go(Io)}),100))})),be(window,"blur",(function(){return Go(Si)})),Ao=!0)}(),qi(this),this.curOp.forceUpdate=!0,An(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout(_(Ci,this),20):Si(this),ya)ya.hasOwnProperty(c)&&ya[c](r,t[c],va);dn(this),t.finishInit&&t.finishInit(this);for(var u=0;u<wa.length;++u)wa[u](r);Ui(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=ba,ka.optionHandlers=ya;var wa=[];function xa(e,t,r,i){var n,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?n=bt(e,t).state:r="prev");var a=e.options.tabSize,l=Ye(o,t),s=H(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(i||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(n,l.text.slice(u.length),l.text))==B||150<c)){if(!i)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?H(Ye(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)p+=a,d+="\t";if(p<c&&(d+=Q(c-p)),d!=u)return po(o,d,ot(t,0),ot(t,u.length),"+input"),!(l.stateAfter=null);for(var f=0;f<o.sel.ranges.length;f++){var g=o.sel.ranges[f];if(g.head.line==t&&g.head.ch<u.length){var m=ot(t,u.length);Kn(o,f,new wn(m,m));break}}}ka.defineInitHook=function(e){return wa.push(e)};var Ca,Sa,La,Ta,Ea,Ma=null;function Na(e){Ma=e}function Oa(e,t,r,i,n){var o=e.doc;e.display.shift=!1,i=i||o.sel;var a=new Date-200,l="paste"==n||e.state.pasteIncoming>a,s=He(t),c=null;if(l&&1<i.ranges.length)if(Ma&&Ma.text.join("\n")==t){if(i.ranges.length%Ma.text.length==0){c=[];for(var u=0;u<Ma.text.length;u++)c.push(o.splitLines(Ma.text[u]))}}else s.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,p=i.ranges.length-1;0<=p;p--){var h=i.ranges[p],f=h.from(),g=h.to();h.empty()&&(r&&0<r?f=ot(f.line,f.ch-r):e.state.overwrite&&!l?g=ot(g.line,Math.min(Ye(o,g.line).text.length,g.ch+$(s).length)):l&&Ma&&Ma.lineWise&&Ma.text.join("\n")==t&&(f=g=ot(f.line,0)));var m={from:f,to:g,text:c?c[p%c.length]:s,origin:n||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};ao(e.doc,m),ur(e,"inputRead",e,m)}t&&!l&&Ga(e,t),Oi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Pa(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");return r&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Yi(t,(function(){return Oa(t,r,0,null,"paste")})),1)}function Ga(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,i=r.ranges.length-1;0<=i;i--){var n=r.ranges[i];if(!(100<n.head.ch||i&&r.ranges[i-1].head.line==n.head.line)){var o=e.getModeAt(n.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(-1<t.indexOf(o.electricChars.charAt(l))){a=xa(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ye(e.doc,n.head.line).text.slice(0,n.head.ch))&&(a=xa(e,n.head.line,"smart"));a&&ur(e,"electricInput",e,n.head.line)}}}function Aa(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var n=e.doc.sel.ranges[i].head.line,o={anchor:ot(n,0),head:ot(n+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ia(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Da(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Ia(e),t}function _a(e,t,r,i,n){var o=t,a=r,l=Ye(e,t.line),s=n&&"rtl"==e.direction?-r:r;function c(i){var o,a=n?function(e,t,r,i){var n=me(t,e.doc.direction);if(!n)return Qo(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=se(n,r.ch,r.sticky),a=n[o];if("ltr"==e.doc.direction&&a.level%2==0&&(0<i?a.to>r.ch:a.from<r.ch))return Qo(t,r,i);function l(e,r){return Ko(t,e instanceof ot?e.ch:e,r)}function s(r){return e.options.lineWrapping?(c=c||Ar(e,t),Jr(e,t,c,r)):{begin:0,end:t.text.length}}var c,u=s("before"==r.sticky?l(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==i<0,p=l(r,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var h=d?"before":"after";return new ot(r.line,p,h)}}function f(e,t,i){for(var o=function(e,t){return t?new ot(r.line,l(e,1),"before"):new ot(r.line,e,"after")};0<=e&&e<n.length;e+=t){var a=n[e],s=0<t==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),i.begin<=c&&c<i.end)return o(c,s)}}var g=f(o+i,i,u);if(g)return g;var m=0<i?u.end:l(u.begin,-1);return null==m||0<i&&m==t.text.length||!(g=f(0<i?0:n.length-1,i,s(m)))?null:g}(e.cm,l,t,r):Qo(l,t,r);if(null==a){if(i||(o=t.line+s)<e.first||o>=e.first+e.size||(t=new ot(o,t.ch,t.sticky),!(l=Ye(e,o))))return;t=$o(n,e.cm,l,t.line,s)}else t=a;return 1}if("char"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var u=null,d="group"==i,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||c(!h);h=!1){var f=l.text.charAt(t.ch)||"\n",g=te(f,p)?"w":d&&"\n"==f?"n":!d||/\s/.test(f)?null:"p";if(!d||h||g||(g="s"),u&&u!=g){r<0&&(r=1,c(),t.sticky="after");break}if(g&&(u=g),0<r&&!c(!h))break}var m=ro(e,t,o,a,!0);return lt(o,m)&&(m.hitSide=!0),m}function Fa(e,t,r,i){var n,o,a,l,s=e.doc,c=t.left;for("page"==i?(n=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),o=Math.max(n-.5*ri(e.display),3),a=(0<r?t.bottom:t.top)+r*o):"line"==i&&(a=0<r?t.bottom+3:t.top-3);(l=Yr(e,c,a)).outside;){if(r<0?a<=0:a>=s.height){l.hitSide=!0;break}a+=5*r}return l}function Ha(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Wa(e,t){var r=Gr(e,t.line);if(!r||r.hidden)return null;var i=Ye(e.doc,t.line),n=Or(r,i,t.line),o=me(i,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var l=Fr(n.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function za(e,t){return t&&(e.bad=!0),e}function Ra(e,t,r){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[r]))return za(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var o=e.display.view[n];if(o.node==i)return Ba(o,t,r)}}function Ba(e,t,r){var i=e.text.firstChild,n=!1;if(!t||!P(i,t))return za(ot(tt(e.line),0),!0);if(t==i&&(n=!0,t=i.childNodes[r],r=0,!t)){var o=e.rest?$(e.rest):e.line;return za(ot(tt(o),o.text.length),n)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r=r&&a.nodeValue.length);l.parentNode!=i;)l=l.parentNode;var s=e.measure,c=s.maps;function u(t,r,i){for(var n=-1;n<(c?c.length:0);n++)for(var o=n<0?s.map:c[n],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var u=tt(n<0?e.line:e.rest[n]),d=o[a]+i;return(i<0||l!=t)&&(d=o[a+(i?1:0)]),ot(u,d)}}}var d=u(a,l,r);if(d)return za(d,n);for(var p=l.nextSibling,h=a?a.nodeValue.length-r:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return za(ot(d.line,d.ch-h),n);h+=p.textContent.length}for(var f=l.previousSibling,g=r;f;f=f.previousSibling){if(d=u(f,f.firstChild,-1))return za(ot(d.line,d.ch+g),n);g+=f.textContent.length}}function ja(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null}function Va(e,t,r,i){Ca.defaults[e]=t,r&&(Sa[e]=i?function(e,t,i){i!=va&&r(e,t,i)}:r)}Ha.prototype.init=function(e){var t=this,r=this,i=r.cm,n=r.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==n)return 1;if(/\bESGMirror-(?:line)?widget\b/.test(t.className))break}}function a(e){if(o(e)&&!xe(i,e)){if(i.somethingSelected())Na({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Aa(i);Na({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,j),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ma.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var l=Da(),s=l.firstChild;i.display.lineSpace.insertBefore(l,i.display.lineSpace.firstChild),s.value=Ma.text.join("\n");var c=document.activeElement;D(s),setTimeout((function(){i.display.lineSpace.removeChild(l),c.focus(),c==n&&r.showPrimarySelection()}),50)}}Ia(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),be(n,"paste",(function(e){!o(e)||xe(i,e)||Pa(e,i)||l<=11&&setTimeout(Zi(i,(function(){return t.updateFromDOM()})),20)})),be(n,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),be(n,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),be(n,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),be(n,"touchstart",(function(){return r.forceCompositionEnd()})),be(n,"input",(function(){t.composing||t.readFromDOMSoon()})),be(n,"copy",a),be(n,"cut",a)},Ha.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ha.prototype.prepareSelection=function(){var e=mi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ha.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ha.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ha.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ra(t,e.anchorNode,e.anchorOffset),l=Ra(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=at(ut(a,l),n)||0!=at(ct(a,l),o)){var s,c,u=t.display.view,d=n.line>=t.display.viewFrom&&Wa(t,n)||{node:u[0].measure.map[2],offset:0},p=o.line<t.display.viewTo&&Wa(t,o);if(p||(p={node:(c=(s=u[u.length-1].measure).maps?s.maps[s.maps.length-1]:s.map)[c.length-1],offset:c[c.length-2]-c[c.length-3]}),d&&p){var h,f=e.rangeCount&&e.getRangeAt(0);try{h=L(d.node,d.offset,p.offset,p.node)}catch(e){}h&&(!r&&t.state.focused?(e.collapse(d.node,d.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),f&&null==e.anchorNode?e.addRange(f):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ha.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ha.prototype.showMultipleSelections=function(e){M(this.cm.display.cursorDiv,e.cursors),M(this.cm.display.selectionDiv,e.selection)},Ha.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ha.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},Ha.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ha.prototype.blur=function(){this.div.blur()},Ha.prototype.getField=function(){return this.div},Ha.prototype.supportsTouch=function(){return!0},Ha.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Yi(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ha.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ha.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e,t,r=this.getSelection(),i=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/ESGMirror-gutter-wrapper/.test(t.className))return 1}(r.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();this.composing||(this.rememberSelection(),e=Ra(i,r.anchorNode,r.anchorOffset),t=Ra(i,r.focusNode,r.focusOffset),e&&t&&Yi(i,(function(){Xn(i.doc,Cn(e,t),j),(e.bad||t.bad)&&(i.curOp.selectionChanged=!0)})))}},Ha.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,i=this.cm,n=i.display,o=i.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=ot(a.line-1,Ye(i.doc,a.line-1).length)),l.ch==Ye(i.doc,l.line).text.length&&l.line<i.lastLine()&&(l=ot(l.line+1,0)),a.line<n.viewFrom||l.line>n.viewTo-1)return!1;r=a.line==n.viewFrom||0==(e=ci(i,a.line))?(t=tt(n.view[0].line),n.view[0].node):(t=tt(n.view[e].line),n.view[e-1].node.nextSibling);var s,c=ci(i,l.line),u=c==n.view.length-1?(s=n.viewTo-1,n.lineDiv.lastChild):(s=tt(n.view[c+1].line)-1,n.view[c+1].node.previousSibling);if(!r)return!1;for(var d=i.doc.splitLines(function(e,t,r,i,n){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function c(){a&&(o+=l,s&&(o+=l),a=s=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void u(r);var o,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(ot(i,0),ot(n+1,0),(m=+p,function(e){return e.id==m}));return void(h.length&&(o=h[0].find(0))&&u(Ze(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&c();for(var g=0;g<t.childNodes.length;g++)d(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),f&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;d(t),t!=r;)t=t.nextSibling,s=!1;return o}(i,r,u,t,s)),p=Ze(i.doc,ot(t,0),ot(s,Ye(i.doc,s).text.length));1<d.length&&1<p.length;)if($(d)==$(p))d.pop(),p.pop(),s--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var h=0,f=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);h<v&&g.charCodeAt(h)==m.charCodeAt(h);)++h;for(var b=$(d),y=$(p),k=Math.min(b.length-(1==d.length?h:0),y.length-(1==p.length?h:0));f<k&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)++f;if(1==d.length&&1==p.length&&t==a.line)for(;h&&h>a.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)h--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=ot(t,h),x=ot(s,p.length?$(p).length-f:0);return 1<d.length||d[0]||at(w,x)?(po(i.doc,d,w,x,"+input"),!0):void 0},Ha.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ha.prototype.reset=function(){this.forceCompositionEnd()},Ha.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ha.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ha.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Yi(this.cm,(function(){return ui(e.cm)}))},Ha.prototype.setUneditable=function(e){e.contentEditable="false"},Ha.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Zi(this.cm,Oa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ha.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ha.prototype.onContextMenu=function(){},Ha.prototype.resetPosition=function(){},Ha.prototype.needsContentAttribute=!0,ja.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var n=this.textarea;function o(e){if(!xe(i,e)){if(i.somethingSelected())Na({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Aa(i);Na({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,j):(r.prevInput="",n.value=t.text.join("\n"),D(n))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(n.style.width="0px"),be(n,"input",(function(){a&&9<=l&&t.hasSelection&&(t.hasSelection=null),r.poll()})),be(n,"paste",(function(e){xe(i,e)||Pa(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())})),be(n,"cut",o),be(n,"copy",o),be(e.scroller,"paste",(function(t){if(!Cr(e,t)&&!xe(i,t)){if(!n.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,n.dispatchEvent(o)}})),be(e.lineSpace,"selectstart",(function(t){Cr(e,t)||Te(t)})),be(n,"compositionstart",(function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"ESGMirror-composing"})}})),be(n,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},ja.prototype.createField=function(e){this.wrapper=Da(),this.textarea=this.wrapper.firstChild},ja.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ja.prototype.prepareSelection=function(){var e,t,r,i=this.cm,n=i.display,o=i.doc,a=mi(i);return i.options.moveInputWithCursor&&(e=Qr(i,o.sel.primary().head,"div"),t=n.wrapper.getBoundingClientRect(),r=n.lineDiv.getBoundingClientRect(),a.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,e.top+r.top-t.top)),a.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,e.left+r.left-t.left))),a},ja.prototype.showSelection=function(e){var t=this.cm.display;M(t.cursorDiv,e.cursors),M(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ja.prototype.reset=function(e){var t,r;this.contextMenuPending||this.composing||((t=this.cm).somethingSelected()?(this.prevInput="",r=t.getSelection(),this.textarea.value=r,t.state.focused&&D(this.textarea),a&&9<=l&&(this.hasSelection=r)):e||(this.prevInput=this.textarea.value="",a&&9<=l&&(this.hasSelection=null)))},ja.prototype.getField=function(){return this.textarea},ja.prototype.supportsTouch=function(){return!1},ja.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||G()!=this.textarea))try{this.textarea.focus()}catch(e){}},ja.prototype.blur=function(){this.textarea.blur()},ja.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ja.prototype.receivedFocus=function(){this.slowPoll()},ja.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ja.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},ja.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||We(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=r.value;if(n==i&&!t.somethingSelected())return!1;if(a&&9<=l&&this.hasSelection===n||b&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(i.length,n.length);s<c&&i.charCodeAt(s)==n.charCodeAt(s);)++s;return Yi(t,(function(){Oa(t,n.slice(s),i.length-s,null,e.composing?"*compose":null),1e3<n.length||-1<n.indexOf("\n")?r.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"ESGMirror-composing"}))})),!0},ja.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ja.prototype.onKeyPress=function(){a&&9<=l&&(this.hasSelection=null),this.fastPoll()},ja.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o,c,u,p,h,f=si(r,e),g=i.scroller.scrollTop;function m(){var e,o;null!=n.selectionStart&&(o=""+((e=r.somethingSelected())?n.value:""),n.value="⇚",n.value=o,t.prevInput=e?"":"",n.selectionStart=1,n.selectionEnd=o.length,i.selForContextMenu=r.doc.sel)}function v(){var e,s;t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=c,n.style.cssText=o,a&&l<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=g),null!=n.selectionStart&&((!a||a&&l<9)&&m(),e=0,s=function(){i.selForContextMenu==r.doc.sel&&0==n.selectionStart&&0<n.selectionEnd&&""==t.prevInput?Zi(r,no)(r):e++<10?i.detectingSelectAll=setTimeout(s,500):(i.selForContextMenu=null,i.input.reset())},i.detectingSelectAll=setTimeout(s,200)))}f&&!d&&(r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(f)&&Zi(r,Xn)(r.doc,Cn(f),j),o=n.style.cssText,c=t.wrapper.style.cssText,u=t.wrapper.offsetParent.getBoundingClientRect(),t.wrapper.style.cssText="position: static",n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.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);",s&&(p=window.scrollY),i.input.focus(),s&&window.scrollTo(null,p),i.input.reset(),r.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll),a&&9<=l&&m(),C?(Ne(e),h=function(){ke(window,"mouseup",h),setTimeout(v,20)},be(window,"mouseup",h)):setTimeout(v,50))},ja.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ja.prototype.setUneditable=function(){},ja.prototype.needsContentAttribute=!1,Sa=(Ca=ka).optionHandlers,Ca.defineOption=Va,Ca.Init=va,Va("value","",(function(e,t){return e.setValue(t)}),!0),Va("mode",null,(function(e,t){e.doc.modeOption=t,Mn(e)}),!0),Va("indentUnit",2,Mn,!0),Va("indentWithTabs",!1),Va("smartIndent",!0),Va("tabSize",4,(function(e){Nn(e),Rr(e),ui(e)}),!0),Va("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t){var r=[],i=e.doc.first;e.doc.iter((function(e){for(var n=0;;){var o=e.text.indexOf(t,n);if(-1==o)break;n=o+t.length,r.push(ot(i,o))}i++}));for(var n=r.length-1;0<=n;n--)po(e.doc,t,r[n],ot(r[n].line,r[n].ch+t.length))}})),Va("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=va&&e.refresh()})),Va("specialCharPlaceholder",(function(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}),(function(e){return e.refresh()}),!0),Va("electricChars",!0),Va("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),Va("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),Va("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),Va("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),Va("rtlMoveVisually",!k),Va("wholeLineUpdateBefore",!0),Va("theme","default",(function(e){ma(e),fn(e)}),!0),Va("keyMap","default",(function(e,t,r){var i=qo(t),n=r!=va&&qo(r);n&&n.detach&&n.detach(e,i),i.attach&&i.attach(e,n||null)})),Va("extraKeys",null),Va("configureMouse",null),Va("lineWrapping",!1,(function(e){e.options.lineWrapping?(A(e.display.wrapper,"ESGMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"ESGMirror-wrap"),Xt(e)),li(e),ui(e),Rr(e),setTimeout((function(){return zi(e)}),100)}),!0),Va("gutters",[],(function(e,t){e.display.gutterSpecs=pn(t,e.options.lineNumbers),fn(e)}),!0),Va("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?oi(e.display)+"px":"0",e.refresh()}),!0),Va("coverGutterNextToScrollbar",!1,(function(e){return zi(e)}),!0),Va("scrollbarStyle","native",(function(e){ji(e),zi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),Va("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pn(e.options.gutters,t),fn(e)}),!0),Va("firstLineNumber",1,fn,!0),Va("lineNumberFormatter",(function(e){return e}),fn,!0),Va("showCursorWhenSelecting",!1,gi,!0),Va("resetSelectionOnContextMenu",!0),Va("lineWiseCopyCut",!0),Va("pasteLinesPerSelection",!0),Va("selectionsMayTouch",!1),Va("readOnly",!1,(function(e,t){"nocursor"==t&&(Si(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),Va("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),Va("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),Va("dragDrop",!0,(function(e,t,r){var i,n;!t!=!(r&&r!=va)&&(i=e.display.dragFunctions,(n=t?be:ke)(e.display.scroller,"dragstart",i.start),n(e.display.scroller,"dragenter",i.enter),n(e.display.scroller,"dragover",i.over),n(e.display.scroller,"dragleave",i.leave),n(e.display.scroller,"drop",i.drop))})),Va("allowDropFileTypes",null),Va("cursorBlinkRate",530),Va("cursorScrollMargin",0),Va("cursorHeight",1,gi,!0),Va("singleCursorHeightPerLine",!0,gi,!0),Va("workTime",100),Va("workDelay",100),Va("flattenSpans",!0,Nn,!0),Va("addModeClass",!1,Nn,!0),Va("pollInterval",100),Va("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),Va("historyEventDelay",1250),Va("viewportMargin",10,(function(e){return e.refresh()}),!0),Va("maxHighlightLength",1e4,Nn,!0),Va("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),Va("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),Va("autofocus",null),Va("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),Va("phrases",null),Ta=(La=ka).optionHandlers,Ea=La.helpers={},La.prototype={constructor:La,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,i=r[e];r[e]==t&&"mode"!=e||(r[e]=t,Ta.hasOwnProperty(e)&&Zi(this,Ta[e])(this,t,i),we(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Ji((function(e,t){var r=e.token?e:La.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var i=0,n=r(t);i<e.length&&r(e[i])<=n;)i++;e.splice(i,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},(function(e){return e.priority})),this.state.modeGen++,ui(this)})),removeOverlay:Ji((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var i=t[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(r,1),this.state.modeGen++,void ui(this)}})),indentLine:Ji((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),it(this.doc,e)&&xa(this,e,t,r)})),indentSelection:Ji((function(e){for(var t=this,r=this.doc.sel.ranges,i=-1,n=0;n<r.length;n++){var o=r[n];if(o.empty())o.head.line>i&&(xa(t,o.head.line,e,!0),i=o.head.line,n==t.doc.sel.primIndex&&Oi(t));else{for(var a=o.from(),l=o.to(),s=Math.max(i,a.line),c=(i=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1,s);c<i;++c)xa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&0<u[n].from().ch&&Kn(t.doc,n,new wn(a,u[n].to()),j)}}})),getTokenAt:function(e,t){return Ct(this,e,t)},getLineTokens:function(e,t){return Ct(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,r=vt(this,Ye(this.doc,e.line)),i=0,n=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=i+n>>1;if((a?r[2*a-1]:0)>=o)n=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}i=1+a}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?La.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ea.hasOwnProperty(t))return r;var i=Ea[t],n=this.getModeAt(e);if("string"==typeof n[t])i[n[t]]&&r.push(i[n[t]]);else if(n[t])for(var o=0;o<n[t].length;o++){var a=i[n[t][o]];a&&r.push(a)}else n.helperType&&i[n.helperType]?r.push(i[n.helperType]):i[n.name]&&r.push(i[n.name]);for(var l=0;l<i._global.length;l++){var s=i._global[l];s.pred(n,this)&&-1==z(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return bt(this,(e=dt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Qr(this,null==e?r.head:"object"==typeof e?pt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Kr(this,pt(this.doc,e),t||"page")},coordsChar:function(e,t){return Yr(this,(e=Ur(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ur(this,{top:e,left:0},t||"page").top,rt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var i,n=!1,o="number"==typeof e?(i=this.doc.first+this.doc.size-1,e<this.doc.first?e=this.doc.first:i<e&&(e=i,n=!0),Ye(this.doc,e)):e;return qr(this,o,{top:0,left:0},t||"page",r||n).top+(n?this.doc.height-Qt(o):0)},defaultTextHeight:function(){return ri(this.display)},defaultCharWidth:function(){return ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,i,n){var o,a,l,s,c=this.display,u=(e=Qr(this,pt(this.doc,e))).bottom,d=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),c.sizer.appendChild(t),"over"==i?u=e.top:"above"!=i&&"near"!=i||(o=Math.max(c.wrapper.clientHeight,this.doc.height),a=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth),("above"==i||e.bottom+t.offsetHeight>o)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(u=e.bottom),d+t.offsetWidth>a&&(d=a-t.offsetWidth)),t.style.top=u+"px",t.style.left=t.style.right="","right"==n?(d=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?d=0:"middle"==n&&(d=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),r&&(null!=(s=Mi(l=this,{left:d,top:u,right:d+t.offsetWidth,bottom:u+t.offsetHeight})).scrollTop&&Ii(l,s.scrollTop),null!=s.scrollLeft&&_i(l,s.scrollLeft))},triggerOnKeyDown:Ji(oa),triggerOnKeyPress:Ji(la),triggerOnKeyUp:aa,triggerOnMouseDown:Ji(da),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Ji((function(e){Ga(this,e)})),findPosH:function(e,t,r,i){var n=1;t<0&&(n=-1,t=-t);for(var o=pt(this.doc,e),a=0;a<t&&!(o=_a(this.doc,o,n,r,i)).hitSide;++a);return o},moveH:Ji((function(e,t){var r=this;this.extendSelectionsBy((function(i){return r.display.shift||r.doc.extend||i.empty()?_a(r.doc,i.head,e,t,r.options.rtlMoveVisually):e<0?i.from():i.to()}),q)})),deleteH:Ji((function(e,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):Uo(this,(function(r){var n=_a(i,r.head,e,t,!1);return e<0?{from:n,to:r.head}:{from:r.head,to:n}}))})),findPosV:function(e,t,r,i){var n=1,o=i;t<0&&(n=-1,t=-t);for(var a=pt(this.doc,e),l=0;l<t;++l){var s=Qr(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Fa(this,s,n,r)).hitSide)break}return a},moveV:Ji((function(e,t){var r=this,i=this.doc,n=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=Qr(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),n.push(l.left);var s=Fa(r,l,e,t);return"page"==t&&a==i.sel.primary()&&Ni(r,Kr(r,s,"div").top-l.top),s}),q),n.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=n[a]})),findWordAt:function(e){var t=Ye(this.doc,e.line).text,r=e.ch,i=e.ch;if(t){var n=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!r?++i:--r;for(var o=t.charAt(r),a=te(o,n)?function(e){return te(e,n)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;i<t.length&&a(t.charAt(i));)++i}return new wn(ot(e.line,r),ot(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?A:T)(this.display.cursorDiv,"ESGMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==G()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ji((function(e,t){Pi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Er(this)-this.display.barHeight,width:e.scrollWidth-Er(this)-this.display.barWidth,clientHeight:Nr(this),clientWidth:Mr(this)}},scrollIntoView:Ji((function(e,t){var r;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?(r=e,Gi(this),this.curOp.scrollToPos=r):Ai(this,e.from,e.to,e.margin)})),setSize:Ji((function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var i=this;null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&zr(this);var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){di(i,n,"widget");break}++n})),this.curOp.forceUpdate=!0,we(this,"refresh",this)})),operation:function(e){return Yi(this,e)},startOperation:function(){return qi(this)},endOperation:function(){return Ui(this)},refresh:Ji((function(){var e=this.display.cachedTextHeight;ui(this),this.curOp.forceUpdate=!0,Rr(this),Pi(this,this.doc.scrollLeft,this.doc.scrollTop),sn(this.display),(null==e||.5<Math.abs(e-ri(this.display))||this.options.lineWrapping)&&li(this),we(this,"refresh",this)})),swapDoc:Ji((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),An(this,e),Rr(this),this.display.input.reset(),Pi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ur(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Le(La),La.registerHelper=function(e,t,r){Ea.hasOwnProperty(e)||(Ea[e]=La[e]={_global:[]}),Ea[e][t]=r},La.registerGlobalHelper=function(e,t,r,i){La.registerHelper(e,t,i),Ea[e]._global.push({pred:r,val:i})};var qa,Ua="iter insert remove copy getEditor constructor".split(" ");for(var Ka in Mo.prototype)Mo.prototype.hasOwnProperty(Ka)&&z(Ua,Ka)<0&&(ka.prototype[Ka]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mo.prototype[Ka]));return Le(Mo),ka.inputStyles={textarea:ja,contenteditable:Ha},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){je[e]=t},ka.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){Mo.prototype[e]=t},ka.fromTextArea=function(e,t){var r;function i(){e.value=l.getValue()}if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus&&(r=G(),t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body),e.form&&(be(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var n=e.form,o=n.submit;try{var a=n.submit=function(){i(),n.submit=o,n.submit(),n.submit=a}}catch(r){}}t.finishInit=function(r){r.save=i,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,i(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var l=ka((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},(qa=ka).off=ke,qa.on=be,qa.wheelEventPixels=function(e){var t=bn(e);return t.x*=vn,t.y*=vn,t},qa.Doc=Mo,qa.splitLines=He,qa.countColumn=H,qa.findColumn=U,qa.isWordChar=ee,qa.Pass=B,qa.signal=we,qa.Line=Yt,qa.changeEnd=Sn,qa.scrollbarModel=Bi,qa.Pos=ot,qa.cmpPos=at,qa.modes=Be,qa.mimeModes=je,qa.resolveMode=Ve,qa.getMode=qe,qa.modeExtensions=Ue,qa.extendMode=function(e,t){F(t,Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={})},qa.copyState=Ke,qa.startState=$e,qa.innerMode=Qe,qa.commands=Xo,qa.keyMap=Wo,qa.keyName=Vo,qa.isModifierKey=Bo,qa.lookupKey=Ro,qa.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==i){delete e[r];continue}for(var n=X(r.split(" "),zo),o=0;o<n.length;o++){var a=void 0,l=o==n.length-1?(a=n.join(" "),i):(a=n.slice(0,o+1).join(" "),"..."),s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[r]}for(var c in t)e[c]=t[c];return e},qa.StringStream=Xe,qa.SharedTextMarker=So,qa.TextMarker=xo,qa.LineWidget=yo,qa.e_preventDefault=Te,qa.e_stopPropagation=Ee,qa.e_stop=Ne,qa.addClass=A,qa.contains=P,qa.rmClass=T,qa.keyNames=Do,ka.version="5.54.0",ka})),ESGMirror.defineMode("css",(function(e,t){"use strict";t.propertyKeywords||(t=ESGMirror.resolveMode("text/css"));var r,i,n=e.indentUnit,o=t.tokenHooks,a=t.mediaTypes||{},l=t.mediaFeatures||{},s=t.propertyKeywords||{},c=t.colorKeywords||{},u=t.valueKeywords||{},d=t.fontProperties||{},p=t.allowNested;function h(e,t){return r=t,e}function f(e){return function(t,i){for(var n,o=!1;null!=(n=t.next());){if(n==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==n}return n!=e&&(o||")"==e)||(i.tokenize=null),r="string"}}function g(e,t){return e.next(),e.match(/\s*[\"\']/,!1)?t.tokenize=null:t.tokenize=f(")"),r="(",null}function m(e,t,r){this.type=e,this.indent=t,this.prev=r}function v(e,t,r){return e.context=new m(r,t.indentation()+n,e.context),r}function b(e){return e.context=e.context.prev,e.context.type}function y(e,t,r){return x[r.context.type](e,t,r)}function k(e,t,r,i){for(var n=i||1;0<n;n--)r.context=r.context.prev;return y(e,t,r)}function w(e){var t=e.current().toLowerCase();i=u.hasOwnProperty(t)?"atom":c.hasOwnProperty(t)?"keyword":"variable"}var x={top:function(e,t,r){if("{"==e)return v(r,t,"block");if("}"==e&&r.context.prev)return b(r);if("@media"==e)return v(r,t,"media");if("@font-face"==e)return"font_face_before";if(e&&"@"==e.charAt(0))return v(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return v(r,t,"interpolation");if(":"==e)return"pseudo";if(p&&"("==e)return v(r,t,"params")}return r.context.type},block:function(e,t,r){return"word"==e?s.hasOwnProperty(t.current().toLowerCase())?(i="property","maybeprop"):p?(i=t.match(/^\s*:/,!1)?"property":"tag","block"):(i+=" error","maybeprop"):"meta"==e?"block":p||"hash"!=e&&"qualifier"!=e?x.top(e,t,r):(i="error","block")},maybeprop:function(e,t,r){return":"==e?v(r,t,"prop"):y(e,t,r)},prop:function(e,t,r){if(";"==e)return b(r);if("{"==e&&p)return v(r,t,"propBlock");if("}"==e||"{"==e)return k(e,t,r);if("("==e)return v(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)w(t);else if("interpolation"==e)return v(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?b(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?k(e,t,r):")"==e?b(r):"parens"},pseudo:function(e,t,r){return"word"==e?(i="variable-3",r.context.type):y(e,t,r)},media:function(e,t,r){return"("==e?v(r,t,"media_parens"):"}"==e?k(e,t,r):"{"==e?b(r)&&v(r,t,p?"block":"top"):("word"==e&&(n=t.current().toLowerCase(),i="only"==n||"not"==n||"and"==n?"keyword":a.hasOwnProperty(n)?"attribute":l.hasOwnProperty(n)?"property":"error"),r.context.type);var n},media_parens:function(e,t,r){return")"==e?b(r):"{"==e||"}"==e?k(e,t,r,2):x.media(e,t,r)},font_face_before:function(e,t,r){return"{"==e?v(r,t,"font_face"):y(e,t,r)},font_face:function(e,t,r){return"}"==e?b(r):"word"==e?(i=d.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},at:function(e,t,r){return";"==e?b(r):"{"==e||"}"==e?k(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?b(r):"{"==e||";"==e?k(e,t,r):("variable"!=e&&(i="error"),"interpolation")},params:function(e,t,r){return")"==e?b(r):"{"==e||"}"==e?k(e,t,r):("word"==e&&w(t),"params")}};return{startState:function(e){return{tokenize:null,state:"top",context:new m("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var i=e.next();if(o[i]){var n=o[i](e,t);if(!1!==n)return n}return"@"==i?(e.eatWhile(/[\w\\\-]/),h("def",e.current())):"="==i||("~"==i||"|"==i)&&e.eat("=")?(r="compare",null):'"'==i||"'"==i?(t.tokenize=f(i),t.tokenize(e,t)):"#"==i?(e.eatWhile(/[\w\\\-]/),r="hash","atom"):"!"==i?(e.match(/^\s*\w*/),r="important","keyword"):/\d/.test(i)||"."==i&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r="unit","number"):"-"!==i?/[,+>*\/]/.test(i)?(r="select-op",null):"."==i&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r="qualifier":/[:;{}\[\]\(\)]/.test(i)?h(null,i):"u"==i&&e.match("rl(")?(e.backUp(1),t.tokenize=g,r="word","property"):/[\w\\\-]/.test(i)?(e.eatWhile(/[\w\\\-]/),r="word","property"):r=null:/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r="unit","number"):e.match(/^[^-]+-/)?r="meta":void 0})(e,t);return n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,t.state=x[t.state](r,e,t),i},indent:function(e,t){var r=e.context,i=t&&t.charAt(0),o=r.indent;return!r.prev||("}"!=i||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"font_face"!=r.type)&&(")"!=i||"parens"!=r.type&&"params"!=r.type&&"media_parens"!=r.type)&&("{"!=i||"at"!=r.type&&"media"!=r.type)||(o=r.indent-n,r=r.prev),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}})),function(){function e(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=!0;return t}var t=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],r=e(t),i=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],n=e(i),o=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"],a=e(o),l=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],s=e(l),c=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],u=e(c),d=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=t.concat(i).concat(o).concat(l).concat(c);function h(e,t){for(var r,i=!1;null!=(r=e.next());){if(i&&"/"==r){t.tokenize=null;break}i="*"==r}return["comment","comment"]}function f(e,t){return e.skipTo("--\x3e")?(e.match("--\x3e"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}ESGMirror.registerHelper("hintWords","css",p),ESGMirror.defineMIME("text/css",{mediaTypes:r,mediaFeatures:n,propertyKeywords:a,colorKeywords:s,valueKeywords:u,fontProperties:d,tokenHooks:{"<":function(e,t){return!!e.match("!--")&&(t.tokenize=f)(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=h)(e,t)}},name:"css"}),ESGMirror.defineMIME("text/x-scss",{mediaTypes:r,mediaFeatures:n,propertyKeywords:a,colorKeywords:s,valueKeywords:u,fontProperties:d,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=h)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),ESGMirror.defineMIME("text/x-less",{mediaTypes:r,mediaFeatures:n,propertyKeywords:a,colorKeywords:s,valueKeywords:u,fontProperties:d,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=h)(e,t):["operator","operator"]},"@":function(e){return!e.match(/^(charset|document|font-face|import|keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}(),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/esgmirror")):"function"==typeof define&&define.amd?define(["../../lib/esgmirror"],e):e(ESGMirror)}((function(e){"use strict";e.defineMode("javascript",(function(t,r){var i,n,o=t.indentUnit,a=r.statementIndent,l=r.jsonld,s=r.json||l,c=r.typescript,u=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),i=e("keyword c"),n=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:i,delete:i,throw:i,debugger:i,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:n,typeof:n,instanceof:n,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),module:e("module"),class:e("class"),super:e("atom"),yield:i,export:e("export"),import:e("import"),extends:i};if(c){var l={type:"variable",style:"variable-3"},s={interface:e("interface"),extends:e("extends"),constructor:e("constructor"),public:e("public"),private:e("private"),protected:e("protected"),static:e("static"),string:l,number:l,bool:l,any:l};for(var u in s)a[u]=s[u]}return a}(),d=/[+\-*&%=<>!?|~^]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,r){return i=e,n=r,t}function f(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(l&&"@"==e.peek()&&e.match(p))return t.tokenize=f,h("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=f),h("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return h("number","number");if("."==r&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return h(r);if("="==r&&e.eat(">"))return h("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),h("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),h("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g)(e,t):e.eat("/")?(e.skipToEnd(),h("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(function(e){for(var t,r=!1,i=!1;null!=(t=e.next());){if(!r){if("/"==t&&!i)return;"["==t?i=!0:i&&"]"==t&&(i=!1)}r=!r&&"\\"==t}}(e),e.eatWhile(/[gimy]/),h("regexp","string-2")):(e.eatWhile(d),h("operator","operator",e.current()));if("`"==r)return(t.tokenize=m)(e,t);if("#"==r)return e.skipToEnd(),h("error","error");if(d.test(r))return e.eatWhile(d),h("operator","operator",e.current());e.eatWhile(/[\w\$_]/);var i,n=e.current(),o=u.propertyIsEnumerable(n)&&u[n];return o&&"."!=t.lastType?h(o.type,o.style,n):h("variable","variable",n)}function g(e,t){for(var r,i=!1;r=e.next();){if("/"==r&&i){t.tokenize=f;break}i="*"==r}return h("comment","comment")}function m(e,t){for(var r,i=!1;null!=(r=e.next());){if(!i&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=f;break}i=!i&&"\\"==r}return h("quasi","string-2",e.current())}var v="([{}])";function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){for(var i=0,n=!1,o=r-1;0<=o;--o){var a=e.string.charAt(o),l=v.indexOf(a);if(0<=l&&l<3){if(!i){++o;break}if(0==--i)break}else if(3<=l&&l<6)++i;else if(/[$\w]/.test(a))n=!0;else if(n&&!i){++o;break}}n&&!i&&(t.fatArrowAt=o)}}var y={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(e,t,r,i,n,o){this.indented=e,this.column=t,this.type=r,this.prev=n,this.info=o,null!=i&&(this.align=i)}var w={state:null,column:null,marked:null,cc:null};function x(){for(var e=arguments.length-1;0<=e;e--)w.cc.push(arguments[e])}function C(){return x.apply(null,arguments),!0}function S(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return 1}var i=w.state;if(i.context){if(w.marked="def",t(i.localVars))return;i.localVars={name:e,next:i.localVars}}else{if(t(i.globalVars))return;r.globalVars&&(i.globalVars={name:e,next:i.globalVars})}}var L={name:"this",next:{name:"arguments"}};function T(){w.state.context={prev:w.state.context,vars:w.state.localVars},w.state.localVars=L}function E(){w.state.localVars=w.state.context.vars,w.state.context=w.state.context.prev}function M(e,t){function r(){var r=w.state,i=r.indented;"stat"==r.lexical.type&&(i=r.lexical.indented),r.lexical=new k(i,w.stream.column(),e,null,r.lexical,t)}return r.lex=!0,r}function N(){var e=w.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function O(e){return function t(r){return r==e?C():";"==e?x():C(t)}}function P(e,t){return"var"==e?C(M("vardef",t.length),J,O(";"),N):"keyword a"==e?C(M("form"),G,P,N):"keyword b"==e?C(M("form"),P,N):"{"==e?C(M("}"),X,N):";"==e?C():"if"==e?("else"==w.state.lexical.info&&w.state.cc[w.state.cc.length-1]==N&&w.state.cc.pop()(),C(M("form"),G,P,N,ne)):"function"==e?C(ue):"for"==e?C(M("form"),oe,P,N):"variable"==e?C(M("stat"),j):"switch"==e?C(M("form"),G,M("}","switch"),O("{"),X,N,N):"case"==e?C(G,O(":")):"default"==e?C(O(":")):"catch"==e?C(M("form"),T,O("("),de,O(")"),P,N,E):"module"==e?C(M("form"),T,ge,E,N):"class"==e?C(M("form"),pe,fe,N):"export"==e?C(M("form"),me,N):"import"==e?C(M("form"),ve,N):x(M("stat"),G,O(";"),N)}function G(e){return I(e,!1)}function A(e){return I(e,!0)}function I(e,t){if(w.state.fatArrowAt==w.stream.start){var r=t?B:R;if("("==e)return C(T,M(")"),Q(ee,")"),N,O("=>"),r,E);if("variable"==e)return x(T,ee,O("=>"),r,E)}var i=t?H:F;return y.hasOwnProperty(e)?C(i):"function"==e?C(ue,i):"keyword c"==e?C(t?_:D):"("==e?C(M(")"),D,xe,O(")"),N,i):"operator"==e||"spread"==e?C(t?A:G):"["==e?C(M("]"),ke,N,i):"{"==e?$(q,"}",null,i):"quasi"==e?x(W,i):C()}function D(e){return e.match(/[;\}\)\],]/)?x():x(G)}function _(e){return e.match(/[;\}\)\],]/)?x():x(A)}function F(e,t){return","==e?C(G):H(e,t,!1)}function H(e,t,r){var i=0==r?F:H,n=0==r?G:A;return"=>"==t?C(T,r?B:R,E):"operator"==e?/\+\+|--/.test(t)?C(i):"?"==t?C(G,O(":"),n):C(n):"quasi"==e?x(W,i):";"!=e?"("==e?$(A,")","call",i):"."==e?C(V,i):"["==e?C(M("]"),D,O("]"),N,i):void 0:void 0}function W(e,t){return"quasi"!=e?x():"${"!=t.slice(t.length-2)?C(W):C(G,z)}function z(e){if("}"==e)return w.marked="string-2",w.state.tokenize=m,C(W)}function R(e){return b(w.stream,w.state),x("{"==e?P:G)}function B(e){return b(w.stream,w.state),x("{"==e?P:A)}function j(e){return":"==e?C(N,P):x(F,O(";"),N)}function V(e){if("variable"==e)return w.marked="property",C()}function q(e,t){if("variable"==e){if(w.marked="property","get"==t||"set"==t)return C(U)}else if("number"==e||"string"==e)w.marked=l?"property":e+" property";else if("["==e)return C(G,O("]"),K);if(y.hasOwnProperty(e))return C(K)}function U(e){return"variable"!=e?x(K):(w.marked="property",C(ue))}function K(e){return":"==e?C(A):"("==e?x(ue):void 0}function Q(e,t){function r(i){if(","!=i)return i==t?C():C(O(t));var n=w.state.lexical;return"call"==n.info&&(n.pos=(n.pos||0)+1),C(e,r)}return function(i){return i==t?C():x(e,r)}}function $(e,t,r){for(var i=3;i<arguments.length;i++)w.cc.push(arguments[i]);return C(M(t,r),Q(e,t),N)}function X(e){return"}"==e?C():x(P,X)}function Y(e){if(c&&":"==e)return C(Z)}function Z(e){if("variable"==e)return w.marked="variable-3",C()}function J(){return x(ee,Y,re,ie)}function ee(e,t){return"variable"==e?(S(t),C()):"["==e?$(ee,"]"):"{"==e?$(te,"}"):void 0}function te(e,t){return"variable"!=e||w.stream.match(/^\s*:/,!1)?("variable"==e&&(w.marked="property"),C(O(":"),ee,re)):(S(t),C(re))}function re(e,t){if("="==t)return C(A)}function ie(e){if(","==e)return C(J)}function ne(e,t){if("keyword b"==e&&"else"==t)return C(M("form","else"),P,N)}function oe(e){if("("==e)return C(M(")"),ae,O(")"),N)}function ae(e){return"var"==e?C(J,O(";"),se):";"==e?C(se):"variable"==e?C(le):x(G,O(";"),se)}function le(e,t){return"in"==t||"of"==t?(w.marked="keyword",C(G)):C(F,se)}function se(e,t){return";"==e?C(ce):"in"==t||"of"==t?(w.marked="keyword",C(G)):x(G,O(";"),ce)}function ce(e){")"!=e&&C(G)}function ue(e,t){return"*"==t?(w.marked="keyword",C(ue)):"variable"==e?(S(t),C(ue)):"("==e?C(T,M(")"),Q(de,")"),N,P,E):void 0}function de(e){return"spread"==e?C(de):x(ee,Y)}function pe(e,t){if("variable"==e)return S(t),C(he)}function he(e,t){if("extends"==t)return C(G)}function fe(e){if("{"==e)return $(q,"}")}function ge(e,t){return"string"==e?C(P):"variable"==e?(S(t),C(ye)):void 0}function me(e,t){return"*"==t?(w.marked="keyword",C(ye,O(";"))):"default"==t?(w.marked="keyword",C(G,O(";"))):x(P)}function ve(e){return"string"==e?C():x(be,ye)}function be(e,t){return"{"==e?$(be,"}"):("variable"==e&&S(t),C())}function ye(e,t){if("from"==t)return w.marked="keyword",C(G)}function ke(e){return"]"==e?C():x(A,we)}function we(e){return"for"==e?x(xe,O("]")):(","==e?C:x)(Q(A,"]"))}function xe(e){return"for"==e?C(oe,xe):"if"==e?C(G,xe):void 0}return N.lex=!0,{startState:function(e){var t={tokenize:f,lastType:"sof",cc:[],lexical:new k((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==i?r:(t.lastType="operator"!=i||"++"!=n&&"--"!=n?i:"incdec",function(e,t,r,i,n){var o=e.cc;for(w.state=e,w.stream=n,w.marked=null,w.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?G:P)(r,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();return w.marked?w.marked:"variable"==r&&function(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return 1;for(var i=e.context;i;i=i.prev)for(r=i.vars;r;r=r.next)if(r.name==t)return 1}(e,i)?"variable-2":t}}(t,r,i,n,e))},indent:function(t,i){if(t.tokenize==g)return e.Pass;if(t.tokenize!=f)return 0;var n=i&&i.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(i))for(var s=t.cc.length-1;0<=s;--s){var c=t.cc[s];if(c==N)l=l.prev;else if(c!=ne)break}"stat"==l.type&&"}"==n&&(l=l.prev),a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var u=l.type,d=n==u;return"vardef"==u?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==u&&"{"==n?l.indented:"form"==u?l.indented+o:"stat"==u?l.indented+("operator"==t.lastType||","==t.lastType?a||o:0):"switch"!=l.info||d||0==r.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:o):l.indented+(/^(?:case|default)\b/.test(i)?o:2*o)},electricChars:":{}",blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",lineComment:s?null:"//",fold:"brace",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s}})),e.registerHelper("wordChars","javascript",/[\\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})), /*! * tp-color-picker.js - Color Picker Plugin for Revolution Slider * @version: 2.0 (16.01.2018) * @author ThemePunch */ function(e){"use strict";window.ESG=void 0===window.ESG?{}:window.ESG,ESG.F=void 0===ESG.F?{}:ESG.F,ESG.ENV=void 0===ESG.ENV?{}:ESG.ENV,ESG.V=void 0===ESG.V?{}:ESG.V,ESG.S=void 0===ESG.S?{}:ESG.S,ESG.SC=void 0===ESG.SC?{}:ESG.SC,ESG.C=void 0===ESG.C?{}:ESG.C,ESG.LIB=void 0===ESG.LIB?{nav_skins:[],item_skins:{},nav_originals:{}}:ESG.LIB,ESG.CM=void 0===ESG.CM?{apiJS:null,ajaxCSS:null,navCSS:null}:ESG.CM,ESG.WIN=void 0===ESG.WIN?jQuery(window):ESG.WIN,ESG.DOC=void 0===ESG.DOC?jQuery(document):ESG.DOC,window.ESGColor={defaultValue:"#ffffff",isColor:/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,get:function(e){return e?ESGColor.process(e,!0)[0]:"transparent"},parse:function(e,t,r){e=ESGColor.process(e,!0);var i=[];return i[0]=t?t+": "+e[0]+";":e[0],r&&(i[1]=e[1]),i},convert:function(e,t){if(!e||"string"!=typeof e)return ESGColor.defaultValue;if("transparent"===e)return e;if(-1!==e.search(/\[\{/)||-1!==e.search("gradient"))return ESGColor.process(e,!0)[0];if(void 0===t||isNaN(t))return ESGColor.process(e,!0)[0];if((t=parseFloat(t))<=1&&(t*=100),0===(t=Math.max(Math.min(parseInt(t,10),100),0)))return"transparent";try{return-1!==e.search("#")||e.length<8?(ESGColor.isColor.test(e)||(e=e.replace(/[^A-Za-z0-9#]/g,"")),ESGColor.processRgba(ESGColor.sanitizeHex(e),t)):(e=ESGColor.rgbValues(e,3),ESGColor.rgbaString(e[0],e[1],e[2],.01*t))}catch(e){return ESGColor.defaultValue}},process:function(e,t){if("string"!=typeof e)return t&&ESGColor.sanitizeGradient(e),[ESGColor.processGradient(e),"gradient",e];if("transparent"===e.trim())return["transparent","transparent"];if(-1===e.search(/\[\{/))return-1!==e.search("-gradient")?[e,"gradient_css",ESGColor.reverseGradient(e)]:-1!==e.search("#")?[ESGColor.sanitizeHex(e),"hex"]:-1!==e.search("rgba")?(-1!==(e=e.replace(/\s/g,"")).search(/,\)/)&&(e=e.split(",)")[0]+",1)"),[e,"rgba"]):[e.replace(/\s/g,""),"rgb"];try{return e=JSON.parse(e.replace(/\&/g,'"')),t&&ESGColor.sanitizeGradient(e),[ESGColor.processGradient(e),"gradient",e]}catch(e){return console.log("ESGColor.process() failed to parse JSON string"),["linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)","gradient",{type:"linear",angle:"0",colors:[{r:"255",g:"255",b:"255",a:"1",position:"0",align:"bottom"},{r:"0",g:"0",b:"0",a:"1",position:"100",align:"bottom"}]}]}},transparentRgba:function(e,t){if(!t&&"rgba"!==ESGColor.process(e)[1])return!1;return"0"===ESGColor.rgbValues(e,4)[3]},rgbValues:function(e,t){3===(e=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(",")).length&&4===t&&(e[3]="1");for(var r=0;r<t;r++)void 0!==e[r]&&(e[r]=e[r].trim());return e},rgbString:function(e,t,r){return"rgb("+e+", "+t+", "+r+")"},rgbaString:function(e,t,r,i){return"rgba("+e+", "+t+", "+r+", "+i+")"},rgbToHex:function(e){var t=ESGColor.rgbValues(e,3);return ESGColor.getRgbToHex(t[0],t[1],t[2])},rgbaToHex:function(e){var t=ESGColor.rgbValues(e,4);return[ESGColor.getRgbToHex(t[0],t[1],t[2]),t[3]]},getOpacity:function(e){return parseInt(100*ESGColor.rgbValues(e,4)[3],10)+"%"},getRgbToHex:function(e,t,r){return"#"+("0"+parseInt(e,10).toString(16)).slice(-2)+("0"+parseInt(t,10).toString(16)).slice(-2)+("0"+parseInt(r,10).toString(16)).slice(-2)},sanitizeAlpha:function(e){return parseFloat(Math.max(Math.min(parseFloat(e),1),0).toFixed(2).replace(/\.?0*$/,""))},joinToRgba:function(e){return e=e.split("||"),ESGColor.convert(e[0],e[1])},processRgba:function(e,t){e=e.replace("#","");var r=void 0!==t,i=(r?"rgba":"rgb")+"("+parseInt(e.substring(0,2),16)+", "+parseInt(e.substring(2,4),16)+", "+parseInt(e.substring(4,6),16);return i+=r?", "+(.01*parseInt(t,10)).toFixed(2).replace(/\.?0*$/,"")+")":")"},hexToRGB:function(e){return e=e.replace("#",""),[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]},processGradient:function(e,t,r){t&&ESGColor.sanitizeGradient(e),!r&&e.easing&&"none"!==e.easing&&("undefined"!=typeof jQuery&&(e=jQuery.extend(!0,{},e)),ESGColor.easeGradient(e));var i,n,o=e.type,a=o+"-gradient(";n="linear"===o?180!==(i=parseInt(e.angle,10))?i+"deg, ":"":"ellipse at center, ";for(var l,s=e.colors,c=s.length,u="",d=0;d<c;d++)d>0&&(u+=", "),u+="rgba("+(l=s[d]).r+", "+l.g+", "+l.b+", "+l.a+") "+l.position+"%";return a+n+u+")"},sanitizeHex:function(e){if(3===(e=e.replace("#","").trim()).length){var t=e.charAt(0),r=e.charAt(1),i=e.charAt(2);e=t+t+r+r+i+i}return"#"+e},sortPoints:function(e,t){return e.hasOwnProperty("x")?e.x<t.x?-1:e.x>t.x?1:0:e.position<t.position?-1:e.position>t.position?1:0},distColor:function(e,t,r,i,n){return Math.max(Math.min(Math.round(Math.abs((e-t)/(r-t)*(n-i)+i)),255),0)},distAlpha:function(e,t,r,i,n){return Math.max(Math.min(Math.abs(parseFloat(((e-t)/(r-t)*(n-i)).toFixed(2))+parseFloat(i)),1),0)},sanitizeGradient:function(e){var t,r=e.colors,i=r.length,n=[];r.sort(ESGColor.sortPoints);for(var o=0;o<i;o++){var a=r[o];delete a.align,a.a=ESGColor.sanitizeAlpha(a.a),a.r=parseInt(a.r,10),a.g=parseInt(a.g,10),a.b=parseInt(a.b,10),a.position=parseInt(a.position,10),t?JSON.stringify(a)!==JSON.stringify(t)&&(n[n.length]=a):n[n.length]=a,t=a}return e.colors=n,e},reverseGradient:function(e){if(-1!==e.search("hsl"))return e;var t=(e=e.replace(/\-moz\-|\-webkit\-/,"").replace("to left","90deg").replace("to bottom","180deg").replace("to top","0deg").replace("to right","270deg").replace(";","")).split("-gradient(");if(t.length<2)return e;var r="0",i=t[1].trim();-1===i.search("ellipse at center")?-1!==i.search("deg")&&(r=(i=i.split("deg"))[0].trim(),i=i[1].trim()):i=i.replace("ellipse at center",""),","===i.charAt(0)&&(i=i.slice(1)),","===i.charAt(i.length-1)&&(i=i.slice(0,i.length-1));var n,o,a,l,s,c=i.split("%"),u=[],d=0;c.pop(),s=c.length;for(var p=0;p<s;p++){if(a=(l=c[p].trim()).length,n="",","===l.charAt(0)&&(l=l.slice(1)),-1===l.search(" "))return e;for(n=l.split(" "),n=parseInt(n[n.length-1],10);a--&&(d=a," "!==l[a]););l=-1!==(l=l.substring(0,d)).search(/\)/)?l.split(")")[0].trim()+")":l.split(" ")[0].trim(),"hex"===ESGColor.process(l)[1]&&(l=ESGColor.sanitizeHex(l),l=ESGColor.processRgba(l)),o&&o===l||(o=l,l=ESGColor.rgbValues(l,4),u[u.length]={r:l[0],g:l[1],b:l[2],a:l[3],position:n,align:"top"},u[u.length]={r:l[0],g:l[1],b:l[2],a:1,position:n,align:"bottom"})}return JSON.stringify({type:t[0].trim(),angle:r,colors:u})},insertPoints:function(e,t,r,i,n){var o=e.position,a=t.position;if(!(o>a)){for(var l,s,c,u=[],d=0;d<n;d++)(s=parseFloat(i(d,0,1,n).toFixed(2))*(a-o)+o)>o&&s<a&&(u[u.length]=s);var p,h,f=u.length,g=parseFloat(((a-o)/(f+1)).toFixed(2)),m=parseFloat(g+o);for(d=0;d<f;d++)(c=u[d])!==e.position&&(p=ESGColor.sanitizeAlpha(e.a),h=ESGColor.sanitizeAlpha(t.a),l={position:m,r:e.r!==t.r?Math.round(ESGColor.distColor(c,o,a,e.r,t.r)):e.r,g:e.g!==t.g?Math.round(ESGColor.distColor(c,o,a,e.g,t.g)):e.g,b:e.b!==t.b?Math.round(ESGColor.distColor(c,o,a,e.b,t.b)):e.b,a:p!==h?ESGColor.sanitizeAlpha(ESGColor.distAlpha(c,o,a,e.a,t.a)):p},m+=g,m=parseFloat(m.toFixed(2)),r[r.length]=l)}},easeGradient:function(e){var t=.01*parseInt(e.strength,10)*15,r=e.colors,i=e.easing,n=r.length-1,o=[];r.sort(ESGColor.sortPoints),i=i.split("."),i=ESGColor.easing[i[0]][i[1]];for(var a=0;a<n;a++)o[o.length]=r[a],ESGColor.insertPoints(r[a],r[a+1],o,i,t);o[o.length]=r[n],e.colors=o},easing:{quint:{easeout:function(e,t,r,i){return r*((e=e/i-1)*e*e*e*e+1)+t},easein:function(e,t,r,i){return r*(e/=i)*e*e*e*e+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e*e*e*e+t:r/2*((e-=2)*e*e*e*e+2)+t}},quad:{easein:function(e,t,r,i){return r*(e/=i)*e+t},easeout:function(e,t,r,i){return-r*(e/=i)*(e-2)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t}},quart:{easein:function(e,t,r,i){return r*(e/=i)*e*e*e+t},easeout:function(e,t,r,i){return-r*((e=e/i-1)*e*e*e-1)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e*e*e+t:-r/2*((e-=2)*e*e*e-2)+t}},cubic:{easein:function(e,t,r,i){return r*(e/=i)*e*e+t},easeout:function(e,t,r,i){return r*((e=e/i-1)*e*e+1)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}},circ:{easein:function(e,t,r,i){return-r*(Math.sqrt(1-(e/=i)*e)-1)+t},easeout:function(e,t,r,i){return r*Math.sqrt(1-(e=e/i-1)*e)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?-r/2*(Math.sqrt(1-e*e)-1)+t:r/2*(Math.sqrt(1-(e-=2)*e)+1)+t}},sine:{easein:function(e,t,r,i){return-r*Math.cos(e/i*(Math.PI/2))+r+t},easeout:function(e,t,r,i){return r*Math.sin(e/i*(Math.PI/2))+t},easeinout:function(e,t,r,i){return-r/2*(Math.cos(Math.PI*e/i)-1)+t}},expo:{easein:function(e,t,r,i){return 0===e?t:r*Math.pow(2,10*(e/i-1))+t},easeout:function(e,t,r,i){return e===i?t+r:r*(1-Math.pow(2,-10*e/i))+t},easeinout:function(e,t,r,i){return 0===e?t:e===i?t+r:(e/=i/2)<1?r/2*Math.pow(2,10*(e-1))+t:r/2*(2-Math.pow(2,-10*--e))+t}},bounce:{easeout:function(e,t,r,i){return(e/=i)<1/2.75?r*(7.5625*e*e)+t:e<2/2.75?r*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?r*(7.5625*(e-=2.25/2.75)*e+.9375)+t:r*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easein:function(e,t,r,i){return r-ESGColor.easing.bounce.easeout(i-e,0,r,i)+t},easeinout:function(e,t,r,i){return e<i/2?.5*ESGColor.easing.bounce.easein(2*e,0,r,i)+t:.5*ESGColor.easing.bounce.easeout(2*e-i,0,r,i)+.5*r+t}}}}}("undefined"!==jQuery&&jQuery),function(e){"use strict";ESG.DOC=void 0===ESG.DOC?jQuery(document):ESG.DOC;var t,r,i,n,o,a,l,s,c,u,d,p,h,f,g,m,v,b,y,k,w,x,C,S,L,T,E,M,N,O,P,G,A,I,D,_,F,H,W,z,R,B,j,V,q,U,K,Q,$,X,Y,Z,J,ee,te,re,ie,ne,oe,ae,le,se,ce,ue,de,pe,he,fe,ge,me,ve,be,ye,ke,we,xe,Ce,Se,Le,Te,Ee,Me,Ne,Oe,Pe,Ge,Ae,Ie,De,_e,Fe,He,We,ze,Re,Be,je,Ve,qe={},Ue=236,Ke=25,Qe=3,$e=4,Xe=150,Ye=10,Ze="full",Je={axis:"x",containment:"#esgbuilder-cpicker-point-wrap"},et={color:"Color",solid_color:"Solid",gradient_color:"Gradient",gradient_easing:"Gradient Easing",easing_strength:"Easing/Strength",currently_editing:"Currently Editing",core_presets:"Core Presets",custom_presets:"Custom Presets",enter_a_name:"Enter a Name",save_a_new_preset:"Save a new Preset",save:"Save Preset",color_hex_value:"Hex",opacity:"Opacity",clear:"Clear Color",location:"Location",delete:"Delete Marker",horizontal:"Horizontal",vertical:"Vertical",radial:"Radial",enter_angle:"Enter Angle",reverse_gradient:"Reverse Gradient",delete_confirm:"Remove/Delete this custom preset color?",naming_error:"Please enter a unique name for the new color preset",preset_collection:"Preset Collection",color_type:"Color Type",close:"Close",save_exit:"Save",apply:"Apply",rgb:"RGB",preset_group:"Preset Group",save_preset:"Save Preset",pos_opacity:"Pos / Opacity"},tt=["#FFFFFF","#000000","#FF3A2D","#007AFF","#4CD964","#FFCC00","#C7C7CC","#8E8E93","#FFD3E0","#34AADC","#E0F8D8","#5AC8FA","#5856D6","#FF69B4","#800000","#009933"],rt=[{0:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:247,&g&:247,&b&:247,&a&:&1&,&position&:0,&align&:&top&},{&r&:247,&g&:247,&b&:247,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:215,&g&:215,&b&:215,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:215,&g&:215,&b&:215,&a&:&1&,&position&:100,&align&:&top&}]}"},{1:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:74,&g&:74,&b&:74,&a&:&1&,&position&:0,&align&:&top&},{&r&:74,&g&:74,&b&:74,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:43,&g&:43,&b&:43,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:43,&g&:43,&b&:43,&a&:&1&,&position&:100,&align&:&top&}]}"},{2:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:219,&g&:221,&b&:222,&a&:&1&,&position&:0,&align&:&top&},{&r&:219,&g&:221,&b&:222,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:137,&g&:140,&b&:144,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:137,&g&:140,&b&:144,&a&:&1&,&position&:100,&align&:&top&}]}"},{3:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:26,&g&:214,&b&:253,&a&:&1&,&position&:0,&align&:&top&},{&r&:26,&g&:214,&b&:253,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:29,&g&:98,&b&:240,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:29,&g&:98,&b&:240,&a&:&1&,&position&:100,&align&:&top&}]}"},{4:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:198,&g&:68,&b&:252,&a&:&1&,&position&:0,&align&:&top&},{&r&:198,&g&:68,&b&:252,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:88,&g&:86,&b&:214,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:88,&g&:86,&b&:214,&a&:&1&,&position&:100,&align&:&top&}]}"},{5:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:42,&b&:104,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:42,&b&:104,&a&:&1&,&position&:100,&align&:&top&}]}"},{6:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:228,&g&:221,&b&:202,&a&:&1&,&position&:0,&align&:&top&},{&r&:228,&g&:221,&b&:202,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:214,&g&:206,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:214,&g&:206,&b&:195,&a&:&1&,&position&:100,&align&:&top&}]}"},{7:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:219,&b&:76,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:219,&b&:76,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:205,&b&:2,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:205,&b&:2,&a&:&1&,&position&:100,&align&:&top&}]}"},{8:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:149,&b&:0,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:149,&b&:0,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:100,&align&:&top&}]}"},{9:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:82,&g&:237,&b&:199,&a&:&1&,&position&:0,&align&:&top&},{&r&:82,&g&:237,&b&:199,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:90,&g&:200,&b&:251,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:90,&g&:200,&b&:251,&a&:&1&,&position&:100,&align&:&top&}]}"},{10:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:228,&g&:183,&b&:240,&a&:&1&,&position&:0,&align&:&top&},{&r&:228,&g&:183,&b&:240,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:200,&g&:110,&b&:223,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:200,&g&:110,&b&:223,&a&:&1&,&position&:100,&align&:&top&}]}"},{11:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:135,&g&:252,&b&:112,&a&:&1&,&position&:0,&align&:&top&},{&r&:135,&g&:252,&b&:112,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:11,&g&:211,&b&:24,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:11,&g&:211,&b&:24,&a&:&1&,&position&:100,&align&:&top&}]}"},{12:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:61,&g&:78,&b&:129,&a&:&1&,&position&:0,&align&:&top&},{&r&:61,&g&:78,&b&:129,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:87,&g&:83,&b&:201,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:110,&g&:127,&b&:243,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:110,&g&:127,&b&:243,&a&:&1&,&position&:100,&align&:&top&}]}"},{13:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:35,&g&:21,&b&:87,&a&:&1&,&position&:0,&align&:&top&},{&r&:35,&g&:21,&b&:87,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:68,&g&:16,&b&:122,&a&:&1&,&position&:29,&align&:&bottom&},{&r&:255,&g&:19,&b&:97,&a&:&1&,&position&:67,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:&1&,&position&:100,&align&:&top&}]}"},{14:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:105,&g&:234,&b&:203,&a&:&1&,&position&:0,&align&:&top&},{&r&:105,&g&:234,&b&:203,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:234,&g&:204,&b&:248,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:102,&g&:84,&b&:241,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:102,&g&:84,&b&:241,&a&:&1&,&position&:100,&align&:&top&}]}"},{15:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:124,&g&:100,&b&:213,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:76,&g&:195,&b&:255,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:76,&g&:195,&b&:255,&a&:&1&,&position&:100,&align&:&top&}]}"},{16:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:141,&g&:11,&b&:147,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:50,&g&:21,&b&:117,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:50,&g&:21,&b&:117,&a&:&1&,&position&:100,&align&:&top&}]}"},{17:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:164,&g&:69,&b&:178,&a&:&1&,&position&:0,&align&:&top&},{&r&:164,&g&:69,&b&:178,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:212,&g&:24,&b&:114,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:255,&g&:0,&b&:102,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:0,&b&:102,&a&:&1&,&position&:100,&align&:&top&}]}"},{18:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:158,&g&:251,&b&:211,&a&:&1&,&position&:0,&align&:&top&},{&r&:158,&g&:251,&b&:211,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:87,&g&:233,&b&:242,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:69,&g&:212,&b&:251,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:69,&g&:212,&b&:251,&a&:&1&,&position&:100,&align&:&top&}]}"},{19:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:172,&g&:50,&b&:228,&a&:&1&,&position&:0,&align&:&top&},{&r&:172,&g&:50,&b&:228,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:121,&g&:24,&b&:242,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:72,&g&:1,&b&:255,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:72,&g&:1,&b&:255,&a&:&1&,&position&:100,&align&:&top&}]}"},{20:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:112,&g&:133,&b&:182,&a&:&1&,&position&:0,&align&:&top&},{&r&:112,&g&:133,&b&:182,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:135,&g&:167,&b&:217,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:222,&g&:243,&b&:248,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:222,&g&:243,&b&:248,&a&:&1&,&position&:100,&align&:&top&}]}"},{21:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:34,&g&:225,&b&:255,&a&:&1&,&position&:0,&align&:&top&},{&r&:34,&g&:225,&b&:255,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:29,&g&:143,&b&:225,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:98,&g&:94,&b&:177,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:98,&g&:94,&b&:177,&a&:&1&,&position&:100,&align&:&top&}]}"},{22:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&top&},{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:107,&g&:141,&b&:214,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:142,&g&:55,&b&:215,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:142,&g&:55,&b&:215,&a&:&1&,&position&:100,&align&:&top&}]}"},{23:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&top&},{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:197,&g&:193,&b&:255,&a&:&1&,&position&:56,&align&:&bottom&},{&r&:255,&g&:186,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:186,&b&:195,&a&:&1&,&position&:100,&align&:&top&}]}"},{24:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:191,&g&:217,&b&:254,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:191,&g&:217,&b&:254,&a&:&1&,&position&:0,&align&:&top&},{&r&:223,&g&:137,&b&:181,&a&:&1&,&position&:100,&align&:&top&},{&r&:223,&g&:137,&b&:181,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{25:"{&type&:&linear&,&angle&:&340&,&colors&:[{&r&:97,&g&:97,&b&:97,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:97,&g&:97,&b&:97,&a&:&1&,&position&:0,&align&:&top&},{&r&:155,&g&:197,&b&:195,&a&:&1&,&position&:100,&align&:&top&},{&r&:155,&g&:197,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{26:"{&type&:&linear&,&angle&:&90&,&colors&:[{&r&:36,&g&:57,&b&:73,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:36,&g&:57,&b&:73,&a&:&1&,&position&:0,&align&:&top&},{&r&:81,&g&:127,&b&:164,&a&:&1&,&position&:100,&align&:&top&},{&r&:81,&g&:127,&b&:164,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{27:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:234,&g&:205,&b&:163,&a&:&1&,&position&:0,&align&:&top&},{&r&:234,&g&:205,&b&:163,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:230,&g&:185,&b&:128,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:230,&g&:185,&b&:128,&a&:&1&,&position&:100,&align&:&top&}]}"},{28:"{&type&:&linear&,&angle&:&45&,&colors&:[{&r&:238,&g&:156,&b&:167,&a&:&1&,&position&:0,&align&:&top&},{&r&:238,&g&:156,&b&:167,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:221,&b&:225,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:221,&b&:225,&a&:&1&,&position&:100,&align&:&top&}]}"},{29:"{&type&:&linear&,&angle&:&340&,&colors&:[{&r&:247,&g&:148,&b&:164,&a&:&1&,&position&:0,&align&:&top&},{&r&:247,&g&:148,&b&:164,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:253,&g&:214,&b&:189,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:253,&g&:214,&b&:189,&a&:&1&,&position&:100,&align&:&top&}]}"},{30:"{&type&:&linear&,&angle&:&45&,&colors&:[{&r&:135,&g&:77,&b&:162,&a&:&1&,&position&:0,&align&:&top&},{&r&:135,&g&:77,&b&:162,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:196,&g&:58,&b&:48,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:196,&g&:58,&b&:48,&a&:&1&,&position&:100,&align&:&top&}]}"},{31:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:243,&g&:231,&b&:233,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:243,&g&:231,&b&:233,&a&:&1&,&position&:0,&align&:&top&},{&r&:218,&g&:212,&b&:236,&a&:&1&,&position&:100,&align&:&top&},{&r&:218,&g&:212,&b&:236,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{32:"{&type&:&linear&,&angle&:&320&,&colors&:[{&r&:43,&g&:88,&b&:118,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:43,&g&:88,&b&:118,&a&:&1&,&position&:0,&align&:&top&},{&r&:78,&g&:67,&b&:118,&a&:&1&,&position&:100,&align&:&top&},{&r&:78,&g&:67,&b&:118,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{33:"{&type&:&linear&,&angle&:&60&,&colors&:[{&r&:41,&g&:50,&b&:60,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:41,&g&:50,&b&:60,&a&:&1&,&position&:0,&align&:&top&},{&r&:72,&g&:85,&b&:99,&a&:&1&,&position&:100,&align&:&top&},{&r&:72,&g&:85,&b&:99,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{34:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:233,&g&:233,&b&:231,&a&:&1&,&position&:0,&align&:&top&},{&r&:233,&g&:233,&b&:231,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:239,&g&:238,&b&:236,&a&:&1&,&position&:25,&align&:&bottom&},{&r&:238,&g&:238,&b&:238,&a&:&1&,&position&:70,&align&:&bottom&},{&r&:213,&g&:212,&b&:208,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:213,&g&:212,&b&:208,&a&:&1&,&position&:100,&align&:&top&}]}"},{35:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:251,&g&:200,&b&:212,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:251,&g&:200,&b&:212,&a&:&1&,&position&:0,&align&:&top&},{&r&:151,&g&:149,&b&:240,&a&:&1&,&position&:100,&align&:&top&},{&r&:151,&g&:149,&b&:240,&a&:&1&,&position&:100,&align&:&bottom&}]}"}],it='<div id="esgbuilder-cpicker-back" class="esgbuilder-cpicker-close"></div><div id="esgbuilder-cpicker"><div id="esgbuilder-cpicker-container"><div id="esgbuilder-cpicker-left" class="esgbuilder-cpicker-column"><div id="esgbuilder-cpicker-head"><div id="esgbuilder-cpicker-drag" class="esgbuilder-cpicker-draggable"></div><div id="esgbuilder-cpicker-type-wrap" class="esgbuilder-cpicker-side esgbuilder-cpicker-left esgbuilder-cpicker-candrag"><span data-text="color_type" class="esgbuilder-cpicker-candrag esgbuilder-cpicker-title"></span><div id="esgbuilder-cpicker-btn-wrap"><span id="esgbuilder-cpicker-color-btn" class="esgbuilder-cpicker-main-btn"><i class="material-icons">invert_colors</i></span><span id="esgbuilder-cpicker-gradient-btn" class="esgbuilder-cpicker-main-btn"><i class="material-icons">gradient</i></span></div></div><div id="esgbuilder-cpicker-editing" class="esgbuilder-cpicker-candrag"><span id="esgbuilder-cpicker-edit-title" data-text="currently_editing"></span><span id="esgbuilder-cpicker-current-edit" class="esgbuilder-cpicker-txt-space-left esgbuilder-cpicker-bright"></span></div></div><div id="esgbuilder-cpicker-base"><div id="esgbuilder-cpicker-colors"><div><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="color" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><span id="esgbuilder-cpicker-preview-color" class="esgbuilder-cpicker-preview"></span><input type="text" id="esgbuilder-cpicker-color-hex" class="esgbuilder-cpicker-input esgbuilder-cpicker-hex" value="#ffffff" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="rgb" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small first"><input type="text" id="esgbuilder-cpicker-r" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small"><input type="text" id="esgbuilder-cpicker-g" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small"><input type="text" id="esgbuilder-cpicker-b" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="opacity" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" id="esgbuilder-cpicker-color-opacity" class="esgbuilder-cpicker-input esgbuilder-cpicker-opacity-input" value="100%" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span id="esgbuilder-cpciker-clear-hex" class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover"><i class="material-icons">delete</i><span data-text="clear"></span></span></div></div><div class="esgbuilder-cpicker-side"><div class="esgbuilder-cpicker-iris"><input id="esgbuilder-cpicker-iris-color" class="esgbuilder-cpicker-iris-input" /><div id="esgbuilder-cpicker-scroller" class="iris-slider iris-strip"><div id="esgbuilder-cpicker-scroll-bg"></div><div id="esgbuilder-cpicker-scroll" class="iris-slider-offset"></div></div></div></div></div><div id="esgbuilder-cpicker-color-presets" class="esgbuilder-cpicker-presets"><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="preset_group" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-preset-colors" class="esgbuilder-cpicker-dropdown esgbuilder-cpicker-preset-selector"><option value="core">Defaults</option><option value="custom">Custom</option></select></div></div><div class="esgbuilder-cpicker-row"><span data-text="save_preset" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" class="esgbuilder-cpicker-input esgbuilder-cpicker-preset-save" data-placeholder="enter_a_name" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-save-preset-btn" data-alert="naming_error" data-message="Please enter a unique name for the new color preset"><i class="material-icons">save</i><span data-text="save"></span></span></div></div><div class="esgbuilder-cpicker-side"><div id="esgbuilder-cpicker-colors-core" class="esgbuilder-cpicker-presets-group ps-container"></div><div id="esgbuilder-cpicker-colors-custom" class="esgbuilder-cpicker-presets-group ps-container esgbuilder-cpicker-presets-custom"></div></div></div></div><div id="esgbuilder-cpicker-gradients"><div><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left esgbuilder-cpicker-supress"><div class="esgbuilder-cpicker-row first"><div class="esgbuilder-cpicker-gradient-block"><div id="esgbuilder-cpicker-gradient-input" class="esgbuilder-cpicker-gradient-builder"><span id="esgbuilder-cpicker-hit-top" class="esgbuilder-cpicker-builder-hit"></span><div id="esgbuilder-cpicker-point-wrap"><div id="esgbuilder-cpciker-point-container"></div></div><span id="esgbuilder-cpicker-hit-bottom" class="esgbuilder-cpicker-builder-hit"></span></div></div></div><div class="esgbuilder-cpicker-row"><span data-text="pos_opacity" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress first disabled"><input type="text" id="esgbuilder-cpicker-color-location" class="esgbuilder-cpicker-input" value="100%" maxlength="4" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress disabled"><input type="text" id="esgbuilder-cpicker-grad-opacity" class="esgbuilder-cpicker-input esgbuilder-cpicker-opacity-input" value="100%" maxlength="4" /></div><span id="esgbuilder-cpicker-color-delete" class="esgbuilder-cpicker-btn esgbuilder-cpicker-btn-small esgbuilder-cpicker-hover esgbuilder-cpicker-point-delete esgbuilder-cpicker-supress"><i class="material-icons">delete</i></span><div class="clearfix"></div></div><div id="revpicker-easing-row" class="esgbuilder-cpicker-row"><span id="esgbuilder-cpicker-easing-title" data-text="gradient_easing" class="esgbuilder-cpicker-title"></span><span id="esgbuilder-cpicker-strength-title" data-text="easing_strength" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-easing" class="esgbuilder-cpicker-dropdown"><option value="none">None</option><option value="sine.easeout">sine.out</option><option value="sine.easein">sine.in</option><option value="sine.easeinout">sine.inOut</option><option value="quad.easeout">Quad.easeOut</option><option value="quad.easein">Quad.easeIn</option><option value="quad.easeinout">Quad.easeInOut</option><option value="cubic.easeout">Cubic.easeOut</option><option value="cubic.easein">Cubic.easeIn</option><option value="cubic.easeinout">Cubic.easeInOut</option><option value="circ.easeout">circ.out</option><option value="circ.easein">circ.in</option><option value="circ.easeinout">circ.inOut</option><option value="quart.easeout">Quart.easeOut</option><option value="quart.easein">Quart.easeIn</option><option value="quart.easeinout">Quart.easeInOut</option><option value="quint.easeout">Quint.easeOut</option><option value="quint.easein">Quint.easeIn</option><option value="quint.easeinout">Quint.easeInOut</option><option value="expo.easeout">expo.out</option><option value="expo.easein">expo.in</option><option value="expo.easeinout">expo.inOut</option><option value="bounce.easeout">bounce.out</option><option value="bounce.easein">bounce.in</option><option value="bounce.easeinout">bounce.inOut</option></select></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress esgbuilder-cpicker-easing-strength"><input type="text" id="esgbuilder-cpicker-strength" class="esgbuilder-cpicker-input" value="100%" maxlength="5" /></div></div><div class="esgbuilder-cpicker-hideable"><div class="esgbuilder-cpicker-row extended"><span data-text="color" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-supress"><span id="esgbuilder-cpicker-preview-gradient" class="esgbuilder-cpicker-preview"></span><input type="text" id="esgbuilder-cpicker-gradient-hex" class="esgbuilder-cpicker-input esgbuilder-cpicker-hex" value="#ffffff" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="rgb" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress first"><input type="text" id="esgbuilder-cpicker-r2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" id="esgbuilder-cpicker-g2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" id="esgbuilder-cpicker-b2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span id="esgbuilder-cpciker-clear-gradient" class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-supress"><i class="material-icons">delete</i><span data-text="clear"></span></span></div></div></div><div class="esgbuilder-cpicker-side"><div class="esgbuilder-cpicker-row first"><div class="esgbuilder-cpicker-gradient-block"><div id="esgbuilder-cpicker-gradient-output" class="esgbuilder-cpicker-gradient-builder"></div></div></div><div class="esgbuilder-cpicker-row"><span id="esgbuilder-cpicker-orientation-horizontal" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress selected" data-direction="90"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-horizontal" class="esgbuilder-cpicker-preset-bg"></span></span><span id="esgbuilder-cpicker-orientation-vertical" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress" data-direction="180"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-vertical" class="esgbuilder-cpicker-preset-bg"></span></span><span id="esgbuilder-cpicker-orientation-radial" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress" data-direction="radial"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-radial" class="esgbuilder-cpicker-preset-bg"></span></span><div id="esgbuilder-cpicker-wheel" class="esgbuilder-cpicker-supress"><div id="esgbuilder-cpicker-wheel-inner"><span id="esgbuilder-cpicker-wheel-point"></span></div></div><div id="esgbuilder-cpicker-radial-wrap" class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" class="esgbuilder-cpicker-input" id="esgbuilder-cpicker-meta-angle" maxlength="4"></div></div><div class="esgbuilder-cpicker-row esgbuilder-cpicker-no-margin"><span data-text="reverse_gradient" class="esgbuilder-cpicker-title esgbuilder-cpicker-label"></span><div id="esgbuilder-cpicker-meta-reverse" class="esgbuilder-cpicker-onoff-wrap esgbuilder-cpicker-supress"><div class="esgbuilder-cpicker-onoff-inner"><div class="esgbuilder-cpicker-onoff esgbuilder-cpicker-off"><span>OFF</span></div><div class="esgbuilder-cpicker-onoff esgbuilder-cpicker-on"><span>ON</span></div></div></div></div><div class="esgbuilder-cpicker-hideable"><div class="esgbuilder-cpicker-row"><div class="esgbuilder-cpicker-iris esgbuilder-cpicker-supress"><input id="esgbuilder-cpicker-iris-gradient" class="esgbuilder-cpicker-iris-input" /></div></div></div></div></div><div id="esgbuilder-cpicker-gradient-presets" class="esgbuilder-cpicker-presets"><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="preset_group" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-preset-gradients" class="esgbuilder-cpicker-dropdown esgbuilder-cpicker-preset-selector"><option value="core">Defaults</option><option value="custom">Custom</option></select></div></div><div class="esgbuilder-cpicker-row"><span data-text="save_preset" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" class="esgbuilder-cpicker-input esgbuilder-cpicker-preset-save" data-placeholder="enter_a_name" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-save-preset-btn" data-alert="naming_error" data-message="Please enter a unique name for the new color preset"><i class="material-icons">save</i><span data-text="save"></span></span></div></div><div class="esgbuilder-cpicker-side"><div id="esgbuilder-cpicker-gradients-core" class="esgbuilder-cpicker-presets-group ps-container"></div><div id="esgbuilder-cpicker-gradients-custom" class="esgbuilder-cpicker-presets-group ps-container esgbuilder-cpicker-presets-custom"></div></div></div></div></div></div><div id="esgbuilder-cpicker-right" class="esgbuilder-cpicker-column"><div id="esgbuilder-cpicker-exit" class="esgbuilder-cpicker-close esgbuilder-cpicker-btn-large esgbuilder-cpicker-hover"><i class="material-icons esgbuilder-cpicker-hover">close</i></div><div id="esgbuilder-cpicker-toggle"><div id="esgbuilder-cpicker-palette" class="esgbuilder-cpicker-btn-large esgbuilder-cpicker-hover"><i class="material-icons esgbuilder-cpicker-hover esgbuilder-cpicker-palette-closed">palette</i><i class="material-icons esgbuilder-cpicker-hover esgbuilder-cpicker-palette-open">keyboard_arrow_up</i></div><div id="esgbuilder-cpicker-check" class="esgbuilder-cpicker-btn-large"><i class="material-icons esgbuilder-cpicker-hover">check</i></div></div></div></div><span id="esgbuilder-cpicker-remove-delete" data-text="delete_confirm"></span></div>';function nt(){this.innerHTML=ge[lt(this,"data-text")]}function ot(){this.setAttribute("placeholder",ge[lt(this,"data-placeholder")])}function at(){this.setAttribute("data-message",ge[lt(this,"data-alert")])}function lt(e,t){return e.getAttribute(t)||""}function st(t){t||(t={}),"string"==typeof t&&(t=JSON.parse(t.replace(/\&/g,'"'))),ge=e.extend({},et,t),q=ge.color,b.find("*[data-placeholder]").each(ot),b.find("*[data-alert]").each(at),b.find("*[data-text]").each(nt)}function ct(t,r,i,n){var o,a,l,s,c;if(e.isPlainObject(t))for(var u in t)t.hasOwnProperty(u)&&("string"==typeof(t=t[u])?"gradient"===(t=ESGColor.process(t))[1]?(s=(a=t[2]).angle,c=a.type,t=ESGColor.processGradient(e.extend(!0,{},a),!0)):t=t[0]:(s=t.angle,c=t.type),o=isNaN(u)?u.replace(/_/g," ").replace(/\b\w/g,(function(e){return e.toUpperCase()})):"radial"!==c?s+"°":"radial");else o=t;if("blank"!==t){e.isPlainObject(t)&&(a=t,"",t=n||ESGColor.processGradient(e.extend(!0,{},t),!0));var d='<span class="esgbuilder-cpicker-color tptip'+i+'" data-title="'+o+'" data-color="'+t+'"><span class="esgbuilder-cpicker-preset-tile"></span><span class="esgbuilder-cpicker-preset-bg" style="background: '+t+'"></span>';return r||(d+='<span class="esgbuilder-cpicker-delete"><i class="material-icons">clear</i></span>'),l=e(d+="</span>"),a&&l.data("gradient",a),l[0]}return(l=document.createElement("span")).className="esgbuilder-cpicker-color blank",l}function ut(){var t=lt(this,"data-color").toLowerCase(),r=!Ie&&t===Oe.toLowerCase();if(t===be||r){var i=e(this);return i.closest(".esgbuilder-cpicker-presets-group").find(".esgbuilder-cpicker-color.selected").removeClass("selected"),We=i,Ie&&!$&&ht(We.data("gradient"),!0),i.addClass("selected"),!1}}function dt(e,t){for(var r=document.createDocumentFragment(),i=-1!==e.search("core"),n=i?"":" esgbuilder-picker-color-custom",o=t.length,a=Math.max(Math.ceil(o/$e),Qe),l=0;l<a;l++)for(;t.length<(l+1)*$e;)t[t.length]="blank";for(o=t.length,l=0;l<o;l++)r.appendChild(ct(t[l],i,n));return["esgbuilder-cpicker-"+e,r]}function pt(e,t,r){if(Ge){if(!e){var i=t||M.val(),n=void 0!==r?r:Me.val();t="transparent"===i?"transparent":"100%"===n?ESGColor.sanitizeHex(i):ESGColor.processRgba(i,n)}var o="transparent"===t,a=o?"":t;e?w.data("state",t):E.data("state",t),o?(Ge.css("background",a),Le.css("background",a)):(Ge[0].style.background=a,Le.css("background",a)),c&&c(Te,t,ye,we),ESG.DOC.trigger("revcolorpickerupdate",[Te,t])}}function ht(r,i){var o=ESGColor.process(r),a=o[1],s=o[0];if(n&&k.removeClass("checked"),"gradient"!==a&&"gradient_css"!==a){switch(a){case"hex":r=ESGColor.sanitizeHex(s),Me.val("100%"),_t(100);break;case"rgba":var c=ESGColor.rgbaToHex(s),u=parseInt(100*c[1],10);r=c[0],Me.val(u+"%"),_t(u);break;case"rgb":r=ESGColor.rgbToHex(s),Me.val("100%"),_t(100);break;default:ne.trigger("click"),E.trigger("click")}V.val(r).trigger("change"),i||E.trigger("click")}else n?("gradient_css"===a&&(o[2]=JSON.parse(o[2])),function(r){var i=r.angle,n=r.easing?r.easing:"none",o=r.hasOwnProperty("strength")?r.strength:"100";"radial"===r.type&&(i="radial");oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+i+'"]').addClass("selected"),zt(n),l.val(n).ddTP("change"),T.val(o+"%"),t.val(kt(i)),zt(),Pt(i),function(e){for(var t,r,i=document.createDocumentFragment(),n=e.length,o=0;o<n;o++)t=(r=e[o]).align,i.appendChild(yt(t,r.position,vt(r),mt(r,t)));de&&de.draggable("destroy");pe.empty().append(i),de=pe.children().draggable(Je)}(r.colors)}(o[2]),St(),i||(ce=!0,w.trigger("click"))):(V.val(ESGColor.defaultValue).trigger("change"),E.trigger("click"));return[s,a]}function ft(t,r){var i=function(e,t){var r,i=o.slice(),n=i.length;for(i.sort(ESGColor.sortPoints);n--;)if((r=i[n]).align===e&&r.x<t)return r;n=i.length;for(var a=0;a<n;a++)if((r=i[a]).align===e&&r.x>t)return r}(t,r),n=i.color,a=mt(n,t,!0),l=yt(t,r,vt(n,!0),a);P&&P.removeClass("active"),P=e(l).addClass("active").appendTo(pe).draggable(Je),B=P.children(".esgbuilder-cpicker-point-square")[0],j=P.children(".esgbuilder-cpicker-point-triangle")[0],de=pe.children();var s=gt(r);St(l),"bottom"===t&&O.val(s[1]).trigger("change")}function gt(e){void 0===e&&(e=o[ae].x);var t=P.attr("data-color"),r=P.hasClass("esgbuilder-cpicker-point-bottom");if(r)he.hasClass("active")&&he.removeClass("active"),t=ESGColor.rgbaToHex(t)[0],Ve.css("background",t),b.find(".esgbuilder-cpicker-point-bottom").length>2&&he.addClass("active"),ue.parent().addClass("disabled"),b.addClass("open");else{he.hasClass("active")&&(Ve.css("background",""),he.removeClass("active"));var i=ESGColor.getOpacity(t);ue.attr("data-opacity",i).val(i).parent().removeClass("disabled"),b.find(".esgbuilder-cpicker-point-top").length>2&&he.addClass("active"),b.removeClass("open")}return N.val(e+"%").parent().removeClass("disabled"),[r,t]}function mt(e,t,r){return"bottom"===t?"rgb("+e.r+","+e.g+","+e.b+")":"rgba(0, 0, 0, "+(r?"1":e.a)+")"}function vt(e,t){var r=t?"1":e.a;return"rgba("+e.r+","+e.g+","+e.b+","+r+")"}function bt(e,t){var r=ESGColor.hexToRGB(e);t?(x.val(e),g.value=r[0],m.value=r[1],v.value=r[2]):(M.val(e),p.value=r[0],h.value=r[1],f.value=r[2],"0%"===Me[0].value&&Me.val("100%").trigger("focusout")),M.esgColorPicker("refresh")}function yt(t,r,i,n){var o=document.createElement("span");return o.className="esgbuilder-cpicker-point esgbuilder-cpicker-point-"+t,"string"==typeof i?o.setAttribute("data-color",i):e(o).data("gradient",i),o.setAttribute("data-location",r),o.style.left=r+"%",o.innerHTML="bottom"===t?'<span class="esgbuilder-cpicker-point-triangle" style="border-bottom-color: '+n+'"></span><span class="esgbuilder-cpicker-point-square" style="background: '+n+'"></span>':'<span class="esgbuilder-cpicker-point-square" style="background: '+n+'"></span><span class="esgbuilder-cpicker-point-triangle" style="border-top-color: '+n+'"></span>',o}function kt(e){return R||(R=document.createElement("textarea")),e&&"radial"!==e||(e="0"),R.innerHTML=e+"°",R.value}function wt(){P&&(P.removeClass("active"),P=!1),N.parent().addClass("disabled"),ue.parent().addClass("disabled"),he.removeClass("active"),he.removeClass("active"),Ve.css("background",""),b.removeClass("open")}function xt(e,t){b.removeClass("active is-basic").hide(),i.removeClass("esgbuilder-colorpicker-open"),He.css({left:"",top:""}),G&&(G.remove(),G=!1),We?(We.hasClass("selected")?(t&&Te.data("hex",We.attr("data-color").toLowerCase()),We.removeClass("selected")):Te.removeData("hex"),We=!1):Te.removeData("hex"),t||(I&&I(Te,se,le,ye,we),Ne&&"transparent"!==Ne?(Ge[0].style.background=Ne,Le.css("background",Ne)):(Ge.css("background",""),Le.css("background","")),ESG.DOC.trigger("revcolorpickercancel",[Te,se,le])),s=null,a=null,p=null,h=null,f=null,g=null,m=null,v=null,x=null,A=null,M=null,Z=null,z=null,X=null,Y=null,J=null,U=null,R=null,ie=null,re=null,pe=null,Le=null,Me=null,Ge=null,Te=null}function Ct(t){var r=e.extend(!0,{},qe);return ESGColor.processGradient(r,!0,t)}function St(r,i,n,s){K=i,Nt(),K=!1;for(var c,u,d,p,h=[],f=o.length,g=0;g<f;g++)u=(d=o[g]).color,h[g]=u,(c=d.el).setAttribute("data-color",ESGColor.rgbaString(u.r,u.g,u.b,u.a)),c.setAttribute("data-opacity",100*u.a),r&&r===c&&(ae=g);a.hasClass("selected")?(qe.type="radial",qe.angle="0"):(qe.type="linear",qe.angle=parseInt(t.val(),10).toString()),qe.colors=h,qe.easing=l.val(),qe.strength=parseInt(T.val(),10),We&&!De&&We.removeClass("selected"),s||(p=e.extend(!0,{},qe),pt(!0,ESGColor.processGradient(p,!0))),n||(X||(X=document.getElementById("esgbuilder-cpicker-direction-horizontal")),Y||(Y=document.getElementById("esgbuilder-cpicker-direction-vertical")),J||(J=document.getElementById("esgbuilder-cpicker-direction-radial")),U||(U=document.getElementById("esgbuilder-cpicker-gradient-input")),p=Ct(!0),U.style.background=function(e,t){var r;-1===e.search("deg")&&(r=(e=e.split("("))[0],e.shift(),e=r+"(180deg, "+e.join("(")),r=(e=e.split("("))[0],e.shift();var i=e.join("(").split(",");return i.shift(),r+"("+(t=void 0!==t?t+"deg,":"ellipse at center,")+i.join(",")}(p.replace("radial-","linear-").replace("ellipse at center,",""),"90"),"none"!==qe.easing&&(p=Ct()),ie.style.background=p,qe.type="linear",qe.angle="90",X.style.background=Ct(),qe.angle="180",Y.style.background=Ct(),qe.type="radial",qe.angle="0",J.style.background=Ct())}function Lt(e,t){if(0===e)return!1;for(var r;e--;)if((r=o[e]).align!==t)return r;return!1}function Tt(e,t,r){if(e===r)return!1;for(var i;e++<r;)if((i=o[e]).align!==t)return i;return!1}function Et(e,t,r){var i,n=t.alpha,o=r.alpha;i=n!==o?ESGColor.distAlpha(e.x,t.x,r.x,n,o).toFixed(2):n,i=ESGColor.sanitizeAlpha(i),e.alpha=i,e.color.a=i}function Mt(e,t,r){var i=e.color,n=t.color,o=r.color;if(t!==r){var a=e.x,l=t.x,s=r.x;i.r=ESGColor.distColor(a,l,s,n.r,o.r),i.g=ESGColor.distColor(a,l,s,n.g,o.g),i.b=ESGColor.distColor(a,l,s,n.b,o.b)}else i.r=n.r,i.g=n.g,i.b=n.b}function Nt(){o=[],H=[],W=[],de.each(Ot),o.sort(ESGColor.sortPoints);for(var e,t,r,i,n=o.length,a=n-1,l=0;l<n;l++)!1===(t=Lt(l,r=(e=o[l]).align))&&(t=Tt(l,r,a)),!1===(i=Tt(l,r,a))&&(i=Lt(l,r)),"bottom"===r?Et(e,t,i):Mt(e,t,i);o.sort(ESGColor.sortPoints)}function Ot(e){var t=ESGColor.rgbValues(lt(this,"data-color"),4),r=-1!==this.className.search("bottom")?"bottom":"top",i=t[3].replace(/\.?0*$/,"")||0,n=this.style.left;-1!==n.search("px")?(n=parseInt(n,10),n=parseInt(100*(Math.round(n)/(Ue-2)).toFixed(2),10)):n=parseInt(n,10),K&&(n<50?n+=2*(50-n):n-=2*(n-50)),this.style.left=n+"%",this.setAttribute("data-location",n),i=ESGColor.sanitizeAlpha(i),o[e]={el:this,x:n,alpha:i,align:r,color:{r:parseInt(t[0],10),g:parseInt(t[1],10),b:parseInt(t[2],10),a:i,position:n,align:r}},P&&P[0]!==this&&("bottom"===r?W[W.length]=n:H[H.length]=n)}function Pt(e){re||(re=document.getElementById("esgbuilder-cpicker-wheel-point")),e=void 0!==e?e:parseInt(t.val(),10),re.style.transform="rotate("+e+"deg)"}function Gt(r,i,n){var o,a,l=void 0!==n,s=l?n:parseInt(t.val(),10);if(r&&"keyup"===r.type)o=!isNaN(s)&&s>=-360&&s<=360,a=s;else{var c=parseInt(t.data("orig-value"),10);s||(s="0"),(isNaN(s)||s<-360||s>360)&&(s=a=c,t.val(kt(s)),o=!0),s!==c&&(a=s,o=!0,t.val(kt(s)),l||(s=i||s,oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+s+'"]').addClass("selected")))}(o||i)&&(a&&Pt(a),St())}function At(e,t){var r=parseInt(100*(Math.round(t.position.left)/(Ue-2)).toFixed(2),10);N.val(r+"%").trigger("keyup")}function It(){var t=e(this);t.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t.trigger("click")}function Dt(){N.trigger("focusout")}function _t(e){Re=!0,ze.slider("value",Math.round(.01*e*Xe)),Re=!1}function Ft(e){var t=te.offset(),r=e.pageX-t.left,i=e.pageY-t.top;if(!isNaN(r)&&!isNaN(i)){var n=Math.atan2(i-Ke,r-Ke)*(180/Math.PI)+90;n<0&&(n+=360),n=Math.max(0,Math.min(360,Math.round(n))),n=5*Math.round(n/5),!0,Gt(!1,!1,n),!1}}function Ht(e){e.stopImmediatePropagation()}function Wt(t){t||(t=Ee),t.each((function(){var t=e(this).find(".esgbuilder-cpicker-color").css("margin-bottom",0),r=t.length;t.each((function(e){e<r-4&&(this.style.marginBottom=Ye+"px")}))})).ESGScroll("update")}function zt(t){Z||(Z=e("#revpicker-easing-row")),t||(t=l.val()),Z["none"===t?"removeClass":"addClass"]("active")}function Rt(){y||function(){i||(i=e("body"),b=e('<div class="esgbuilder-cpicker-wrap _TPRB_ color-view palette-open">'+it+"</div>").appendTo(i));Ce.core&&(Ce.core.colors&&(tt=Ce.core.colors),Ce.core.gradients&&(rt=Ce.core.gradients));jt(Ce),st(Ce.language||et),y=!0}(),Ve=e("#esgbuilder-cpicker-preview-gradient"),he=e("#esgbuilder-cpicker-color-delete"),ue=e("#esgbuilder-cpicker-grad-opacity"),N=e("#esgbuilder-cpicker-color-location"),oe=e(".esgbuilder-cpicker-orientation"),O=e("#esgbuilder-cpicker-iris-gradient"),V=e("#esgbuilder-cpicker-iris-color"),w=e("#esgbuilder-cpicker-gradient-btn"),ne=e("#esgbuilder-cpciker-clear-hex"),k=e("#esgbuilder-cpicker-meta-reverse"),ze=e("#esgbuilder-cpicker-scroll"),E=e("#esgbuilder-cpicker-color-btn"),T=e("#esgbuilder-cpicker-strength"),t=e("#esgbuilder-cpicker-meta-angle"),te=e("#esgbuilder-cpicker-wheel"),He=e("#esgbuilder-cpicker"),l=e("#esgbuilder-cpicker-easing"),Je.drag=At,Je.stop=Dt,Je.start=It,E.data("state",e("#esgbuilder-cpicker-colors").find(".esgbuilder-cpicker-color").eq(0).attr("data-color")||"#ffffff"),w.data("state",e("#esgbuilder-cpicker-gradients").find(".esgbuilder-cpicker-color").eq(0).attr("data-color")||"linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)"),He.draggable({containment:"window",handle:".esgbuilder-cpicker-draggable",stop:function(){He.css("height","auto")}}),Ee=e(".esgbuilder-cpicker-presets-group").ESGScroll({wheelPropagation:!1,suppressScrollX:!0}),te.on("mousedown.esgcpicker",(function(e){oe.removeClass("selected"),Q=!0,Ft(e)})).on("mousemove.esgcpicker",(function(e){Q&&Ft(e)})).on("mouseleave.esgcpicker mouseup.esgcpicker",(function(){Q=!1})),e(".esgbuilder-cpicker-main-btn").on("click.esgcpicker",(function(){var t;if($=-1===this.id.search("gradient"),Ge&&(t=e(this).data("state")),$?(Ge&&(be=M.val()),b.removeClass("gradient-view").addClass("color-view")):(Ge&&(be=t),b.removeClass("color-view").addClass("gradient-view"),ce||(A.children(".esgbuilder-cpicker-color").not(".blank").eq(0).trigger("click"),ce=!0)),t){var r="transparent"===t?"":t;Ge.css("background",r),Le.css("background",r),Ie=!0,e(".esgbuilder-cpicker-color").not(".blank").each(ut),Ie=!1,ESG.DOC.trigger("revcolorpickerupdate",[Te,t])}$||(De=!0,e(".esgbuilder-cpicker-point-bottom").first().trigger("click"),De=!1)})),e("#esgbuilder-cpicker-palette").on("click",(function(){b.hasClass("palette-open")?b.removeClass("palette-open"):(b.addClass("palette-open"),Wt())})),e("#esgbuilder-cpicker-check").on("click.revcipicker",(function(){var t,r,i,n;if(b.hasClass("color-view")){var o=M.val(),a=Me.val();i="transparent"===o?"transparent":"100%"===a?ESGColor.sanitizeHex(o):ESGColor.processRgba(o,a),t=[Te,i,!1],r=i}else{wt(),St(!1,!1,!0,!0);var l=JSON.stringify(qe).replace(/\"/g,"&");r=ESGColor.processGradient(e.extend(!0,{},qe),!0),t=[Te,r,l]}!0!==(n=t[1]!==Ne)&&!0!==fe||(Te.attr("data-color",t[1]),ESG.DOC.trigger("revcolorpickerchanged",t),je&&je(t[0],t[1],t[2],ye,we)),xt(0,!0===n||!0===fe)})),b.on("click.esgcpicker",(function(t){e(t.target).closest("#esgbuilder-cpicker").length||wt()})),e(".esgbuilder-cpicker-close").on("click.esgcpicker",xt),V.wpColorPicker({palettes:!1,width:190,border:!1,hide:!1,change:function(e,t){var r=t.color.toString();if(this.value=r,bt(r),!Ae){var i=Me.val();0===parseInt(i,10)&&(r="transparent"),pt(!1,r,i),We&&(We.removeClass("selected"),We=!1)}}}),O.wpColorPicker({palettes:!1,height:190,border:!1,hide:!1,change:function(e,t){var r=t.color.toString();this.value=r,bt(r,!0),Ve.css("background",r),B.style.backgroundColor=r,j.style.borderBottomColor=r;var i=ESGColor.processRgba(r,100),n=ESGColor.rgbValues(i,4),o=qe.colors[ae];o.r=n[0],o.g=n[1],o.b=n[2],o.a=ESGColor.sanitizeAlpha(n[3]),P&&P.attr("data-color",i),St()}}),ze.slider({orientation:"vertical",max:Xe,value:Xe,start:function(){Fe="transparent"===M.val()},slide:function(e,t){if(!Re){var r,i=parseInt(100*(t.value/Xe).toFixed(2),10);Fe&&(r=i?"#ffffff":"transparent",M.val(r)),0===i&&(r="transparent"),pt(!1,r,i||"transparent"),Me.val(i+"%")}}}),e("body").on("click.esgcpicker",".esgbuilder-cpicker-point",(function(){pe.find(".esgbuilder-cpicker-point.active").removeClass("active"),P=e(this).addClass("active"),B=P.children(".esgbuilder-cpicker-point-square")[0],j=P.children(".esgbuilder-cpicker-point-triangle")[0],St(this);var t=gt();t[0]&&O.val(t[1]).trigger("change")})).on("mousedown.esgcpicker",".esgbuilder-cpicker-point",(function(t){P=e(this).data("mousestart",t.pageY)})).on("mousemove.esgcpicker",(function(e){if(P&&P.data("mousestart")){var t=P.data("mousestart"),r=e.pageY;P.hasClass("esgbuilder-cpicker-point-bottom")?r>t&&r-t>15&&he.hasClass("active")?P.addClass("warning"):P.removeClass("warning"):t>r&&t-r>15&&he.hasClass("active")?P.addClass("warning"):P.removeClass("warning")}})).on("mouseup.esgcpicker",(function(e){if(P&&P.data("mousestart")){var t=P.data("mousestart"),r=e.pageY;P.removeData("mousestart"),P.hasClass("esgbuilder-cpicker-point-bottom")?r>t&&r-t>10&&he.hasClass("active")?he.trigger("click"):P.removeClass("warning"):t>r&&t-r>10&&he.hasClass("active")?he.trigger("click"):P.removeClass("warning")}})).on("keypress.esgcpicker",(function(e){if(b.hasClass("active")){var t=e.which;27==t?xt():13==t&&C&&C.blur()}})).on("click.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",(function(){if(We){if(We[0]===this&&We.hasClass("selected"))return;We.removeClass("selected")}if(We=e(this),b.hasClass("color-view")){var t,r=We.attr("data-color"),i=ESGColor.process(r);"rgba"===i[1]?(r=ESGColor.rgbaToHex(i[0]),t=100*parseFloat(r[1]),Me.val(t+"%").trigger("keyup"),r=r[0]):"transparent"!==i[1]&&"transparent"!==r?Me.val("100%").trigger("keyup"):(Ae=!0,ne.trigger("click")),Ae=!0,V.val(r).trigger("change"),"transparent"===M.val()&&M.val(r.toLowerCase()),Ae=!1;var n=Me.val();0===parseInt(n,10)&&(r="transparent"),pt(!1,r,n),We.addClass("selected")}else s.removeClass("full"),z.removeClass("full"),ht(We.data("gradient"),!0),k.removeClass("checked"),A.find(".esgbuilder-cpicker-color.selected").removeClass("selected"),e(".esgbuilder-cpicker-point-bottom").first().trigger("click"),We.addClass("selected")})).on("mouseover.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",(function(){_e})).on("mouseout.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",(function(){_e})).on("click.esgcpicker",".esgbuilder-cpicker-delete",(function(){if(d){if(window.confirm(document.getElementById("esgbuilder-cpicker-remove-delete").innerHTML)){b.addClass("onajax onajaxdelete");var t=e(this),r=t.parent(),i=r.attr("data-title")||"";if(!i)return void console.log("Preset does not have a name/title");var n=-1!==t.closest(".esgbuilder-cpicker-presets-group")[0].id.search("colors")?"colors":"gradients";ESG.DOC.off("esgcpicker_onajax_delete.esgcpicker").on("esgcpicker_onajax_delete.esgcpicker",(function(i,n){n&&console.log(n);var o=t.closest(".esgbuilder-cpicker-presets-group"),a=o.find(".rs__scrollbar-x-rail");r.remove(),e('<span id="hello" class="esgbuilder-cpicker-color blank"></span>').insertBefore(a),Wt(o),b.removeClass("onajax onajaxdelete")})),i=e.trim(i.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),d("delete",i,n,"esgcpicker_onajax_delete",Te)}return!1}console.log("Ajax callback not defined")})),e(".esgbuilder-cpicker-save-preset-btn").on("click.esgcpicker",(function(){if(d){var t,r,i=e(this),n=i.closest(".esgbuilder-cpicker-presets").find(".esgbuilder-cpicker-preset-save").val();if(n&&isNaN(n)){if(t=b.hasClass("color-view")?"colors":"gradients",n=e.trim(n.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),e("#esgbuilder-cpicker-"+t+"-custom").find(".esgbuilder-cpicker-color").not(".blank").each((function(){if(e.trim(lt(this,"data-title").replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase()===n)return alert(i.attr("data-message")),r=!0,!1})),!r){b.addClass("onajax onajaxsave");var o,a,l={};if("colors"===t){var s=M.val(),c=Me.val();o="transparent"===s?"transparent":"100%"===c?ESGColor.sanitizeHex(s):ESGColor.processRgba(s,c)}else a=ie.style.background,St(!1,!1,!0),o=e.extend({},qe);l[n]=o,ESG.DOC.off("esgcpicker_onajax_save.esgcpicker").on("esgcpicker_onajax_save.esgcpicker",(function(r,n){if(n)return b.removeClass("onajax onajaxsave"),void alert(i.attr("data-message"));var o=e(ct(l,!1," esgbuilder-picker-color-custom",a)),s=e("#esgbuilder-cpicker-"+t+"-custom"),c=s.find(".rs__scrollbar-x-rail"),u=s.find(".esgbuilder-cpicker-color.blank");if(u.length)u=u.eq(0),o.insertBefore(u),u.remove();else{o.insertBefore(c);for(var d=s.children(".esgbuilder-cpicker-color").length,p=Math.max(Math.ceil(d/$e),Qe)*$e;d++<p;)e('<span class="esgbuilder-cpicker-color blank"></span>').insertBefore(c)}e("#esgbuilder-cpicker-preset-"+t).val("custom").trigger("change"),Wt(s),o.trigger("click"),e(".esgbuilder-cpicker-preset-save").val(""),b.removeClass("onajax onajaxsave")})),d("save",l,t,"esgcpicker_onajax_save",Te)}}else alert(i.attr("data-message"))}else console.log("Ajax callback not defined")})),ne.on("click.esgcpicker",(function(){_t(0),V.val(ESGColor.defaultValue).trigger("change"),M.val("transparent"),pt(!1,"transparent"),clearTimeout(Se),Se=setTimeout(Bt,100)})),b.find('input[type="text"]').on("focusin.esgcpicker",(function(){C=this})).on("focusout.esgcpicker",(function(){C=!1})),e(".esgbuilder-cpicker-input").on("focusin.esgcpicker",(function(){var t=e(this);t.data("orig-value",t.val()).parent().addClass("focus")})).on("focusout.esgcpicker",(function(){e(this).parent().removeClass("focus")})),e(".esgbuilder-cpicker-rgb").on("focusin.esgcpicker",(function(){e(this).data("prev",this.value)})).on("focusout.esgcpicker keyup.esgcpicker",(function(){var t=this.value;isNaN(t)||t<0||t>255?this.value=e(this).data("prev"):b.hasClass("color-view")?M.val(ESGColor.rgbToHex("rgb("+p.value+","+h.value+","+f.value+")")).trigger("focusout"):x.val(ESGColor.rgbToHex("rgb("+g.value+","+m.value+","+v.value+")")).trigger("focusout")})),e(".esgbuilder-cpicker-hex").on("focusout.esgcpicker",(function(){var t,r;if("esgbuilder-cpicker-color-hex"===this.id){if(!(r=M.val()))return void ne.trigger("click");if(r=ESGColor.sanitizeHex(r),ESGColor.isColor.test(r))bt(r);else{if(!(t=e(this).data("orig-value")))return void ne.trigger("click");if("transparent"===(r=t))return void ne.trigger("click");bt(r)}V.val(r).trigger("change")}else r=x.val()||ESGColor.defaultValue,r=ESGColor.sanitizeHex(r),ESGColor.isColor.test(r)||(r=(t=e(this).data("orig-value"))||ESGColor.defaultValue),x.val(r),O.val(r).trigger("change")})).on("focusin.esgcpicker",Ht),N.on("keyup.esgcpicker focusout.esgcpicker",(function(e){if(P){var t,r="bottom"===(P.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top")?W:H,i=N.val().replace("%","")||"0",n=e.type;for(isNaN(i)&&(i="keyup"===n?"0":P.attr("data-location")),t=(i=Math.max(0,Math.min(100,parseInt(i,10))))<50?1:-1;-1!==r.indexOf(i);)i+=t;"focusout"===n&&(N.val(i+"%"),P.attr("data-location",i)),P.css("left",i+"%"),St()}})).on("focusin.esgcpicker",Ht),e("#esgbuilder-cpciker-clear-gradient").on("click.esgcpicker",(function(){O.val(ESGColor.defaultValue).trigger("change")})),t.on("keyup.esgcpicker focusout.esgcpicker",Gt).on("focusin.esgcpicker",Ht),oe.on("click.esgcpicker",(function(){var r=e(this),i=r.attr("data-direction");oe.removeClass("selected"),r.addClass("selected"),"radial"!==i?t.val(kt(i)):t.val(0),Gt(!1,i)})),e(".esgbuilder-cpicker-point-delete").on("click.esgcpicker",(function(){if(-1!==this.className.search("active")){var e=P.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t=b.find(".esgbuilder-cpicker-point-"+e).length;t>2&&(P.draggable("destroy").remove(),de=pe.children(),b.trigger("click"),St()),t<=20&&("bottom"===e?z.removeClass("full"):s.removeClass("full"))}})),e(".esgbuilder-cpicker-preset-save").on("focusin.esgcpicker",Ht),e(".esgbuilder-cpicker-opacity-input").on("keyup.esgcpicker focusout.esgcpicker",(function(t){var r,i=-1===this.id.search("grad"),n=i?Me:ue,o=n.val().replace("%",""),a=t.type;if(isNaN(o)&&(o="keyup"===a?"0":e(this).data("orig-value").replace("%","")),o=Math.max(0,Math.min(100,o)),"focusout"===a&&(n.val(o+"%"),i||P.attr("data-opacity",o)),i){pt(!1,0===parseInt(o,10)&&"transparent",o),_t(o)}else{var l=ESGColor.rgbValues(P.attr("data-color"),3),s=qe.colors[ae];o=ESGColor.sanitizeAlpha(.01*parseInt(o,10)),s.r=l[0],s.g=l[1],s.b=l[2],s.a=o,r=ESGColor.rgbaString(s.r,s.g,s.b,o),P.attr("data-color",r),St(),r="rgba(0, 0, 0, "+o+")",B.style.backgroundColor=r,j.style.borderTopColor=r}})).on("focusin.esgcpicker",Ht),e(".esgbuilder-cpicker-builder-hit").on("click.esgcpicker",(function(e){o||Nt();for(var t=parseInt(100*((e.pageX-s.offset().left)/Ue).toFixed(2),10),r=-1!==this.id.search("bottom")?"bottom":"top",i="bottom"===r?W:H,n=t<50?1:-1;-1!==i.indexOf(t);)t+=n;"bottom"===r?b.find(".esgbuilder-cpicker-point-bottom").length<20?(ft(r,t),We=!1):z.addClass("full"):b.find(".esgbuilder-cpicker-point-top").length<20?(ft(r,t),We=!1):s.addClass("full")})),k.on("click.esgcpicker",(function(){!k.hasClass("checked")?k.addClass("checked"):k.removeClass("checked"),St(!1,!0)})),l.on("change.esgcpicker",(function(){St(),zt(this.value)})),T.on("keyup.esgcpicker focusout.esgcpicker",(function(e){var t=T.val().replace("%",""),r=e.type;isNaN(t)&&(t="keyup"===r?"0":T.data("orig-value").replace("%","")),t=Math.max(10,Math.min(1e3,t)),"focusout"===r&&T.val(t+"%"),St()})).on("focusin.esgcpicker",Ht);var n=e(".esgbuilder-cpicker-preset-selector").on("change.esgcpicker",(function(){var e=this.value,t="core"===e?"custom":"core",r=-1!==this.id.search("colors")?"colors":"gradients";document.getElementById("esgbuilder-cpicker-"+r+"-"+t).style.display="none",document.getElementById("esgbuilder-cpicker-"+r+"-"+e).style.display="block",Wt()}));e.fn.ddTP&&(n.ddTP(),l.ddTP()),r=!0}function Bt(){Me.val("0%")}function jt(t){var r,i,n,o,a,l=e.extend({},t),s=l.core||{},c=l.custom;!me||c?(o=4,c=(me=c)||{colors:[],gradients:[]}):o=2,s.colors||(s.colors=tt),s.gradients||(s.gradients=rt);for(var u=0;u<o;u++){switch(u){case 0:r="colors-core",n=s.colors;break;case 1:r="gradients-core",n=s.gradients;break;case 2:r="colors-custom",n=c.colors;break;case 3:r="gradients-custom",n=c.gradients}i=dt(r,n.slice()||[]),(a=e("#"+i[0])).find(".esgbuilder-cpicker-color").remove(),a.prepend(i[1])}}function Vt(e,t,r){return jQuery.grep(e,(function(e){return e[r]!=t[r]}))}function qt(e,t,r){var i=-1;for(var n in t)void 0!==t[n][r]&&t[n][r]===e[r]&&(i=n);return i}function Ut(e){return e.id?jQuery('<span><span class="skin_mini_color" style="background:'+ye[e.element.value].v+'"></span>'+e.text+"</span>"):e.text}function Kt(e){for(var t in void 0!==ye[e]&&ht(ye[e].v,!1),xe)for(var r in ye)ye.hasOwnProperty(r)&&(r!==e&&void 0!==ye[r].ref&&0!==ye[r].ref.length&&(ye[r].ref=Vt(ye[r].ref,xe[t],"r")),r===e&&(ye[r].ref=void 0===ye[r].ref?[]:ye[r].ref,-1==qt(xe[t],ye[r].ref,"r")&&ye[r].ref.push(xe[t])))}e.esgColorPickerApi={setValue:function(e,t){ht(e,t)},setGlobalColors:function(e){ye=jQuery.extend(!0,{},e)},setGlobalCandidates:function(e){xe=e},getGlobalColors:function(){return ye},closeColorPicker:function(){xt()},showGlobal:function(e,t,r){ye=jQuery.extend(!0,{},t),xe=r,ke=e.mode;e.currentInput[0].dataset;var i,n,o=document.getElementById("esgbuilder-cpicker-current-edit"),a=(document.getElementById("esgbuilder-cpicker-edit-title"),Te.attr("data-widget-id"),Te.attr("data-appended-html"),Te.attr("data-editing"));for(var l in i='<div id="esgbuilder-cpicker-globals"><div id="esgbuilder-cpicker-gactive">'+ESG_LANG.globalcoloractive+"</div>",i+='<input id="enadisaGlobalSkin" type="checkbox">',i+='<div id="inp_SkinPicker">',i+='<div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-input-wrap-margin"><select id="gc_skinPicker">',ye)ye.hasOwnProperty(l)&&(i+='<option value="'+l+'" '+(ye[l].v.indexOf("gradient")>=0&&("single"===e.mode||"basic"===e.mode)?' disabled="true" ':"")+">"+ye[l].alias+"</option>");i+="</select></div>",i+='<div id="edit_skin_colors" class="basic_action_button layerinput autosize"><i class="material-icons">color_lens</i>'+ESG_LANG.editskins+"</div></div>",i+="</div>",b.find("#esgbuilder-cpicker").append(i=jQuery(i)),n=i.find("#gc_skinPicker");var s=function(){var e=[];for(var t in xe)for(var r in e[t]=-1,ye)ye.hasOwnProperty(r)&&void 0!==ye[r].ref&&0!==ye[r].ref.length&&-1===e[t]&&(e[t]=-1!==qt(xe[t],ye[r].ref,"r")?r:-1);var i=-1;for(var r in e)i=-1===i&&-1!==e[r]?e[r]:-1!==e[r]&&-1!==i[r]?-999:i;return i}();-1===s||-999===s?(we=!1,document.getElementById("inp_SkinPicker").style.display="none",jQuery("#enadisaGlobalSkin")[0].checked=!1):(we=s,n[0].value=s,document.getElementById("inp_SkinPicker").style.display="inline-block",jQuery("#enadisaGlobalSkin")[0].checked=!0,o.innerHTML=ye[s].alias+" Skin"),void 0!==ESG&&void 0!==ESG.F&&void 0!==ESG.F.initOnOff&&(ESG.F.initOnOff(i),ESG.F.turnOnOff(i,!1)),n.ddTP("destroy").ddTP({tags:!1,pre:'<span class="skin_mini_color" style="background:#data#"></span>',preDataFunction:function(e){var t=jQuery.rsColorPickerApi.getGlobalColors();return void 0!==t&&void 0!==t[e]?t[e].v:void 0},templateResult:Ut}),jQuery("#enadisaGlobalSkin").on("change",(function(){fe=!0,!0===this.checked?(document.getElementById("inp_SkinPicker").style.display="inline-block",n.trigger("change.select2"),n.ddTP("change")):(we=!1,Kt(-1),document.getElementById("inp_SkinPicker").style.display="none",ht(Ne,!1),o.innerHTML=a)})),n.on("change.select2",(function(){fe=!0,ye=jQuery.extend(!0,{},t),-1!==we&&-999!==we&&void 0!==t[we]&&ht(t[we].v,!1),we=this.value,Kt(this.value),function(e,t){var r="single"===t||"basic"===t;if(!r)for(var i in ye[e].ref)ye[e].ref.hasOwnProperty(i)&&(r=!0===r||ESG.F.noGradient(ye[e].ref[i].r));r?jQuery("#esgbuilder-cpicker-gradient-btn").hide():jQuery("#esgbuilder-cpicker-gradient-btn").show()}(this.value,ke),o.innerHTML=ye[this.value].alias+" Skin"}))},hideGlobal:function(){jQuery("#esgbuilder-cpicker-globals").remove(),ye=void 0,we=void 0}},e.esgColorPicker=function(t){Ce=e.extend(!0,Ce||{},t),t.mode&&(Ze=t.mode),t.init&&(u=t.init),t.onAjax&&(L=t.onAjax),t.onEdit&&(S=t.onEdit),t.change&&(F=t.change),t.cancel&&(_=t.cancel),t.title&&(D=t.title),t.language&&t.language,t.widgetId&&(ve=t.widgetId),t.defaultValue&&(ESGColor.defaultValue=t.defaultValue),t.wrapClasses&&(Be=t.wrapClasses),t.appendedHtml&&(Pe=t.appendedHtml),t.onRefresh&&(ee=t.defRefresh),y&&(Wt(),t.language&&st(t.language))};var Qt={refresh:function(){var t=e(this),r=[t];if(t.hasClass("esgbuilder-cpicker-component")){var i=t.data("revcp")||{},n=t.val()||i.defaultValue||ESGColor.defaultValue,o=i.onRefresh||ee,a=ESGColor.process(n);n=a[0],a="rgba"===a[1]&&ESGColor.transparentRgba(n,!0)?"":n,"transparent"!==n?(t.data("tpcp")[0].style.background=a,Le&&Le.css("background",a)):(t.data("tpcp").css("background",""),Le&&Le.css("background","")),t.attr("data-color",n).data("hex",n),r[1]=n,o&&o(r[0],n)}else r[1]=!1,r[2]="Color Picker not inited for this input field yet";ESG.DOC.trigger("revcolorpickerrefresh",r)},destroy:function(){e(this).removeData().closest(".esgbuilder-cpicker-master-wrap").removeData().remove()}};function $t(){void 0!==ESG.LIB.COLOR_PRESETS&&ESG.LIB.COLOR_PRESETS||(ESG.LIB.COLOR_PRESETS={colors:[],gradients:[]}),ESG.LIB.COLOR_PRESETS.colors||(ESG.LIB.COLOR_PRESETS.colors=[]),ESG.LIB.COLOR_PRESETS.gradients||(ESG.LIB.COLOR_PRESETS.gradients=[]),e.esgColorPicker({custom:ESG.LIB.COLOR_PRESETS,onAjax:function(e,t,r,i,n){var o=!1,a=ESG.LIB.COLOR_PRESETS[r];switch(e){case"save":a[a.length]=t,o=!0;break;case"delete":var l=a.length;e:for(var s=0;s<l;s++)for(var c in a[s])if(c===t){a.splice(s,1),o=!0;break e}}o&&"undefined"!=typeof ESG&&void 0!==ESG.F&&ESG.F.ajaxRequest("save_color_preset",{presets:jQuery.extend(!0,{},ESG.LIB.COLOR_PRESETS)},(function(e){var t=e.error||!1;ESG.DOC.trigger(i,[t]);try{jQuery.rsColorPicker&&jQuery.rsColorPicker({custom:ESG.LIB.COLOR_PRESETS})}catch(t){}AdminEssentials.showWaitAMinute({fadeOut:300})}))}})}e.fn.esgColorPicker=function(t){return t&&"string"==typeof t?this.each(Qt[t]):this.each((function(){var r=e(this);if(r.hasClass("esgbuilder-cpicker-component"))r.esgColorPicker("refresh");else{var i,n,o=e('<span class="esgbuilder-colorpicker"></span>').data("revcolorinput",r),a=e('<span class="esgbuilder-colorbox" />'),l=e('<span class="esgbuilder-colorbtn" />'),s=r.attr("data-wrap-classes"),c=r.attr("data-wrapper"),d=r.attr("data-wrap-id"),p=r.attr("data-title"),h=r.val(),f=1==r.data("visible")?"visible-cp-input":"";if(o.insertBefore(r).append([a,l,r]),t&&e.isPlainObject(t)){c||(c=t.wrapper),s||(s=t.wrapClasses),d||(d=t.wrapId),p||(p=t.title),n=t.defaultValue;var g=r.data("revcp");g&&(t=e.extend({},g,t)),r.data("revcp",t)}s||(s=Be),s&&o.addClass(s),d&&o.attr("id",d),h||(h=n||ESGColor.defaultValue,r.val(h)),h=(i=ESGColor.process(h))[0],"transparent"!==(i="rgba"===i[1]&&ESGColor.transparentRgba(h,!0)?"":h)&&(a[0].style.background=i),l[0].innerHTML=p||D||q||et.color,r.attr("data-color",h).data("tpcp",a).addClass("esgbuilder-cpicker-component"),c?(c=e(c).addClass("esgbuilder-cpicker-master-wrap").addClass(f),o.wrap(c)):o.addClass("esgbuilder-cpicker-master-wrap").addClass(f);var m=!!t&&(t.init||u),v=Ce?e.extend(!0,Ce,t||{}):t||!1;m&&m(o,r,h,v),ESG.DOC.trigger("revcolorpickerinit",[o,r,h,v])}}))},e((function(){e("body").on("click.esgcpicker",".esgbuilder-colorpicker",(function(){r||Rt(),ie=document.getElementById("esgbuilder-cpicker-gradient-output"),g=document.getElementById("esgbuilder-cpicker-r2"),m=document.getElementById("esgbuilder-cpicker-g2"),v=document.getElementById("esgbuilder-cpicker-b2"),p=document.getElementById("esgbuilder-cpicker-r"),h=document.getElementById("esgbuilder-cpicker-g"),f=document.getElementById("esgbuilder-cpicker-b"),pe=e("#esgbuilder-cpciker-point-container"),Le=e("#esgbuilder-cpicker-preview-color"),Me=e("#esgbuilder-cpicker-color-opacity"),a=e("#esgbuilder-cpicker-orientation-radial"),A=e("#esgbuilder-cpicker-gradients-core"),x=e("#esgbuilder-cpicker-gradient-hex"),z=e("#esgbuilder-cpicker-hit-bottom"),M=e("#esgbuilder-cpicker-color-hex"),s=e("#esgbuilder-cpicker-hit-top"),Te=e(this).data("revcolorinput");var t,o,l,u,y,k,C,T,N,O,P,D,H,W=document.getElementById("esgbuilder-cpicker-current-edit"),R=document.getElementById("esgbuilder-cpicker-edit-title"),B=Te.attr("data-widget-id"),j=Te.attr("data-appended-html"),V=Te.attr("data-editing"),q=Te.attr("data-colors"),U=Te.attr("data-mode"),K=Te.data("revcp"),Q=Te.attr("data-lang");if(q&&((q=JSON.parse(q.replace(/\&/g,'"'))).colors&&(k=q.colors),q.gradients&&(u=q.gradients)),K){var $=K.colors;$&&($.core&&(l=$.core.colors,t=$.core.gradients),$.custom&&(y=$.custom.colors,o=$.custom.gradients)),P=K.onEdit,D=K.onAjax,T=K.change,N=K.cancel,Q||(Q=K.lang),U||(U=K.mode),j||(j=K.appendedHtml),V||(V=K.editing),B||(B=K.widgetId)}(t||l||o||y||u||k)&&(C={},(t||l||u||k)&&(C.core={colors:k||l||tt,gradients:u||t||rt}),(o||y)&&(C.custom={colors:y||tt,gradients:o||rt}),jt(C)),B||(B=ve),B&&(b[0].id=B),j||(j=Pe),j&&(G=e(j).appendTo(He)),Q&&st(Q),U||(U=Ze),V?R.style.visibility="visible":(V="",R.style.visibility="hidden"),W.innerHTML=V,"single"===U||"basic"===U?(n=!1,w.hide(),E.show(),"basic"===U&&b.addClass("is-basic")):(n=!0,w.show(),E.show()),function(e){return"string"==typeof e&&"transparent"!==e.trim()&&-1===e.search(/\[\{/)&&-1!==e.search("-gradient")}(H=Te.val()||ESGColor.defaultValue)&&(H=ESGColor.reverseGradient(H)),H.split("||").length>1&&(H=ESGColor.joinToRgba(H),Te.val(H)),O=ht(H),Ne=O[0],se=Ne,le=Te.val(),c=P||S,d=D||L,I=N||_,je=T||F,"gradient"!==O[1]?E.data("state",Ne):w.data("state",Ne),i.addClass("esgbuilder-colorpicker-open"),Ge=Te.data("tpcp"),b.data("esgcpickerinput",Te).addClass("active").show(),Wt(),Oe=Te.attr("data-color");var X=ESGColor.process(H);"rgba"===X[1]?0==(X=ESGColor.rgbValues(X[0],4))[3]?Le.css("background",""):Le.css("background",Oe):"transparent"===X[1]?Le.css("background",""):Le.css("background",Oe),be=Te.data("hex"),e(".esgbuilder-cpicker-color").not(".blank").each(ut),He.css({marginLeft:-.5*He.width(),marginTop:-.5*He.height()}),ESG.DOC.trigger("ESGCOLOR.OPEN",{openingValue:O[0],mode:U,currentInput:Te})}))}));var Xt=!1;"loading"===document.readyState?document.addEventListener("readystatechange",(function(){"interactive"!==document.readyState&&"complete"!==document.readyState||Xt||(Xt=!0,$t())})):(Xt=!0,$t())}("undefined"!==jQuery&&jQuery), /*! * ThemePunchs Own Select2RS Library * @version: 2.0 (25.03.2021) * @author ThemePunch */ function(e,t){"use strict";var r,i,n=8,o=9,a=13,l=16,s=17,c=18,u=227,d=91,p=93,h=37,f=38,g=39,m=40,v=e(document);window.ddTPCalls=["destroy","update","rebuild","change","main"],window.ddTP_R_cache={},window.ddTPcache={},e.fn.extend({select2RS:function(t,r){return e(this).ddTP(t,r)},ddTP:function(e,i){return"destroy"==e||"udate"==e||"rebuild"==e||"change"==e?(window.ddTP_R_cache[e]=window.ddTP_R_cache[e]===t?{list:[],params:[]}:window.ddTP_R_cache[e],window.ddTP_R_cache[e].list.push(this),window.ddTP_R_cache[e].params.push(i)):(window.ddTP_R_cache.main=window.ddTP_R_cache.main===t?{list:[],params:[]}:window.ddTP_R_cache.main,window.ddTP_R_cache.main.list.push(this),window.ddTP_R_cache.main.params.push(e)),window.ddTP_R_RFACalled===t&&(window.ddTP_R_RFACalled=!0,requestAnimationFrame((function(){var e,r,i;for(i=0;i<window.ddTPCalls.length;i++)if(e=window.ddTPCalls[i],window.ddTP_R_cache[e]!==t)for(r in window.ddTP_R_cache[e].list)b(window.ddTP_R_cache[e].list[r],e,window.ddTP_R_cache[e].params[r]);window.ddTP_R_cache={},delete window.ddTP_R_RFACalled}))),r===t&&B(),this}});var b=function(e,r,n){if("destroy"==r)for(o in e)e.hasOwnProperty(o)&&e[o]!==t&&"SELECT"===e[o].tagName&&e[o].id!==t&&""!==e[o].id&&ddTPcache[e[o].id]!==t&&k(e[o]);else if("update"==r)for(o in e)e.hasOwnProperty(o)&&e[o]!==t&&"SELECT"===e[o].tagName&&e[o].id!==t&&""!==e[o].id&&ddTPcache[e[o].id]!==t&&i.INFOCUS===e[o].id&&G(e[o].id,!0);else if("rebuild"==r)for(var o in e)!e.hasOwnProperty(o)||e[o]===t||"SELECT"!==e[o].tagName||e[o].id===t&&""===e[o].id||(k(e[o]),y(e[o],n));else if("change"==r)for(var o in e)e.hasOwnProperty(o)&&e[o].id!==t&&""!==e[o].id&&ddTPcache[e[o].id]!==t&&w(ddTPcache[e[o].id].rendered,C(e[o],ddTPcache[e[o].id].params));else for(var o in e)!e.hasOwnProperty(o)||e[o]===t||"SELECT"!==e[o].tagName||e[o].id!==t&&""!==e[o].id&&ddTPcache[e[o].id]!==t||y(e[o],n)},y=function(e,r){e.id!==t&&""!==e.id||(e.id="ddTP_"+Math.round(1e10*Math.random())),e.classList.add("ddTP_hidden"),e.classList.add("ddTP_based");var i=ddTPcache[e.id]===t?document.createElement("span"):ddTPcache[e.id].container,n=document.createElement("span"),o=document.createElement("span"),a=document.createElement(e.multiple?"ul":"span");if(i.className="ddTP ddTP_C ddTP-fake"+(e.dataset.theme!==t?" ddTP_C--"+e.dataset.theme:""),n.className="selection",o.className="ddTP_S ddTP_S--"+(e.multiple?"multiple":"single"),a.className="ddTP_S__rendered",i.dataset.refid=e.id,n.dir="ltr",n.appendChild(o),o.appendChild(a),!e.multiple){var l=document.createElement("span"),s=document.createElement("b");l.className="ddTP_S__arrow",o.appendChild(l),l.appendChild(s)}w(a,C(e,r)),i.appendChild(n),V(i,e),ddTPcache[e.id]={sel:e,container:i,innerwrapper:n,selection:o,rendered:a,params:r===t?{}:r}},k=function(e){ddTPcache!=t&&ddTPcache[e.id]!=t&&ddTPcache[e.id].container!=t&&(ddTPcache[e.id].container.parentNode.removeChild(ddTPcache[e.id].container),ddTPcache[e.id].container.innerHTML="",delete ddTPcache[e.id])},w=function(e,t){requestAnimationFrame((function(){"UL"===e.tagName?(e.innerHTML="",e.appendChild(t.values)):t.html?e.innerHTML=t.values:e.innerText=t.values}))},x=function(e,r,i){return r===t||e===t?t:e.preData!==t?r[e.preData]:e.preDataFunction!==t?e.preDataFunction(i):t},C=function(e,r){if(e.multiple){var n=document.createDocumentFragment(),o=!1;for(var a in e.options)e.options[a]!==t&&e.options[a].selected&&(o=!0,n.appendChild(T(e.options[a].value,e.options[a].text===t?e.options[a].value:e.options[a].text,t,e.id,r,x(r,e.options[a].dataset,e.options[a].value))));return(r.tags||r.search)&&(i.liSearch=document.createElement("li"),i.liSearch.className="ddTP_SCH ddTP_SCH--inline",i.liSearch.appendChild(S(r.searchValue,e.id)),n.appendChild(i.liSearch),o=!0),o||n.appendChild(T(t,r===t||r.placeholder===t?"":r.placeholder,!0,e.id,r,x(r,e.options[a].dataset,e.options[a].value))),{values:n}}n="";var l,s,c=!1;for(var a in e.options)a!==e.options[a].id&&e.options[a].selected&&((l=(s=x(r,e.options[a].dataset,e.options[a].value))!==t?L(r,s):t)!==t&&(c=!0),n+=(l===t?"":l)+(e.options[a].text===t?e.options[a].value:e.options[a].text));return{html:c,values:""===n?r===t||r.placeholder===t?"":r.placeholder:n}},S=function(e,r){var i=document.createElement("input");return i.className="ddTP_SCH__field",i.dataset.refid=r,i.tabindex="0",i.autocomplete="off",i.autocorrect="off",i.autocapitalize="none",i.spellcheck="false",i.role="searchbox",i.ariaAutocomplete="list",i.placeholder="",i.type="search",e!==t&&e.length>0?(i.value=e,i.style.width=.75*(i.value.length+1)+"em"):i.style.width="0.75em",i},L=function(e,r){return e!==t&&e.pre!==t?e.pre.replace("#data#",r):t},T=function(e,t,r,i,n,o){var a=O({c:"ddTP_S__choice"+(r?" isplaceholder":""),v:e,id:i,iH:t||e,iTB:L(n,o)});if(!r){var l=document.createElement("span");l.className="ddTP_S__choice__remove",l.innerText="x",l.dataset.refid=i,a.appendChild(l)}return a},E=function(){if(i.INFOCUS!=t){var e=window.ddTPcache[i.INFOCUS];i.wrap.classList.remove("ddTP_C--open"),e.container.classList.remove("ddTP_C--open"),e.container.classList.remove("ddTP_C--focus"),null!==i.liSearch&&i.liSearch!==t&&(i.liSearch.style.display="none"),tpGS.gsap.set(i.wrap,{display:"none"}),delete i.timeStamp,delete i.INFOCUS,delete i.highlighted,z()}},M=function(){if(i.timeStamp!==t&&i.INFOCUS!==t&&window.ddTPcache[i.INFOCUS]!==t&&window.ddTPcache[i.INFOCUS].container!==t){var e=window.ddTPcache[i.INFOCUS].container.getBoundingClientRect();tpGS.gsap.set(i.wrap,{x:e.left+i.drop.offsetWidth>window.innerWidth?e.left+(window.innerWidth-25-(e.left+i.drop.offsetWidth)):e.left,y:window.pageYOffset+e.bottom+i.drop.offsetHeight>window.pageYOffset+window.innerHeight-50?window.pageYOffset+e.top-i.drop.offsetHeight:e.bottom+window.pageYOffset}),requestAnimationFrame((function(){M()}))}},N=function(){i.highlighted!==t&&null!==i.highlighted&&(i.ul.scrollTop+50>i.highlighted.offsetTop?i.ul.scrollTop=Math.max(0,i.highlighted.offsetTop-100):i.ul.scrollTop-300<i.highlighted.offsetTop&&(i.ul.scrollTop=i.highlighted.offsetTop-200))},O=function(e){var r=document.createElement("li");return e.group!==t?(r.innerHTML='<strong class="ddTP_R__group">'+e.group+"</strong>",r):(e.c&&(r.className=e.c),e.v&&(r.dataset.val=e.v),e.iTB||e.iTA?r.innerHTML=(e.iTB===t?"":e.iTB)+(e.iT===t?e.iH:e.iT)+(e.iTA===t?"":e.iTA):e.iT?r.innerText=e.iT:e.iH&&(r.innerHTML=e.iH),e.id&&(r.dataset.refid=e.id),e.optid!==t&&(r.dataset.optid=e.optid),e.aS&&(r.ariaSelected=e.aS),r)},P=function(e,r,n,o){return O({c:"ddTP_RO"+(i.highlighted===t&&e.selected?" ddTP_RO--highlighted":""),v:e.value,id:o,aS:e.selected,iT:e.text===t||""===e.text?e.value:e.text,iTB:L(n,x(n,e.dataset,e.value)),optid:r,group:"OPTGROUP"===e.tagName?e.label:t})},G=function(e,r){var n,o=window.ddTPcache[e],a=(o.container.getBoundingClientRect(),document.createDocumentFragment()),l="";o.params=o.params===t?{}:o.params,o.params.tags="true"==o.sel.dataset.tags||o.params.tags,o.params.search=o.params.search===t?(" "+o.sel.className).indexOf(" searchbox")>=0:o.params.search,i.highlighted=t,i.timeStamp||(i.searchi.value="",requestAnimationFrame((function(){i.searchi.focus()}))),R(),i.wrap.className="ddTP_C ddTP_C--default ddTP_C--open"+(o.sel.dataset.theme!==t?" ddTP_C--"+o.sel.dataset.theme:""),o.container.classList.add("ddTP_C--open"),o.container.classList.add("ddTP_C--focus"),i.ul.ariaMultiselectable=o.sel.multiple,i.searchw.style.display=o.sel.multiple||!o.params.search?"none":"block",i.INFOCUS=e,i.ul.innerHTML="",i.searchi.dataset.refid=e,o.params.search&&o.params.searchValue!==t&&""!==o.params.searchValue&&(l=o.params.searchValue.toLowerCase()),o.sel.multiple&&(o.params.search||o.params.tags)&&null!==i.liSearch&&i.liSearch!==t&&(i.liSearch.style.display="block");var s=-1;for(var c in o.sel.children)if(s++,!(!o.sel.children.hasOwnProperty(c)||"OPTION"!==o.sel.children[c].tagName&&"OPTGROUP"!==o.sel.children[c].tagName||o.sel.children[c].disabled||"OPTION"===o.sel.children[c].tagName&&""!==l&&-1==o.sel.children[c].value.toLowerCase().indexOf(l)))if(n=P(o.sel.children[c],s,o.params,e),"OPTGROUP"===o.sel.children[c].tagName)for(var u in a.appendChild(n),s--,o.sel.children[c].children)s++,!o.sel.children[c].children.hasOwnProperty(u)||"OPTION"!==o.sel.children[c].children[u].tagName||o.sel.children[c].children[u].disabled||""!==l&&-1==o.sel.children[c].children[u].value.toLowerCase().indexOf(l)||(n=P(o.sel.children[c].children[u],s,o.params,e),i.highlighted===t&&o.sel.children[c].selected&&(i.highlighted=n),a.appendChild(n));else i.highlighted===t&&o.sel.children[c].selected&&(i.highlighted=n),a.appendChild(n);if(i.highlighted===t&&a.childElementCount>0&&(i.highlighted=a.firstElementChild,N(),i.highlighted.classList.add("ddTP_RO--highlighted")),i.ul.appendChild(a),tpGS.gsap.set(i.wrap,{display:"block",left:0,top:0,position:"absolute",width:"185px"}),i.timeStamp===t&&(i.timeStamp=2,N(),requestAnimationFrame((function(){M()}))),r&&w(o.rendered,C(o.sel,o.params)),(o.params.tags||o.params.search)&&o.params.searchFocus){var d=o.sel.multiple?o.rendered.getElementsByClassName("ddTP_SCH__field"):i.searchi;d!==t&&null!==d&&d.length>0&&requestAnimationFrame((function(){d[0].focus(),0!==o.params.cursorPosition&&o.params.cursorPosition!==t&&(d[0].selectionStart=d[0].selectionEnd=o.params.cursorPosition),o.params.cursorPosition=0}))}},A=function(e){if(e.sel!=t&&e.sel.options!=t){var r;for(var i in e.sel.options){if(!e.sel.options.hasOwnProperty(i)||r)continue;r=e.sel.options[i].value==e.value?e.sel.options[i]:r}r!==t&&e.sel.removeChild(r)}},I=function(e){requestAnimationFrame((function(){G(e,!0)}))},D=function(e){i.INFOCUS!==t&&-1===e.target.className.indexOf("ddTP")&&E()},F=function(){i.highlighted=document.getElementsByClassName("ddTP_RO--highlighted"),i.highlighted=null===i.highlighted||i.highlighted===t||0===i.highlighted.length?t:i.highlighted[0]},H=function(e){F(),i.highlighted!==t&&null!==i.highlighted[e]&&i.highlighted[e]!==t&&(i.highlighted.classList.remove("ddTP_RO--highlighted"),i.highlighted=i.highlighted[e],i.highlighted.classList.add("ddTP_RO--highlighted"),N())},W=function(e){if(i.INFOCUS!==t&&i.highlighted!==t){var r=e.which||e.keyCode;return r===f||r===m?(ddTPcache[i.INFOCUS].sel.multiple?null!==i.liSearch&&i.liSearch!==t&&i.liSearch.blur():i.searchi.blur(),H(r===f?"previousElementSibling":"nextElementSibling"),e.preventDefault(),!1):r!==a||ddTPcache[i.INFOCUS].params.tags?void 0:(F(),i.highlighted!==t&&j(i.highlighted),e.preventDefault(),!1)}},z=function(){document.body.removeEventListener("click",D),document.body.removeEventListener("keydown",W),i.GLOBALLISTENER=t},R=function(){i.GLOBALLISTENER||(document.body.addEventListener("click",D),document.body.addEventListener("keydown",W),i.GLOBALLISTENER=!0)},B=function(){var b;r=!0,b=document.createDocumentFragment(),(i={wrap:document.createElement("span"),drop:document.createElement("span"),searchw:document.createElement("span"),searchi:document.createElement("input"),result:document.createElement("span"),ul:document.createElement("ul")}).wrap.className="ddTP_C ddTP_C--default",i.drop.className="ddTP-dropdown ddTP-dropdown--below",i.searchw.className="ddTP_SCH ddTP_SCH--dropdown",i.searchi.className="ddTP_SCH__field",i.result.className="ddTP_R",i.ul.className="ddTP_ROs",i.drop.dir="ltr",i.searchi.type="search",i.searchw.appendChild(i.searchi),i.wrap.appendChild(i.drop),i.drop.appendChild(i.searchw),i.drop.appendChild(i.result),i.result.appendChild(i.ul),b.appendChild(i.wrap),i.wrap.style.display="none",document.body.appendChild(b),v.on("click",".ddTP_C.ddTP-fake",(function(){i.INFOCUS!==this.dataset.refid||ddTPcache[this.dataset.refid].params.tags||ddTPcache[this.dataset.refid].multiple?(ddTPcache[this.dataset.refid].params.searchFocus=!0,G(this.dataset.refid)):E()})),v.on("mouseenter",".ddTP_RO",(function(){this.classList.add("ddTP_RO--highlighted")})),v.on("mouseleave",".ddTP_RO",(function(){this.classList.remove("ddTP_RO--highlighted")})),v.on("click",".ddTP_S__choice__remove",(function(){var r=ddTPcache[this.dataset.refid];return r.params.tags?(A({sel:r.sel,value:this.parentNode.dataset.val}),this.parentNode.parentNode.removeChild(this.parentNode),r.params.searchValue="",r.params.searchFocus=!1):(!function(e){if(e.sel!=t&&e.sel.options!=t){var r;for(var i in e.sel.options)e.sel.options.hasOwnProperty(i)&&!r&&(r=e.sel.options[i].value==e.value?e.sel.options[i]:r);r!==t&&(r.selected=!1)}}({sel:r.sel,value:this.parentNode.dataset.val}),r.params.searchValue="",r.params.searchFocus=!1),r.sel.dispatchEvent(new Event("change",{bubbles:!0})),e(r.sel).trigger("ddTP:unselect"),I(this.dataset.refid),!1})),v.on("keydown",".ddTP_SCH__field",(function(r){var i=r.which||r.keyCode,l=this.dataset.refid,s=ddTPcache[l];if(i===f||i===m)return H(i===f?"previousElementSibling":"nextElementSibling"),r.preventDefault(),!1;if(i!==o)if(s.params.tags){if(s.params.tags&&i===n&&""===this.value){var c=this.parentNode.previousElementSibling;null!==c&&c!==t&&"LI"===c.tagName&&c.dataset.val!==t&&(s.params.searchValue=c.dataset.val,s.params.searchFocus=!0,A({sel:s.sel,value:s.params.searchValue}),e(s.sel).trigger("ddTP:unselect"))}else if(this.value.length>1&&(e.inArray(String.fromCharCode(i),s.params.tokenSeparators)>=0||e.inArray(r.key,s.params.tokenSeparators)>=0)||i===a){var u=document.createElement("option");u.value=this.value,u.innerHTML=this.value,u.dataset.refid=l,u.selected=!0,s.sel.appendChild(u),s.sel.multiple&&this.parentNode.parentNode.insertBefore(T(this.value,t,s.sel.id,t),this.parentNode),this.value="",s.params.searchValue="",s.params.searchFocus=!0,s.params.cursorPosition=0,s.sel.multpile||(u.ariaSelected=!0),e(s.sel).trigger("ddTP:select"),s.sel.multpile||(w(s.rendered,C(s.sel,s.params)),s.sel.dispatchEvent(new Event("change",{bubbles:!0})),E())}}else s.sel.multiple&&s.params.search&&q(this);else E()})),v.on("keyup",".ddTP_SCH__field",(function(e){var t=e.which||e.keyCode;t!==h&&t!==g&&t!==l&&t!=c&&t!=s&&t!=u&&t!=p&&t!=d&&(_=ddTPcache[this.dataset.refid],_.params.searchValue=this.value,_.params.searchFocus=!0,_.params.cursorPosition=this.selectionStart,G(this.dataset.refid,!0))})),v.on("click",".ddTP_RO",(function(){j(this)}))},j=function(t){var r=ddTPcache[t.dataset.refid];r.sel.multiple?(t.ariaSelected=1!=t.ariaSelected&&"true"!=t.ariaSelected,r.sel.options[t.dataset.optid].selected=1==t.ariaSelected||"true"==t.ariaSelected,r.params.searchValue="",r.params.searchFocus=!1,e(r.sel).trigger("ddTP:select")):(r.sel.value=t.dataset.val,E()),w(r.rendered,C(r.sel,r.params)),r.sel.dispatchEvent(new Event("change",{bubbles:!0})),r.sel.multiple&&I(t.dataset.refid)},V=function(e,r){null!==r&&e!==t&&null!==r.parentNode&&r.parentNode.insertBefore(e,r.nextSibling)},q=function(e){tpGS.gsap.set(e,{width:.75*(e.value.length+1)+"em"})}}(jQuery);