UNPKG

@nodefony/monitoring-bundle

Version:
1 lines 183 kB
(self["webpackChunk_nodefony_monitoring_bundle"]=self["webpackChunk_nodefony_monitoring_bundle"]||[]).push([[155,5237,7402],{20155:function(e,t,n){"use strict";n.r(t);var r=n(35994),i=n(15237),o=n.n(i),l=n(73525),a=n(27905);n(87402);function s(e,t,n){u(e,t,n),d(e,t,n,t.type)}function u(e,t,n){var r;const i=(null===(r=t.fieldDef)||void 0===r?void 0:r.name)||"";v(e,i,"field-name",n,(0,a.Q0)(t))}function c(e,t,n){var r;const i="@"+((null===(r=t.directiveDef)||void 0===r?void 0:r.name)||"");v(e,i,"directive-name",n,(0,a.t8)(t))}function f(e,t,n){var r;const i=(null===(r=t.argDef)||void 0===r?void 0:r.name)||"";v(e,i,"arg-name",n,(0,a.Hh)(t)),d(e,t,n,t.inputType)}function h(e,t,n){var r;const i=(null===(r=t.enumValue)||void 0===r?void 0:r.name)||"";p(e,t,n,t.inputType),v(e,"."),v(e,i,"enum-value",n,(0,a.IR)(t))}function d(e,t,n,i){const o=document.createElement("span");o.className="type-name-pill",i instanceof r.Gc?(p(o,t,n,i.ofType),v(o,"!")):i instanceof r.KT?(v(o,"["),p(o,t,n,i.ofType),v(o,"]")):v(o,(null===i||void 0===i?void 0:i.name)||"","type-name",n,(0,a.a2)(t,i)),e.append(o)}function p(e,t,n,i){i instanceof r.Gc?(p(e,t,n,i.ofType),v(e,"!")):i instanceof r.KT?(v(e,"["),p(e,t,n,i.ofType),v(e,"]")):v(e,(null===i||void 0===i?void 0:i.name)||"","type-name",n,(0,a.a2)(t,i))}function g(e,t,n){const{description:r}=n;if(r){const n=document.createElement("div");n.className="info-description",t.renderDescription?n.innerHTML=t.renderDescription(r):n.append(document.createTextNode(r)),e.append(n)}m(e,t,n)}function m(e,t,n){const r=n.deprecationReason;if(r){const n=document.createElement("div");n.className="info-deprecation",e.append(n);const i=document.createElement("span");i.className="info-deprecation-label",i.append(document.createTextNode("Deprecated")),n.append(i);const o=document.createElement("div");o.className="info-deprecation-reason",t.renderDescription?o.innerHTML=t.renderDescription(r):o.append(document.createTextNode(r)),n.append(o)}}function v(e,t,n="",r={onClick:null},i=null){if(n){const{onClick:o}=r;let l;o?(l=document.createElement("a"),l.href="javascript:void 0",l.addEventListener("click",(e=>{e.preventDefault(),o(i,e)}))):l=document.createElement("span"),l.className=n,l.append(document.createTextNode(t)),e.append(l)}else e.append(document.createTextNode(t))}o().registerHelper("info","graphql",((e,t)=>{var n;if(!t.schema||!e.state)return;const{kind:r,step:i}=e.state,o=(0,l.A)(t.schema,e.state);if("Field"===r&&0===i&&o.fieldDef||"AliasedField"===r&&2===i&&o.fieldDef||"ObjectField"===r&&0===i&&o.fieldDef){const e=document.createElement("div");e.className="CodeMirror-info-header",s(e,o,t);const n=document.createElement("div");return n.append(e),g(n,t,o.fieldDef),n}if("Directive"===r&&1===i&&o.directiveDef){const e=document.createElement("div");e.className="CodeMirror-info-header",c(e,o,t);const n=document.createElement("div");return n.append(e),g(n,t,o.directiveDef),n}if("Argument"===r&&0===i&&o.argDef){const e=document.createElement("div");e.className="CodeMirror-info-header",f(e,o,t);const n=document.createElement("div");return n.append(e),g(n,t,o.argDef),n}if("EnumValue"===r&&(null===(n=o.enumValue)||void 0===n?void 0:n.description)){const e=document.createElement("div");e.className="CodeMirror-info-header",h(e,o,t);const n=document.createElement("div");return n.append(e),g(n,t,o.enumValue),n}if("NamedType"===r&&o.type&&o.type.description){const e=document.createElement("div");e.className="CodeMirror-info-header",p(e,o,t,o.type);const n=document.createElement("div");return n.append(e),g(n,t,o.type),n}}))},27905:function(e,t,n){"use strict";n.d(t,{Hh:function(){return l},IR:function(){return a},Q0:function(){return i},a2:function(){return s},t8:function(){return o}});var r=n(35994);function i(e){return{kind:"Field",schema:e.schema,field:e.fieldDef,type:u(e.fieldDef)?null:e.parentType}}function o(e){return{kind:"Directive",schema:e.schema,directive:e.directiveDef}}function l(e){return e.directiveDef?{kind:"Argument",schema:e.schema,argument:e.argDef,directive:e.directiveDef}:{kind:"Argument",schema:e.schema,argument:e.argDef,field:e.fieldDef,type:u(e.fieldDef)?null:e.parentType}}function a(e){return{kind:"EnumValue",value:e.enumValue||void 0,type:e.inputType?(0,r.MR)(e.inputType):void 0}}function s(e,t){return{kind:"Type",schema:e.schema,type:t||e.type}}function u(e){return"__"===e.name.slice(0,2)}},24294:function(e,t,n){"use strict";function r(e,t){const n=[];let r=e;while(null===r||void 0===r?void 0:r.kind)n.push(r),r=r.prevState;for(let i=n.length-1;i>=0;i--)t(n[i])}n.d(t,{A:function(){return r}})},73525:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(35994),i=n(9488),o=n(24294);function l(e,t){const n={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return(0,o.A)(t,(t=>{var i,o;switch(t.kind){case"Query":case"ShortQuery":n.type=e.getQueryType();break;case"Mutation":n.type=e.getMutationType();break;case"Subscription":n.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(n.type=e.getType(t.type));break;case"Field":case"AliasedField":n.fieldDef=n.type&&t.name?a(e,n.parentType,t.name):null,n.type=null===(i=n.fieldDef)||void 0===i?void 0:i.type;break;case"SelectionSet":n.parentType=n.type?(0,r.MR)(n.type):null;break;case"Directive":n.directiveDef=t.name?e.getDirective(t.name):null;break;case"Arguments":const l=t.prevState?"Field"===t.prevState.kind?n.fieldDef:"Directive"===t.prevState.kind?n.directiveDef:"AliasedField"===t.prevState.kind?t.prevState.name&&a(e,n.parentType,t.prevState.name):null:null;n.argDefs=l?l.args:null;break;case"Argument":if(n.argDef=null,n.argDefs)for(let e=0;e<n.argDefs.length;e++)if(n.argDefs[e].name===t.name){n.argDef=n.argDefs[e];break}n.inputType=null===(o=n.argDef)||void 0===o?void 0:o.type;break;case"EnumValue":const u=n.inputType?(0,r.MR)(n.inputType):null;n.enumValue=u instanceof r.Zb?s(u.getValues(),(e=>e.value===t.name)):null;break;case"ListValue":const c=n.inputType?(0,r.yl)(n.inputType):null;n.inputType=c instanceof r.KT?c.ofType:null;break;case"ObjectValue":const f=n.inputType?(0,r.MR)(n.inputType):null;n.objectFieldDefs=f instanceof r.zP?f.getFields():null;break;case"ObjectField":const h=t.name&&n.objectFieldDefs?n.objectFieldDefs[t.name]:null;n.inputType=null===h||void 0===h?void 0:h.type,n.fieldDef=h;break;case"NamedType":n.type=t.name?e.getType(t.name):null;break}})),n}function a(e,t,n){return n===i.S0.name&&e.getQueryType()===t?i.S0:n===i.Xe.name&&e.getQueryType()===t?i.Xe:n===i.of.name&&(0,r.ML)(t)?i.of:t&&t.getFields?t.getFields()[n]:void 0}function s(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}},87402:function(e,t,n){"use strict";n.r(t);var r=n(15237),i=n.n(r);function o(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}function l(e){const{options:t}=e.state.info;return(null===t||void 0===t?void 0:t.hoverTime)||500}function a(e,t){const n=e.state.info,r=t.target||t.srcElement;if(!(r instanceof HTMLElement))return;if("SPAN"!==r.nodeName||void 0!==n.hoverTimeout)return;const o=r.getBoundingClientRect(),a=function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(c,f)},u=function(){i().off(document,"mousemove",a),i().off(e.getWrapperElement(),"mouseout",u),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},c=function(){i().off(document,"mousemove",a),i().off(e.getWrapperElement(),"mouseout",u),n.hoverTimeout=void 0,s(e,o)},f=l(e);n.hoverTimeout=setTimeout(c,f),i().on(document,"mousemove",a),i().on(e.getWrapperElement(),"mouseout",u)}function s(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2},"window"),r=e.state.info,{options:i}=r,o=i.render||e.getHelper(n,"info");if(o){const r=e.getTokenAt(n,!0);if(r){const l=o(r,i,e,n);l&&u(e,t,l)}}}function u(e,t,n){const r=document.createElement("div");r.className="CodeMirror-info",r.append(n),document.body.append(r);const o=r.getBoundingClientRect(),l=window.getComputedStyle(r),a=o.right-o.left+parseFloat(l.marginLeft)+parseFloat(l.marginRight),s=o.bottom-o.top+parseFloat(l.marginTop)+parseFloat(l.marginBottom);let u=t.bottom;s>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(u=t.top-s),u<0&&(u=t.bottom);let c,f=Math.max(0,window.innerWidth-a-15);f>t.left&&(f=t.left),r.style.opacity="1",r.style.top=u+"px",r.style.left=f+"px";const h=function(){clearTimeout(c)},d=function(){clearTimeout(c),c=setTimeout(p,200)},p=function(){i().off(r,"mouseover",h),i().off(r,"mouseout",d),i().off(e.getWrapperElement(),"mouseout",d),r.style.opacity?(r.style.opacity="0",setTimeout((()=>{r.parentNode&&r.remove()}),600)):r.parentNode&&r.remove()};i().on(r,"mouseover",h),i().on(r,"mouseout",d),i().on(e.getWrapperElement(),"mouseout",d)}i().defineOption("info",!1,((e,t,n)=>{if(n&&n!==i().Init){const t=e.state.info.onMouseOver;i().off(e.getWrapperElement(),"mouseover",t),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const n=e.state.info=o(t);n.onMouseOver=a.bind(null,e),i().on(e.getWrapperElement(),"mouseover",n.onMouseOver)}}))},15237:function(e){(function(t,n){e.exports=n()})(0,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,a=l&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\/(\d+)/.exec(e),f=c&&+c[1],h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),w=/\bCrOS\b/.test(e),x=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,s=!0);var S=b&&(u||h&&(null==C||C<12.11)),k=n||l&&a>=9;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,M=function(e,t){var n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function N(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return N(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function W(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 H(e){var t,n=e.ownerDocument||e;try{t=e.activeElement}catch(r){t=n.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement)t=t.shadowRoot.activeElement;return t}function F(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?" ":"")+t)}function E(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=" "+n[r]);return t}L=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var P=function(e){e.select()};function R(e){return e.display.wrapper.ownerDocument}function I(e){return z(e.display.wrapper)}function z(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function B(e){return R(e).defaultView}function V(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function G(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function U(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(P=function(e){try{e.select()}catch(t){}});var K=function(){this.id=null,this.f=null,this.time=0,this.handler=V(this.onTimeout,this)};function j(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}K.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},K.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var X=50,_={toString:function(){return"CodeMirror.Pass"}},Y={scroll:!1},$={origin:"*mouse"},q={origin:"+move"};function Z(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Q=[""];function J(e){while(Q.length<=e)Q.push(ee(Q)+" ");return Q[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ne(e,t,n){var r=0,i=n(t);while(r<e.length&&n(e[r])<=i)r++;e.splice(r,0,t)}function re(){}function ie(e,t){var n;return Object.create?n=Object.create(e):(re.prototype=e,n=new re),t&&G(t,n),n}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function le(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function ae(e,t){return t?!!(t.source.indexOf("\\w")>-1&&le(e))||t.test(e):le(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ue=/[\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 ce(e){return e.charCodeAt(0)>=768&&ue.test(e)}function fe(e,t,n){while((n<0?t>0:t<e.length)&&ce(e.charAt(t)))t+=n;return t}function he(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function de(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var pe=null;function ge(e,t,n){var r;pe=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:pe=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:pe=i)}return null!=r?r:pe}var me=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,f=[],h=0;h<c;++h)f.push(n(e.charCodeAt(h)));for(var d=0,p=u;d<c;++d){var g=f[d];"m"==g?f[d]=p:p=g}for(var m=0,v=u;m<c;++m){var y=f[m];"1"==y&&"r"==v?f[m]="n":o.test(y)&&(v=y,"r"==y&&(f[m]="R"))}for(var b=1,w=f[0];b<c-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<c;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var k=void 0;for(k=C+1;k<c&&"%"==f[k];++k);for(var T=C&&"!"==f[C-1]||k<c&&"1"==f[k]?"1":"N",L=C;L<k;++L)f[L]=T;C=k-1}}for(var M=0,N=u;M<c;++M){var D=f[M];"L"==N&&"1"==D?f[M]="L":o.test(D)&&(N=D)}for(var A=0;A<c;++A)if(i.test(f[A])){var O=void 0;for(O=A+1;O<c&&i.test(f[O]);++O);for(var W="L"==(A?f[A-1]:u),H="L"==(O<c?f[O]:u),F=W==H?W?"L":"R":u,E=A;E<O;++E)f[E]=F;A=O-1}for(var P,R=[],I=0;I<c;)if(l.test(f[I])){var z=I;for(++I;I<c&&l.test(f[I]);++I);R.push(new s(0,z,I))}else{var B=I,V=R.length,G="rtl"==t?1:0;for(++I;I<c&&"L"!=f[I];++I);for(var U=B;U<I;)if(a.test(f[U])){B<U&&(R.splice(V,0,new s(1,B,U)),V+=G);var K=U;for(++U;U<I&&a.test(f[U]);++U);R.splice(V,0,new s(2,K,U)),V+=G,B=U}else++U;B<I&&R.splice(V,0,new s(1,B,I))}return"ltr"==t&&(1==R[0].level&&(P=e.match(/^\s+/))&&(R[0].from=P[0].length,R.unshift(new s(0,0,P[0].length))),1==ee(R).level&&(P=e.match(/\s+$/))&&(ee(R).to-=P[0].length,R.push(new s(0,c-P[0].length,c)))),"rtl"==t?R.reverse():R}}();function ve(e,t){var n=e.order;return null==n&&(n=e.order=me(e.text,t)),n}var ye=[],be=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ye).concat(n)}};function we(e,t){return e._handlers&&e._handlers[t]||ye}function xe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=j(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ce(e,t){var n=we(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Se(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,n||t.type,e,t),De(t)||t.codemirrorIgnore}function ke(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==j(n,t[r])&&n.push(t[r])}function Te(e,t){return we(e,t).length>0}function Le(e){e.prototype.on=function(e,t){be(this,e,t)},e.prototype.off=function(e,t){xe(this,e,t)}}function Me(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ne(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ae(e){Me(e),Ne(e)}function Oe(e){return e.target||e.srcElement}function We(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var He,Fe,Ee=function(){if(l&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Pe(e){if(null==He){var t=A("span","​");D(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=He?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Re(e){if(null!=Fe)return Fe;var t=D(e,document.createTextNode("AخA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return N(e),!(!n||n.left==n.right)&&(Fe=r.right-n.right<3)}var Ie=3!="\n\nb".split(/\n/).length?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ze=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Be=function(){var e=A("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ve=null;function Ge(e){if(null!=Ve)return Ve;var t=D(e,A("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return Ve=Math.abs(n.left-r.left)>1}var Ue={},Ke={};function je(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ue[e]=t}function Xe(e,t){Ke[e]=t}function _e(e){if("string"==typeof e&&Ke.hasOwnProperty(e))e=Ke[e];else if(e&&"string"==typeof e.name&&Ke.hasOwnProperty(e.name)){var t=Ke[e.name];"string"==typeof t&&(t={name:t}),e=ie(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return _e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return _e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ye(e,t){t=_e(t);var n=Ue[t.name];if(!n)return Ye(e,"text/plain");var r=n(e,t);if($e.hasOwnProperty(t.name)){var i=$e[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var $e={};function qe(e,t){var n=$e.hasOwnProperty(e)?$e[e]:$e[e]={};G(t,n)}function Ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Qe(e,t){var n;while(e.innerMode){if(n=e.innerMode(t),!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function Je(e,t,n){return!e.startState||e.startState(t,n)}var et=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function tt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function nt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function rt(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function it(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ot(e){if(null==e.parent)return null;for(var t=e.parent,n=j(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function lt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function at(e,t){return t>=e.first&&t<e.first+e.size}function st(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ut(e,t,n){if(void 0===n&&(n=null),!(this instanceof ut))return new ut(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ct(e,t){return e.line-t.line||e.ch-t.ch}function ft(e,t){return e.sticky==t.sticky&&0==ct(e,t)}function ht(e){return ut(e.line,e.ch)}function dt(e,t){return ct(e,t)<0?t:e}function pt(e,t){return ct(e,t)<0?e:t}function gt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function mt(e,t){if(t.line<e.first)return ut(e.first,0);var n=e.first+e.size-1;return t.line>n?ut(n,tt(e,n).text.length):vt(t,tt(e,t.line).text.length)}function vt(e,t){var n=e.ch;return null==n||n>t?ut(e.line,t):n<0?ut(e.line,0):e}function yt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=mt(e,t[r]);return n}et.prototype.eol=function(){return this.pos>=this.string.length},et.prototype.sol=function(){return this.pos==this.lineStart},et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},et.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)),t)return++this.pos,n},et.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e));return this.pos>t},et.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},et.prototype.skipToEnd=function(){this.pos=this.string.length},et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},et.prototype.backUp=function(e){this.pos-=e},et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=U(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?U(this.string,this.lineStart,this.tabSize):0)},et.prototype.indentation=function(){return U(this.string,null,this.tabSize)-(this.lineStart?U(this.string,this.lineStart,this.tabSize):0)},et.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},et.prototype.current=function(){return this.string.slice(this.start,this.pos)},et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var bt=function(e,t){this.state=e,this.lookAhead=t},wt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function xt(e,t,n,r){var i=[e.state.modeGen],o={};At(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],s=1,u=0;n.state=!0,At(e,t.text,a.mode,n,(function(e,t){var n=s;while(u<e){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ct(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=St(e,ot(t)),i=t.text.length>e.options.maxHighlightLength&&Ze(e.doc.mode,r.state),o=xt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new wt(r,!0,t);var o=Ot(e,t,n),l=o>r.first&&tt(r,o-1).stateAfter,a=l?wt.fromSaved(r,l,o):new wt(r,Je(r.mode),o);return r.iter(o,t,(function(n){kt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function kt(e,t,n,r){var i=e.doc.mode,o=new et(t,e.options.tabSize,n);o.start=o.pos=r||0,""==t&&Tt(i,n.state);while(!o.eol())Lt(i,o,n.state),o.start=o.pos}function Tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Qe(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Lt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Qe(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},wt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(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}},wt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},wt.fromSaved=function(e,t,n){return t instanceof bt?new wt(e,Ze(e.mode,t.state),n,t.lookAhead):new wt(e,Ze(e.mode,t),n)},wt.prototype.save=function(e){var t=!1!==e?Ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new bt(t,this.maxLookAhead):t};var Mt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Nt(e,t,n,r){var i,o=e.doc,l=o.mode;t=mt(o,t);var a,s=tt(o,t.line),u=St(e,t.line,n),c=new et(s.text,e.options.tabSize,u);r&&(a=[]);while((r||c.pos<t.ch)&&!c.eol())c.start=c.pos,i=Lt(l,c,u.state),r&&a.push(new Mt(c,i,Ze(o.mode,u.state)));return r?a:new Mt(c,i,u.state)}function Dt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function At(e,t,n,r,i,o,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,u=0,c=null,f=new et(t,e.options.tabSize,r),h=e.options.addModeClass&&[null];""==t&&Dt(Tt(n,r.state),o);while(!f.eol()){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&kt(e,t,r,f.pos),f.pos=t.length,s=null):s=Dt(Lt(n,f,r.state,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!a||c!=s){while(u<f.start)u=Math.min(f.start,u+5e3),i(u,c);c=s}f.start=f.pos}while(u<f.pos){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}function Ot(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=tt(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof bt?u.lookAhead:0)<=o.modeFrontier))return a;var c=U(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function Wt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=tt(e,r).stateAfter;if(i&&(!(i instanceof bt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Ht=!1,Ft=!1;function Et(){Ht=!0}function Pt(){Ft=!0}function Rt(e,t,n){this.marker=e,this.from=t,this.to=n}function It(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Bt(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Vt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rt(l,o.from,s?null:o.to))}}return r}function Gt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rt(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Ut(e,t){if(t.full)return null;var n=at(e,t.from.line)&&tt(e,t.from.line).markedSpans,r=at(e,t.to.line)&&tt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==ct(t.from,t.to),a=Vt(n,i,l),s=Gt(r,o,l),u=1==t.text.length,c=ee(t.text).length+(u?i:0);if(a)for(var f=0;f<a.length;++f){var h=a[f];if(null==h.to){var d=It(s,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p];if(null!=g.to&&(g.to+=c),null==g.from){var m=It(a,g.marker);m||(g.from=c,u&&(a||(a=[])).push(g))}else g.from+=c,u&&(a||(a=[])).push(g)}a&&(a=Kt(a)),s&&s!=a&&(s=Kt(s));var v=[a];if(!u){var y,b=t.text.length-2;if(b>0&&a)for(var w=0;w<a.length;++w)null==a[w].to&&(y||(y=[])).push(new Rt(a[w].marker,null,null));for(var x=0;x<b;++x)v.push(y);v.push(s)}return v}function Kt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function jt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=j(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ct(u.to,a.from)<0||ct(u.from,a.to)>0)){var c=[s,1],f=ct(u.from,a.from),h=ct(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Xt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function _t(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Yt(e){return e.inclusiveLeft?-1:0}function $t(e){return e.inclusiveRight?1:0}function qt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ct(r.from,i.from)||Yt(e)-Yt(t);if(o)return-o;var l=ct(r.to,i.to)||$t(e)-$t(t);return l||t.id-e.id}function Zt(e,t){var n,r=Ft&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||qt(n,i.marker)<0)&&(n=i.marker);return n}function Qt(e){return Zt(e,!0)}function Jt(e){return Zt(e,!1)}function en(e,t){var n,r=Ft&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function tn(e,t,n,r,i){var o=tt(e,t),l=Ft&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),c=ct(u.from,n)||Yt(s.marker)-Yt(i),f=ct(u.to,r)||$t(s.marker)-$t(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(u.to,n)>=0:ct(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(u.from,r)<=0:ct(u.from,r)<0)))return!0}}}function nn(e){var t;while(t=Qt(e))e=t.find(-1,!0).line;return e}function rn(e){var t;while(t=Jt(e))e=t.find(1,!0).line;return e}function on(e){var t,n;while(t=Jt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ln(e,t){var n=tt(e,t),r=nn(n);return n==r?t:ot(r)}function an(e,t){if(t>e.lastLine())return t;var n,r=tt(e,t);if(!sn(e,r))return t;while(n=Jt(r))r=n.find(1,!0).line;return ot(r)+1}function sn(e,t){var n=Ft&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&un(e,t,r))return!0}}function un(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return un(e,r.line,It(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&un(e,t,i))return!0}function cn(e){e=nn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function fn(e){if(0==e.height)return 0;var t,n=e.text.length,r=e;while(t=Qt(r)){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}r=e;while(t=Jt(r)){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function hn(e){var t=e.display,n=e.doc;t.maxLine=tt(n,n.first),t.maxLineLength=fn(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=fn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var dn=function(e,t,n){this.text=e,_t(this,t),this.height=n?n(this):1};function pn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Xt(e),_t(e,n);var i=r?r(e):1;i!=e.height&&it(e,i)}function gn(e){e.parent=null,Xt(e)}dn.prototype.lineNo=function(){return ot(this)},Le(dn);var mn={},vn={};function yn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?vn:mn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function bn(e,t){var n=O("span",null,null,s?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=xn,Re(e.display.measure)&&(l=ve(o,e.doc.direction))&&(r.addToken=Sn(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&ot(o);Tn(o,r,Ct(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=E(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=E(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Pe(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=E(r.pre.className,r.textClass||"")),r}function wn(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function xn(e,t,n,r,i,o,s){if(t){var u,c=e.splitSpaces?Cn(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){u=document.createDocumentFragment();var d=0;while(1){f.lastIndex=d;var p=f.exec(t),g=p?p.index-d:t.length-d;if(g){var m=document.createTextNode(c.slice(d,d+g));l&&a<9?u.appendChild(A("span",[m])):u.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=u.appendChild(A("span",J(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(v=u.appendChild(A("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",p[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),l&&a<9?u.appendChild(A("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&a<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||h||o||s){var w=n||"";r&&(w+=r),i&&(w+=i);var x=A("span",[u],w,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,s[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function Cn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function Sn(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var f=void 0,h=0;h<t.length;h++)if(f=t[h],f.to>u&&f.from<=u)break;if(f.to>=c)return e(n,r,i,o,l,a,s);e(n,r.slice(0,f.to-u),i,o,null,a,s),o=null,r=r.slice(f.to-u),u=f.to}}}function kn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Tn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,u,c,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){s=u=c=a="",h=null,f=null,v=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var S in C.attributes)(h||(h={}))[S]=C.attributes[S];C.collapsed&&(!f||qt(f.marker,C)<0)&&(f=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(u+=" "+b[k]);if(!f||f.from==p)for(var T=0;T<y.length;++T)kn(t,0,y[T]);if(f&&(f.from||0)==p){if(kn(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;var L=Math.min(d,v);while(1){if(m){var M=p+m.length;if(!f){var N=M>L?m.slice(0,L-p):m;t.addToken(t,N,l?l+s:s,c,p+N.length==v?u:"",a,h)}if(M>=L){m=m.slice(L-p),p=L;break}p=M,c=""}m=i.slice(o,o=n[g++]),l=yn(n[g++],t.cm.options)}}else for(var D=1;D<n.length;D+=2)t.addToken(t,i.slice(o,o=n[D]),yn(n[D+1],t.cm.options))}function Ln(e,t,n){this.line=t,this.rest=on(t),this.size=this.rest?ot(ee(this.rest))-n+1:1,this.node=this.text=null,this.hidden=sn(e,t)}function Mn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new Ln(e.doc,tt(e.doc,o),o);r=o+l.size,i.push(l)}return i}var Nn=null;function Dn(e){Nn?Nn.ops.push(e):e.ownsGroup=Nn={ops:[e],delayedCallbacks:[]}}function An(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function On(e,t){var n=e.ownsGroup;if(n)try{An(n)}finally{Nn=null,t(n)}}var Wn=null;function Hn(e,t){var n=we(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Nn?r=Nn.delayedCallbacks:Wn?r=Wn:(r=Wn=[],setTimeout(Fn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},l=0;l<n.length;++l)o(l)}}function Fn(){var e=Wn;Wn=null;for(var t=0;t<e.length;++t)e[t]()}function En(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?zn(e,t):"gutter"==o?Vn(e,t,n,r):"class"==o?Bn(e,t):"widget"==o&&Gn(e,t,r)}t.changes=null}function Pn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&a<8&&(e.node.style.zIndex=2)),e.node}function Rn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Pn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function In(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):bn(e,t)}function zn(e,t){var n=t.text.className,r=In(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Bn(e,t)):n&&(t.text.className=n)}function Bn(e,t){Rn(e,t),t.line.wrapClass?Pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Vn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Pn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=Pn(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(A("div",st(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=T("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Kn(e,t,n)}function Un(e,t,n,r){var i=In(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Bn(e,t),Vn(e,t,n,r),Kn(e,t,r),t.node}function Kn(e,t,n){if(jn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)jn(e,t.rest[r],t,n,!1)}function jn(e,t,n,r,i){if(t.widgets)for(var o=Pn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=A("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Xn(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Hn(s,"redraw")}}function Xn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function _n(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!W(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),D(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Yn(e,t){for(var n=Oe(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function $n(e){return e.lineSpace.offsetTop}function qn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Zn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=D(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Qn(e){return X-e.display.nativeBarWidth}function Jn(e){return e.display.scroller.clientWidth-Qn(e)-e.display.barWidth}function er(e){return e.display.scroller.clientHeight-Qn(e)-e.display.barHeight}function tr(e,t,n){var r=e.options.lineWrapping,i=r&&Jn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function nr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ot(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rr(e,t){t=nn(t);var n=ot(t),r=e.display.externalMeasured=new Ln(e.doc,t,n);r.lineN=n;var i=r.built=bn(e,r);return r.text=i.pre,D(e.display.lineMeasure,i.pre),r}function ir(e,t,n,r){return ar(e,lr(e,t),n,r)}function or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Br(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function lr(e,t){var n=ot(t),r=or(e,n);r&&!r.text?r=null:r&&r.changes&&(En(e,r,n,Er(e)),e.curOp.forceUpdate=!0),r||(r=rr(e,t));var i=nr(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function ar(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(tr(e,t.view,t.rect),t.hasHeights=!0),o=hr(e,t,n,r),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var sr,ur={left:0,right:0,top:0,bottom:0};function cr(e,t,n){for(var r,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=