File: //proc/self/cwd/wp-content/plugins/essential-grid/admin/assets/js/plugins/utils.min.js
!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 T,E=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 L(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function M(e,t){return L(e).appendChild(t)}function O(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 P(e,t,r,i){var n=O(e,t,r,i);return n.setAttribute("role","presentation"),n}function N(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}T=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 _=function(e){e.select()};function D(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?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=D(this.onTimeout,this)};function W(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-new Date)},z.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={toString:function(){return"ESGMirror.Pass"}},B={scroll:!1},j={origin:"*mouse"},V={origin:"+move"};function q(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 U=[""];function K(e){for(;U.length<=e;)U.push(Q(U)+" ");return U[e]}function Q(e){return e[e.length-1]}function $(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function X(){}function Y(e,t){var r=Object.create?Object.create(e):(X.prototype=e,new X);return t&&F(t,r),r}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function ee(e,t){return t?!!(-1<t.source.indexOf("\\w")&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}var re=/[\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 ie(e){return 768<=e.charCodeAt(0)&&re.test(e)}function ne(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function oe(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 ae=null;function le(e,t,r){var i;ae=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:ae=n),o.from==t&&(o.from!=o.to&&"before"!=r?i=n:ae=n)}return null!=i?i:ae}var se,ce,ue,de,pe,he=(se=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ce=/[stwN]/,ue=/[LRr]/,de=/[Lb1n]/,pe=/[1n]/,function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!se.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":ue.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":ue.test(C)&&(x=C)}for(var S=0;S<n;++S)if(ce.test(o[S])){var T=void 0;for(T=S+1;T<n&&ce.test(o[T]);++T);for(var E="L"==(S?o[S-1]:r),L=E==("L"==(T<n?o[T]:r))?E?"L":"R":r,M=S;M<T;++M)o[M]=L;S=T-1}for(var O,P=[],N=0;N<n;)if(de.test(o[N])){var G=N;for(++N;N<n&&de.test(o[N]);++N);P.push(new fe(0,G,N))}else{var A=N,I=P.length,_="rtl"==t?1:0;for(++N;N<n&&"L"!=o[N];++N);for(var D=A;D<N;)if(pe.test(o[D])){A<D&&(P.splice(I,0,new fe(1,A,D)),I+=_);var F=D;for(++D;D<N&&pe.test(o[D]);++D);P.splice(I,0,new fe(2,F,D)),I+=_,A=D}else++D;A<N&&P.splice(I,0,new fe(1,A,N))}return"ltr"==t&&(1==P[0].level&&(O=e.match(/^\s+/))&&(P[0].from=O[0].length,P.unshift(new fe(0,0,O[0].length))),1==Q(P).level&&(O=e.match(/\s+$/))&&(Q(P).to-=O[0].length,P.push(new fe(0,n-O[0].length,n)))),"rtl"==t?P.reverse():P});function fe(e,t,r){this.level=e,this.from=t,this.to=r}function ge(e,t){var r=e.order;return null==r&&(r=e.order=he(e.text,t)),r}var me=[],ve=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]||me).concat(r)};function be(e,t){return e._handlers&&e._handlers[t]||me}function ye(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=W(n,r))&&(i[t]=n.slice(0,o).concat(n.slice(o+1)))}function ke(e,t){var r=be(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 we(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,r||t.type,e,t),Le(t)||t.esgmirrorIgnore}function xe(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==W(r,t[i])&&r.push(t[i])}function Ce(e,t){return 0<be(e,t).length}function Se(e){e.prototype.on=function(e,t){ve(this,e,t)},e.prototype.off=function(e,t){ye(this,e,t)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(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 Ne,Ge,Ae=function(){if(a&&l<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function Ie(e){var t;null==Ne&&(t=O("span",""),M(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ne=t.offsetWidth<=1&&2<t.offsetHeight&&!(a&&l<8)));var r=Ne?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function _e(e){if(null!=Ge)return Ge;var t=M(e,document.createTextNode("AخA")),r=T(t,0,1).getBoundingClientRect(),i=T(t,1,2).getBoundingClientRect();return L(e),r&&r.left!=r.right&&(Ge=i.right-r.right<3)}var De,Fe=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/)},He=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(De=O("div"))||(De.setAttribute("oncopy","return;"),"function"==typeof De.oncopy),We=null,Re={},Be={};function je(e){if("string"==typeof e&&Be.hasOwnProperty(e))e=Be[e];else if(e&&"string"==typeof e.name&&Be.hasOwnProperty(e.name)){var t=Be[e.name];"string"==typeof t&&(t={name:t}),(e=Y(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return je("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return je("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=je(t);var r=Re[t.name];if(!r)return Ve(e,"text/plain");var i=r(e,t);if(qe.hasOwnProperty(t.name)){var n=qe[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 qe={};function Ue(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 Ke(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 Qe(e,t,r){return!e.startState||e.startState(t,r)}var $e=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 Xe(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 Ye(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 Ze(e,t,r){var i=[];return e.iter(t,r,(function(e){i.push(e.text)})),i}function Je(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function et(e){if(null==e.parent)return null;for(var t=e.parent,r=W(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 tt(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 rt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function nt(e,t,r){if(void 0===r&&(r=null),!(this instanceof nt))return new nt(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ot(e,t){return e.line-t.line||e.ch-t.ch}function at(e,t){return e.sticky==t.sticky&&0==ot(e,t)}function lt(e){return nt(e.line,e.ch)}function st(e,t){return ot(e,t)<0?t:e}function ct(e,t){return ot(e,t)<0?e:t}function ut(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(e,t){if(t.line<e.first)return nt(e.first,0);var r,i,n,o=e.first+e.size-1;return t.line>o?nt(o,Xe(e,o).text.length):(i=Xe(e,(r=t).line).text.length,null==(n=r.ch)||i<n?nt(r.line,i):n<0?nt(r.line,0):r)}function pt(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=dt(e,t[i]);return r}$e.prototype.eol=function(){return this.pos>=this.string.length},$e.prototype.sol=function(){return this.pos==this.lineStart},$e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$e.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},$e.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},$e.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},$e.prototype.skipToEnd=function(){this.pos=this.string.length},$e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},$e.prototype.backUp=function(e){this.pos-=e},$e.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)},$e.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},$e.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},$e.prototype.current=function(){return this.string.slice(this.start,this.pos)},$e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$e.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ht=function(e,t){this.state=e,this.lookAhead=t},ft=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 gt(e,t,r,i){var n=[e.state.modeGen],o={};St(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,St(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 mt(e,t,r){var i,n,o;return t.styles&&t.styles[0]==e.state.modeGen||(i=vt(e,et(t)),n=t.text.length>e.options.maxHighlightLength&&Ue(e.doc.mode,i.state),o=gt(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 vt(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState)return new ft(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=Xe(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof ht?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&&Xe(i,o-1).stateAfter,l=a?ft.fromSaved(i,a,o):new ft(i,Qe(i.mode),o);return i.iter(o,t,(function(r){bt(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 bt(e,t,r,i){var n=e.doc.mode,o=new $e(t,e.options.tabSize,r);for(o.start=o.pos=i||0,""==t&&yt(n,r.state);!o.eol();)kt(n,o,r.state),o.start=o.pos}function yt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ke(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function kt(e,t,r,i){for(var n=0;n<10;n++){i&&(i[0]=Ke(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.")}ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ft.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ft.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},ft.fromSaved=function(e,t,r){return t instanceof ht?new ft(e,Ue(e.mode,t.state),r,t.lookAhead):new ft(e,Ue(e.mode,t),r)},ft.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new ht(t,this.maxLookAhead):t};var wt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function xt(e,t,r,i){var n,o,a=e.doc,l=a.mode,s=Xe(a,(t=dt(a,t)).line),c=vt(e,t.line,r),u=new $e(s.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,n=kt(l,u,c.state),i&&o.push(new wt(u,n,Ue(a.mode,c.state)));return i?o:new wt(u,n,c.state)}function Ct(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 St(e,t,r,i,n,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s=0,c=null,u=new $e(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&Ct(yt(r,i.state),o);!u.eol();){var p,h=u.pos>e.options.maxHighlightLength?(l=!1,a&&bt(e,t,i,u.pos),u.pos=t.length,null):Ct(kt(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 Lt(e,t,r){this.marker=e,this.from=t,this.to=r}function Mt(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=rt(e,t.from.line)&&Xe(e,t.from.line).markedSpans,i=rt(e,t.to.line)&&Xe(e,t.to.line).markedSpans;if(!r&&!i)return null;var n=t.from.ch,o=t.to.ch,a=0==ot(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 Lt(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 Lt(l,o?null:a.from-t,null==a.to?null:a.to-t)))}return i}(i,o,a),c=1==t.text.length,u=Q(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=Mt(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?Mt(l,g.marker)||(g.from=u,c&&(l=l||[]).push(g)):(g.from+=u,c&&(l=l||[]).push(g))}l=l&&Nt(l),s&&s!=l&&(s=Nt(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 Lt(l[y].marker,null,null));for(var k=0;k<b;++k)m.push(v);m.push(s)}return m}function Nt(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 Gt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function It(e){return e.inclusiveLeft?-1:0}function _t(e){return e.inclusiveRight?1:0}function Dt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var i=e.find(),n=t.find(),o=ot(i.from,n.from)||It(e)-It(t);return o?-o:ot(i.to,n.to)||_t(e)-_t(t)||t.id-e.id}function Ft(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||Dt(r,n.marker)<0)&&(r=n.marker);return r}function Ht(e){return Ft(e,!0)}function zt(e){return Ft(e,!1)}function Wt(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||Dt(r,o.marker)<0)&&(r=o.marker)}return r}function Rt(e,t,r,i,n){var o=Xe(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=ot(c.from,r)||It(s.marker)-It(n),d=ot(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<=ot(c.to,r):0<ot(c.to,r))||0<=u&&(s.marker.inclusiveRight&&n.inclusiveLeft?ot(c.from,i)<=0:ot(c.from,i)<0)))return 1}}}function Bt(e){for(var t;t=Ht(e);)e=t.find(-1,!0).line;return e}function jt(e,t){var r=Xe(e,t),i=Bt(r);return r==i?t:et(i)}function Vt(e,t){if(t>e.lastLine())return t;var r,i=Xe(e,t);if(!qt(e,i))return t;for(;r=zt(i);)i=r.find(1,!0).line;return et(i)+1}function qt(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&&Ut(e,t,i))return!0}}function Ut(e,t,r){if(null==r.to){var i=r.marker.find(1,!0);return Ut(e,i.line,Mt(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)&&Ut(e,t,n))return!0}function Kt(e){for(var t=0,r=(e=Bt(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 Qt(e){if(0==e.height)return 0;for(var t,r=e.text.length,i=e;t=Ht(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 $t(e){var t=e.display,r=e.doc;t.maxLine=Xe(r,r.first),t.maxLineLength=Qt(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Qt(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Xt=function(e,t,r){this.text=e,At(this,t),this.height=r?r(this):1};Xt.prototype.lineNo=function(){return et(this)},Se(Xt);var Yt={},Zt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Zt:Yt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function er(e,t){var r=P("span",null,null,s?"padding-right: .1px":null),i={pre:P("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=tr,_e(e.display.measure)&&(l=ge(a,e.doc.direction))&&(i.addToken=rr(i.addToken,l)),i.map=[],nr(a,i,mt(e,a,t!=e.display.externalMeasured&&et(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(Ie(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")),ke(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=I(i.pre.className,i.textClass||"")),i}function tr(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(O("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(O("span",K(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b):("\r"==g[0]||"\n"==g[0]?(y=c.appendChild(O("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(O("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=O("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 rr(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 ir(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 nr(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||Dt(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 T=0;T<b.length;++T)ir(t,0,b[T]);if(d&&(d.from||0)==f){if(ir(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 E=Math.min(h,v);;){if(m){var L,M=f+m.length;if(d||(L=E<M?m.slice(0,E-f):m,t.addToken(t,L,a?a+s:s,u,f+L.length==v?c:"",l,p)),E<=M){m=m.slice(E-f),f=E;break}f=M,u=""}m=n.slice(o,o=r[g++]),a=Jt(r[g++],t.cm.options)}}else for(var O=1;O<r.length;O+=2)t.addToken(t,n.slice(o,o=r[O]),Jt(r[O+1],t.cm.options))}function or(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?et(Q(this.rest))-r+1:1,this.node=this.text=null,this.hidden=qt(e,t)}function ar(e,t,r){for(var i=[],n=t;n<r;n=a){var o=new or(e.doc,Xe(e.doc,n),n),a=n+o.size;i.push(o)}return i}var lr=null;var sr=null;function cr(e,t){var r=be(e,t);if(r.length){var i,n=Array.prototype.slice.call(arguments,2);lr?i=lr.delayedCallbacks:sr?i=sr:(i=sr=[],setTimeout(ur,0));for(var o=function(e){i.push((function(){return r[e].apply(null,n)}))},a=0;a<r.length;++a)o(a)}}function ur(){var e=sr;sr=null;for(var t=0;t<e.length;++t)e[t]()}function dr(e,t,r,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];"text"==o?fr(e,t):"gutter"==o?mr(e,t,r,i):"class"==o?gr(e,t):"widget"==o&&vr(e,t,i)}t.changes=null}function pr(e){return e.node==e.text&&(e.node=O("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 hr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):er(e,t)}function fr(e,t){var r=t.text.className,i=hr(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,gr(e,t)):r&&(t.text.className=r)}function gr(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=pr(i),i.background=n.insertBefore(O("div",null,o),n.firstChild),r.display.input.setUneditable(i.background)),t.line.wrapClass?pr(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 mr(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=pr(t),t.gutterBackground=O("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=pr(t),l=t.gutter=O("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(O("div",it(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(O("div",[u],"ESGMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function vr(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);br(e,t,r)}function br(e,t,r){if(yr(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)yr(e,t.rest[i],t,r,!1)}function yr(e,t,r,i,n){if(t.widgets)for(var o=pr(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=O("div",[s.node],"ESGMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),kr(s,c,r,i),e.display.input.setUneditable(c),n&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),cr(s,"redraw")}}function kr(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 wr(e){if(null!=e.height)return e.height;var t,r=e.doc.cm;return r?(N(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,O("div",[e.node],null,t))),e.height=e.node.parentNode.offsetHeight):0}function xr(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 Cr(e){return e.lineSpace.offsetTop}function Sr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Tr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=M(e.measure,O("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 50-e.display.nativeBarWidth}function Lr(e){return e.display.scroller.clientWidth-Er(e)-e.display.barWidth}function Mr(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(et(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Pr(e,t,r,i){return Ar(e,Gr(e,t),r,i)}function Nr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[si(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Gr(e,t){var r=et(t),i=Nr(e,r);i&&!i.text?i=null:i&&i.changes&&(dr(e,i,r,ii(e)),e.curOp.forceUpdate=!0);var n=Or(i=i||function(e,t){var r=et(t=Bt(t)),i=e.display.externalMeasured=new or(e.doc,t,r);i.lineN=r;var n=i.built=er(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 Ar(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&&Lr(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=Dr(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&&ie(t.line.text.charAt(c.coverStart+d));)--d;for(;c.coverStart+p<c.coverEnd&&ie(t.line.text.charAt(c.coverStart+p));)++p;if((n=a&&l<9&&0==d&&p==c.coverEnd-c.coverStart?u.parentNode.getBoundingClientRect():Fr(T(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!=We)return We;var t=M(e,O("span","x")),r=t.getBoundingClientRect(),i=T(t,0,1).getBoundingClientRect();return We=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+ri(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 Ir,_r={left:0,right:0,top:0,bottom:0};function Dr(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 Fr(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 Hr(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,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Hr(e.display.view[t])}function Wr(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 Rr(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Br(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function jr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=wr(e.widgets[r]));return t}function Vr(e,t,r,i,n){var o;if(n||(o=jr(t),r.top+=o,r.bottom+=o),"line"==i)return r;i=i||"local";var a,l,s=Kt(t);return"local"==i?s+=Cr(e.display):s-=e.display.viewOffset,"page"!=i&&"window"!=i||(s+=(a=e.display.lineSpace.getBoundingClientRect()).top+("window"==i?0:Br()),l=a.left+("window"==i?0:Rr()),r.left+=l,r.right+=l),r.top+=s,r.bottom+=s,r}function qr(e,t,r){if("div"==r)return t;var i,n=t.left,o=t.top;"page"==r?(n-=Rr(),o-=Br()):"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 Ur(e,t,r,i,n){return Vr(e,i=i||Xe(e.doc,t.line),Pr(e,i,t.ch,n),r)}function Kr(e,t,r,i,n,o){function a(t,a){var l=Ar(e,n,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,Vr(e,i,l,r)}i=i||Xe(e.doc,t.line),n=n||Gr(e,i);var l=ge(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=le(l,s,c),p=ae,h=u(s,d,"before"==c);return null!=p&&(h.other=u(s,p,"before"!=c)),h}function Qr(e,t){var r=0;t=dt(e.doc,t),e.options.lineWrapping||(r=ri(e.display)*t.ch);var i=Xe(e.doc,t.line),n=Kt(i)+Cr(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function $r(e,t,r,i,n){var o=nt(e,t,r);return o.xRel=n,i&&(o.outside=i),o}function Xr(e,t,r){var i=e.doc;if((r+=e.display.viewOffset)<0)return $r(i.first,0,null,-1,-1);var n=tt(i,r),o=i.first+i.size-1;if(o<n)return $r(i.first+i.size-1,Xe(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(i,n);;){var l=ei(e,a,n,t,r),s=Wt(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=Xe(i,n=c.line)}}function Yr(e,t,r,i){i-=jr(t);var n=t.text.length,o=oe((function(t){return Ar(e,r,t-1).bottom<=i}),n,0);return{begin:o,end:n=oe((function(t){return Ar(e,r,t).top>i}),o,n)}}function Zr(e,t,r,i){return Yr(e,t,r=r||Gr(e,t),Vr(e,t,Ar(e,r,i),"line").top)}function Jr(e,t,r,i){return!(e.bottom<=r)&&(e.top>r||(i?e.left:e.right)>t)}function ei(e,t,r,i,n){n-=Kt(t);var o,a=Gr(e,t),l=jr(t),s=0,c=t.text.length,u=!0,d=ge(t,e.doc.direction);d&&(s=(u=1!=(o=(e.options.lineWrapping?function(e,t,r,i,n,o,a){var l=Yr(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=Ar(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=oe((function(l){var s=n[l],c=1!=s.level;return Jr(Kr(e,nt(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,Jr(s=Kr(e,nt(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=oe((function(t){var r=Ar(e,a,t);return r.top+=l,r.bottom+=l,Jr(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&&Ar(e,a,y-(u?1:0)).bottom+l<=n==u?"after":"before",g=(m=Kr(e,nt(r,y,f),"line",t,a)).left,k=n<m.top?-1:n>=m.bottom?1:0),$r(r,y=ne(t.text,y,1),f,k,i-g)}function ti(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=O("pre",null,"ESGMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(O("br"));Ir.appendChild(document.createTextNode("x"))}M(e.measure,Ir);var r=Ir.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),L(e.measure),r||1}function ri(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),r=O("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 ii(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:ni(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ni(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function oi(e){var t=ti(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/ri(e.display)-3);return function(n){if(qt(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 ai(e){var t=e.doc,r=oi(e);t.iter((function(e){var t=r(e);t!=e.height&&Je(e,t)}))}function li(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=Xr(e,o,a);return i&&0<u.xRel&&(s=Xe(e.doc,u.line).text).length==u.ch&&(c=H(s,s.length,e.options.tabSize)-s.length,u=nt(u.line,Math.max(0,Math.round((o-Tr(e.display).left)/ri(e.display))-c))),u}function si(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 ci(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&&jt(e.doc,t)<s.viewTo&&di(e):r<=s.viewFrom?Et&&Vt(e.doc,r+i)>s.viewFrom?di(e):(s.viewFrom+=i,s.viewTo+=i):t<=s.viewFrom&&r>=s.viewTo?di(e):t<=s.viewFrom?(n=pi(e,r,r+i,1))?(s.view=s.view.slice(n.index),s.viewFrom=n.lineN,s.viewTo+=i):di(e):r>=s.viewTo?(o=pi(e,t,t,-1))?(s.view=s.view.slice(0,o.index),s.viewTo=o.lineN):di(e):(a=pi(e,t,t,-1),l=pi(e,r,r+i,1),a&&l?(s.view=s.view.slice(0,a.index).concat(ar(e,a.lineN,l.lineN)).concat(s.view.slice(l.index)),s.viewTo+=i):di(e));var c=s.externalMeasured;c&&(r<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(s.externalMeasured=null))}function ui(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[si(e,t)]).node||-1==W(n=i.changes||(i.changes=[]),r)&&n.push(r)}function di(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pi(e,t,r,i){var n,o=si(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(;jt(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 hi(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 fi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function gi(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)&&mi(e,r.head,a),i||bi(e,r,l));return o}function mi(e,t,r){var i,n=Kr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(O("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(O("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 vi(e,t){return e.top-t.top||e.left-t.left}function bi(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,Lr(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(O("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=Xe(n,t),p=d.text.length;function h(r,i){return Ur(e,nt(t,r),"div",d,i)}function f(t,r,i){var n=Zr(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=ge(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"),T=h(t-1,C?"right":"left"),E=null==r&&0==e,L=null==i&&t==p,M=0==d,O=!g||d==g.length-1;T.top-S.top<=3?(m=(c?L:E)&&O,v=(c?E:L)&&M?l:(C?S:T).left,b=m?s:(C?T:S).right,u(v,S.top,b-v,S.bottom)):(x=C?(y=c&&E&&M?l:S.left,k=c?s:f(e,n,"before"),w=c?l:f(t,n,"after"),c&&L&&O?s:T.right):(y=c?f(e,n,"before"):l,k=!c&&E&&M?s:S.right,w=!c&&L&&O?l:T.left,c?f(t,n,"after"):s),u(y,S.top,k-y,S.bottom),S.bottom<T.top&&u(l,S.bottom,null,T.top),u(w,T.top,x-w,T.bottom)),(!o||vi(S,o)<0)&&(o=S),vi(T,o)<0&&(o=T),(!a||vi(S,a)<0)&&(a=S),vi(T,a)<0&&(a=T)})),{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=Xe(n,v.line),h=Xe(n,b.line),f=Bt(p)==Bt(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 yi(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 ki(e){e.state.focused||(e.display.input.focus(),xi(e))}function wi(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ci(e))}),100)}function xi(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ke(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()),yi(e))}function Ci(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"ESGMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Si(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)&&(Je(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/ri(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-Cr(e)),r&&null!=r.bottom?r.bottom:o+e.wrapper.clientHeight),l=tt(t,o),s=tt(t,a);return r&&r.ensure&&(i=r.ensure.from.line,n=r.ensure.to.line,i<l?s=tt(t,Kt(Xe(t,l=i))+e.wrapper.clientHeight):Math.min(n,t.lastLine())>=s&&(l=tt(t,Kt(Xe(t,n))-e.wrapper.clientHeight),s=n)),{from:l,to:Math.max(s,l+1)}}function Li(e,t){var r=e.display,i=ti(e.display);t.top<0&&(t.top=0);var n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Mr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l,s=e.doc.height+Sr(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=Lr(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 Mi(e,t){null!=t&&(Ni(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Oi(e){Ni(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||Ni(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Ni(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Gi(e,Qr(e,t.from),Qr(e,t.to),t.margin))}function Gi(e,t,r,i){var n=Li(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 Ai(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||an(e,{top:t}),Ii(e,t,!0),r&&an(e),en(e,100))}function Ii(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,cn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Di(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+Sr(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 Fi(e,t,r){this.cm=r;var i=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"ESGMirror-vscrollbar"),n=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"ESGMirror-hscrollbar");i.tabIndex=n.tabIndex=-1,e(i),e(n),ve(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),ve(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 Hi(){}function zi(e,t){t=t||Di(e);var r=e.display.barWidth,i=e.display.barHeight;Wi(e,t);for(var n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++)r!=e.display.barWidth&&e.options.lineWrapping&&Si(e),Wi(e,Di(e)),r=e.display.barWidth,i=e.display.barHeight}function Wi(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=""}Fi.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}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.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 z,this.disableVert=new z},Fi.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)}))},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)},Hi.prototype.update=function(){return{bottom:0,right:0}},Hi.prototype.setScrollLeft=function(){},Hi.prototype.setScrollTop=function(){},Hi.prototype.clear=function(){};var Ri={native:Fi,null:Hi};function Bi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ri[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(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:Ai)(e,t)}),e),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)}var ji=0;function Vi(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:++ji},t=e.curOp,lr?lr.ops.push(t):t.ownsGroup=lr={ops:[t],delayedCallbacks:[]}}function qi(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{lr=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++)Ui(t[r]);for(var i=0;i<t.length;i++)(n=t[i]).updatedDisplay=n.mustUpdate&&nn(n.cm,n.update);for(var n,o=0;o<t.length;o++)Ki(t[o]);for(var a=0;a<t.length;a++)Qi(t[a]);for(var l=0;l<t.length;l++)$i(t[l])}(e)}))}function Ui(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&&$t(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 rn(i,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ki(e){var t=e.cm,r=t.display;e.updatedDisplay&&Si(t),e.barMeasure=Di(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-Lr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Qi(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&&sn(t,e.barMeasure),e.selectionChanged&&yi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&ki(e.cm)}function $i(e){var t,r,i,n,o,a,l,s=e.cm,c=s.display,u=s.doc;e.updatedDisplay&&on(s,e.update),null==c.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null!=e.scrollTop&&Ii(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?nt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?nt(t.line,t.ch+1,"before"):t);for(var n=0;n<5;n++){var o,a=!1,l=Kr(e,t),s=r&&r!=t?Kr(e,r):l,c=Li(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&&(Ai(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,dt(u,e.scrollToPos.from),dt(u,e.scrollToPos.to),e.scrollToPos.margin),i=t,we(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=O("div","",null,"position: absolute;\n top: "+(i.top-n.viewOffset-Cr(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||ke(d[h],"hide");if(p)for(var g=0;g<p.length;++g)p[g].lines.length&&ke(p[g],"unhide");c.wrapper.offsetHeight&&(u.scrollTop=s.display.scroller.scrollTop),e.changeObjs&&ke(s,"changes",s,e.changeObjs),e.update&&e.update.finish()}function Xi(e,t){if(e.curOp)return t();Vi(e);try{return t()}finally{qi(e)}}function Yi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vi(e);try{return t.apply(e,arguments)}finally{qi(e)}}}function Zi(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{qi(this)}}}function Ji(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vi(t);try{return e.apply(this,arguments)}finally{qi(t)}}}function en(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,D(tn,e))}function tn(e){var t,r,i,n=e.doc;n.highlightFrontier>=e.display.viewTo||(t=+new Date+e.options.workTime,r=vt(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?Ue(n.mode,r.state):null,s=gt(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&&bt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>t)return en(e,e.options.workDelay),!0})),n.highlightFrontier=r.line,n.modeFrontier=Math.max(n.modeFrontier,r.line),i.length&&Xi(e,(function(){for(var t=0;t<i.length;t++)ui(e,i[t],"text")})))}var rn=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=Lr(e),this.force=r,this.dims=ii(e),this.events=[]};function nn(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return di(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==hi(e))return!1;un(e)&&(di(e),t.dims=ii(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=jt(e.doc,o),a=Vt(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=ar(l,c,u),d.viewFrom=c):(d.viewFrom>c?d.view=ar(l,c,d.viewFrom).concat(d.view):d.viewFrom<c&&(d.view=d.view.slice(si(l,c))),d.viewFrom=c,d.viewTo<u?d.view=d.view.concat(ar(l,d.viewTo,u)):d.viewTo>u&&(d.view=d.view.slice(0,si(l,u)))),d.viewTo=u,r.viewOffset=Kt(Xe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var h=hi(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||!N(e.display.lineDiv,t))return null;var r,i={activeElt:t};return!window.getSelection||(r=window.getSelection()).anchorNode&&r.extend&&N(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<W(v.changes,"gutter")&&(y=!1),dr(e,v,g,r)),y&&(L(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(it(e.options,g)))),p=v.node.nextSibling}else{var k=(o=g,a=r,l=hr(i=e,n=v),n.text=n.node=l.pre,l.bgClass&&(n.bgClass=l.bgClass),l.textClass&&(n.textClass=l.textClass),gr(i,n),mr(i,n,o,a),br(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&&N(document.body,f.anchorNode)&&N(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))),L(r.cursorDiv),L(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,p&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,en(e,400)),!(r.updateLineNumbers=null)}function on(e,t){for(var r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Lr(e))i&&(t.visible=Ei(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Sr(e.display)-Mr(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(!nn(e,t))break;Si(e);var n=Di(e);fi(e),zi(e,n),sn(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 an(e,t){var r,i=new rn(e,t);nn(e,i)&&(Si(e),on(e,i),r=Di(e),fi(e),zi(e,r),sn(e,r),i.finish())}function ln(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function sn(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 cn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=ni(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 un(e){if(e.options.lineNumbers){var t=e.doc,r=it(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(O("div",[O("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",ln(e.display),1}}}function dn(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 pn(e){var t=e.gutters,r=e.gutterSpecs;L(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(O("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",ln(e)}function hn(e){pn(e.display),ci(e),cn(e)}function fn(e,t,i,n){var o=this;this.input=i,o.scrollbarFiller=O("div",null,"ESGMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=O("div",null,"ESGMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=P("div",null,"ESGMirror-code"),o.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=O("div",null,"ESGMirror-cursors"),o.measure=O("div",null,"ESGMirror-measure"),o.lineMeasure=O("div",null,"ESGMirror-measure"),o.lineSpace=P("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=P("div",[o.lineSpace],"ESGMirror-lines");o.mover=O("div",[c],null,"position: relative"),o.sizer=O("div",[o.mover],"ESGMirror-sizer"),o.sizerWidth=null,o.heightForcer=O("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=O("div",null,"ESGMirror-gutters"),o.lineGutter=null,o.scroller=O("div",[o.sizer,o.heightForcer,o.gutters],"ESGMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=O("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=dn(n.gutters,n.lineNumbers),pn(o),i.init(o)}rn.prototype.signal=function(e,t){Ce(e,t)&&this.events.push(arguments)},rn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};var gn=0,mn=null;function vn(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 bn(e,t){var i,n,o,a=vn(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!=mn)return c&&f&&Ai(e,Math.max(0,p.scrollTop+c*mn)),_i(e,Math.max(0,p.scrollLeft+l*mn)),(!c||c&&f)&&Te(t),void(u.wheelStartX=null);c&&null!=mn&&(i=c*mn,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),an(e,{top:n,bottom:o})),gn<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&&(mn=(mn*gn+r)/(gn+1),++gn))}),200)):(u.wheelDX+=l,u.wheelDY+=c))}}a?mn=-.53:r?mn=15:u?mn=-.7:p&&(mn=-1/3);var yn=function(e,t){this.ranges=e,this.primIndex=t};yn.prototype.primary=function(){return this.ranges[this.primIndex]},yn.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(!at(r.anchor,i.anchor)||!at(r.head,i.head))return!1}return!0},yn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new kn(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new yn(e,this.primIndex)},yn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},yn.prototype.contains=function(e,t){t=t||e;for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(0<=ot(t,i.from())&&ot(e,i.to())<=0)return r}return-1};var kn=function(e,t){this.anchor=e,this.head=t};function wn(e,t,r){var i=e&&e.options.selectionsMayTouch,n=t[r];t.sort((function(e,t){return ot(e.from(),t.from())})),r=W(t,n);for(var o=1;o<t.length;o++){var a,l,s,c=t[o],u=t[o-1],d=ot(u.to(),c.from());(i&&!c.empty()?0<d:0<=d)&&(a=ct(u.from(),c.from()),l=st(u.to(),c.to()),s=u.empty()?c.from()==c.head:u.from()==u.head,o<=r&&--r,t.splice(--o,2,new kn(s?l:a,s?a:l)))}return new yn(t,r)}function xn(e,t){return new yn([new kn(e,t||e)],0)}function Cn(e){return e.text?nt(e.from.line+e.text.length-1,Q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Sn(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return Cn(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+=Cn(t).ch-t.to.ch),nt(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 kn(Sn(n.anchor,t),Sn(n.head,t)))}return wn(e.cm,r,e.sel.primIndex)}function En(e,t,r){return e.line==t.line?nt(r.line,e.ch-t.ch+r.ch):nt(r.line+(e.line-t.line),e.ch)}function Ln(e){e.doc.mode=Ve(e.options,e.doc.modeOption),Mn(e)}function Mn(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,en(e,100),e.state.modeGen++,e.curOp&&ci(e)}function On(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Q(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),Gt(e),At(e,r);var n=i?i(e):1;n!=e.height&&Je(e,n)}(e,r,n,i),cr(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Xt(p[o],n(o),i));return r}var l,s,c,u=t.from,d=t.to,p=t.text,h=Xe(e,u.line),f=Xe(e,d.line),g=Q(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 Xt(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)),cr(e,"change",e,t)}function Nn(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 Gn(e,t){if(t.cm)throw new Error("This document is already in use.");ai((e.doc=t).cm=e),Ln(e),An(e),e.options.lineWrapping||$t(e),e.options.mode=t.modeOption,ci(e)}function An(e){("rtl"==e.doc.direction?A:E)(e.display.lineDiv,"ESGMirror-rtl")}function In(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:lt(t.from),to:Cn(t),text:Ye(e,t.from,t.to)};return zn(e,r,t.from.line,t.to.line+1),Nn(e,(function(e){return zn(e,r,t.from.line,t.to.line+1)}),!0),r}function Dn(e){for(;e.length&&Q(e).ranges;)e.pop()}function Fn(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?(Dn(l.done),Q(l.done)):l.done.length&&!Q(l.done).ranges?Q(l.done):1<l.done.length&&!l.done[l.done.length-2].ranges?(l.done.pop(),Q(l.done)):void 0))a=Q(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,a.to)?a.to=Cn(t):o.changes.push(_n(e,t));else{var c=Q(n.done);for(c&&c.ranges||Hn(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||ke(e,"historyAdded")}function Hn(e,t){var r=Q(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 Wn(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 Rn(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(Wn(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 Bn(e,t,r){for(var i=[],n=0;n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?yn.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<W(t,Number(u[1]))&&(Q(l)[d]=c[d],delete c[d])}}}return i}function jn(e,t,r,i){if(i){var n,o=e.anchor;return r&&((n=ot(t,o)<0)!=ot(r,o)<0?(o=t,t=r):n!=ot(t,r)<0&&(t=r)),new kn(o,t)}return new kn(r||t,t)}function Vn(e,t,r,i,n){null==n&&(n=e.cm&&(e.cm.display.shift||e.extend)),$n(e,new yn([jn(e.sel.primary(),t,r,n)],0),i)}function qn(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]=jn(e.sel.ranges[o],t[o],null,n);$n(e,wn(e.cm,i,e.sel.primIndex),r)}function Un(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r,$n(e,wn(e.cm,n,e.sel.primIndex),i)}function Kn(e,t,r,i){$n(e,xn(t,r),i)}function Qn(e,t,r){var i=e.history.done,n=Q(i);n&&n.ranges?Xn(e,i[i.length-1]=t,r):$n(e,t,r)}function $n(e,t,r){Xn(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=Q(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:Hn(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,i&&!1!==i.clearRedo&&Dn(c.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Xn(e,t,r){var i,n,o,a;(Ce(e,"beforeSelectionChange")||e.cm&&Ce(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 kn(dt(i,e[t].anchor),dt(i,e[t].head))},origin:o&&o.origin},ke(i,"beforeSelectionChange",i,a),i.cm&&ke(i.cm,"beforeSelectionChange",i.cm,a),t=a.ranges!=n.ranges?wn(i.cm,a.ranges,a.ranges.length-1):n);var l=r&&r.bias||(ot(t.primary().head,e.sel.primary().head)<0?-1:1);Yn(e,Jn(e,t,l,!0)),r&&!1===r.scroll||!e.cm||Oi(e.cm)}function Yn(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),cr(e,"cursorActivity",e))}function Zn(e){Yn(e,Jn(e,e.sel,null,!1))}function Jn(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=to(e,a.anchor,l&&l.anchor,r,i),c=to(e,a.head,l&&l.head,r,i);!n&&s==a.anchor&&c==a.head||((n=n||t.ranges.slice(0,o))[o]=new kn(s,c))}return n?wn(e.cm,n,t.primIndex):t}function eo(e,t,r,i,n){var o=Xe(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&&(ke(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=ro(e,d,-i,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(p=ot(d,r))&&(i<0?p<0:0<p))return eo(e,d,t,i,n)}var h=s.find(i<0?-1:1);return(i<0?c:u)&&(h=ro(e,h,i,h.line==t.line?o:null)),h?eo(e,h,t,i,n):null}}return t}function to(e,t,r,i,n){var o=i||1;return eo(e,t,r,o,n)||!n&&eo(e,t,r,o,!0)||eo(e,t,r,-o,n)||!n&&eo(e,t,r,-o,!0)||(e.cantEdit=!0,nt(e.first,0))}function ro(e,t,r,i){return r<0&&0==t.ch?t.line>e.first?dt(e,nt(t.line-1)):null:0<r&&t.ch==(i||Xe(e,t.line)).text.length?t.line<e.first+e.size-1?nt(t.line+1,0):null:new nt(t.line,t.ch+r)}function io(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),B)}function no(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=dt(e,t)),r&&(i.to=dt(e,r)),n&&(i.text=n),void 0!==o&&(i.origin=o)}),ke(e,"beforeChange",e,i),e.cm&&ke(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 oo(e,t,r){if(e.cm){if(!e.cm.curOp)return Yi(e.cm,oo)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ce(e,"beforeChange")||e.cm&&Ce(e.cm,"beforeChange"))||(t=no(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!=W(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];ot(p.to,l.from)<0||0<ot(p.from,l.to)||(c=[s,1],u=ot(p.from,l.from),d=ot(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)ao(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin});else ao(e,t)}}function ao(e,t){var r,i;1==t.text.length&&""==t.text[0]&&0==ot(t.from,t.to)||(r=Tn(e,t),Fn(e,t,r,e.cm?e.cm.curOp.id:NaN),co(e,t,r,Pt(e,t)),i=[],Nn(e,(function(e,r){r||-1!=W(i,e.history)||(fo(e.history,t),i.push(e.history)),co(e,t,null,Pt(e,t))})))}function lo(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(Hn(n,s),r&&!n.equals(e.sel))return void $n(e,n,{clearRedo:!1});a=n}var u=[];Hn(a,s),s.push({changes:u,generation:o.generation}),o.generation=n.generation||++o.maxGeneration;for(var d=Ce(e,"beforeChange")||e.cm&&Ce(e.cm,"beforeChange"),p=function(r){var i=n.changes[r];if(i.origin=t,d&&!no(e,i,!1))return l.length=0,{};u.push(_n(e,i));var o=r?Tn(e,i):Q(l);co(e,i,o,Rn(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Cn(i)});var a=[];Nn(e,(function(e,t){t||-1!=W(a,e.history)||(fo(e.history,i),a.push(e.history)),co(e,i,null,Rn(e,i))}))},h=n.changes.length-1;0<=h;--h){var f=p(h);if(f)return f.v}}}}function so(e,t){if(0!=t&&(e.first+=t,e.sel=new yn($(e.sel.ranges,(function(e){return new kn(nt(e.anchor.line+t,e.anchor.ch),nt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){ci(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)ui(e.cm,i,"gutter")}}function co(e,t,r,i){if(e.cm&&!e.cm.curOp)return Yi(e.cm,co)(e,t,r,i);var n,o;t.to.line<e.first?so(e,t.text.length-1-(t.to.line-t.from.line)):t.from.line>e.lastLine()||(t.from.line<e.first&&(so(e,n=t.text.length-1-(e.first-t.from.line)),t={from:nt(e.first,0),to:nt(t.to.line+n,t.to.ch),text:[Q(t.text)],origin:t.origin}),o=e.lastLine(),t.to.line>o&&(t={from:t.from,to:nt(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ye(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=et(Bt(Xe(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)&&xe(e),Pn(i,t,r,oi(e)),e.options.lineWrapping||(i.iter(s,o.line+t.text.length,(function(e){var t=Qt(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=Xe(e,i).stateAfter;if(n&&(!(n instanceof ht)||i+n.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(i,o.line),en(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?ci(e):o.line!=a.line||1!=t.text.length||On(e.doc,t)?ci(e,o.line,a.line+1,c):ui(e,o.line,"text");var u,d=Ce(e,"changes"),p=Ce(e,"change");(p||d)&&(u={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin},p&&cr(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),Xn(e,r,B),e.cantEdit&&to(e,nt(e.firstLine(),0))&&(e.cantEdit=!1))}function uo(e,t,r,i,n){var o;ot(i=i||r,r)<0&&(r=(o=[i,r])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),oo(e,{from:r,to:i,text:t,origin:n})}function po(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function ho(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++)po(o.ranges[l].anchor,t,r,i),po(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=nt(c.from.line+i,c.from.ch),c.to=nt(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 fo(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;ho(e.done,r,i,n),ho(e.undone,r,i,n)}function go(e,t,r,i){var n=t,o=t;return"number"==typeof t?o=Xe(e,ut(e,t)):n=et(t),null==n?null:(i(o,n)&&e.cm&&ui(e.cm,n,r),o)}function mo(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 vo(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 bo(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t}function yo(e,t,r){Kt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Mi(e,r)}kn.prototype.from=function(){return ct(this.anchor,this.head)},kn.prototype.to=function(){return st(this.anchor,this.head)},kn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},mo.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,Gt(r),cr(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}},vo.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 mo))&&(r=[],this.collapse(r),this.children=[new mo(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 mo(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 vo(e.children.splice(e.children.length-5,5));e.parent?(e.size-=i.size,e.height-=i.height,t=W(e.parent.children,e),e.parent.children.splice(t+1,0,i)):(((r=new vo(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}}},bo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=et(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=wr(this);Je(r,Math.max(0,r.height-o)),e&&(Xi(e,(function(){yo(e,r,-o),ui(e,i,"widget")})),cr(e,"lineWidgetCleared",e,this,i))}},bo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var n=wr(this)-t;n&&(qt(this.doc,i)||Je(i,i.height+n),r&&Xi(r,(function(){r.curOp.forceUpdate=!0,yo(r,i,n),cr(r,"lineWidgetChanged",r,e,et(i))})))},Se(bo);var ko=0,wo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ko};function xo(e,t,r,i,n){if(i&&i.shared)return function(e,t,r,i,n){(i=F(i)).shared=!1;var o=[xo(e,t,r,i,n)],a=o[0],l=i.widgetNode;return Nn(e,(function(e){l&&(i.widgetNode=l.cloneNode(!0)),o.push(xo(e,dt(e,t),dt(e,r),i,n));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Q(o)})),new Co(o,a)}(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return Yi(e.cm,xo)(e,t,r,i,n);var o=new wo(e,n),a=ot(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=P("span",[o.replacedWith],"ESGMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Rt(e,t.line,t,r,o)||t.line!=r.line&&Rt(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Et=!0}o.addToHistory&&Fn(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&&Bt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Je(e,0),i=e,n=new Lt(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){qt(e,t)&&Je(t,0)})),o.clearOnEnter&&ve(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)ci(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++)ui(c,u,"text");o.atomic&&Zn(c.doc),cr(c,"markerAdded",c,o)}return o}wo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t,r=this.doc.cm,i=r&&!r.curOp;i&&Vi(r),!Ce(this,"clear")||(t=this.find())&&cr(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=Mt(l.markedSpans,e);r&&!e.collapsed?ui(r,et(l),"text"):r&&(null!=s.to&&(o=et(l)),null!=s.from&&(n=et(l))),l.markedSpans=Ot(l.markedSpans,s),null==s.from&&e.collapsed&&!qt(e.doc,l)&&r&&Je(l,ti(r.display))}if(r&&this.collapsed&&!r.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=Bt(e.lines[c]),d=Qt(u);d>r.display.maxLineLength&&(r.display.maxLine=u,r.display.maxLineLength=d,r.display.maxLineChanged=!0)}null!=n&&r&&this.collapsed&&ci(r,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,r&&Zn(r.doc)),r&&cr(r,"markerCleared",r,this,n,o),i&&qi(r),this.parent&&this.parent.clear()}},wo.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=Mt(o.markedSpans,this);if(null!=a.from&&(r=nt(t?o:et(o),a.from),-1==e))return r;if(null!=a.to&&(i=nt(t?o:et(o),a.to),1==e))return i}return r&&{from:r,to:i}},wo.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;t&&i&&Xi(i,(function(){var n,o,a=t.line,l=et(t.line),s=Nr(i,l);s&&(Hr(s),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,qt(r.doc,a)||null==r.height||(n=r.height,r.height=null,(o=wr(r)-n)&&Je(a,a.height+o)),cr(i,"markerChanged",i,e)}))},wo.prototype.attachLine=function(e){var t;!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)),this.lines.push(e)},wo.prototype.detachLine=function(e){var t;this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)},Se(wo);var Co=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function So(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),(function(e){return e.parent}))}function To(e){for(var t=function(t){var r=e[t],i=[r.primary.doc];Nn(r.primary.doc,(function(e){return i.push(e)}));for(var n=0;n<r.markers.length;n++){var o=r.markers[n];-1==W(i,o.doc)&&(o.parent=null,r.markers.splice(n--,1))}},r=0;r<e.length;r++)t(r)}Co.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cr(this,"clear")}},Co.prototype.find=function(e,t){return this.primary.find(e,t)},Se(Co);var Eo=0,Lo=function(e,t,r,i,n){if(!(this instanceof Lo))return new Lo(e,t,r,i,n);null==r&&(r=0),vo.call(this,[new mo([new Xt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=nt(r,0);this.sel=xn(o),this.history=new In(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}),$n(this,xn(o),B)};Lo.prototype=Y(vo.prototype,{constructor:Lo,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=Ze(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Ji((function(e){var t=nt(this.first,0),r=this.first+this.size-1;oo(this,{from:t,to:nt(r,Xe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pi(this.cm,0,0),$n(this,xn(t),B)})),replaceRange:function(e,t,r,i){uo(this,e,t=dt(this,t),r=r?dt(this,r):t,i)},getRange:function(e,t,r){var i=Ye(this,dt(this,e),dt(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(rt(this,e))return Xe(this,e)},getLineNumber:et,getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Xe(this,e)),Bt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return dt(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:Ji((function(e,t,r){Kn(this,dt(this,"number"==typeof e?nt(e,t||0):e),null,r)})),setSelection:Ji((function(e,t,r){Kn(this,dt(this,e),dt(this,t||e),r)})),extendSelection:Ji((function(e,t,r){Vn(this,dt(this,e),t&&dt(this,t),r)})),extendSelections:Ji((function(e,t){qn(this,pt(this,e),t)})),extendSelectionsBy:Ji((function(e,t){qn(this,pt(this,$(this.sel.ranges,e)),t)})),setSelections:Ji((function(e,t,r){if(e.length){for(var i=[],n=0;n<e.length;n++)i[n]=new kn(dt(this,e[n].anchor),dt(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),$n(this,wn(this.cm,i,t),r)}})),addSelection:Ji((function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new kn(dt(this,e),dt(this,t||e))),$n(this,wn(this.cm,i,i.length-1),r)})),getSelection:function(e){for(var t=this.sel.ranges,r=0;r<t.length;r++)var i=Ye(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=Ye(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:Ji((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=nt(e.first,0),o=0;o<t.length;o++){var a,l,s=t[o],c=En(s.from,d,n),u=En(Cn(s),d,n),d=s.to;n=u;"around"==r?(l=ot((a=e.sel.ranges[o]).head,a.anchor)<0,i[o]=new kn(l?u:c,l?c:u)):i[o]=new kn(c,c)}return new yn(i,e.sel.primIndex)}(this,i,t),s=i.length-1;0<=s;s--)oo(this,i[s]);l?Qn(this,l):this.cm&&Oi(this.cm)})),undo:Ji((function(){lo(this,"undo")})),redo:Ji((function(){lo(this,"redo")})),undoSelection:Ji((function(){lo(this,"undo",!0)})),redoSelection:Ji((function(){lo(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 In(this.history.maxGeneration),Nn(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:Bn(this.history.done),undone:Bn(this.history.undone)}},setHistory:function(e){var t=this.history=new In(this.history.maxGeneration);t.done=Bn(e.done.slice(0),null,!0),t.undone=Bn(e.undone.slice(0),null,!0)},setGutterMarker:Ji((function(e,t,r){return go(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return!(i[t]=r)&&te(i)&&(e.gutterMarkers=null),1}))})),clearGutter:Ji((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&go(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),1}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(!(e=Xe(this,t=e)))return null}else if(null==(t=et(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:Ji((function(e,t,r){return go(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:Ji((function(e,t,r){return go(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:Ji((function(e,t,r){return n=e,o=new bo(i=this,t,r),(a=i.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),go(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&&!qt(i,e)&&(t=Kt(e)<i.scrollTop,Je(e,e.height+wr(o)),t&&Mi(a,o.height),a.curOp.forceUpdate=!0),1})),a&&cr(a,"lineWidgetAdded",a,o,"number"==typeof n?n:et(n)),o;var i,n,o,a})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return xo(this,dt(this,e),dt(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 xo(this,e=dt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Xe(this,(e=dt(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=dt(this,e),t=dt(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})),dt(this,nt(r,t))},indexFromPos:function(e){var t=(e=dt(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 Lo(Ze(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 Lo(Ze(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);ot(a,l)&&(i=xo(e,a,l,n.primary,n.primary.type),n.markers.push(i),i.parent=n)}}(i,So(this)),i},unlinkDoc:function(e){var t;if(e instanceof ya&&(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(So(this));break}e.history==this.history&&(t=[e.id],Nn(e,(function(e){return t.push(e.id)}),!0),e.history=new In(null),e.history.done=Bn(this.history.done,t),e.history.undone=Bn(this.history.undone,t))},iterLinkedDocs:function(e){Nn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Fe(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ji((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Xi(t=this.cm,(function(){An(t),ci(t)})))}))}),Lo.prototype.eachLine=Lo.prototype.iter;var Mo=0;function Oo(e){var t=this;if(Po(t),!we(t,e)&&!xr(t.display,e)){Te(e),a&&(Mo=+new Date);var r=li(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&&Yi(t,(function(){var e={from:r=dt(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};oo(t.doc,e),Qn(t.doc,xn(dt(t.doc,r),dt(t.doc,Cn(e))))}))()},c=function(e,r){var i;t.options.allowDropFileTypes&&-1==W(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()),Xn(t.doc,xn(r,r)),d)for(var h=0;h<d.length;++h)uo(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 No(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 Go=!1;function Ao(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Io={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",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++)Io[_o+48]=Io[_o+96]=String(_o);for(var Do=65;Do<=90;Do++)Io[Do]=String.fromCharCode(Do);for(var Fo=1;Fo<=12;Fo++)Io[Fo+111]=Io[Fo+63235]="F"+Fo;var Ho={};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 Wo(e,t,r,i){var n=(t=Vo(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 Wo(e,t.fallthrough,r,i);for(var o=0;o<t.fallthrough.length;o++){var a=Wo(e,t.fallthrough[o],r,i);if(a)return a}}}function Ro(e){var t="string"==typeof e?e:Io[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Bo(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 jo(e,t){if(d&&34==e.keyCode&&e.char)return!1;var r=Io[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Bo(r,e,t))}function Vo(e){return"string"==typeof e?Ho[e]:e}function qo(e,t){for(var r=e.doc.sel.ranges,i=[],n=0;n<r.length;n++){for(var o=t(r[n]);i.length&&ot(o.from,Q(i).to)<=0;){var a=i.pop();if(ot(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Xi(e,(function(){for(var t=i.length-1;0<=t;t--)uo(e.doc,"",i[t].from,i[t].to,"+delete");Oi(e)}))}function Uo(e,t,r){var i=ne(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Ko(e,t,r){var i=Uo(e,t.ch,r);return null==i?null:new nt(t.line,i,r<0?"after":"before")}function Qo(e,t,r,i,n){if(e){"rtl"==t.doc.direction&&(n=-n);var o=ge(r,t.doc.direction);if(o){var a,l,s,c=n<0?Q(o):o[0],u=n<0==(1==c.level)?"after":"before";return 0<c.level||"rtl"==t.doc.direction?(a=Gr(t,r),l=n<0?r.text.length-1:0,s=Ar(t,a,l).top,l=oe((function(e){return Ar(t,a,e).top==s}),n<0==(1==c.level)?c.from:c.to-1,l),"before"==u&&(l=Uo(r,l,1))):l=n<0?c.to:c.from,new nt(i,l,u)}}return new nt(i,n<0?r.text.length:0,n<0?"before":"after")}Ho.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"},Ho.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"},Ho.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"},Ho.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"]},Ho.default=b?Ho.macDefault:Ho.pcDefault;var $o={selectAll:io,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),B)},killLine:function(e){return qo(e,(function(t){if(t.empty()){var r=Xe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:nt(t.head.line+1,0)}:{from:t.head,to:nt(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return qo(e,(function(t){return{from:nt(t.from().line,0),to:dt(e.doc,nt(t.to().line+1,0))}}))},delLineLeft:function(e){return qo(e,(function(e){return{from:nt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return qo(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 qo(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(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Xo(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return Yo(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Xe(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=et(i)),Qo(!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")}),V)},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")}),V)},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/)?Yo(e,t.head):i}),V)},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(K(i-a%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Xi(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=Xe(e.doc,t.line).text)&&(t.ch==r.length&&(t=new nt(t.line,t.ch-1)),0<t.ch?(t=new nt(t.line,t.ch+1),e.replaceRange(r.charAt(t.ch-1)+r.charAt(t.ch-2),nt(t.line,t.ch-2),t,"+transpose")):t.line>e.doc.first&&(i=Xe(e.doc,t.line-1).text)&&(t=new nt(t.line,1),e.replaceRange(r.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),nt(t.line-1,i.length-1),t,"+transpose"))),o.push(new kn(t,t)));e.setSelections(o)}))},newlineAndIndent:function(e){return Xi(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 Xo(e,t){var r=Xe(e.doc,t),i=Bt(r);return i!=r&&(t=et(i)),Qo(!0,e,i,t,1)}function Yo(e,t){var r=Xo(e,t.line),i=Xe(e.doc,r.line),n=ge(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 nt(r.line,a?0:o,r.sticky)}function Zo(e,t,r){if("string"==typeof t&&!(t=$o[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)!=R}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}var Jo=new z;function ea(e,t,r,i){var n=e.state.keySeq;if(n){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Jo.set(50,(function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())})),ta(e,n+" "+t,r,i))return!0}return ta(e,t,r,i)}function ta(e,t,r,i){var n=function(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var n=Wo(t,e.state.keyMaps[i],r,e);if(n)return n}return e.options.extraKeys&&Wo(t,e.options.extraKeys,r,e)||Wo(t,e.options.keyMap,r,e)}(e,t,i);return"multi"==n&&(e.state.keySeq=t),"handled"==n&&cr(e,"keyHandled",e,t,r),"handled"!=n&&"multi"!=n||(Te(r),yi(e)),!!n}function ra(e,t){var r=jo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ea(e,"Shift-"+r,t,(function(t){return Zo(e,t,!0)}))||ea(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Zo(e,t)})):ea(e,r,t,(function(t){return Zo(e,t)})))}var ia=null;function na(e){var t,i,n,o=this;function s(e){18!=e.keyCode&&e.altKey||(E(n,"ESGMirror-crosshair"),ye(document,"keyup",s),ye(document,"mouseover",s))}e.target&&e.target!=o.display.input.getField()||(o.curOp.focus=G(),we(o,e)||(a&&l<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,o.display.shift=16==t||e.shiftKey,i=ra(o,e),d&&(ia=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"),ve(document,"keyup",s),ve(document,"mouseover",s))))}function oa(e){16==e.keyCode&&(this.doc.sel.shift=!1),we(this,e)}function aa(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||xr(t.display,e)||we(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var r,i,n=e.keyCode,o=e.charCode;if(d&&n==ia)return ia=null,void Te(e);d&&(!e.which||e.which<10)&&ra(t,e)||"\b"!=(r=String.fromCharCode(null==o?n:o))&&(ea(i=t,"'"+r+"'",e,(function(e){return Zo(i,e,!0)}))||t.display.input.onKeyPress(e))}}var la,sa,ca=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ua(e){var t,r,i,n,o,c,u=this,d=u.display;we(u,e)||d.activeTouch&&d.input.supportsTouch()||(d.input.ensurePolled(),d.shift=e.shiftKey,xr(d,e)?s||(d.scroller.draggable=!1,setTimeout((function(){return d.scroller.draggable=!0}),100)):ha(u,e)||(t=li(u,e),r=Pe(e),i=t?(n=t,o=r,c=+new Date,sa&&sa.compare(c,n,o)?(la=sa=null,"triple"):la&&la.compare(c,n,o)?(sa=new ca(c,n,o),la=null,"double"):(la=new ca(c,n,o),sa=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),ea(e,Bo(o=(1==t?"Left":2==t?"Middle":"Right")+o,n),n,(function(t){if("string"==typeof t&&(t=$o[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,r)!=R}finally{e.state.suppressEdits=!1}return i}))}(u,r,t,i,e)||(1==r?t?function(e,t,r,i){a?setTimeout(D(ki,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&&Ae&&!e.isReadOnly()&&"single"==r&&-1<(n=c.contains(t))&&(ot((n=c.ranges[n]).from(),t)<0||0<t.xRel)&&(0<ot(n.to(),t)||t.xRel<0)?function(e,t,r,i){var n=e.display,o=!1,c=Yi(e,(function(t){s&&(n.scroller.draggable=!1),e.state.draggingText=!1,ye(n.wrapper.ownerDocument,"mouseup",c),ye(n.wrapper.ownerDocument,"mousemove",u),ye(n.scroller,"dragstart",d),ye(n.scroller,"drop",c),o||(Te(t),i.addNew||Vn(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(),ve(n.wrapper.ownerDocument,"mouseup",c),ve(n.wrapper.ownerDocument,"mousemove",u),ve(n.scroller,"dragstart",d),ve(n.scroller,"drop",c),wi(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 kn(r,r)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit?(i.addNew||(a=new kn(r,r)),r=li(e,t,!0,!0),l=-1):(s=da(e,r,i.unit),a=i.extend?jn(a,s.anchor,s.head,i.extend):s),i.addNew?-1==l?(l=u.length,$n(o,wn(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):1<u.length&&u[l].empty()&&"char"==i.unit&&!i.extend?($n(o,wn(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Un(o,l,a,j):($n(o,new yn([a],l=0),j),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()),ye(n.wrapper.ownerDocument,"mousemove",g),ye(n.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var g=Yi(e,(function(t){(0!==t.buttons&&Pe(t)?function t(s){var u,f,g=++h,m=li(e,s,!0,"rectangle"==i.unit);m&&(0!=ot(m,d)?(e.curOp.focus=G(),function(t){if(0!=ot(d,t))if(d=t,"rectangle"==i.unit){for(var n=[],s=e.options.tabSize,u=H(Xe(o,r.line).text,r.ch,s),p=H(Xe(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=Xe(o,g).text,b=q(v,h,s);h==f?n.push(new kn(nt(g,b),nt(g,b))):v.length>b&&n.push(new kn(nt(g,b),nt(g,q(v,f,s))))}n.length||n.push(new kn(r,r)),$n(o,wn(e,c.ranges.slice(0,l).concat(n),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,k=a,w=da(e,t,i.unit),x=k.anchor,C=(x=0<ot(w.anchor,x)?(y=w.head,ct(k.from(),w.anchor)):(y=w.anchor,st(k.to(),w.head)),c.ranges.slice(0));C[l]=function(e,t){var r=t.anchor,i=t.head,n=Xe(e.doc,r.line);if(0==ot(r,i)&&r.sticky==i.sticky)return t;var o=ge(n);if(!o)return t;var a=le(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=le(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 kn(new nt(r.line,f,g),i)}(e,new kn(dt(o,x),y)),$n(o,wn(e,C,l),j)}}(m),u=Ei(n,o),(m.line>=u.to||m.line<u.from)&&setTimeout(Yi(e,(function(){h==g&&t(s)})),150)):(f=s.clientY<p.top?-20:s.clientY>p.bottom?20:0)&&setTimeout(Yi(e,(function(){h==g&&(n.scroller.scrollTop+=f,t(s))})),50))}:f)(t)})),m=Yi(e,f);e.state.selectingText=m,ve(n.wrapper.ownerDocument,"mousemove",g),ve(n.wrapper.ownerDocument,"mouseup",m)})(e,i,t,o)}(u,t,i,e):Oe(e)==d.scroller&&Te(e):2==r?(t&&Vn(u.doc,t),setTimeout((function(){return d.input.focus()}),20)):3==r&&(C?u.display.input.onContextMenu(e):wi(u)))))}function da(e,t,r){if("char"==r)return new kn(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new kn(nt(t.line,0),dt(e.doc,nt(t.line+1,0)));var i=r(e,t);return new kn(i.from,i.to)}function pa(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||!Ce(e,r))return Le(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 ke(e,r,e,tt(e.doc,o),e.display.gutterSpecs[s].className,t),Le(t)}}function ha(e,t){return pa(e,t,"gutterClick",!0)}function fa(e,t){var r,i;xr(e.display,t)||(i=t,Ce(r=e,"gutterContextMenu")&&pa(r,i,"gutterContextMenu",!1))||we(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ga(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wr(e)}ca.prototype.compare=function(e,t,r){return this.time+400>e&&0==ot(t,this.pos)&&r==this.button};var ma={toString:function(){return"ESGMirror.Init"}},va={},ba={};function ya(e,t){var r=this;if(!(this instanceof ya))return new ya(e,t);this.options=t=t?F(t):{},F(va,t,!1);var i=t.value;"string"==typeof i?i=new Lo(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var n=new ya.inputStyles[t.inputStyle](this),o=this.display=new fn(e,i,n,t);for(var c in ga(o.wrapper.ESGMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" ESGMirror-wrap"),Bi(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 z,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;ve(t.scroller,"mousedown",Yi(e,ua)),ve(t.scroller,"dblclick",a&&l<11?Yi(e,(function(t){var r,i;we(e,t)||!(r=li(e,t))||ha(e,t)||xr(e.display,t)||(Te(t),i=e.findWordAt(r),Vn(e.doc,i.anchor,i.head))})):function(t){return we(e,t)||Te(t)}),ve(t.scroller,"contextmenu",(function(t){return fa(e,t)})),ve(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||fa(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}ve(t.scroller,"touchstart",(function(n){var o;we(e,n)||function(e){if(1==e.touches.length){var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}}(n)||ha(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))})),ve(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),ve(t.scroller,"touchend",(function(r){var i,a,l=t.activeTouch;l&&!xr(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 kn(i,i):!l.prev.prev||o(l,l.prev.prev)?e.findWordAt(i):new kn(nt(i.line,0),dt(e.doc,nt(i.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Te(r)),n()})),ve(t.scroller,"touchcancel",n),ve(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ai(e,t.scroller.scrollTop),_i(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))})),ve(t.scroller,"mousewheel",(function(t){return bn(e,t)})),ve(t.scroller,"DOMMouseScroll",(function(t){return bn(e,t)})),ve(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){we(e,t)||Me(t)},over:function(t){var r,i,n;we(e,t)||((n=li(r=e,t))&&(mi(r,n,i=document.createDocumentFragment()),r.display.dragCursor||(r.display.dragCursor=O("div",null,"ESGMirror-cursors ESGMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),M(r.display.dragCursor,i)),Me(t))},start:function(t){return r=e,i=t,void(a&&(!r.state.draggingText||new Date-Mo<100)?Me(i):we(r,i)||xr(r.display,i)||(i.dataTransfer.setData("Text",r.getSelection()),i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setDragImage&&!p&&((n=O("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:Yi(e,Oo),leave:function(t){we(e,t)||Po(e)}};var s=t.input.getField();ve(s,"keyup",(function(t){return oa.call(e,t)})),ve(s,"keydown",Yi(e,na)),ve(s,"keypress",Yi(e,aa)),ve(s,"focus",(function(t){return xi(e,t)})),ve(s,"blur",(function(t){return Ci(e,t)}))}(this),function(){var e;Go||(ve(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,No(Ao)}),100))})),ve(window,"blur",(function(){return No(Ci)})),Go=!0)}(),Vi(this),this.curOp.forceUpdate=!0,Gn(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout(D(xi,this),20):Ci(this),ba)ba.hasOwnProperty(c)&&ba[c](r,t[c],ma);un(this),t.finishInit&&t.finishInit(this);for(var u=0;u<ka.length;++u)ka[u](r);qi(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ya.defaults=va,ya.optionHandlers=ba;var ka=[];function wa(e,t,r,i){var n,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?n=vt(e,t).state:r="prev");var a=e.options.tabSize,l=Xe(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))==R||150<c)){if(!i)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?H(Xe(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+=K(c-p)),d!=u)return uo(o,d,nt(t,0),nt(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=nt(t,u.length);Un(o,f,new kn(m,m));break}}}ya.defineInitHook=function(e){return ka.push(e)};var xa,Ca,Sa,Ta,Ea,La=null;function Ma(e){La=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=Fe(t),c=null;if(l&&1<i.ranges.length)if(La&&La.text.join("\n")==t){if(i.ranges.length%La.text.length==0){c=[];for(var u=0;u<La.text.length;u++)c.push(o.splitLines(La.text[u]))}}else s.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=$(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=nt(f.line,f.ch-r):e.state.overwrite&&!l?g=nt(g.line,Math.min(Xe(o,g.line).text.length,g.ch+Q(s).length)):l&&La&&La.lineWise&&La.text.join("\n")==t&&(f=g=nt(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")};oo(e.doc,m),cr(e,"inputRead",e,m)}t&&!l&&Na(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||Xi(t,(function(){return Oa(t,r,0,null,"paste")})),1)}function Na(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=wa(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,n.head.line).text.slice(0,n.head.ch))&&(a=wa(e,n.head.line,"smart"));a&&cr(e,"electricInput",e,n.head.line)}}}function Ga(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:nt(n,0),head:nt(n+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Aa(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ia(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("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"),Aa(e),t}function _a(e,t,r,i,n){var o=t,a=r,l=Xe(e,t.line),s=n&&"rtl"==e.direction?-r:r;function c(i){var o,a=n?function(e,t,r,i){var n=ge(t,e.doc.direction);if(!n)return Ko(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=le(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 Ko(t,r,i);function l(e,r){return Uo(t,e instanceof nt?e.ch:e,r)}function s(r){return e.options.lineWrapping?(c=c||Gr(e,t),Zr(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 nt(r.line,p,h)}}function f(e,t,i){for(var o=function(e,t){return t?new nt(r.line,l(e,1),"before"):new nt(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):Ko(l,t,r);if(null==a){if(i||(o=t.line+s)<e.first||o>=e.first+e.size||(t=new nt(o,t.ch,t.sticky),!(l=Xe(e,o))))return;t=Qo(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=ee(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=to(e,t,o,a,!0);return at(o,m)&&(m.hitSide=!0),m}function Da(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*ti(e.display),3),a=(0<r?t.bottom:t.top)+r*o):"line"==i&&(a=0<r?t.bottom+3:t.top-3);(l=Xr(e,c,a)).outside;){if(r<0?a<=0:a>=s.height){l.hitSide=!0;break}a+=5*r}return l}function Fa(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Ha(e,t){var r=Nr(e,t.line);if(!r||r.hidden)return null;var i=Xe(e.doc,t.line),n=Or(r,i,t.line),o=ge(i,e.doc.direction),a="left";o&&(a=le(o,t.ch)%2?"right":"left");var l=Dr(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 Wa(e,t,r){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[r]))return za(e.clipPos(nt(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 Ra(o,t,r)}}function Ra(e,t,r){var i=e.text.firstChild,n=!1;if(!t||!N(i,t))return za(nt(et(e.line),0),!0);if(t==i&&(n=!0,t=i.childNodes[r],r=0,!t)){var o=e.rest?Q(e.rest):e.line;return za(nt(et(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=et(n<0?e.line:e.rest[n]),d=o[a]+i;return(i<0||l!=t)&&(d=o[a+(i?1:0)]),nt(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(nt(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(nt(d.line,d.ch+g),n);g+=f.textContent.length}}function Ba(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null}function ja(e,t,r,i){xa.defaults[e]=t,r&&(Ca[e]=i?function(e,t,i){i!=ma&&r(e,t,i)}:r)}Fa.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)&&!we(i,e)){if(i.somethingSelected())Ma({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Ga(i);Ma({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,B),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=La.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var l=Ia(),s=l.firstChild;i.display.lineSpace.insertBefore(l,i.display.lineSpace.firstChild),s.value=La.text.join("\n");var c=document.activeElement;_(s),setTimeout((function(){i.display.lineSpace.removeChild(l),c.focus(),c==n&&r.showPrimarySelection()}),50)}}Aa(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),ve(n,"paste",(function(e){!o(e)||we(i,e)||Pa(e,i)||l<=11&&setTimeout(Yi(i,(function(){return t.updateFromDOM()})),20)})),ve(n,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),ve(n,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),ve(n,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),ve(n,"touchstart",(function(){return r.forceCompositionEnd()})),ve(n,"input",(function(){t.composing||t.readFromDOMSoon()})),ve(n,"copy",a),ve(n,"cut",a)},Fa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Fa.prototype.prepareSelection=function(){var e=gi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Fa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fa.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=Wa(t,e.anchorNode,e.anchorOffset),l=Wa(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=ot(ct(a,l),n)||0!=ot(st(a,l),o)){var s,c,u=t.display.view,d=n.line>=t.display.viewFrom&&Ha(t,n)||{node:u[0].measure.map[2],offset:0},p=o.line<t.display.viewTo&&Ha(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=T(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()}}},Fa.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)},Fa.prototype.showMultipleSelections=function(e){M(this.cm.display.cursorDiv,e.cursors),M(this.cm.display.selectionDiv,e.selection)},Fa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},Fa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fa.prototype.blur=function(){this.div.blur()},Fa.prototype.getField=function(){return this.div},Fa.prototype.supportsTouch=function(){return!0},Fa.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Xi(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))}))},Fa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fa.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=Wa(i,r.anchorNode,r.anchorOffset),t=Wa(i,r.focusNode,r.focusOffset),e&&t&&Xi(i,(function(){$n(i.doc,xn(e,t),B),(e.bad||t.bad)&&(i.curOp.selectionChanged=!0)})))}},Fa.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=nt(a.line-1,Xe(i.doc,a.line-1).length)),l.ch==Xe(i.doc,l.line).text.length&&l.line<i.lastLine()&&(l=nt(l.line+1,0)),a.line<n.viewFrom||l.line>n.viewTo-1)return!1;r=a.line==n.viewFrom||0==(e=si(i,a.line))?(t=et(n.view[0].line),n.view[0].node):(t=et(n.view[e].line),n.view[e-1].node.nextSibling);var s,c=si(i,l.line),u=c==n.view.length-1?(s=n.viewTo-1,n.lineDiv.lastChild):(s=et(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(nt(i,0),nt(n+1,0),(m=+p,function(e){return e.id==m}));return void(h.length&&(o=h[0].find(0))&&u(Ye(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=Ye(i.doc,nt(t,0),nt(s,Xe(i.doc,s).text.length));1<d.length&&1<p.length;)if(Q(d)==Q(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=Q(d),y=Q(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=nt(t,h),x=nt(s,p.length?Q(p).length-f:0);return 1<d.length||d[0]||ot(w,x)?(uo(i.doc,d,w,x,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.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))},Fa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Xi(this.cm,(function(){return ci(e.cm)}))},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Yi(this.cm,Oa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0,Ba.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var n=this.textarea;function o(e){if(!we(i,e)){if(i.somethingSelected())Ma({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Ga(i);Ma({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,B):(r.prevInput="",n.value=t.text.join("\n"),_(n))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(n.style.width="0px"),ve(n,"input",(function(){a&&9<=l&&t.hasSelection&&(t.hasSelection=null),r.poll()})),ve(n,"paste",(function(e){we(i,e)||Pa(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())})),ve(n,"cut",o),ve(n,"copy",o),ve(e.scroller,"paste",(function(t){if(!xr(e,t)&&!we(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)}})),ve(e.lineSpace,"selectstart",(function(t){xr(e,t)||Te(t)})),ve(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"})}})),ve(n,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Ba.prototype.createField=function(e){this.wrapper=Ia(),this.textarea=this.wrapper.firstChild},Ba.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ba.prototype.prepareSelection=function(){var e,t,r,i=this.cm,n=i.display,o=i.doc,a=gi(i);return i.options.moveInputWithCursor&&(e=Kr(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},Ba.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")},Ba.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&&_(this.textarea),a&&9<=l&&(this.hasSelection=r)):e||(this.prevInput=this.textarea.value="",a&&9<=l&&(this.hasSelection=null)))},Ba.prototype.getField=function(){return this.textarea},Ba.prototype.supportsTouch=function(){return!1},Ba.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||G()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ba.prototype.blur=function(){this.textarea.blur()},Ba.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ba.prototype.receivedFocus=function(){this.slowPoll()},Ba.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ba.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))}))},Ba.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||He(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 Xi(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},Ba.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ba.prototype.onKeyPress=function(){a&&9<=l&&(this.hasSelection=null),this.fastPoll()},Ba.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=li(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?Yi(r,io)(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)&&Yi(r,$n)(r.doc,xn(f),B),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?(Me(e),h=function(){ye(window,"mouseup",h),setTimeout(v,20)},ve(window,"mouseup",h)):setTimeout(v,50))},Ba.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ba.prototype.setUneditable=function(){},Ba.prototype.needsContentAttribute=!1,Ca=(xa=ya).optionHandlers,xa.defineOption=ja,xa.Init=ma,ja("value","",(function(e,t){return e.setValue(t)}),!0),ja("mode",null,(function(e,t){e.doc.modeOption=t,Ln(e)}),!0),ja("indentUnit",2,Ln,!0),ja("indentWithTabs",!1),ja("smartIndent",!0),ja("tabSize",4,(function(e){Mn(e),Wr(e),ci(e)}),!0),ja("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(nt(i,o))}i++}));for(var n=r.length-1;0<=n;n--)uo(e.doc,t,r[n],nt(r[n].line,r[n].ch+t.length))}})),ja("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!=ma&&e.refresh()})),ja("specialCharPlaceholder",(function(e){var t=O("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),ja("electricChars",!0),ja("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),ja("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),ja("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),ja("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),ja("rtlMoveVisually",!k),ja("wholeLineUpdateBefore",!0),ja("theme","default",(function(e){ga(e),hn(e)}),!0),ja("keyMap","default",(function(e,t,r){var i=Vo(t),n=r!=ma&&Vo(r);n&&n.detach&&n.detach(e,i),i.attach&&i.attach(e,n||null)})),ja("extraKeys",null),ja("configureMouse",null),ja("lineWrapping",!1,(function(e){e.options.lineWrapping?(A(e.display.wrapper,"ESGMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"ESGMirror-wrap"),$t(e)),ai(e),ci(e),Wr(e),setTimeout((function(){return zi(e)}),100)}),!0),ja("gutters",[],(function(e,t){e.display.gutterSpecs=dn(t,e.options.lineNumbers),hn(e)}),!0),ja("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ni(e.display)+"px":"0",e.refresh()}),!0),ja("coverGutterNextToScrollbar",!1,(function(e){return zi(e)}),!0),ja("scrollbarStyle","native",(function(e){Bi(e),zi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),ja("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=dn(e.options.gutters,t),hn(e)}),!0),ja("firstLineNumber",1,hn,!0),ja("lineNumberFormatter",(function(e){return e}),hn,!0),ja("showCursorWhenSelecting",!1,fi,!0),ja("resetSelectionOnContextMenu",!0),ja("lineWiseCopyCut",!0),ja("pasteLinesPerSelection",!0),ja("selectionsMayTouch",!1),ja("readOnly",!1,(function(e,t){"nocursor"==t&&(Ci(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),ja("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),ja("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),ja("dragDrop",!0,(function(e,t,r){var i,n;!t!=!(r&&r!=ma)&&(i=e.display.dragFunctions,(n=t?ve:ye)(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))})),ja("allowDropFileTypes",null),ja("cursorBlinkRate",530),ja("cursorScrollMargin",0),ja("cursorHeight",1,fi,!0),ja("singleCursorHeightPerLine",!0,fi,!0),ja("workTime",100),ja("workDelay",100),ja("flattenSpans",!0,Mn,!0),ja("addModeClass",!1,Mn,!0),ja("pollInterval",100),ja("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),ja("historyEventDelay",1250),ja("viewportMargin",10,(function(e){return e.refresh()}),!0),ja("maxHighlightLength",1e4,Mn,!0),ja("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),ja("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),ja("autofocus",null),ja("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),ja("phrases",null),Ta=(Sa=ya).optionHandlers,Ea=Sa.helpers={},Sa.prototype={constructor:Sa,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)&&Yi(this,Ta[e])(this,t,i),ke(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"](Vo(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:Zi((function(e,t){var r=e.token?e:Sa.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++,ci(this)})),removeOverlay:Zi((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 ci(this)}})),indentLine:Zi((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&wa(this,e,t,r)})),indentSelection:Zi((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&&(wa(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)wa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&0<u[n].from().ch&&Un(t.doc,n,new kn(a,u[n].to()),B)}}})),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,nt(e),t,!0)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t,r=mt(this,Xe(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?Sa.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==W(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return vt(this,(e=ut(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Kr(this,null==e?r.head:"object"==typeof e?dt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Ur(this,dt(this.doc,e),t||"page")},coordsChar:function(e,t){return Xr(this,(e=qr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=qr(this,{top:e,left:0},t||"page").top,tt(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),Xe(this.doc,e)):e;return Vr(this,o,{top:0,left:0},t||"page",r||n).top+(n?this.doc.height-Kt(o):0)},defaultTextHeight:function(){return ti(this.display)},defaultCharWidth:function(){return ri(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=Kr(this,dt(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=Li(l=this,{left:d,top:u,right:d+t.offsetWidth,bottom:u+t.offsetHeight})).scrollTop&&Ai(l,s.scrollTop),null!=s.scrollLeft&&_i(l,s.scrollLeft))},triggerOnKeyDown:Zi(na),triggerOnKeyPress:Zi(aa),triggerOnKeyUp:oa,triggerOnMouseDown:Zi(ua),execCommand:function(e){if($o.hasOwnProperty(e))return $o[e].call(null,this)},triggerElectric:Zi((function(e){Na(this,e)})),findPosH:function(e,t,r,i){var n=1;t<0&&(n=-1,t=-t);for(var o=dt(this.doc,e),a=0;a<t&&!(o=_a(this.doc,o,n,r,i)).hitSide;++a);return o},moveH:Zi((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()}),V)})),deleteH:Zi((function(e,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):qo(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=dt(this.doc,e),l=0;l<t;++l){var s=Kr(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Da(this,s,n,r)).hitSide)break}return a},moveV:Zi((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=Kr(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),n.push(l.left);var s=Da(r,l,e,t);return"page"==t&&a==i.sel.primary()&&Mi(r,Ur(r,s,"div").top-l.top),s}),V),n.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=n[a]})),findWordAt:function(e){var t=Xe(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=ee(o,n)?function(e){return ee(e,n)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};0<r&&a(t.charAt(r-1));)--r;for(;i<t.length&&a(t.charAt(i));)++i}return new kn(nt(e.line,r),nt(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?A:E)(this.display.cursorDiv,"ESGMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==G()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Zi((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:Mr(this),clientWidth:Lr(this)}},scrollIntoView:Zi((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:nt(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,Ni(this),this.curOp.scrollToPos=r):Gi(this,e.from,e.to,e.margin)})),setSize:Zi((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){ui(i,n,"widget");break}++n})),this.curOp.forceUpdate=!0,ke(this,"refresh",this)})),operation:function(e){return Xi(this,e)},startOperation:function(){return Vi(this)},endOperation:function(){return qi(this)},refresh:Zi((function(){var e=this.display.cachedTextHeight;ci(this),this.curOp.forceUpdate=!0,Wr(this),Pi(this,this.doc.scrollLeft,this.doc.scrollTop),ln(this.display),(null==e||.5<Math.abs(e-ti(this.display))||this.options.lineWrapping)&&ai(this),ke(this,"refresh",this)})),swapDoc:Zi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Gn(this,e),Wr(this),this.display.input.reset(),Pi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,cr(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}},Se(Sa),Sa.registerHelper=function(e,t,r){Ea.hasOwnProperty(e)||(Ea[e]=Sa[e]={_global:[]}),Ea[e][t]=r},Sa.registerGlobalHelper=function(e,t,r,i){Sa.registerHelper(e,t,i),Ea[e]._global.push({pred:r,val:i})};var Va,qa="iter insert remove copy getEditor constructor".split(" ");for(var Ua in Lo.prototype)Lo.prototype.hasOwnProperty(Ua)&&W(qa,Ua)<0&&(ya.prototype[Ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(Lo.prototype[Ua]));return Se(Lo),ya.inputStyles={textarea:Ba,contenteditable:Fa},ya.defineMode=function(e){ya.defaults.mode||"null"==e||(ya.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}.apply(this,arguments)},ya.defineMIME=function(e,t){Be[e]=t},ya.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),ya.defineMIME("text/plain","null"),ya.defineExtension=function(e,t){ya.prototype[e]=t},ya.defineDocExtension=function(e,t){Lo.prototype[e]=t},ya.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&&(ve(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&&(ye(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var l=ya((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},(Va=ya).off=ye,Va.on=ve,Va.wheelEventPixels=function(e){var t=vn(e);return t.x*=mn,t.y*=mn,t},Va.Doc=Lo,Va.splitLines=Fe,Va.countColumn=H,Va.findColumn=q,Va.isWordChar=J,Va.Pass=R,Va.signal=ke,Va.Line=Xt,Va.changeEnd=Cn,Va.scrollbarModel=Ri,Va.Pos=nt,Va.cmpPos=ot,Va.modes=Re,Va.mimeModes=Be,Va.resolveMode=je,Va.getMode=Ve,Va.modeExtensions=qe,Va.extendMode=function(e,t){F(t,qe.hasOwnProperty(e)?qe[e]:qe[e]={})},Va.copyState=Ue,Va.startState=Qe,Va.innerMode=Ke,Va.commands=$o,Va.keyMap=Ho,Va.keyName=jo,Va.isModifierKey=Ro,Va.lookupKey=Wo,Va.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=$(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},Va.StringStream=$e,Va.SharedTextMarker=Co,Va.TextMarker=wo,Va.LineWidget=bo,Va.e_preventDefault=Te,Va.e_stopPropagation=Ee,Va.e_stop=Me,Va.addClass=A,Va.contains=N,Va.rmClass=E,Va.keyNames=Io,ya.version="5.54.0",ya})),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())}function v(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="([{}])".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 b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function y(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 k={state:null,column:null,marked:null,cc:null};function w(){for(var e=arguments.length-1;0<=e;e--)k.cc.push(arguments[e])}function x(){return w.apply(null,arguments),!0}function C(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return 1}var i=k.state;if(i.context){if(k.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 S={name:"this",next:{name:"arguments"}};function T(){k.state.context={prev:k.state.context,vars:k.state.localVars},k.state.localVars=S}function E(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function L(e,t){function r(){var r=k.state,i=r.indented;"stat"==r.lexical.type&&(i=r.lexical.indented),r.lexical=new y(i,k.stream.column(),e,null,r.lexical,t)}return r.lex=!0,r}function M(){var e=k.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?x():";"==e?w():x(t)}}function P(e,t){return"var"==e?x(L("vardef",t.length),Z,O(";"),M):"keyword a"==e?x(L("form"),N,P,M):"keyword b"==e?x(L("form"),P,M):"{"==e?x(L("}"),$,M):";"==e?x():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==M&&k.state.cc.pop()(),x(L("form"),N,P,M,ie)):"function"==e?x(ce):"for"==e?x(L("form"),ne,P,M):"variable"==e?x(L("stat"),B):"switch"==e?x(L("form"),N,L("}","switch"),O("{"),$,M,M):"case"==e?x(N,O(":")):"default"==e?x(O(":")):"catch"==e?x(L("form"),T,O("("),ue,O(")"),P,M,E):"module"==e?x(L("form"),T,fe,E,M):"class"==e?x(L("form"),de,he,M):"export"==e?x(L("form"),ge,M):"import"==e?x(L("form"),me,M):w(L("stat"),N,O(";"),M)}function N(e){return A(e,!1)}function G(e){return A(e,!0)}function A(e,t){if(k.state.fatArrowAt==k.stream.start){var r=t?R:W;if("("==e)return x(T,L(")"),K(J,")"),M,O("=>"),r,E);if("variable"==e)return w(T,J,O("=>"),r,E)}var i=t?F:D;return b.hasOwnProperty(e)?x(i):"function"==e?x(ce,i):"keyword c"==e?x(t?_:I):"("==e?x(L(")"),I,we,O(")"),M,i):"operator"==e||"spread"==e?x(t?G:N):"["==e?x(L("]"),ye,M,i):"{"==e?Q(V,"}",null,i):"quasi"==e?w(H,i):x()}function I(e){return e.match(/[;\}\)\],]/)?w():w(N)}function _(e){return e.match(/[;\}\)\],]/)?w():w(G)}function D(e,t){return","==e?x(N):F(e,t,!1)}function F(e,t,r){var i=0==r?D:F,n=0==r?N:G;return"=>"==t?x(T,r?R:W,E):"operator"==e?/\+\+|--/.test(t)?x(i):"?"==t?x(N,O(":"),n):x(n):"quasi"==e?w(H,i):";"!=e?"("==e?Q(G,")","call",i):"."==e?x(j,i):"["==e?x(L("]"),I,O("]"),M,i):void 0:void 0}function H(e,t){return"quasi"!=e?w():"${"!=t.slice(t.length-2)?x(H):x(N,z)}function z(e){if("}"==e)return k.marked="string-2",k.state.tokenize=m,x(H)}function W(e){return v(k.stream,k.state),w("{"==e?P:N)}function R(e){return v(k.stream,k.state),w("{"==e?P:G)}function B(e){return":"==e?x(M,P):w(D,O(";"),M)}function j(e){if("variable"==e)return k.marked="property",x()}function V(e,t){if("variable"==e){if(k.marked="property","get"==t||"set"==t)return x(q)}else if("number"==e||"string"==e)k.marked=l?"property":e+" property";else if("["==e)return x(N,O("]"),U);if(b.hasOwnProperty(e))return x(U)}function q(e){return"variable"!=e?w(U):(k.marked="property",x(ce))}function U(e){return":"==e?x(G):"("==e?w(ce):void 0}function K(e,t){function r(i){if(","!=i)return i==t?x():x(O(t));var n=k.state.lexical;return"call"==n.info&&(n.pos=(n.pos||0)+1),x(e,r)}return function(i){return i==t?x():w(e,r)}}function Q(e,t,r){for(var i=3;i<arguments.length;i++)k.cc.push(arguments[i]);return x(L(t,r),K(e,t),M)}function $(e){return"}"==e?x():w(P,$)}function X(e){if(c&&":"==e)return x(Y)}function Y(e){if("variable"==e)return k.marked="variable-3",x()}function Z(){return w(J,X,te,re)}function J(e,t){return"variable"==e?(C(t),x()):"["==e?Q(J,"]"):"{"==e?Q(ee,"}"):void 0}function ee(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),x(O(":"),J,te)):(C(t),x(te))}function te(e,t){if("="==t)return x(G)}function re(e){if(","==e)return x(Z)}function ie(e,t){if("keyword b"==e&&"else"==t)return x(L("form","else"),P,M)}function ne(e){if("("==e)return x(L(")"),oe,O(")"),M)}function oe(e){return"var"==e?x(Z,O(";"),le):";"==e?x(le):"variable"==e?x(ae):w(N,O(";"),le)}function ae(e,t){return"in"==t||"of"==t?(k.marked="keyword",x(N)):x(D,le)}function le(e,t){return";"==e?x(se):"in"==t||"of"==t?(k.marked="keyword",x(N)):w(N,O(";"),se)}function se(e){")"!=e&&x(N)}function ce(e,t){return"*"==t?(k.marked="keyword",x(ce)):"variable"==e?(C(t),x(ce)):"("==e?x(T,L(")"),K(ue,")"),M,P,E):void 0}function ue(e){return"spread"==e?x(ue):w(J,X)}function de(e,t){if("variable"==e)return C(t),x(pe)}function pe(e,t){if("extends"==t)return x(N)}function he(e){if("{"==e)return Q(V,"}")}function fe(e,t){return"string"==e?x(P):"variable"==e?(C(t),x(be)):void 0}function ge(e,t){return"*"==t?(k.marked="keyword",x(be,O(";"))):"default"==t?(k.marked="keyword",x(N,O(";"))):w(P)}function me(e){return"string"==e?x():w(ve,be)}function ve(e,t){return"{"==e?Q(ve,"}"):("variable"==e&&C(t),x())}function be(e,t){if("from"==t)return k.marked="keyword",x(N)}function ye(e){return"]"==e?x():w(G,ke)}function ke(e){return"for"==e?w(we,O("]")):(","==e?x:w)(K(G,"]"))}function we(e){return"for"==e?x(ne,we):"if"==e?x(N,we):void 0}return M.lex=!0,{startState:function(e){var t={tokenize:f,lastType:"sof",cc:[],lexical:new y((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(),v(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(k.state=e,k.stream=n,k.marked=null,k.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?N:P)(r,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.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==M)l=l.prev;else if(c!=ie)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(){"use strict";window.ESG??={},ESG.F??={},ESG.E??={},ESG.V??={},ESG.S??={},ESG.SC??={},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??=jQuery(window),ESG.DOC??=jQuery(document),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,T,E,L,M,O,P,N,G,A,I,_,D,F,H,z,W,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,Te,Ee,Le,Me,Oe,Pe,Ne,Ge,Ae,Ie,_e,De,Fe,He,ze,We,Re,Be,je,Ve,qe={},Ue=150,Ke="full",Qe={axis:"x",containment:"#esgbuilder-cpicker-point-wrap"},$e={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"},Xe=["#FFFFFF","#000000","#FF3A2D","#007AFF","#4CD964","#FFCC00","#C7C7CC","#8E8E93","#FFD3E0","#34AADC","#E0F8D8","#5AC8FA","#5856D6","#FF69B4","#800000","#009933"],Ye=[{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&}]}"}],Ze='<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 Je(){this.innerHTML=ge[rt(this,"data-text")]}function et(){this.setAttribute("placeholder",ge[rt(this,"data-placeholder")])}function tt(){this.setAttribute("data-message",ge[rt(this,"data-alert")])}function rt(e,t){return e.getAttribute(t)||""}function it(t){t||(t={}),"string"==typeof t&&(t=JSON.parse(t.replace(/\&/g,'"'))),ge=e.extend({},$e,t),q=ge.color,b.find("*[data-placeholder]").each(et),b.find("*[data-alert]").each(tt),b.find("*[data-text]").each(Je)}function nt(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 ot(){var t=rt(this,"data-color").toLowerCase(),r=!Ie&&t===Pe.toLowerCase();if(t===be||r){var i=e(this);return i.closest(".esgbuilder-cpicker-presets-group").find(".esgbuilder-cpicker-color.selected").removeClass("selected"),ze=i,Ie&&!$&&st(ze.data("gradient"),!0),i.addClass("selected"),!1}}function at(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/4),3),l=0;l<a;l++)for(;t.length<4*(l+1);)t[t.length]="blank";for(o=t.length,l=0;l<o;l++)r.appendChild(nt(t[l],i,n));return["esgbuilder-cpicker-"+e,r]}function lt(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):L.data("state",t),o?(Ge.css("background",a),Te.css("background",a)):(Ge[0].style.background=a,Te.css("background",a)),c&&c(Ee,t,ye,we),ESG.DOC.trigger("revcolorpickerupdate",[Ee,t])}}function st(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%"),Nt(100);break;case"rgba":var c=ESGColor.rgbaToHex(s),u=parseInt(100*c[1],10);r=c[0],Me.val(u+"%"),Nt(u);break;case"rgb":r=ESGColor.rgbToHex(s),Me.val("100%"),Nt(100);break;default:ne.trigger("click"),L.trigger("click")}V.val(r).trigger("change"),i||L.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"),_t(n),l.val(n).ddTP("change"),E.val(o+"%"),t.val(gt(i)),_t(),Et(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(ft(t,r.position,pt(r),dt(r,t)));de&&de.draggable("destroy");pe.empty().append(i),de=pe.children().draggable(Qe)}(r.colors)}(o[2]),yt(),i||(ce=!0,w.trigger("click"))):(V.val(ESGColor.defaultValue).trigger("change"),L.trigger("click"));return[s,a]}function ct(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=dt(n,t,!0),l=ft(t,r,pt(n,!0),a);N&&N.removeClass("active"),N=e(l).addClass("active").appendTo(pe).draggable(Qe),B=N.children(".esgbuilder-cpicker-point-square")[0],j=N.children(".esgbuilder-cpicker-point-triangle")[0],de=pe.children();var s=ut(r);yt(l),"bottom"===t&&P.val(s[1]).trigger("change")}function ut(e){void 0===e&&(e=o[ae].x);var t=N.attr("data-color"),r=N.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 O.val(e+"%").parent().removeClass("disabled"),[r,t]}function dt(e,t,r){return"bottom"===t?"rgb("+e.r+","+e.g+","+e.b+")":"rgba(0, 0, 0, "+(r?"1":e.a)+")"}function pt(e,t){var r=t?"1":e.a;return"rgba("+e.r+","+e.g+","+e.b+","+r+")"}function ht(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 ft(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 gt(e){return R||(R=document.createElement("textarea")),e&&"radial"!==e||(e="0"),R.innerHTML=e+"°",R.value}function mt(){N&&(N.removeClass("active"),N=!1),O.parent().addClass("disabled"),ue.parent().addClass("disabled"),he.removeClass("active"),he.removeClass("active"),Ve.css("background",""),b.removeClass("open")}function vt(e,t){b.removeClass("active is-basic").hide(),i.removeClass("esgbuilder-colorpicker-open"),He.css({left:"",top:""}),G&&(G.remove(),G=!1),ze?(ze.hasClass("selected")?(t&&Ee.data("hex",ze.attr("data-color").toLowerCase()),ze.removeClass("selected")):Ee.removeData("hex"),ze=!1):Ee.removeData("hex"),t||(I&&I(Ee,se,le,ye,we),Oe&&"transparent"!==Oe?(Ge[0].style.background=Oe,Te.css("background",Oe)):(Ge.css("background",""),Te.css("background","")),ESG.DOC.trigger("revcolorpickercancel",[Ee,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,W=null,X=null,Y=null,J=null,U=null,R=null,ie=null,re=null,pe=null,Te=null,Me=null,Ge=null,Ee=null}function bt(t){var r=e.extend(!0,{},qe);return ESGColor.processGradient(r,!0,t)}function yt(r,i,n,s){K=i,St(),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(E.val(),10),ze&&!_e&&ze.removeClass("selected"),s||(p=e.extend(!0,{},qe),lt(!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=bt(!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=bt()),ie.style.background=p,qe.type="linear",qe.angle="90",X.style.background=bt(),qe.angle="180",Y.style.background=bt(),qe.type="radial",qe.angle="0",J.style.background=bt())}function kt(e,t){if(0===e)return!1;for(var r;e--;)if((r=o[e]).align!==t)return r;return!1}function wt(e,t,r){if(e===r)return!1;for(var i;e++<r;)if((i=o[e]).align!==t)return i;return!1}function xt(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 Ct(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 St(){o=[],H=[],z=[],de.each(Tt),o.sort(ESGColor.sortPoints);for(var e,t,r,i,n=o.length,a=n-1,l=0;l<n;l++)!1===(t=kt(l,r=(e=o[l]).align))&&(t=wt(l,r,a)),!1===(i=wt(l,r,a))&&(i=kt(l,r)),"bottom"===r?xt(e,t,i):Ct(e,t,i);o.sort(ESGColor.sortPoints)}function Tt(e){var t=ESGColor.rgbValues(rt(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)/234).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}},N&&N[0]!==this&&("bottom"===r?z[z.length]=n:H[H.length]=n)}function Et(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 Lt(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(gt(s)),o=!0),s!==c&&(a=s,o=!0,t.val(gt(s)),l||(s=i||s,oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+s+'"]').addClass("selected")))}(o||i)&&(a&&Et(a),yt())}function Mt(e,t){var r=parseInt(100*(Math.round(t.position.left)/234).toFixed(2),10);O.val(r+"%").trigger("keyup")}function Ot(){var t=e(this);t.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t.trigger("click")}function Pt(){O.trigger("focusout")}function Nt(e){Re=!0,We.slider("value",Math.round(.01*e*Ue)),Re=!1}function Gt(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-25,r-25)*(180/Math.PI)+90;n<0&&(n+=360),n=Math.max(0,Math.min(360,Math.round(n))),n=5*Math.round(n/5),Lt(!1,!1,n)}}function At(e){e.stopImmediatePropagation()}function It(t){t||(t=Le),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="10px")}))})).ESGScroll("update")}function _t(t){Z||(Z=e("#revpicker-easing-row")),t||(t=l.val()),Z["none"===t?"removeClass":"addClass"]("active")}function Dt(){y||function(){i||(i=e("body"),b=e('<div class="esgbuilder-cpicker-wrap _TPRB_ color-view palette-open">'+Ze+"</div>").appendTo(i));Ce.core&&(Ce.core.colors&&(Xe=Ce.core.colors),Ce.core.gradients&&(Ye=Ce.core.gradients));Ht(Ce),it(Ce.language||$e),y=!0}(),Ve=e("#esgbuilder-cpicker-preview-gradient"),he=e("#esgbuilder-cpicker-color-delete"),ue=e("#esgbuilder-cpicker-grad-opacity"),O=e("#esgbuilder-cpicker-color-location"),oe=e(".esgbuilder-cpicker-orientation"),P=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"),We=e("#esgbuilder-cpicker-scroll"),L=e("#esgbuilder-cpicker-color-btn"),E=e("#esgbuilder-cpicker-strength"),t=e("#esgbuilder-cpicker-meta-angle"),te=e("#esgbuilder-cpicker-wheel"),He=e("#esgbuilder-cpicker"),l=e("#esgbuilder-cpicker-easing"),Qe.drag=Mt,Qe.stop=Pt,Qe.start=Ot,L.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")}}),Le=e(".esgbuilder-cpicker-presets-group").ESGScroll({wheelPropagation:!1,suppressScrollX:!0}),te.on("mousedown.esgcpicker",(function(e){oe.removeClass("selected"),Q=!0,Gt(e)})).on("mousemove.esgcpicker",(function(e){Q&&Gt(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),Te.css("background",r),Ie=!0,e(".esgbuilder-cpicker-color").not(".blank").each(ot),Ie=!1,ESG.DOC.trigger("revcolorpickerupdate",[Ee,t])}$||(_e=!0,e(".esgbuilder-cpicker-point-bottom").first().trigger("click"),_e=!1)})),e("#esgbuilder-cpicker-palette").on("click",(function(){b.hasClass("palette-open")?b.removeClass("palette-open"):(b.addClass("palette-open"),It())})),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=[Ee,i,!1],r=i}else{mt(),yt(!1,!1,!0,!0);var l=JSON.stringify(qe).replace(/\"/g,"&");r=ESGColor.processGradient(e.extend(!0,{},qe),!0),t=[Ee,r,l]}!0!==(n=t[1]!==Oe)&&!0!==fe||(Ee.attr("data-color",t[1]),ESG.DOC.trigger("revcolorpickerchanged",t),je&&je(t[0],t[1],t[2],ye,we)),vt(0,!0===n||!0===fe)})),b.on("click.esgcpicker",(function(t){e(t.target).closest("#esgbuilder-cpicker").length||mt()})),e(".esgbuilder-cpicker-close").on("click.esgcpicker",vt),V.wpColorPicker({palettes:!1,width:190,border:!1,hide:!1,change:function(e,t){var r=t.color.toString();if(this.value=r,ht(r),!Ae){var i=Me.val();0===parseInt(i,10)&&(r="transparent"),lt(!1,r,i),ze&&(ze.removeClass("selected"),ze=!1)}}}),P.wpColorPicker({palettes:!1,height:190,border:!1,hide:!1,change:function(e,t){var r=t.color.toString();this.value=r,ht(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]),N&&N.attr("data-color",i),yt()}}),We.slider({orientation:"vertical",max:Ue,value:Ue,start:function(){Fe="transparent"===M.val()},slide:function(e,t){if(!Re){var r,i=parseInt(100*(t.value/Ue).toFixed(2),10);Fe&&(r=i?"#ffffff":"transparent",M.val(r)),0===i&&(r="transparent"),lt(!1,r,i||"transparent"),Me.val(i+"%")}}}),e("body").on("click.esgcpicker",".esgbuilder-cpicker-point",(function(){pe.find(".esgbuilder-cpicker-point.active").removeClass("active"),N=e(this).addClass("active"),B=N.children(".esgbuilder-cpicker-point-square")[0],j=N.children(".esgbuilder-cpicker-point-triangle")[0],yt(this);var t=ut();t[0]&&P.val(t[1]).trigger("change")})).on("mousedown.esgcpicker",".esgbuilder-cpicker-point",(function(t){N=e(this).data("mousestart",t.pageY)})).on("mousemove.esgcpicker",(function(e){if(N&&N.data("mousestart")){var t=N.data("mousestart"),r=e.pageY;N.hasClass("esgbuilder-cpicker-point-bottom")?r>t&&r-t>15&&he.hasClass("active")?N.addClass("warning"):N.removeClass("warning"):t>r&&t-r>15&&he.hasClass("active")?N.addClass("warning"):N.removeClass("warning")}})).on("mouseup.esgcpicker",(function(e){if(N&&N.data("mousestart")){var t=N.data("mousestart"),r=e.pageY;N.removeData("mousestart"),N.hasClass("esgbuilder-cpicker-point-bottom")?r>t&&r-t>10&&he.hasClass("active")?he.trigger("click"):N.removeClass("warning"):t>r&&t-r>10&&he.hasClass("active")?he.trigger("click"):N.removeClass("warning")}})).on("keypress.esgcpicker",(function(e){if(b.hasClass("active")){var t=e.which;27==t?vt():13==t&&C&&C.blur()}})).on("click.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",(function(){if(ze){if(ze[0]===this&&ze.hasClass("selected"))return;ze.removeClass("selected")}if(ze=e(this),b.hasClass("color-view")){var t,r=ze.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"),lt(!1,r,n),ze.addClass("selected")}else s.removeClass("full"),W.removeClass("full"),st(ze.data("gradient"),!0),k.removeClass("checked"),A.find(".esgbuilder-cpicker-color.selected").removeClass("selected"),e(".esgbuilder-cpicker-point-bottom").first().trigger("click"),ze.addClass("selected")})).on("mouseover.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",(function(){De})).on("mouseout.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",(function(){De})).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),It(o),b.removeClass("onajax onajaxdelete")})),i=e.trim(i.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),d("delete",i,n,"esgcpicker_onajax_delete",Ee)}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(rt(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,yt(!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(nt(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=4*Math.max(Math.ceil(d/4),3);d++<p;)e('<span class="esgbuilder-cpicker-color blank"></span>').insertBefore(c)}e("#esgbuilder-cpicker-preset-"+t).val("custom").trigger("change"),It(s),o.trigger("click"),e(".esgbuilder-cpicker-preset-save").val(""),b.removeClass("onajax onajaxsave")})),d("save",l,t,"esgcpicker_onajax_save",Ee)}}else alert(i.attr("data-message"))}else console.log("Ajax callback not defined")})),ne.on("click.esgcpicker",(function(){Nt(0),V.val(ESGColor.defaultValue).trigger("change"),M.val("transparent"),lt(!1,"transparent"),clearTimeout(Se),Se=setTimeout(Ft,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))ht(r);else{if(!(t=e(this).data("orig-value")))return void ne.trigger("click");if("transparent"===(r=t))return void ne.trigger("click");ht(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),P.val(r).trigger("change")})).on("focusin.esgcpicker",At),O.on("keyup.esgcpicker focusout.esgcpicker",(function(e){if(N){var t,r="bottom"===(N.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top")?z:H,i=O.val().replace("%","")||"0",n=e.type;for(isNaN(i)&&(i="keyup"===n?"0":N.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&&(O.val(i+"%"),N.attr("data-location",i)),N.css("left",i+"%"),yt()}})).on("focusin.esgcpicker",At),e("#esgbuilder-cpciker-clear-gradient").on("click.esgcpicker",(function(){P.val(ESGColor.defaultValue).trigger("change")})),t.on("keyup.esgcpicker focusout.esgcpicker",Lt).on("focusin.esgcpicker",At),oe.on("click.esgcpicker",(function(){var r=e(this),i=r.attr("data-direction");oe.removeClass("selected"),r.addClass("selected"),"radial"!==i?t.val(gt(i)):t.val(0),Lt(!1,i)})),e(".esgbuilder-cpicker-point-delete").on("click.esgcpicker",(function(){if(-1!==this.className.search("active")){var e=N.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t=b.find(".esgbuilder-cpicker-point-"+e).length;t>2&&(N.draggable("destroy").remove(),de=pe.children(),b.trigger("click"),yt()),t<=20&&("bottom"===e?W.removeClass("full"):s.removeClass("full"))}})),e(".esgbuilder-cpicker-preset-save").on("focusin.esgcpicker",At),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||N.attr("data-opacity",o)),i){lt(!1,0===parseInt(o,10)&&"transparent",o),Nt(o)}else{var l=ESGColor.rgbValues(N.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),N.attr("data-color",r),yt(),r="rgba(0, 0, 0, "+o+")",B.style.backgroundColor=r,j.style.borderTopColor=r}})).on("focusin.esgcpicker",At),e(".esgbuilder-cpicker-builder-hit").on("click.esgcpicker",(function(e){o||St();for(var t=parseInt(100*((e.pageX-s.offset().left)/236).toFixed(2),10),r=-1!==this.id.search("bottom")?"bottom":"top",i="bottom"===r?z:H,n=t<50?1:-1;-1!==i.indexOf(t);)t+=n;"bottom"===r?b.find(".esgbuilder-cpicker-point-bottom").length<20?(ct(r,t),ze=!1):W.addClass("full"):b.find(".esgbuilder-cpicker-point-top").length<20?(ct(r,t),ze=!1):s.addClass("full")})),k.on("click.esgcpicker",(function(){!k.hasClass("checked")?k.addClass("checked"):k.removeClass("checked"),yt(!1,!0)})),l.on("change.esgcpicker",(function(){yt(),_t(this.value)})),E.on("keyup.esgcpicker focusout.esgcpicker",(function(e){var t=E.val().replace("%",""),r=e.type;isNaN(t)&&(t="keyup"===r?"0":E.data("orig-value").replace("%","")),t=Math.max(10,Math.min(1e3,t)),"focusout"===r&&E.val(t+"%"),yt()})).on("focusin.esgcpicker",At);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",It()}));e.fn.ddTP&&(n.ddTP(),l.ddTP()),r=!0}function Ft(){Me.val("0%")}function Ht(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=Xe),s.gradients||(s.gradients=Ye);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=at(r,n.slice()||[]),(a=e("#"+i[0])).find(".esgbuilder-cpicker-color").remove(),a.prepend(i[1])}}function zt(e,t,r){return jQuery.grep(e,(function(e){return e[r]!=t[r]}))}function Wt(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 Rt(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 Bt(e){for(var t in void 0!==ye[e]&&st(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=zt(ye[r].ref,xe[t],"r")),r===e&&(ye[r].ref=void 0===ye[r].ref?[]:ye[r].ref,-1==Wt(xe[t],ye[r].ref,"r")&&ye[r].ref.push(xe[t])))}e.esgColorPickerApi={setValue:function(e,t){st(e,t)},setGlobalColors:function(e){ye=jQuery.extend(!0,{},e)},setGlobalCandidates:function(e){xe=e},getGlobalColors:function(){return ye},closeColorPicker:function(){vt()},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"),Ee.attr("data-widget-id"),Ee.attr("data-appended-html"),Ee.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!==Wt(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.esgColorPicker.getGlobalColors();return void 0!==t&&void 0!==t[e]?t[e].v:void 0},templateResult:Rt}),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,Bt(-1),document.getElementById("inp_SkinPicker").style.display="none",st(Oe,!1),o.innerHTML=a)})),n.on("change.select2",(function(){fe=!0,ye=jQuery.extend(!0,{},t),-1!==we&&-999!==we&&void 0!==t[we]&&st(t[we].v,!1),we=this.value,Bt(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&&(Ke=t.mode),t.init&&(u=t.init),t.onAjax&&(T=t.onAjax),t.onEdit&&(S=t.onEdit),t.change&&(F=t.change),t.cancel&&(D=t.cancel),t.title&&(_=t.title),t.language&&t.language,t.widgetId&&(ve=t.widgetId),t.defaultValue&&(ESGColor.defaultValue=t.defaultValue),t.wrapClasses&&(Be=t.wrapClasses),t.appendedHtml&&(Ne=t.appendedHtml),t.onRefresh&&(ee=t.defRefresh),y&&(It(),t.language&&it(t.language))};var jt={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,Te&&Te.css("background",a)):(t.data("tpcp").css("background",""),Te&&Te.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 Vt(){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.esgColorPicker&&jQuery.esgColorPicker({custom:ESG.LIB.COLOR_PRESETS})}catch(t){}AdminEssentials.showWaitAMinute({fadeOut:300})}))}})}e.fn.esgColorPicker=function(t){return t&&"string"==typeof t?this.each(jt[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||_||q||$e.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||Dt(),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"),Te=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"),W=e("#esgbuilder-cpicker-hit-bottom"),M=e("#esgbuilder-cpicker-color-hex"),s=e("#esgbuilder-cpicker-hit-top"),Ee=e(this).data("revcolorinput");var t,o,l,u,y,k,C,E,O,P,N,_,H,z=document.getElementById("esgbuilder-cpicker-current-edit"),R=document.getElementById("esgbuilder-cpicker-edit-title"),B=Ee.attr("data-widget-id"),j=Ee.attr("data-appended-html"),V=Ee.attr("data-editing"),q=Ee.attr("data-colors"),U=Ee.attr("data-mode"),K=Ee.data("revcp"),Q=Ee.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)),N=K.onEdit,_=K.onAjax,E=K.change,O=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||Xe,gradients:u||t||Ye}),(o||y)&&(C.custom={colors:y||Xe,gradients:o||Ye}),Ht(C)),B||(B=ve),B&&(b[0].id=B),j||(j=Ne),j&&(G=e(j).appendTo(He)),Q&&it(Q),U||(U=Ke),V?R.style.visibility="visible":(V="",R.style.visibility="hidden"),z.innerHTML=V,"single"===U||"basic"===U?(n=!1,w.hide(),L.show(),"basic"===U&&b.addClass("is-basic")):(n=!0,w.show(),L.show()),function(e){return"string"==typeof e&&"transparent"!==e.trim()&&-1===e.search(/\[\{/)&&-1!==e.search("-gradient")}(H=Ee.val()||ESGColor.defaultValue)&&(H=ESGColor.reverseGradient(H)),H.split("||").length>1&&(H=ESGColor.joinToRgba(H),Ee.val(H)),P=st(H),Oe=P[0],se=Oe,le=Ee.val(),c=N||S,d=_||T,I=O||D,je=E||F,"gradient"!==P[1]?L.data("state",Oe):w.data("state",Oe),i.addClass("esgbuilder-colorpicker-open"),Ge=Ee.data("tpcp"),b.data("esgcpickerinput",Ee).addClass("active").show(),It(),Pe=Ee.attr("data-color");var X=ESGColor.process(H);"rgba"===X[1]?0==(X=ESGColor.rgbValues(X[0],4))[3]?Te.css("background",""):Te.css("background",Pe):"transparent"===X[1]?Te.css("background",""):Te.css("background",Pe),be=Ee.data("hex"),e(".esgbuilder-cpicker-color").not(".blank").each(ot),He.css({marginLeft:-.5*He.width(),marginTop:-.5*He.height()}),ESG.DOC.trigger("ESGCOLOR.OPEN",{openingValue:P[0],mode:U,currentInput:Ee})}))}));var qt=!1;"loading"===document.readyState?document.addEventListener("readystatechange",(function(){"interactive"!==document.readyState&&"complete"!==document.readyState||qt||(qt=!0,Vt())})):(qt=!0,Vt())}("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(E(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(E(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?T(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},T=function(e,r){return e!==t&&e.pre!==t?e.pre.replace("#data#",r):t},E=function(e,t,r,i,n,o){var a=P({c:"ddTP_S__choice"+(r?" isplaceholder":""),v:e,id:i,iH:t||e,iTB:T(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},L=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"),_tpt.gsap.set(i.wrap,{display:"none"}),delete i.timeStamp,delete i.INFOCUS,delete i.highlighted,W()}},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();_tpt.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()}))}},O=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))},P=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)},N=function(e,r,n,o){return P({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:T(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=N(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=N(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,O(),i.highlighted.classList.add("ddTP_RO--highlighted")),i.ul.appendChild(a),_tpt.gsap.set(i.wrap,{display:"block",left:0,top:0,position:"absolute",width:"185px"}),i.timeStamp===t&&(i.timeStamp=2,O(),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")&&L()},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"),O())},z=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)}},W=function(){document.body.removeEventListener("click",D),document.body.removeEventListener("keydown",z),i.GLOBALLISTENER=t},R=function(){i.GLOBALLISTENER||(document.body.addEventListener("click",D),document.body.addEventListener("keydown",z),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)):L()})),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(E(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})),L())}}else s.sel.multiple&&s.params.search&&q(this);else L()})),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,L()),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){_tpt.gsap.set(e,{width:.75*(e.value.length+1)+"em"})}}(jQuery);