|
-(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[216],{169:(e,t,n)=>{"use strict";n.d(t,{u_:()=>zn,u:()=>ci});var i={};n.r(i),n.d(i,{afterMain:()=>C,afterRead:()=>x,afterWrite:()=>E,applyStyles:()=>N,arrow:()=>Z,auto:()=>l,basePlacements:()=>u,beforeMain:()=>w,beforeRead:()=>y,beforeWrite:()=>k,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>ee,createPopper:()=>Fe,createPopperBase:()=>Te,createPopperLite:()=>Le,detectOverflow:()=>ge,end:()=>h,eventListeners:()=>ne,flip:()=>ve,hide:()=>xe,left:()=>a,main:()=>D,modifierPhases:()=>S,offset:()=>we,placements:()=>v,popper:()=>p,popperGenerator:()=>Ae,popperOffsets:()=>De,preventOverflow:()=>Ce,read:()=>b,reference:()=>m,right:()=>s,start:()=>c,top:()=>r,variationPlacements:()=>g,viewport:()=>f,write:()=>_});var r="top",o="bottom",s="right",a="left",l="auto",u=[r,o,s,a],c="start",h="end",d="clippingParents",f="viewport",p="popper",m="reference",g=u.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+h])}),[]),v=[].concat(u,[l]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+h])}),[]),y="beforeRead",b="read",x="afterRead",w="beforeMain",D="main",C="afterMain",k="beforeWrite",_="write",E="afterWrite",S=[y,b,x,w,D,C,k,_,E];function A(e){return e?(e.nodeName||"").toLowerCase():null}function T(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function F(e){return e instanceof T(e).Element||e instanceof Element}function L(e){return e instanceof T(e).HTMLElement||e instanceof HTMLElement}function M(e){return"undefined"!=typeof ShadowRoot&&(e instanceof T(e).ShadowRoot||e instanceof ShadowRoot)}const N={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];L(r)&&A(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});L(i)&&A(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function O(e){return e.split("-")[0]}function B(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function I(e){var t=B(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function z(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&M(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function P(e){return T(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(A(e))>=0}function R(e){return((F(e)?e.ownerDocument:e.document)||window.document).documentElement}function W(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(M(e)?e.host:null)||R(e)}function j(e){return L(e)&&"fixed"!==P(e).position?e.offsetParent:null}function $(e){for(var t=T(e),n=j(e);n&&H(n)&&"static"===P(n).position;)n=j(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===P(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&L(e)&&"fixed"===P(e).position)return null;for(var n=W(e);L(n)&&["html","body"].indexOf(A(n))<0;){var i=P(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function q(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}var U=Math.max,V=Math.min,G=Math.round;function K(e,t,n){return U(e,V(t,n))}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Y(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Z={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,l=e.options,c=n.elements.arrow,h=n.modifiersData.popperOffsets,d=O(n.placement),f=q(d),p=[a,s].indexOf(d)>=0?"height":"width";if(c&&h){var m=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Y(e,u))}(l.padding,n),g=I(c),v="y"===f?r:a,y="y"===f?o:s,b=n.rects.reference[p]+n.rects.reference[f]-h[f]-n.rects.popper[p],x=h[f]-n.rects.reference[f],w=$(c),D=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,C=b/2-x/2,k=m[v],_=D-g[p]-m[y],E=D/2-g[p]/2+C,S=K(k,E,_),A=f;n.modifiersData[i]=((t={})[A]=S,t.centerOffset=S-E,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&z(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};var Q={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,i=e.popperRect,l=e.placement,u=e.offsets,c=e.position,h=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,p=!0===f?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:G(G(t*i)/i)||0,y:G(G(n*i)/i)||0}}(u):"function"==typeof f?f(u):u,m=p.x,g=void 0===m?0:m,v=p.y,y=void 0===v?0:v,b=u.hasOwnProperty("x"),x=u.hasOwnProperty("y"),w=a,D=r,C=window;if(d){var k=$(n),_="clientHeight",E="clientWidth";k===T(n)&&"static"!==P(k=R(n)).position&&(_="scrollHeight",E="scrollWidth"),k=k,l===r&&(D=o,y-=k[_]-i.height,y*=h?1:-1),l===a&&(w=s,g-=k[E]-i.width,g*=h?1:-1)}var S,A=Object.assign({position:c},d&&Q);return h?Object.assign({},A,((S={})[D]=x?"0":"",S[w]=b?"0":"",S.transform=(C.devicePixelRatio||1)<2?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",S)):Object.assign({},A,((t={})[D]=x?y+"px":"",t[w]=b?g+"px":"",t.transform="",t))}const ee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:O(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var te={passive:!0};const ne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=void 0===r||r,s=i.resize,a=void 0===s||s,l=T(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,te)})),a&&l.addEventListener("resize",n.update,te),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,te)})),a&&l.removeEventListener("resize",n.update,te)}},data:{}};var ie={left:"right",right:"left",bottom:"top",top:"bottom"};function re(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var oe={start:"end",end:"start"};function se(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function ae(e){var t=T(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return B(R(e)).left+ae(e).scrollLeft}function ue(e){var t=P(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ce(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:L(e)&&ue(e)?e:ce(W(e))}function he(e,t){var n;void 0===t&&(t=[]);var i=ce(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=T(i),s=r?[o].concat(o.visualViewport||[],ue(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(he(W(s)))}function de(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fe(e,t){return t===f?de(function(e){var t=T(e),n=R(e),i=t.visualViewport,r=n.clientWidth,o=n.clientHeight,s=0,a=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=i.offsetLeft,a=i.offsetTop)),{width:r,height:o,x:s+le(e),y:a}}(e)):L(t)?function(e){var t=B(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):de(function(e){var t,n=R(e),i=ae(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=U(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=U(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+le(e),l=-i.scrollTop;return"rtl"===P(r||n).direction&&(a+=U(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(R(e)))}function pe(e){return e.split("-")[1]}function me(e){var t,n=e.reference,i=e.element,l=e.placement,u=l?O(l):null,d=l?pe(l):null,f=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2;switch(u){case r:t={x:f,y:n.y-i.height};break;case o:t={x:f,y:n.y+n.height};break;case s:t={x:n.x+n.width,y:p};break;case a:t={x:n.x-i.width,y:p};break;default:t={x:n.x,y:n.y}}var m=u?q(u):null;if(null!=m){var g="y"===m?"height":"width";switch(d){case c:t[m]=t[m]-(n[g]/2-i[g]/2);break;case h:t[m]=t[m]+(n[g]/2-i[g]/2)}}return t}function ge(e,t){void 0===t&&(t={});var n=t,i=n.placement,a=void 0===i?e.placement:i,l=n.boundary,c=void 0===l?d:l,h=n.rootBoundary,g=void 0===h?f:h,v=n.elementContext,y=void 0===v?p:v,b=n.altBoundary,x=void 0!==b&&b,w=n.padding,D=void 0===w?0:w,C=X("number"!=typeof D?D:Y(D,u)),k=y===p?m:p,_=e.elements.reference,E=e.rects.popper,S=e.elements[x?k:y],T=function(e,t,n){var i="clippingParents"===t?function(e){var t=he(W(e)),n=["absolute","fixed"].indexOf(P(e).position)>=0&&L(e)?$(e):e;return F(n)?t.filter((function(e){return F(e)&&z(e,n)&&"body"!==A(e)})):[]}(e):[].concat(t),r=[].concat(i,[n]),o=r[0],s=r.reduce((function(t,n){var i=fe(e,n);return t.top=U(i.top,t.top),t.right=V(i.right,t.right),t.bottom=V(i.bottom,t.bottom),t.left=U(i.left,t.left),t}),fe(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(F(S)?S:S.contextElement||R(e.elements.popper),c,g),M=B(_),N=me({reference:M,element:E,strategy:"absolute",placement:a}),O=de(Object.assign({},E,N)),I=y===p?O:M,H={top:T.top-I.top+C.top,bottom:I.bottom-T.bottom+C.bottom,left:T.left-I.left+C.left,right:I.right-T.right+C.right},j=e.modifiersData.offset;if(y===p&&j){var q=j[a];Object.keys(H).forEach((function(e){var t=[s,o].indexOf(e)>=0?1:-1,n=[r,o].indexOf(e)>=0?"y":"x";H[e]+=q[n]*t}))}return H}const ve={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var h=n.mainAxis,d=void 0===h||h,f=n.altAxis,p=void 0===f||f,m=n.fallbackPlacements,y=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,D=n.flipVariations,C=void 0===D||D,k=n.allowedAutoPlacements,_=t.options.placement,E=O(_),S=m||(E!==_&&C?function(e){if(O(e)===l)return[];var t=re(e);return[se(e),t,se(t)]}(_):[re(_)]),A=[_].concat(S).reduce((function(e,n){return e.concat(O(n)===l?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?v:l,h=pe(i),d=h?a?g:g.filter((function(e){return pe(e)===h})):u,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:r,rootBoundary:o,padding:s})[O(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:y,flipVariations:C,allowedAutoPlacements:k}):n)}),[]),T=t.rects.reference,F=t.rects.popper,L=new Map,M=!0,N=A[0],B=0;B<A.length;B++){var I=A[B],z=O(I),P=pe(I)===c,H=[r,o].indexOf(z)>=0,R=H?"width":"height",W=ge(t,{placement:I,boundary:b,rootBoundary:x,altBoundary:w,padding:y}),j=H?P?s:a:P?o:r;T[R]>F[R]&&(j=re(j));var $=re(j),q=[];if(d&&q.push(W[z]<=0),p&&q.push(W[j]<=0,W[$]<=0),q.every((function(e){return e}))){N=I,M=!1;break}L.set(I,q)}if(M)for(var U=function(e){var t=A.find((function(t){var n=L.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return N=t,"break"},V=C?3:1;V>0&&"break"!==U(V);V--);t.placement!==N&&(t.modifiersData[i]._skip=!0,t.placement=N,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function be(e){return[r,s,o,a].some((function(t){return e[t]>=0}))}const xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,s=ge(t,{elementContext:"reference"}),a=ge(t,{altBoundary:!0}),l=ye(s,i),u=ye(a,r,o),c=be(l),h=be(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}},we={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.offset,l=void 0===o?[0,0]:o,u=v.reduce((function(e,n){return e[n]=function(e,t,n){var i=O(e),o=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,u=l[0],c=l[1];return u=u||0,c=(c||0)*o,[a,s].indexOf(i)>=0?{x:c,y:u}:{x:u,y:c}}(n,t.rects,l),e}),{}),c=u[t.placement],h=c.x,d=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=h,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=u}},De={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=me({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Ce={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,l=n.mainAxis,u=void 0===l||l,h=n.altAxis,d=void 0!==h&&h,f=n.boundary,p=n.rootBoundary,m=n.altBoundary,g=n.padding,v=n.tether,y=void 0===v||v,b=n.tetherOffset,x=void 0===b?0:b,w=ge(t,{boundary:f,rootBoundary:p,padding:g,altBoundary:m}),D=O(t.placement),C=pe(t.placement),k=!C,_=q(D),E="x"===_?"y":"x",S=t.modifiersData.popperOffsets,A=t.rects.reference,T=t.rects.popper,F="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,L={x:0,y:0};if(S){if(u||d){var M="y"===_?r:a,N="y"===_?o:s,B="y"===_?"height":"width",z=S[_],P=S[_]+w[M],H=S[_]-w[N],R=y?-T[B]/2:0,W=C===c?A[B]:T[B],j=C===c?-T[B]:-A[B],G=t.elements.arrow,X=y&&G?I(G):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[M],Q=Y[N],J=K(0,A[B],X[B]),ee=k?A[B]/2-R-J-Z-F:W-J-Z-F,te=k?-A[B]/2+R+J+Q+F:j+J+Q+F,ne=t.elements.arrow&&$(t.elements.arrow),ie=ne?"y"===_?ne.clientTop||0:ne.clientLeft||0:0,re=t.modifiersData.offset?t.modifiersData.offset[t.placement][_]:0,oe=S[_]+ee-re-ie,se=S[_]+te-re;if(u){var ae=K(y?V(P,oe):P,z,y?U(H,se):H);S[_]=ae,L[_]=ae-z}if(d){var le="x"===_?r:a,ue="x"===_?o:s,ce=S[E],he=ce+w[le],de=ce-w[ue],fe=K(y?V(he,oe):he,ce,y?U(de,se):de);S[E]=fe,L[E]=fe-ce}}t.modifiersData[i]=L}},requiresIfExists:["offset"]};function ke(e,t,n){void 0===n&&(n=!1);var i,r,o=R(t),s=B(e),a=L(t),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!n)&&(("body"!==A(t)||ue(o))&&(l=(i=t)!==T(i)&&L(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:ae(i)),L(t)?((u=B(t)).x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=le(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function _e(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var Ee={placement:"bottom",modifiers:[],strategy:"absolute"};function Se(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Ae(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,r=t.defaultOptions,o=void 0===r?Ee:r;return function(e,t,n){void 0===n&&(n=o);var r,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ee,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:a,setOptions:function(n){h(),a.options=Object.assign({},o,a.options,n),a.scrollParents={reference:F(e)?he(e):e.contextElement?he(e.contextElement):[],popper:he(t)};var r,s,u=function(e){var t=_e(e);return S.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((r=[].concat(i,a.options.modifiers),s=r.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(s).map((function(e){return s[e]}))));return a.orderedModifiers=u.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,r=e.effect;if("function"==typeof r){var o=r({state:a,name:t,instance:c,options:i});l.push(o||function(){})}})),c.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(Se(t,n)){a.rects={reference:ke(t,$(n),"fixed"===a.options.strategy),popper:I(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],o=r.fn,s=r.options,l=void 0===s?{}:s,h=r.name;"function"==typeof o&&(a=o({state:a,options:l,name:h,instance:c})||a)}else a.reset=!1,i=-1}}},update:(r=function(){return new Promise((function(e){c.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(r())}))}))),s}),destroy:function(){h(),u=!0}};if(!Se(e,t))return c;function h(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var Te=Ae(),Fe=Ae({defaultModifiers:[ne,De,ee,N,we,ve,Ce,Z,xe]}),Le=Ae({defaultModifiers:[ne,De,ee,N]});const Me={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let i=e.parentNode;for(;i&&i.nodeType===Node.ELEMENT_NODE&&3!==i.nodeType;)i.matches(t)&&n.push(i),i=i.parentNode;return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]}},Ne="transitionend",Oe=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},Be=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t},Ie=e=>{const t=Be(e);return t&&document.querySelector(t)?t:null},ze=e=>{const t=Be(e);return t?document.querySelector(t):null},Pe=e=>{e.dispatchEvent(new Event(Ne))},He=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),Re=e=>He(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?Me.findOne(e):null,We=(e,t,n)=>{Object.keys(n).forEach((i=>{const r=n[i],o=t[i],s=o&&He(o)?"element":null==(a=o)?`${a}`:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();var a;if(!new RegExp(r).test(s))throw new TypeError(`${e.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${r}".`)}))},je=e=>!(!He(e)||0===e.getClientRects().length)&&"visible"===getComputedStyle(e).getPropertyValue("visibility"),$e=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),qe=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?qe(e.parentNode):null},Ue=()=>{},Ve=e=>e.offsetHeight,Ge=()=>{const{jQuery:e}=window;return e&&!document.body.hasAttribute("data-bs-no-jquery")?e:null},Ke=[],Xe=()=>"rtl"===document.documentElement.dir,Ye=e=>{var t;t=()=>{const t=Ge();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}},"loading"===document.readyState?(Ke.length||document.addEventListener("DOMContentLoaded",(()=>{Ke.forEach((e=>e()))})),Ke.push(t)):t()},Ze=e=>{"function"==typeof e&&e()},Qe=(e,t,n=!0)=>{if(!n)return void Ze(e);const i=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),r=Number.parseFloat(n);return i||r?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let r=!1;const o=({target:n})=>{n===t&&(r=!0,t.removeEventListener(Ne,o),Ze(e))};t.addEventListener(Ne,o),setTimeout((()=>{r||Pe(t)}),i)},Je=(e,t,n,i)=>{let r=e.indexOf(t);if(-1===r)return e[!n&&i?e.length-1:0];const o=e.length;return r+=n?1:-1,i&&(r=(r+o)%o),e[Math.max(0,Math.min(r,o-1))]},et=/[^.]*(?=\..*)\.|.*/,tt=/\..*/,nt=/::\d+$/,it={};let rt=1;const ot={mouseenter:"mouseover",mouseleave:"mouseout"},st=/^(mouseenter|mouseleave)/i,at=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function lt(e,t){return t&&`${t}::${rt++}`||e.uidEvent||rt++}function ut(e){const t=lt(e);return e.uidEvent=t,it[t]=it[t]||{},it[t]}function ct(e,t,n=null){const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){const o=e[i[r]];if(o.originalHandler===t&&o.delegationSelector===n)return o}return null}function ht(e,t,n){const i="string"==typeof t,r=i?n:t;let o=pt(e);return at.has(o)||(o=e),[i,r,o]}function dt(e,t,n,i,r){if("string"!=typeof t||!e)return;if(n||(n=i,i=null),st.test(t)){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};i?i=e(i):n=e(n)}const[o,s,a]=ht(t,n,i),l=ut(e),u=l[a]||(l[a]={}),c=ct(u,s,o?n:null);if(c)return void(c.oneOff=c.oneOff&&r);const h=lt(s,t.replace(et,"")),d=o?function(e,t,n){return function i(r){const o=e.querySelectorAll(t);for(let{target:s}=r;s&&s!==this;s=s.parentNode)for(let a=o.length;a--;)if(o[a]===s)return r.delegateTarget=s,i.oneOff&&mt.off(e,r.type,t,n),n.apply(s,[r]);return null}}(e,n,i):function(e,t){return function n(i){return i.delegateTarget=e,n.oneOff&&mt.off(e,i.type,t),t.apply(e,[i])}}(e,n);d.delegationSelector=o?n:null,d.originalHandler=s,d.oneOff=r,d.uidEvent=h,u[h]=d,e.addEventListener(a,d,o)}function ft(e,t,n,i,r){const o=ct(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function pt(e){return e=e.replace(tt,""),ot[e]||e}const mt={on(e,t,n,i){dt(e,t,n,i,!1)},one(e,t,n,i){dt(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[r,o,s]=ht(t,n,i),a=s!==t,l=ut(e),u=t.startsWith(".");if(void 0!==o){if(!l||!l[s])return;return void ft(e,l,s,o,r?n:null)}u&&Object.keys(l).forEach((n=>{!function(e,t,n,i){const r=t[n]||{};Object.keys(r).forEach((o=>{if(o.includes(i)){const i=r[o];ft(e,t,n,i.originalHandler,i.delegationSelector)}}))}(e,l,n,t.slice(1))}));const c=l[s]||{};Object.keys(c).forEach((n=>{const i=n.replace(nt,"");if(!a||t.includes(i)){const t=c[n];ft(e,l,s,t.originalHandler,t.delegationSelector)}}))},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=Ge(),r=pt(t),o=t!==r,s=at.has(r);let a,l=!0,u=!0,c=!1,h=null;return o&&i&&(a=i.Event(t,n),i(e).trigger(a),l=!a.isPropagationStopped(),u=!a.isImmediatePropagationStopped(),c=a.isDefaultPrevented()),s?(h=document.createEvent("HTMLEvents"),h.initEvent(r,l,!0)):h=new CustomEvent(t,{bubbles:l,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(h,e,{get:()=>n[e]})})),c&&h.preventDefault(),u&&e.dispatchEvent(h),h.defaultPrevented&&void 0!==a&&a.preventDefault(),h}},gt=new Map;var vt={set(e,t,n){gt.has(e)||gt.set(e,new Map);const i=gt.get(e);i.has(t)||0===i.size?i.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(e,t)=>gt.has(e)&>.get(e).get(t)||null,remove(e,t){if(!gt.has(e))return;const n=gt.get(e);n.delete(t),0===n.size&>.delete(e)}};class yt{constructor(e){(e=Re(e))&&(this._element=e,vt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){vt.remove(this._element,this.constructor.DATA_KEY),mt.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((e=>{this[e]=null}))}_queueCallback(e,t,n=!0){Qe(e,t,n)}static getInstance(e){return vt.get(e,this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.0.2"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}}class bt extends yt{static get NAME(){return"alert"}close(e){const t=e?this._getRootElement(e):this._element,n=this._triggerCloseEvent(t);null===n||n.defaultPrevented||this._removeElement(t)}_getRootElement(e){return ze(e)||e.closest(".alert")}_triggerCloseEvent(e){return mt.trigger(e,"close.bs.alert")}_removeElement(e){e.classList.remove("show");const t=e.classList.contains("fade");this._queueCallback((()=>this._destroyElement(e)),e,t)}_destroyElement(e){e.remove(),mt.trigger(e,"closed.bs.alert")}static jQueryInterface(e){return this.each((function(){const t=bt.getOrCreateInstance(this);"close"===e&&t[e](this)}))}static handleDismiss(e){return function(t){t&&t.preventDefault(),e.close(this)}}}mt.on(document,"click.bs.alert.data-api",'[data-bs-dismiss="alert"]',bt.handleDismiss(new bt)),Ye(bt);const xt='[data-bs-toggle="button"]';class wt extends yt{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=wt.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}function Dt(e){return"true"===e||"false"!==e&&(e===Number(e).toString()?Number(e):""===e||"null"===e?null:e)}function Ct(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}mt.on(document,"click.bs.button.data-api",xt,(e=>{e.preventDefault();const t=e.target.closest(xt);wt.getOrCreateInstance(t).toggle()})),Ye(wt);const kt={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${Ct(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${Ct(t)}`)},getDataAttributes(e){if(!e)return{};const t={};return Object.keys(e.dataset).filter((e=>e.startsWith("bs"))).forEach((n=>{let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),t[i]=Dt(e.dataset[n])})),t},getDataAttribute:(e,t)=>Dt(e.getAttribute(`data-bs-${Ct(t)}`)),offset(e){const t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},position:e=>({top:e.offsetTop,left:e.offsetLeft})},_t="carousel",Et={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},St={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},At="next",Tt="prev",Ft="left",Lt="right",Mt={ArrowLeft:Lt,ArrowRight:Ft},Nt="slid.bs.carousel",Ot="active",Bt=".active.carousel-item",It="touch";class zt extends yt{constructor(e,t){super(e),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(t),this._indicatorsElement=Me.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return Et}static get NAME(){return _t}next(){this._slide(At)}nextWhenVisible(){!document.hidden&&je(this._element)&&this.next()}prev(){this._slide(Tt)}pause(e){e||(this._isPaused=!0),Me.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&(Pe(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(e){this._activeElement=Me.findOne(Bt,this._element);const t=this._getItemIndex(this._activeElement);if(e>this._items.length-1||e<0)return;if(this._isSliding)return void mt.one(this._element,Nt,(()=>this.to(e)));if(t===e)return this.pause(),void this.cycle();const n=e>t?At:Tt;this._slide(n,this._items[e])}_getConfig(e){return e={...Et,...kt.getDataAttributes(this._element),..."object"==typeof e?e:{}},We(_t,e,St),e}_handleSwipe(){const e=Math.abs(this.touchDeltaX);if(e<=40)return;const t=e/this.touchDeltaX;this.touchDeltaX=0,t&&this._slide(t>0?Lt:Ft)}_addEventListeners(){this._config.keyboard&&mt.on(this._element,"keydown.bs.carousel",(e=>this._keydown(e))),"hover"===this._config.pause&&(mt.on(this._element,"mouseenter.bs.carousel",(e=>this.pause(e))),mt.on(this._element,"mouseleave.bs.carousel",(e=>this.cycle(e)))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}_addTouchEventListeners(){const e=e=>{!this._pointerEvent||"pen"!==e.pointerType&&e.pointerType!==It?this._pointerEvent||(this.touchStartX=e.touches[0].clientX):this.touchStartX=e.clientX},t=e=>{this.touchDeltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this.touchStartX},n=e=>{!this._pointerEvent||"pen"!==e.pointerType&&e.pointerType!==It||(this.touchDeltaX=e.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((e=>this.cycle(e)),500+this._config.interval))};Me.find(".carousel-item img",this._element).forEach((e=>{mt.on(e,"dragstart.bs.carousel",(e=>e.preventDefault()))})),this._pointerEvent?(mt.on(this._element,"pointerdown.bs.carousel",(t=>e(t))),mt.on(this._element,"pointerup.bs.carousel",(e=>n(e))),this._element.classList.add("pointer-event")):(mt.on(this._element,"touchstart.bs.carousel",(t=>e(t))),mt.on(this._element,"touchmove.bs.carousel",(e=>t(e))),mt.on(this._element,"touchend.bs.carousel",(e=>n(e))))}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Mt[e.key];t&&(e.preventDefault(),this._slide(t))}_getItemIndex(e){return this._items=e&&e.parentNode?Me.find(".carousel-item",e.parentNode):[],this._items.indexOf(e)}_getItemByOrder(e,t){const n=e===At;return Je(this._items,t,n,this._config.wrap)}_triggerSlideEvent(e,t){const n=this._getItemIndex(e),i=this._getItemIndex(Me.findOne(Bt,this._element));return mt.trigger(this._element,"slide.bs.carousel",{relatedTarget:e,direction:t,from:i,to:n})}_setActiveIndicatorElement(e){if(this._indicatorsElement){const t=Me.findOne(".active",this._indicatorsElement);t.classList.remove(Ot),t.removeAttribute("aria-current");const n=Me.find("[data-bs-target]",this._indicatorsElement);for(let t=0;t<n.length;t++)if(Number.parseInt(n[t].getAttribute("data-bs-slide-to"),10)===this._getItemIndex(e)){n[t].classList.add(Ot),n[t].setAttribute("aria-current","true");break}}}_updateInterval(){const e=this._activeElement||Me.findOne(Bt,this._element);if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);t?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=t):this._config.interval=this._config.defaultInterval||this._config.interval}_slide(e,t){const n=this._directionToOrder(e),i=Me.findOne(Bt,this._element),r=this._getItemIndex(i),o=t||this._getItemByOrder(n,i),s=this._getItemIndex(o),a=Boolean(this._interval),l=n===At,u=l?"carousel-item-start":"carousel-item-end",c=l?"carousel-item-next":"carousel-item-prev",h=this._orderToDirection(n);if(o&&o.classList.contains(Ot))return void(this._isSliding=!1);if(this._isSliding)return;if(this._triggerSlideEvent(o,h).defaultPrevented)return;if(!i||!o)return;this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(o),this._activeElement=o;const d=()=>{mt.trigger(this._element,Nt,{relatedTarget:o,direction:h,from:r,to:s})};if(this._element.classList.contains("slide")){o.classList.add(c),Ve(o),i.classList.add(u),o.classList.add(u);const e=()=>{o.classList.remove(u,c),o.classList.add(Ot),i.classList.remove(Ot,c,u),this._isSliding=!1,setTimeout(d,0)};this._queueCallback(e,i,!0)}else i.classList.remove(Ot),o.classList.add(Ot),this._isSliding=!1,d();a&&this.cycle()}_directionToOrder(e){return[Lt,Ft].includes(e)?Xe()?e===Ft?Tt:At:e===Ft?At:Tt:e}_orderToDirection(e){return[At,Tt].includes(e)?Xe()?e===Tt?Ft:Lt:e===Tt?Lt:Ft:e}static carouselInterface(e,t){const n=zt.getOrCreateInstance(e,t);let{_config:i}=n;"object"==typeof t&&(i={...i,...t});const r="string"==typeof t?t:i.slide;if("number"==typeof t)n.to(t);else if("string"==typeof r){if(void 0===n[r])throw new TypeError(`No method named "${r}"`);n[r]()}else i.interval&&i.ride&&(n.pause(),n.cycle())}static jQueryInterface(e){return this.each((function(){zt.carouselInterface(this,e)}))}static dataApiClickHandler(e){const t=ze(this);if(!t||!t.classList.contains("carousel"))return;const n={...kt.getDataAttributes(t),...kt.getDataAttributes(this)},i=this.getAttribute("data-bs-slide-to");i&&(n.interval=!1),zt.carouselInterface(t,n),i&&zt.getInstance(t).to(i),e.preventDefault()}}mt.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",zt.dataApiClickHandler),mt.on(window,"load.bs.carousel.data-api",(()=>{const e=Me.find('[data-bs-ride="carousel"]');for(let t=0,n=e.length;t<n;t++)zt.carouselInterface(e[t],zt.getInstance(e[t]))})),Ye(zt);const Pt="collapse",Ht={toggle:!0,parent:""},Rt={toggle:"boolean",parent:"(string|element)"},Wt="show",jt="collapse",$t="collapsing",qt="collapsed",Ut="width",Vt='[data-bs-toggle="collapse"]';class Gt extends yt{constructor(e,t){super(e),this._isTransitioning=!1,this._config=this._getConfig(t),this._triggerArray=Me.find(`${Vt}[href="#${this._element.id}"],${Vt}[data-bs-target="#${this._element.id}"]`);const n=Me.find(Vt);for(let e=0,t=n.length;e<t;e++){const t=n[e],i=Ie(t),r=Me.find(i).filter((e=>e===this._element));null!==i&&r.length&&(this._selector=i,this._triggerArray.push(t))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}static get Default(){return Ht}static get NAME(){return Pt}toggle(){this._element.classList.contains(Wt)?this.hide():this.show()}show(){if(this._isTransitioning||this._element.classList.contains(Wt))return;let e,t;this._parent&&(e=Me.find(".show, .collapsing",this._parent).filter((e=>"string"==typeof this._config.parent?e.getAttribute("data-bs-parent")===this._config.parent:e.classList.contains(jt))),0===e.length&&(e=null));const n=Me.findOne(this._selector);if(e){const i=e.find((e=>n!==e));if(t=i?Gt.getInstance(i):null,t&&t._isTransitioning)return}if(mt.trigger(this._element,"show.bs.collapse").defaultPrevented)return;e&&e.forEach((e=>{n!==e&&Gt.collapseInterface(e,"hide"),t||vt.set(e,"bs.collapse",null)}));const i=this._getDimension();this._element.classList.remove(jt),this._element.classList.add($t),this._element.style[i]=0,this._triggerArray.length&&this._triggerArray.forEach((e=>{e.classList.remove(qt),e.setAttribute("aria-expanded",!0)})),this.setTransitioning(!0);const r=`scroll${i[0].toUpperCase()+i.slice(1)}`;this._queueCallback((()=>{this._element.classList.remove($t),this._element.classList.add(jt,Wt),this._element.style[i]="",this.setTransitioning(!1),mt.trigger(this._element,"shown.bs.collapse")}),this._element,!0),this._element.style[i]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._element.classList.contains(Wt))return;if(mt.trigger(this._element,"hide.bs.collapse").defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,Ve(this._element),this._element.classList.add($t),this._element.classList.remove(jt,Wt);const t=this._triggerArray.length;if(t>0)for(let e=0;e<t;e++){const t=this._triggerArray[e],n=ze(t);n&&!n.classList.contains(Wt)&&(t.classList.add(qt),t.setAttribute("aria-expanded",!1))}this.setTransitioning(!0),this._element.style[e]="",this._queueCallback((()=>{this.setTransitioning(!1),this._element.classList.remove($t),this._element.classList.add(jt),mt.trigger(this._element,"hidden.bs.collapse")}),this._element,!0)}setTransitioning(e){this._isTransitioning=e}_getConfig(e){return(e={...Ht,...e}).toggle=Boolean(e.toggle),We(Pt,e,Rt),e}_getDimension(){return this._element.classList.contains(Ut)?Ut:"height"}_getParent(){let{parent:e}=this._config;e=Re(e);const t=`${Vt}[data-bs-parent="${e}"]`;return Me.find(t,e).forEach((e=>{const t=ze(e);this._addAriaAndCollapsedClass(t,[e])})),e}_addAriaAndCollapsedClass(e,t){if(!e||!t.length)return;const n=e.classList.contains(Wt);t.forEach((e=>{n?e.classList.remove(qt):e.classList.add(qt),e.setAttribute("aria-expanded",n)}))}static collapseInterface(e,t){let n=Gt.getInstance(e);const i={...Ht,...kt.getDataAttributes(e),..."object"==typeof t&&t?t:{}};if(!n&&i.toggle&&"string"==typeof t&&/show|hide/.test(t)&&(i.toggle=!1),n||(n=new Gt(e,i)),"string"==typeof t){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t]()}}static jQueryInterface(e){return this.each((function(){Gt.collapseInterface(this,e)}))}}mt.on(document,"click.bs.collapse.data-api",Vt,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();const t=kt.getDataAttributes(this),n=Ie(this);Me.find(n).forEach((e=>{const n=Gt.getInstance(e);let i;n?(null===n._parent&&"string"==typeof t.parent&&(n._config.parent=t.parent,n._parent=n._getParent()),i="toggle"):i=t,Gt.collapseInterface(e,i)}))})),Ye(Gt);const Kt="dropdown",Xt="Escape",Yt="Space",Zt="ArrowUp",Qt="ArrowDown",Jt=new RegExp("ArrowUp|ArrowDown|Escape"),en="click.bs.dropdown.data-api",tn="keydown.bs.dropdown.data-api",nn="show",rn='[data-bs-toggle="dropdown"]',on=".dropdown-menu",sn=Xe()?"top-end":"top-start",an=Xe()?"top-start":"top-end",ln=Xe()?"bottom-end":"bottom-start",un=Xe()?"bottom-start":"bottom-end",cn=Xe()?"left-start":"right-start",hn=Xe()?"right-start":"left-start",dn={offset:[0,2],boundary:"clippingParents",reference:"toggle",display:"dynamic",popperConfig:null,autoClose:!0},fn={offset:"(array|string|function)",boundary:"(string|element)",reference:"(string|element|object)",display:"string",popperConfig:"(null|object|function)",autoClose:"(boolean|string)"};class pn extends yt{constructor(e,t){super(e),this._popper=null,this._config=this._getConfig(t),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}static get Default(){return dn}static get DefaultType(){return fn}static get NAME(){return Kt}toggle(){$e(this._element)||(this._element.classList.contains(nn)?this.hide():this.show())}show(){if($e(this._element)||this._menu.classList.contains(nn))return;const e=pn.getParentFromElement(this._element),t={relatedTarget:this._element};if(!mt.trigger(this._element,"show.bs.dropdown",t).defaultPrevented){if(this._inNavbar)kt.setDataAttribute(this._menu,"popper","none");else{if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=e:He(this._config.reference)?t=Re(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const n=this._getPopperConfig(),r=n.modifiers.find((e=>"applyStyles"===e.name&&!1===e.enabled));this._popper=Fe(t,this._menu,n),r&&kt.setDataAttribute(this._menu,"popper","static")}"ontouchstart"in document.documentElement&&!e.closest(".navbar-nav")&&[].concat(...document.body.children).forEach((e=>mt.on(e,"mouseover",Ue))),this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.toggle(nn),this._element.classList.toggle(nn),mt.trigger(this._element,"shown.bs.dropdown",t)}}hide(){if($e(this._element)||!this._menu.classList.contains(nn))return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_addEventListeners(){mt.on(this._element,"click.bs.dropdown",(e=>{e.preventDefault(),this.toggle()}))}_completeHide(e){mt.trigger(this._element,"hide.bs.dropdown",e).defaultPrevented||("ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((e=>mt.off(e,"mouseover",Ue))),this._popper&&this._popper.destroy(),this._menu.classList.remove(nn),this._element.classList.remove(nn),this._element.setAttribute("aria-expanded","false"),kt.removeDataAttribute(this._menu,"popper"),mt.trigger(this._element,"hidden.bs.dropdown",e))}_getConfig(e){if(e={...this.constructor.Default,...kt.getDataAttributes(this._element),...e},We(Kt,e,this.constructor.DefaultType),"object"==typeof e.reference&&!He(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Kt.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_getMenuElement(){return Me.next(this._element,on)[0]}_getPlacement(){const e=this._element.parentNode;if(e.classList.contains("dropend"))return cn;if(e.classList.contains("dropstart"))return hn;const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?an:sn:t?un:ln}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return"static"===this._config.display&&(e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){const n=Me.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(je);n.length&&Je(n,t,e===Qt,!n.includes(t)).focus()}static dropdownInterface(e,t){const n=pn.getOrCreateInstance(e,t);if("string"==typeof t){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t]()}}static jQueryInterface(e){return this.each((function(){pn.dropdownInterface(this,e)}))}static clearMenus(e){if(e&&(2===e.button||"keyup"===e.type&&"Tab"!==e.key))return;const t=Me.find(rn);for(let n=0,i=t.length;n<i;n++){const i=pn.getInstance(t[n]);if(!i||!1===i._config.autoClose)continue;if(!i._element.classList.contains(nn))continue;const r={relatedTarget:i._element};if(e){const t=e.composedPath(),n=t.includes(i._menu);if(t.includes(i._element)||"inside"===i._config.autoClose&&!n||"outside"===i._config.autoClose&&n)continue;if(i._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;"click"===e.type&&(r.clickEvent=e)}i._completeHide(r)}}static getParentFromElement(e){return ze(e)||e.parentNode}static dataApiKeydownHandler(e){if(/input|textarea/i.test(e.target.tagName)?e.key===Yt||e.key!==Xt&&(e.key!==Qt&&e.key!==Zt||e.target.closest(on)):!Jt.test(e.key))return;const t=this.classList.contains(nn);if(!t&&e.key===Xt)return;if(e.preventDefault(),e.stopPropagation(),$e(this))return;const n=()=>this.matches(rn)?this:Me.prev(this,rn)[0];return e.key===Xt?(n().focus(),void pn.clearMenus()):e.key===Zt||e.key===Qt?(t||n().click(),void pn.getInstance(n())._selectMenuItem(e)):void(t&&e.key!==Yt||pn.clearMenus())}}mt.on(document,tn,rn,pn.dataApiKeydownHandler),mt.on(document,tn,on,pn.dataApiKeydownHandler),mt.on(document,en,pn.clearMenus),mt.on(document,"keyup.bs.dropdown.data-api",pn.clearMenus),mt.on(document,en,rn,(function(e){e.preventDefault(),pn.dropdownInterface(this)})),Ye(pn);const mn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",gn=".sticky-top";class vn{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"paddingRight",(t=>t+e)),this._setElementAttributes(mn,"paddingRight",(t=>t+e)),this._setElementAttributes(gn,"marginRight",(t=>t-e))}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e)[t];e.style[t]=`${n(Number.parseFloat(r))}px`}))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(mn,"paddingRight"),this._resetElementAttributes(gn,"marginRight")}_saveInitialAttribute(e,t){const n=e.style[t];n&&kt.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const n=kt.getDataAttribute(e,t);void 0===n?e.style.removeProperty(t):(kt.removeDataAttribute(e,t),e.style[t]=n)}))}_applyManipulationCallback(e,t){He(e)?t(e):Me.find(e,this._element).forEach(t)}isOverflowing(){return this.getWidth()>0}}const yn={isVisible:!0,isAnimated:!1,rootElement:"body",clickCallback:null},bn={isVisible:"boolean",isAnimated:"boolean",rootElement:"(element|string)",clickCallback:"(function|null)"},xn="show",wn="mousedown.bs.backdrop";class Dn{constructor(e){this._config=this._getConfig(e),this._isAppended=!1,this._element=null}show(e){this._config.isVisible?(this._append(),this._config.isAnimated&&Ve(this._getElement()),this._getElement().classList.add(xn),this._emulateAnimation((()=>{Ze(e)}))):Ze(e)}hide(e){this._config.isVisible?(this._getElement().classList.remove(xn),this._emulateAnimation((()=>{this.dispose(),Ze(e)}))):Ze(e)}_getElement(){if(!this._element){const e=document.createElement("div");e.className="modal-backdrop",this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_getConfig(e){return(e={...yn,..."object"==typeof e?e:{}}).rootElement=Re(e.rootElement),We("backdrop",e,bn),e}_append(){this._isAppended||(this._config.rootElement.appendChild(this._getElement()),mt.on(this._getElement(),wn,(()=>{Ze(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(mt.off(this._element,wn),this._element.remove(),this._isAppended=!1)}_emulateAnimation(e){Qe(e,this._getElement(),this._config.isAnimated)}}const Cn="modal",kn="Escape",_n={backdrop:!0,keyboard:!0,focus:!0},En={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},Sn="hidden.bs.modal",An="show.bs.modal",Tn="focusin.bs.modal",Fn="resize.bs.modal",Ln="click.dismiss.bs.modal",Mn="keydown.dismiss.bs.modal",Nn="mousedown.dismiss.bs.modal",On="modal-open",Bn="show",In="modal-static";class zn extends yt{constructor(e,t){super(e),this._config=this._getConfig(t),this._dialog=Me.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new vn}static get Default(){return _n}static get NAME(){return Cn}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||mt.trigger(this._element,An,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(On),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),mt.on(this._element,Ln,'[data-bs-dismiss="modal"]',(e=>this.hide(e))),mt.on(this._dialog,Nn,(()=>{mt.one(this._element,"mouseup.dismiss.bs.modal",(e=>{e.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(e))))}hide(e){if(e&&["A","AREA"].includes(e.target.tagName)&&e.preventDefault(),!this._isShown||this._isTransitioning)return;if(mt.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),mt.off(document,Tn),this._element.classList.remove(Bn),mt.off(this._element,Ln),mt.off(this._dialog,Nn),this._queueCallback((()=>this._hideModal()),this._element,t)}dispose(){[window,this._dialog].forEach((e=>mt.off(e,".bs.modal"))),this._backdrop.dispose(),super.dispose(),mt.off(document,Tn)}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Dn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_getConfig(e){return e={..._n,...kt.getDataAttributes(this._element),..."object"==typeof e?e:{}},We(Cn,e,En),e}_showElement(e){const t=this._isAnimated(),n=Me.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,n&&(n.scrollTop=0),t&&Ve(this._element),this._element.classList.add(Bn),this._config.focus&&this._enforceFocus(),this._queueCallback((()=>{this._config.focus&&this._element.focus(),this._isTransitioning=!1,mt.trigger(this._element,"shown.bs.modal",{relatedTarget:e})}),this._dialog,t)}_enforceFocus(){mt.off(document,Tn),mt.on(document,Tn,(e=>{document===e.target||this._element===e.target||this._element.contains(e.target)||this._element.focus()}))}_setEscapeEvent(){this._isShown?mt.on(this._element,Mn,(e=>{this._config.keyboard&&e.key===kn?(e.preventDefault(),this.hide()):this._config.keyboard||e.key!==kn||this._triggerBackdropTransition()})):mt.off(this._element,Mn)}_setResizeEvent(){this._isShown?mt.on(window,Fn,(()=>this._adjustDialog())):mt.off(window,Fn)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(On),this._resetAdjustments(),this._scrollBar.reset(),mt.trigger(this._element,Sn)}))}_showBackdrop(e){mt.on(this._element,Ln,(e=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:e.target===e.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(e)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(mt.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const{classList:e,scrollHeight:t,style:n}=this._element,i=t>document.documentElement.clientHeight;!i&&"hidden"===n.overflowY||e.contains(In)||(i||(n.overflowY="hidden"),e.add(In),this._queueCallback((()=>{e.remove(In),i||this._queueCallback((()=>{n.overflowY=""}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;(!n&&e&&!Xe()||n&&!e&&Xe())&&(this._element.style.paddingLeft=`${t}px`),(n&&!e&&!Xe()||!n&&e&&Xe())&&(this._element.style.paddingRight=`${t}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const n=zn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e](t)}}))}}mt.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',(function(e){const t=ze(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),mt.one(t,An,(e=>{e.defaultPrevented||mt.one(t,Sn,(()=>{je(this)&&this.focus()}))})),zn.getOrCreateInstance(t).toggle(this)})),Ye(zn);const Pn="offcanvas",Hn={backdrop:!0,keyboard:!0,scroll:!1},Rn={backdrop:"boolean",keyboard:"boolean",scroll:"boolean"},Wn="show",jn=".offcanvas.show",$n="hidden.bs.offcanvas",qn="focusin.bs.offcanvas";class Un extends yt{constructor(e,t){super(e),this._config=this._getConfig(t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._addEventListeners()}static get NAME(){return Pn}static get Default(){return Hn}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||mt.trigger(this._element,"show.bs.offcanvas",{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._element.style.visibility="visible",this._backdrop.show(),this._config.scroll||((new vn).hide(),this._enforceFocusOnElement(this._element)),this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Wn),this._queueCallback((()=>{mt.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:e})}),this._element,!0))}hide(){this._isShown&&(mt.trigger(this._element,"hide.bs.offcanvas").defaultPrevented||(mt.off(document,qn),this._element.blur(),this._isShown=!1,this._element.classList.remove(Wn),this._backdrop.hide(),this._queueCallback((()=>{this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._element.style.visibility="hidden",this._config.scroll||(new vn).reset(),mt.trigger(this._element,$n)}),this._element,!0)))}dispose(){this._backdrop.dispose(),super.dispose(),mt.off(document,qn)}_getConfig(e){return e={...Hn,...kt.getDataAttributes(this._element),..."object"==typeof e?e:{}},We(Pn,e,Rn),e}_initializeBackDrop(){return new Dn({isVisible:this._config.backdrop,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:()=>this.hide()})}_enforceFocusOnElement(e){mt.off(document,qn),mt.on(document,qn,(t=>{document===t.target||e===t.target||e.contains(t.target)||e.focus()})),e.focus()}_addEventListeners(){mt.on(this._element,"click.dismiss.bs.offcanvas",'[data-bs-dismiss="offcanvas"]',(()=>this.hide())),mt.on(this._element,"keydown.dismiss.bs.offcanvas",(e=>{this._config.keyboard&&"Escape"===e.key&&this.hide()}))}static jQueryInterface(e){return this.each((function(){const t=Un.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}mt.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',(function(e){const t=ze(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),$e(this))return;mt.one(t,$n,(()=>{je(this)&&this.focus()}));const n=Me.findOne(jn);n&&n!==t&&Un.getInstance(n).hide(),Un.getOrCreateInstance(t).toggle(this)})),mt.on(window,"load.bs.offcanvas.data-api",(()=>Me.find(jn).forEach((e=>Un.getOrCreateInstance(e).show())))),Ye(Un);const Vn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Gn=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i,Kn=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,Xn=(e,t)=>{const n=e.nodeName.toLowerCase();if(t.includes(n))return!Vn.has(n)||Boolean(Gn.test(e.nodeValue)||Kn.test(e.nodeValue));const i=t.filter((e=>e instanceof RegExp));for(let e=0,t=i.length;e<t;e++)if(i[e].test(n))return!0;return!1};function Yn(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),r=Object.keys(t),o=[].concat(...i.body.querySelectorAll("*"));for(let e=0,n=o.length;e<n;e++){const n=o[e],i=n.nodeName.toLowerCase();if(!r.includes(i)){n.remove();continue}const s=[].concat(...n.attributes),a=[].concat(t["*"]||[],t[i]||[]);s.forEach((e=>{Xn(e,a)||n.removeAttribute(e.nodeName)}))}return i.body.innerHTML}const Zn="tooltip",Qn=new RegExp("(^|\\s)bs-tooltip\\S+","g"),Jn=new Set(["sanitize","allowList","sanitizeFn"]),ei={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(array|string|function)",container:"(string|element|boolean)",fallbackPlacements:"array",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",allowList:"object",popperConfig:"(null|object|function)"},ti={AUTO:"auto",TOP:"top",RIGHT:Xe()?"left":"right",BOTTOM:"bottom",LEFT:Xe()?"right":"left"},ni={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:[0,0],container:!1,fallbackPlacements:["top","right","bottom","left"],boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},ii={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},ri="fade",oi="show",si="show",ai="out",li="hover",ui="focus";class ci extends yt{constructor(e,t){if(void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this._config=this._getConfig(t),this.tip=null,this._setListeners()}static get Default(){return ni}static get NAME(){return Zn}static get Event(){return ii}static get DefaultType(){return ei}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(e){if(this._isEnabled)if(e){const t=this._initializeOnDelegatedTarget(e);t._activeTrigger.click=!t._activeTrigger.click,t._isWithActiveTrigger()?t._enter(null,t):t._leave(null,t)}else{if(this.getTipElement().classList.contains(oi))return void this._leave(null,this);this._enter(null,this)}}dispose(){clearTimeout(this._timeout),mt.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.tip&&this.tip.remove(),this._popper&&this._popper.destroy(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this.isWithContent()||!this._isEnabled)return;const e=mt.trigger(this._element,this.constructor.Event.SHOW),t=qe(this._element),n=null===t?this._element.ownerDocument.documentElement.contains(this._element):t.contains(this._element);if(e.defaultPrevented||!n)return;const i=this.getTipElement(),r=Oe(this.constructor.NAME);i.setAttribute("id",r),this._element.setAttribute("aria-describedby",r),this.setContent(),this._config.animation&&i.classList.add(ri);const o="function"==typeof this._config.placement?this._config.placement.call(this,i,this._element):this._config.placement,s=this._getAttachment(o);this._addAttachmentClass(s);const{container:a}=this._config;vt.set(i,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||(a.appendChild(i),mt.trigger(this._element,this.constructor.Event.INSERTED)),this._popper?this._popper.update():this._popper=Fe(this._element,i,this._getPopperConfig(s)),i.classList.add(oi);const l="function"==typeof this._config.customClass?this._config.customClass():this._config.customClass;l&&i.classList.add(...l.split(" ")),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((e=>{mt.on(e,"mouseover",Ue)}));const u=this.tip.classList.contains(ri);this._queueCallback((()=>{const e=this._hoverState;this._hoverState=null,mt.trigger(this._element,this.constructor.Event.SHOWN),e===ai&&this._leave(null,this)}),this.tip,u)}hide(){if(!this._popper)return;const e=this.getTipElement();if(mt.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented)return;e.classList.remove(oi),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((e=>mt.off(e,"mouseover",Ue))),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1;const t=this.tip.classList.contains(ri);this._queueCallback((()=>{this._isWithActiveTrigger()||(this._hoverState!==si&&e.remove(),this._cleanTipClass(),this._element.removeAttribute("aria-describedby"),mt.trigger(this._element,this.constructor.Event.HIDDEN),this._popper&&(this._popper.destroy(),this._popper=null))}),this.tip,t),this._hoverState=""}update(){null!==this._popper&&this._popper.update()}isWithContent(){return Boolean(this.getTitle())}getTipElement(){if(this.tip)return this.tip;const e=document.createElement("div");return e.innerHTML=this._config.template,this.tip=e.children[0],this.tip}setContent(){const e=this.getTipElement();this.setElementContent(Me.findOne(".tooltip-inner",e),this.getTitle()),e.classList.remove(ri,oi)}setElementContent(e,t){if(null!==e)return He(t)?(t=Re(t),void(this._config.html?t.parentNode!==e&&(e.innerHTML="",e.appendChild(t)):e.textContent=t.textContent)):void(this._config.html?(this._config.sanitize&&(t=Yn(t,this._config.allowList,this._config.sanitizeFn)),e.innerHTML=t):e.textContent=t)}getTitle(){let e=this._element.getAttribute("data-bs-original-title");return e||(e="function"==typeof this._config.title?this._config.title.call(this._element):this._config.title),e}updateAttachment(e){return"right"===e?"end":"left"===e?"start":e}_initializeOnDelegatedTarget(e,t){const n=this.constructor.DATA_KEY;return(t=t||vt.get(e.delegateTarget,n))||(t=new this.constructor(e.delegateTarget,this._getDelegateConfig()),vt.set(e.delegateTarget,n,t)),t}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:e=>this._handlePopperPlacementChange(e)}],onFirstUpdate:e=>{e.options.placement!==e.placement&&this._handlePopperPlacementChange(e)}};return{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_addAttachmentClass(e){this.getTipElement().classList.add(`bs-tooltip-${this.updateAttachment(e)}`)}_getAttachment(e){return ti[e.toUpperCase()]}_setListeners(){this._config.trigger.split(" ").forEach((e=>{if("click"===e)mt.on(this._element,this.constructor.Event.CLICK,this._config.selector,(e=>this.toggle(e)));else if("manual"!==e){const t=e===li?this.constructor.Event.MOUSEENTER:this.constructor.Event.FOCUSIN,n=e===li?this.constructor.Event.MOUSELEAVE:this.constructor.Event.FOCUSOUT;mt.on(this._element,t,this._config.selector,(e=>this._enter(e))),mt.on(this._element,n,this._config.selector,(e=>this._leave(e)))}})),this._hideModalHandler=()=>{this._element&&this.hide()},mt.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this._config.selector?this._config={...this._config,trigger:"manual",selector:""}:this._fixTitle()}_fixTitle(){const e=this._element.getAttribute("title"),t=typeof this._element.getAttribute("data-bs-original-title");(e||"string"!==t)&&(this._element.setAttribute("data-bs-original-title",e||""),!e||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",e),this._element.setAttribute("title",""))}_enter(e,t){t=this._initializeOnDelegatedTarget(e,t),e&&(t._activeTrigger["focusin"===e.type?ui:li]=!0),t.getTipElement().classList.contains(oi)||t._hoverState===si?t._hoverState=si:(clearTimeout(t._timeout),t._hoverState=si,t._config.delay&&t._config.delay.show?t._timeout=setTimeout((()=>{t._hoverState===si&&t.show()}),t._config.delay.show):t.show())}_leave(e,t){t=this._initializeOnDelegatedTarget(e,t),e&&(t._activeTrigger["focusout"===e.type?ui:li]=t._element.contains(e.relatedTarget)),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState=ai,t._config.delay&&t._config.delay.hide?t._timeout=setTimeout((()=>{t._hoverState===ai&&t.hide()}),t._config.delay.hide):t.hide())}_isWithActiveTrigger(){for(const e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1}_getConfig(e){const t=kt.getDataAttributes(this._element);return Object.keys(t).forEach((e=>{Jn.has(e)&&delete t[e]})),(e={...this.constructor.Default,...t,..."object"==typeof e&&e?e:{}}).container=!1===e.container?document.body:Re(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),We(Zn,e,this.constructor.DefaultType),e.sanitize&&(e.template=Yn(e.template,e.allowList,e.sanitizeFn)),e}_getDelegateConfig(){const e={};if(this._config)for(const t in this._config)this.constructor.Default[t]!==this._config[t]&&(e[t]=this._config[t]);return e}_cleanTipClass(){const e=this.getTipElement(),t=e.getAttribute("class").match(Qn);null!==t&&t.length>0&&t.map((e=>e.trim())).forEach((t=>e.classList.remove(t)))}_handlePopperPlacementChange(e){const{state:t}=e;t&&(this.tip=t.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(t.placement)))}static jQueryInterface(e){return this.each((function(){const t=ci.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Ye(ci);const hi=new RegExp("(^|\\s)bs-popover\\S+","g"),di={...ci.Default,placement:"right",offset:[0,8],trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'},fi={...ci.DefaultType,content:"(string|element|function)"},pi={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},mi=".popover-header",gi=".popover-body";class vi extends ci{static get Default(){return di}static get NAME(){return"popover"}static get Event(){return pi}static get DefaultType(){return fi}isWithContent(){return this.getTitle()||this._getContent()}getTipElement(){return this.tip||(this.tip=super.getTipElement(),this.getTitle()||Me.findOne(mi,this.tip).remove(),this._getContent()||Me.findOne(gi,this.tip).remove()),this.tip}setContent(){const e=this.getTipElement();this.setElementContent(Me.findOne(mi,e),this.getTitle());let t=this._getContent();"function"==typeof t&&(t=t.call(this._element)),this.setElementContent(Me.findOne(gi,e),t),e.classList.remove("fade","show")}_addAttachmentClass(e){this.getTipElement().classList.add(`bs-popover-${this.updateAttachment(e)}`)}_getContent(){return this._element.getAttribute("data-bs-content")||this._config.content}_cleanTipClass(){const e=this.getTipElement(),t=e.getAttribute("class").match(hi);null!==t&&t.length>0&&t.map((e=>e.trim())).forEach((t=>e.classList.remove(t)))}static jQueryInterface(e){return this.each((function(){const t=vi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Ye(vi);const yi="scrollspy",bi={offset:10,method:"auto",target:""},xi={offset:"number",method:"string",target:"(string|element)"},wi="active",Di="position";class Ci extends yt{constructor(e,t){super(e),this._scrollElement="BODY"===this._element.tagName?window:this._element,this._config=this._getConfig(t),this._selector=`${this._config.target} .nav-link, ${this._config.target} .list-group-item, ${this._config.target} .dropdown-item`,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,mt.on(this._scrollElement,"scroll.bs.scrollspy",(()=>this._process())),this.refresh(),this._process()}static get Default(){return bi}static get NAME(){return yi}refresh(){const e=this._scrollElement===this._scrollElement.window?"offset":Di,t="auto"===this._config.method?e:this._config.method,n=t===Di?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),Me.find(this._selector).map((e=>{const i=Ie(e),r=i?Me.findOne(i):null;if(r){const e=r.getBoundingClientRect();if(e.width||e.height)return[kt[t](r).top+n,i]}return null})).filter((e=>e)).sort(((e,t)=>e[0]-t[0])).forEach((e=>{this._offsets.push(e[0]),this._targets.push(e[1])}))}dispose(){mt.off(this._scrollElement,".bs.scrollspy"),super.dispose()}_getConfig(e){if("string"!=typeof(e={...bi,...kt.getDataAttributes(this._element),..."object"==typeof e&&e?e:{}}).target&&He(e.target)){let{id:t}=e.target;t||(t=Oe(yi),e.target.id=t),e.target=`#${t}`}return We(yi,e,xi),e}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),n=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=n){const e=this._targets[this._targets.length-1];this._activeTarget!==e&&this._activate(e)}else{if(this._activeTarget&&e<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(let t=this._offsets.length;t--;)this._activeTarget!==this._targets[t]&&e>=this._offsets[t]&&(void 0===this._offsets[t+1]||e<this._offsets[t+1])&&this._activate(this._targets[t])}}_activate(e){this._activeTarget=e,this._clear();const t=this._selector.split(",").map((t=>`${t}[data-bs-target="${e}"],${t}[href="${e}"]`)),n=Me.findOne(t.join(","));n.classList.contains("dropdown-item")?(Me.findOne(".dropdown-toggle",n.closest(".dropdown")).classList.add(wi),n.classList.add(wi)):(n.classList.add(wi),Me.parents(n,".nav, .list-group").forEach((e=>{Me.prev(e,".nav-link, .list-group-item").forEach((e=>e.classList.add(wi))),Me.prev(e,".nav-item").forEach((e=>{Me.children(e,".nav-link").forEach((e=>e.classList.add(wi)))}))}))),mt.trigger(this._scrollElement,"activate.bs.scrollspy",{relatedTarget:e})}_clear(){Me.find(this._selector).filter((e=>e.classList.contains(wi))).forEach((e=>e.classList.remove(wi)))}static jQueryInterface(e){return this.each((function(){const t=Ci.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}mt.on(window,"load.bs.scrollspy.data-api",(()=>{Me.find('[data-bs-spy="scroll"]').forEach((e=>new Ci(e)))})),Ye(Ci);const ki="active",_i="fade",Ei="show",Si=".active",Ai=":scope > li > .active";class Ti extends yt{static get NAME(){return"tab"}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains(ki))return;let e;const t=ze(this._element),n=this._element.closest(".nav, .list-group");if(n){const t="UL"===n.nodeName||"OL"===n.nodeName?Ai:Si;e=Me.find(t,n),e=e[e.length-1]}const i=e?mt.trigger(e,"hide.bs.tab",{relatedTarget:this._element}):null;if(mt.trigger(this._element,"show.bs.tab",{relatedTarget:e}).defaultPrevented||null!==i&&i.defaultPrevented)return;this._activate(this._element,n);const r=()=>{mt.trigger(e,"hidden.bs.tab",{relatedTarget:this._element}),mt.trigger(this._element,"shown.bs.tab",{relatedTarget:e})};t?this._activate(t,t.parentNode,r):r()}_activate(e,t,n){const i=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?Me.children(t,Si):Me.find(Ai,t))[0],r=n&&i&&i.classList.contains(_i),o=()=>this._transitionComplete(e,i,n);i&&r?(i.classList.remove(Ei),this._queueCallback(o,e,!0)):o()}_transitionComplete(e,t,n){if(t){t.classList.remove(ki);const e=Me.findOne(":scope > .dropdown-menu .active",t.parentNode);e&&e.classList.remove(ki),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}e.classList.add(ki),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),Ve(e),e.classList.contains(_i)&&e.classList.add(Ei);let i=e.parentNode;if(i&&"LI"===i.nodeName&&(i=i.parentNode),i&&i.classList.contains("dropdown-menu")){const t=e.closest(".dropdown");t&&Me.find(".dropdown-toggle",t).forEach((e=>e.classList.add(ki))),e.setAttribute("aria-expanded",!0)}n&&n()}static jQueryInterface(e){return this.each((function(){const t=Ti.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}mt.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),$e(this)||Ti.getOrCreateInstance(this).show()})),Ye(Ti);const Fi="toast",Li="hide",Mi="show",Ni="showing",Oi={animation:"boolean",autohide:"boolean",delay:"number"},Bi={animation:!0,autohide:!0,delay:5e3};class Ii extends yt{constructor(e,t){super(e),this._config=this._getConfig(t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get DefaultType(){return Oi}static get Default(){return Bi}static get NAME(){return Fi}show(){mt.trigger(this._element,"show.bs.toast").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Li),Ve(this._element),this._element.classList.add(Ni),this._queueCallback((()=>{this._element.classList.remove(Ni),this._element.classList.add(Mi),mt.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this._element.classList.contains(Mi)&&(mt.trigger(this._element,"hide.bs.toast").defaultPrevented||(this._element.classList.remove(Mi),this._queueCallback((()=>{this._element.classList.add(Li),mt.trigger(this._element,"hidden.bs.toast")}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this._element.classList.contains(Mi)&&this._element.classList.remove(Mi),super.dispose()}_getConfig(e){return e={...Bi,...kt.getDataAttributes(this._element),..."object"==typeof e&&e?e:{}},We(Fi,e,this.constructor.DefaultType),e}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){mt.on(this._element,"click.dismiss.bs.toast",'[data-bs-dismiss="toast"]',(()=>this.hide())),mt.on(this._element,"mouseover.bs.toast",(e=>this._onInteraction(e,!0))),mt.on(this._element,"mouseout.bs.toast",(e=>this._onInteraction(e,!1))),mt.on(this._element,"focusin.bs.toast",(e=>this._onInteraction(e,!0))),mt.on(this._element,"focusout.bs.toast",(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=Ii.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}Ye(Ii)},354:(e,t,n)=>{"use strict";var i=n(581);function r(e){"function"==typeof(e=e||{}).codeMirrorInstance&&"function"==typeof e.codeMirrorInstance.defineMode?(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),e.codeMirrorInstance.defineMode("spell-checker",(function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var s='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',a={token:function(e){var t=e.peek(),n="";if(s.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!s.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},l=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(l,a,!0)}))):console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`")}r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,e.exports=r},994:(e,t,n)=>{!function(e){"use strict";function t(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(n,i){n.state.autoRefresh&&(t(0,n.state.autoRefresh),n.state.autoRefresh=null),i&&0==n.display.wrapper.offsetHeight&&function(n,i){function r(){n.display.wrapper.offsetHeight?(t(0,i),n.display.lastWrapHeight!=n.display.wrapper.clientHeight&&n.refresh()):i.timeout=setTimeout(r,i.delay)}i.timeout=setTimeout(r,i.delay),i.hurry=function(){clearTimeout(i.timeout),i.timeout=setTimeout(r,50)},e.on(window,"mouseup",i.hurry),e.on(window,"keyup",i.hurry)}(n,n.state.autoRefresh={delay:i.delay||250})}))}(n(631))},960:(e,t,n)=>{!function(e){"use strict";e.defineOption("fullScreen",!1,(function(t,n,i){i==e.Init&&(i=!1),!i!=!n&&(n?function(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}(t):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}(t))}))}(n(631))},386:(e,t,n)=>{!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){o(e)&&n(e)}function r(e){var i=e.getWrapperElement(),r=o(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(o,s,a){var l=a&&a!=e.Init;if(s&&!l)o.on("blur",i),o.on("change",r),o.on("swapDoc",r),e.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(e){setTimeout((function(){var i=!1;if(1==e.lineCount()){var r=e.getInputField();i="TEXTAREA"==r.nodeName?!e.getLine(0).length:!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)}i?n(e):t(e)}),20)}(o)}),r(o);else if(!s&&l){o.off("blur",i),o.off("change",r),o.off("swapDoc",r),e.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),t(o);var u=o.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}s&&!o.hasFocus()&&i(o)}))}(n(631))},350:(e,t,n)=>{!function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;function r(e,n){var i=n.line,r=0,o=0,s=t.exec(e.getLine(i)),a=s[1];do{var l=i+(r+=1),u=e.getLine(l),c=t.exec(u);if(c){var h=c[1],d=parseInt(s[3],10)+r-o,f=parseInt(c[3],10),p=f;if(a!==h||isNaN(f)){if(a.length>h.length)return;if(a.length<h.length&&1===r)return;o+=1}else d===f&&(p=f+1),d>f&&(p=d+1),e.replaceRange(u.replace(t,h+p+c[4]+c[5]),{line:l,ch:0},{line:l,ch:u.length})}}while(c)}e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var s=o.listSelections(),a=[],l=0;l<s.length;l++){var u=s[l].head,c=o.getStateAfter(u.line),h=e.innerMode(o.getMode(),c);if("markdown"!==h.mode.name)return void o.execCommand("newlineAndIndent");var d=!1!==(c=h.state).list,f=0!==c.quote,p=o.getLine(u.line),m=t.exec(p),g=/^\s*$/.test(p.slice(0,u.ch));if(!s[l].empty()||!d&&!f||!m||g)return void o.execCommand("newlineAndIndent");if(n.test(p)){var v=f&&/>\s*$/.test(p),y=!/>\s*$/.test(p);(v||y)&&o.replaceRange("",{line:u.line,ch:0},{line:u.line,ch:u.ch+1}),a[l]="\n"}else{var b=m[1],x=m[5],w=!(i.test(m[2])||m[2].indexOf(">")>=0),D=w?parseInt(m[3],10)+1+m[4]:m[2].replace("x"," ");a[l]="\n"+b+D+x,w&&r(o,u)}}o.replaceSelections(a)}}(n(631))},146:(e,t,n)=>{!function(e){"use strict";e.overlayMode=function(t,n,i){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(i){return{base:e.copyState(t,i.base),overlay:e.copyState(n,i.overlay),basePos:i.basePos,baseCur:null,overlayPos:i.overlayPos,overlayCur:null}},token:function(e,r){return(e!=r.streamSeen||Math.min(r.basePos,r.overlayPos)<e.start)&&(r.streamSeen=e,r.basePos=r.overlayPos=e.start),e.start==r.basePos&&(r.baseCur=t.token(e,r.base),r.basePos=e.pos),e.start==r.overlayPos&&(e.pos=e.start,r.overlayCur=n.token(e,r.overlay),r.overlayPos=e.pos),e.pos=Math.min(r.basePos,r.overlayPos),null==r.overlayCur?r.baseCur:null!=r.baseCur&&r.overlay.combineTokens||i&&null==r.overlay.combineTokens?r.baseCur+" "+r.overlayCur:r.overlayCur},indent:t.indent&&function(e,n,i){return t.indent(e.base,n,i)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var r,o;return t.blankLine&&(r=t.blankLine(e.base)),n.blankLine&&(o=n.blankLine(e.overlay)),null==o?r:i&&null!=r?r+" "+o:o}}}}(n(631))},95:(e,t,n)=>{!function(e){"use strict";var t,n,i=e.Pos;function r(e,t){for(var n=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),i=n,r=0;r<t.length;r++)-1==i.indexOf(t.charAt(r))&&(i+=t.charAt(r));return n==i?e:new RegExp(e.source,i)}function o(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function s(e,t,n){t=r(t,"g");for(var o=n.line,s=n.ch,a=e.lastLine();o<=a;o++,s=0){t.lastIndex=s;var l=e.getLine(o),u=t.exec(l);if(u)return{from:i(o,u.index),to:i(o,u.index+u[0].length),match:u}}}function a(e,t,n){if(!o(t))return s(e,t,n);t=r(t,"gm");for(var a,l=1,u=n.line,c=e.lastLine();u<=c;){for(var h=0;h<l&&!(u>c);h++){var d=e.getLine(u++);a=null==a?d:a+"\n"+d}l*=2,t.lastIndex=n.ch;var f=t.exec(a);if(f){var p=a.slice(0,f.index).split("\n"),m=f[0].split("\n"),g=n.line+p.length-1,v=p[p.length-1].length;return{from:i(g,v),to:i(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:f}}}}function l(e,t,n){for(var i,r=0;r<=e.length;){t.lastIndex=r;var o=t.exec(e);if(!o)break;var s=o.index+o[0].length;if(s>e.length-n)break;(!i||s>i.index+i[0].length)&&(i=o),r=o.index+1}return i}function u(e,t,n){t=r(t,"g");for(var o=n.line,s=n.ch,a=e.firstLine();o>=a;o--,s=-1){var u=e.getLine(o),c=l(u,t,s<0?0:u.length-s);if(c)return{from:i(o,c.index),to:i(o,c.index+c[0].length),match:c}}}function c(e,t,n){if(!o(t))return u(e,t,n);t=r(t,"gm");for(var s,a=1,c=e.getLine(n.line).length-n.ch,h=n.line,d=e.firstLine();h>=d;){for(var f=0;f<a&&h>=d;f++){var p=e.getLine(h--);s=null==s?p:p+"\n"+s}a*=2;var m=l(s,t,c);if(m){var g=s.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=h+g.length,b=g[g.length-1].length;return{from:i(y,b),to:i(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:m}}}}function h(e,t,n,i){if(e.length==t.length)return n;for(var r=0,o=n+Math.max(0,e.length-t.length);;){if(r==o)return r;var s=r+o>>1,a=i(e.slice(0,s)).length;if(a==n)return s;a>n?o=s:r=s+1}}function d(e,r,o,s){if(!r.length)return null;var a=s?t:n,l=a(r).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-l.length;u<=d;u++,c=0){var f=e.getLine(u).slice(c),p=a(f);if(1==l.length){var m=p.indexOf(l[0]);if(-1==m)continue e;return o=h(f,p,m,a)+c,{from:i(u,h(f,p,m,a)+c),to:i(u,h(f,p,m+l[0].length,a)+c)}}var g=p.length-l[0].length;if(p.slice(g)==l[0]){for(var v=1;v<l.length-1;v++)if(a(e.getLine(u+v))!=l[v])continue e;var y=e.getLine(u+l.length-1),b=a(y),x=l[l.length-1];if(b.slice(0,x.length)==x)return{from:i(u,h(f,p,g,a)+c),to:i(u+l.length-1,h(y,b,x.length,a))}}}}function f(e,r,o,s){if(!r.length)return null;var a=s?t:n,l=a(r).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.firstLine()-1+l.length;u>=d;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var p=a(f);if(1==l.length){var m=p.lastIndexOf(l[0]);if(-1==m)continue e;return{from:i(u,h(f,p,m,a)),to:i(u,h(f,p,m+l[0].length,a))}}var g=l[l.length-1];if(p.slice(0,g.length)==g){var v=1;for(o=u-l.length+1;v<l.length-1;v++)if(a(e.getLine(o+v))!=l[v])continue e;var y=e.getLine(u+1-l.length),b=a(y);if(b.slice(b.length-l[0].length)==l[0])return{from:i(u+1-l.length,h(y,b,y.length-l[0].length,a)),to:i(u,h(f,p,g.length,a))}}}}function p(e,t,n,o){var l;this.atOccurrence=!1,this.doc=e,n=n?e.clipPos(n):i(0,0),this.pos={from:n,to:n},"object"==typeof o?l=o.caseFold:(l=o,o=null),"string"==typeof t?(null==l&&(l=!1),this.matches=function(n,i){return(n?f:d)(e,t,i,l)}):(t=r(t,"gm"),o&&!1===o.multiline?this.matches=function(n,i){return(n?u:s)(e,t,i)}:this.matches=function(n,i){return(n?c:a)(e,t,i)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},n=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},n=function(e){return e}),p.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));n&&0==e.cmpPos(n.from,n.to);)t?n.from.ch?n.from=i(n.from.line,n.from.ch-1):n=n.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(i(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=i(n.to.line,n.to.ch+1):n=n.to.line==this.doc.lastLine()?null:this.matches(t,i(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var r=i(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:r,to:r},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new p(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new p(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)}))}(n(631))},20:(e,t,n)=>{!function(e){"use strict";function t(e){e.state.markedSelection&&e.operation((function(){!function(e){if(!e.somethingSelected())return s(e);if(e.listSelections().length>1)return a(e);var t=e.getCursor("start"),n=e.getCursor("end"),i=e.state.markedSelection;if(!i.length)return o(e,t,n);var l=i[0].find(),u=i[i.length-1].find();if(!l||!u||n.line-t.line<=8||r(t,u.to)>=0||r(n,l.from)<=0)return a(e);for(;r(t,l.from)>0;)i.shift().clear(),l=i[0].find();for(r(t,l.from)<0&&(l.to.line-t.line<8?(i.shift().clear(),o(e,t,l.to,0)):o(e,t,l.from,0));r(n,u.to)<0;)i.pop().clear(),u=i[i.length-1].find();r(n,u.to)>0&&(n.line-u.from.line<8?(i.pop().clear(),o(e,u.from,n)):o(e,u.to,n))}(e)}))}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation((function(){s(e)}))}e.defineOption("styleSelectedText",!1,(function(i,r,o){var l=o&&o!=e.Init;r&&!l?(i.state.markedSelection=[],i.state.markedSelectionStyle="string"==typeof r?r:"CodeMirror-selectedtext",a(i),i.on("cursorActivity",t),i.on("change",n)):!r&&l&&(i.off("cursorActivity",t),i.off("change",n),s(i),i.state.markedSelection=i.state.markedSelectionStyle=null)}));var i=e.Pos,r=e.cmpPos;function o(e,t,n,o){if(0!=r(t,n))for(var s=e.state.markedSelection,a=e.state.markedSelectionStyle,l=t.line;;){var u=l==t.line?t:i(l,0),c=l+8,h=c>=n.line,d=h?n:i(c,0),f=e.markText(u,d,{className:a});if(null==o?s.push(f):s.splice(o++,0,f),h)break;l=c}}function s(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function a(e){s(e);for(var t=e.listSelections(),n=0;n<t.length;n++)o(e,t[n].from(),t[n].to())}}(n(631))},631:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),s=i||r||o,a=s&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=h&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,l=!0);var D=y&&(u||h&&(null==w||w<12.11)),C=n||s&&a>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,E=function(e,t){var n=e.className,i=k(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return S(e).appendChild(t)}function T(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)r.appendChild(t[o]);return r}function F(e,t,n,i){var r=T(e,t,n,i);return r.setAttribute("role","presentation"),r}function L(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 M(){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 N(e,t){var n=e.className;k(t).test(n)||(e.className+=(n?" ":"")+t)}function O(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!k(n[i]).test(t)&&(t+=" "+n[i]);return t}_=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var B=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function z(e,t,n){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===n&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function P(e,t,n,i,r){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,s=r||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}m?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(B=function(e){try{e.select()}catch(e){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function R(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.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 W={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},$={origin:"*mouse"},q={origin:"+move"};function U(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var s=o-i;if(o==e.length||r+s>=t)return i+Math.min(s,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var V=[""];function G(e){for(;V.length<=e;)V.push(K(V)+" ");return V[e]}function K(e){return e[e.length-1]}function X(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function Y(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&z(t,n),n}var Q=/[\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()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 e.charCodeAt(0)>=768&&ne.test(e)}function re(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}var se=null;function ae(e,t,n){var i;se=null;for(var r=0;r<e.length;++r){var o=e[r];if(o.from<t&&o.to>t)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:se=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:se=r)}return null!=i?i:se}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,r=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,a){var l,u="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!e.test(s))return!1;for(var c=s.length,h=[],d=0;d<c;++d)h.push((l=s.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(l):1424<=l&&l<=1524?"R":1536<=l&&l<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(l-1536):1774<=l&&l<=2220?"r":8192<=l&&l<=8203?"w":8204==l?"b":"L");for(var f=0,p=u;f<c;++f){var m=h[f];"m"==m?h[f]=p:p=m}for(var g=0,v=u;g<c;++g){var y=h[g];"1"==y&&"r"==v?h[g]="n":n.test(y)&&(v=y,"r"==y&&(h[g]="R"))}for(var b=1,x=h[0];b<c-1;++b){var w=h[b];"+"==w&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=w||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=w}for(var D=0;D<c;++D){var C=h[D];if(","==C)h[D]="N";else if("%"==C){var k=void 0;for(k=D+1;k<c&&"%"==h[k];++k);for(var _=D&&"!"==h[D-1]||k<c&&"1"==h[k]?"1":"N",E=D;E<k;++E)h[E]=_;D=k-1}}for(var S=0,A=u;S<c;++S){var T=h[S];"L"==A&&"1"==T?h[S]="L":n.test(T)&&(A=T)}for(var F=0;F<c;++F)if(t.test(h[F])){var L=void 0;for(L=F+1;L<c&&t.test(h[L]);++L);for(var M="L"==(F?h[F-1]:u),N=M==("L"==(L<c?h[L]:u))?M?"L":"R":u,O=F;O<L;++O)h[O]=N;F=L-1}for(var B,I=[],z=0;z<c;)if(i.test(h[z])){var P=z;for(++z;z<c&&i.test(h[z]);++z);I.push(new o(0,P,z))}else{var H=z,R=I.length,W="rtl"==a?1:0;for(++z;z<c&&"L"!=h[z];++z);for(var j=H;j<z;)if(r.test(h[j])){H<j&&(I.splice(R,0,new o(1,H,j)),R+=W);var $=j;for(++j;j<z&&r.test(h[j]);++j);I.splice(R,0,new o(2,$,j)),R+=W,H=j}else++j;H<z&&I.splice(R,0,new o(1,H,z))}return"ltr"==a&&(1==I[0].level&&(B=s.match(/^\s+/))&&(I[0].from=B[0].length,I.unshift(new o(0,0,B[0].length))),1==K(I).level&&(B=s.match(/\s+$/))&&(K(I).to-=B[0].length,I.push(new o(0,c-B[0].length,c)))),"rtl"==a?I.reverse():I}}();function ue(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var ce=[],he=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ce).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ce}function fe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var o=R(r,n);o>-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function pe(e,t){var n=de(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,n||t.type,e,t),we(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==R(n,t[i])&&n.push(t[i])}function ve(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function De(e){be(e),xe(e)}function Ce(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var _e,Ee,Se=function(){if(s&&a<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==_e){var t=T("span","");A(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(_e=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&a<8))}var n=_e?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=Ee)return Ee;var t=A(e,document.createTextNode("AخA")),n=_(t,0,1).getBoundingClientRect(),i=_(t,1,2).getBoundingClientRect();return S(e),!(!n||n.left==n.right)&&(Ee=i.right-n.right<3)}var Fe,Le=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Me=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)},Ne="oncopy"in(Fe=T("div"))||(Fe.setAttribute("oncopy","return;"),"function"==typeof Fe.oncopy),Oe=null;var Be={},Ie={};function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}function Pe(e){if("string"==typeof e&&Ie.hasOwnProperty(e))e=Ie[e];else if(e&&"string"==typeof e.name&&Ie.hasOwnProperty(e.name)){var t=Ie[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=Pe(t);var n=Be[t.name];if(!n)return He(e,"text/plain");var i=n(e,t);if(Re.hasOwnProperty(t.name)){var r=Re[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)i[s]=t.modeProps[s];return i}var Re={};function We(e,t){z(t,Re.hasOwnProperty(e)?Re[e]:Re[e]={})}function je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function $e(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function qe(e,t,n){return!e.startState||e.startState(t,n)}var Ue=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 Ve(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 n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t<o){n=r;break}t-=o}return n.lines[t]}function Ge(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;r==n.line&&(o=o.slice(0,n.ch)),r==t.line&&(o=o.slice(t.ch)),i.push(o),++r})),i}function Ke(e,t,n){var i=[];return e.iter(t,n,(function(e){i.push(e.text)})),i}function Xe(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,n=R(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function Ze(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],o=r.height;if(t<o){e=r;continue e}t-=o,n+=r.chunkSize()}return n}while(!e.lines);for(var s=0;s<e.lines.length;++s){var a=e.lines[s].height;if(t<a)break;t-=a}return n+s}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function it(e){return et(e.line,e.ch)}function rt(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function st(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function at(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ve(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ve(e,t.line).text.length)}function lt(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=at(e,t[i]);return n}Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.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},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.match=function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,i){var r=[e.state.modeGen],o={};xt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=e.state.overlays[i],l=1,u=0;n.state=!0,xt(e,t.text,a.mode,n,(function(e,t){for(var n=l;u<e;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,u=Math.min(e,i)}if(t)if(a.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=s,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)a(l);return{styles:r,classes:o.bgClass||o.textClass?o:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=ft(e,Ye(t)),r=t.text.length>e.options.maxHighlightLength&&je(e.doc.mode,i.state),o=ht(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),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 ft(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new ct(i,!0,t);var o=function(e,t,n){for(var i,r,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Ve(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return a;var c=P(l.text,null,e.options.tabSize);(null==r||i>c)&&(r=a-1,i=c)}return r}(e,t,n),s=o>i.first&&Ve(i,o-1).stateAfter,a=s?ct.fromSaved(i,s,o):new ct(i,qe(i.mode),o);return i.iter(o,t,(function(n){pt(e,n.text,a);var i=a.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?a.save():null,a.nextLine()})),n&&(i.modeFrontier=a.line),a}function pt(e,t,n,i){var r=e.doc.mode,o=new Ue(t,e.options.tabSize,n);for(o.start=o.pos=i||0,""==t&&mt(r,n.state);!o.eol();)gt(r,o,n.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=$e(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=$e(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.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.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}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof ut?new ct(e,je(e.mode,t.state),n,t.lookAhead):new ct(e,je(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,i){var r,o,s=e.doc,a=s.mode,l=Ve(s,(t=at(s,t)).line),u=ft(e,t.line,n),c=new Ue(l.text,e.options.tabSize,u);for(i&&(o=[]);(i||c.pos<t.ch)&&!c.eol();)c.start=c.pos,r=gt(a,c,u.state),i&&o.push(new vt(c,r,je(s.mode,u.state)));return i?o:new vt(c,r,u.state)}function bt(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 i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function xt(e,t,n,i,r,o,s){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,u=0,c=null,h=new Ue(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,i.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,s&&pt(e,t,i,h.pos),h.pos=t.length,l=null):l=bt(gt(n,h,i.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u<h.start;)r(u=Math.min(h.start,u+5e3),c);c=l}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);r(p,c),u=p}}var wt=!1,Dt=!1;function Ct(e,t,n){this.marker=e,this.from=t,this.to=n}function kt(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function _t(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function Et(e,t){if(t.full)return null;var n=Qe(e,t.from.line)&&Ve(e,t.from.line).markedSpans,i=Qe(e,t.to.line)&&Ve(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,o=t.to.ch,s=0==tt(t.from,t.to),a=function(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],s=o.marker;if(null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Ct(s,o.from,a?null:o.to))}}return i}(n,r,s),l=function(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],s=o.marker;if(null==o.to||(s.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Ct(s,a?null:o.from-t,null==o.to?null:o.to-t))}}return i}(i,o,s),u=1==t.text.length,c=K(t.text).length+(u?r:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(null==d.to){var f=kt(l,d.marker);f?u&&(d.to=null==f.to?null:f.to+c):d.to=r}}if(l)for(var p=0;p<l.length;++p){var m=l[p];null!=m.to&&(m.to+=c),null==m.from?kt(a,m.marker)||(m.from=c,u&&(a||(a=[])).push(m)):(m.from+=c,u&&(a||(a=[])).push(m))}a&&(a=St(a)),l&&l!=a&&(l=St(l));var g=[a];if(!u){var v,y=t.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(v||(v=[])).push(new Ct(a[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function St(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 At(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Ft(e){return e.inclusiveLeft?-1:0}function Lt(e){return e.inclusiveRight?1:0}function Mt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),o=tt(i.from,r.from)||Ft(e)-Ft(t);return o?-o:tt(i.to,r.to)||Lt(e)-Lt(t)||t.id-e.id}function Nt(e,t){var n,i=Dt&&e.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(t?r.from:r.to)&&(!n||Mt(n,r.marker)<0)&&(n=r.marker);return n}function Ot(e){return Nt(e,!0)}function Bt(e){return Nt(e,!1)}function It(e,t){var n,i=Dt&&e.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Mt(n,o.marker)<0)&&(n=o.marker)}return n}function zt(e,t,n,i,r){var o=Ve(e,t),s=Dt&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),c=tt(u.from,n)||Ft(l.marker)-Ft(r),h=tt(u.to,i)||Lt(l.marker)-Lt(r);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(u.to,n)>=0:tt(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(u.from,i)<=0:tt(u.from,i)<0)))return!0}}}function Pt(e){for(var t;t=Ot(e);)e=t.find(-1,!0).line;return e}function Ht(e,t){var n=Ve(e,t),i=Pt(n);return n==i?t:Ye(i)}function Rt(e,t){if(t>e.lastLine())return t;var n,i=Ve(e,t);if(!Wt(e,i))return t;for(;n=Bt(i);)i=n.find(1,!0).line;return Ye(i)+1}function Wt(e,t){var n=Dt&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&jt(e,t,i))return!0}}function jt(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return jt(e,i.line,kt(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,o=0;o<t.markedSpans.length;++o)if((r=t.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&jt(e,t,r))return!0}function $t(e){for(var t=0,n=(e=Pt(e)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==n)break;t+=a.height}return t}function qt(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=Ot(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=Bt(i);){var o=t.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function Ut(e){var t=e.display,n=e.doc;t.maxLine=Ve(n,n.first),t.maxLineLength=qt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=qt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Vt=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,At(e)}Vt.prototype.lineNo=function(){return Ye(this)},ye(Vt);var Kt={},Xt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Xt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=F("span",null,null,l?"padding-right: .1px":null),i={pre:F("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,s=void 0;i.pos=0,i.addToken=Jt,Te(e.display.measure)&&(s=ue(o,e.doc.direction))&&(i.addToken=en(i.addToken,s)),i.map=[],nn(o,i,dt(e,o,t!=e.display.externalMeasured&&Ye(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=O(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=O(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ae(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=i.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=O(i.pre.className,i.textClass||"")),i}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,n,i,r,o,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var o=e.charAt(r);" "!=o||!n||r!=e.length-1&&32!=e.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){u=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),m=p?p.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));s&&a<9?u.appendChild(T("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(T("span",G(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(T("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),s&&a<9?u.appendChild(T("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),s&&a<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||r||d||o||l){var x=n||"";i&&(x+=i),r&&(x+=r);var w=T("span",[u],x,o);if(l)for(var D in l)l.hasOwnProperty(D)&&"style"!=D&&"class"!=D&&w.setAttribute(D,l[D]);return e.content.appendChild(w)}e.content.appendChild(u)}}function en(e,t){return function(n,i,r,o,s,a,l){r=r?r+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+i.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>u&&h.from<=u);d++);if(h.to>=c)return e(n,i,r,o,s,a,l);e(n,i.slice(0,h.to-u),r,o,null,a,l),o=null,i=i.slice(h.to-u),u=h.to}}}function tn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var s,a,l,u,c,h,d,f=r.length,p=0,m=1,g="",v=0;;){if(v==p){l=u=c=a="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;x<i.length;++x){var w=i[x],D=w.marker;if("bookmark"==D.type&&w.from==p&&D.widgetNode)y.push(D);else if(w.from<=p&&(null==w.to||w.to>p||D.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),D.className&&(l+=" "+D.className),D.css&&(a=(a?a+";":"")+D.css),D.startStyle&&w.from==p&&(c+=" "+D.startStyle),D.endStyle&&w.to==v&&(b||(b=[])).push(D.endStyle,w.to),D.title&&((d||(d={})).title=D.title),D.attributes)for(var C in D.attributes)(d||(d={}))[C]=D.attributes[C];D.collapsed&&(!h||Mt(h.marker,D)<0)&&(h=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(u+=" "+b[k]);if(!h||h.from==p)for(var _=0;_<y.length;++_)tn(t,0,y[_]);if(h&&(h.from||0)==p){if(tn(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var E=Math.min(f,v);;){if(g){var S=p+g.length;if(!h){var A=S>E?g.slice(0,E-p):g;t.addToken(t,A,s?s+l:l,c,p+A.length==v?u:"",a,d)}if(S>=E){g=g.slice(E-p),p=E;break}p=S,c=""}g=r.slice(o,o=n[m++]),s=Yt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,r.slice(o,o=n[T]),Yt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Bt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function on(e,t,n){for(var i,r=[],o=t;o<n;o=i){var s=new rn(e.doc,Ve(e.doc,o),o);i=o+s.size,r.push(s)}return r}var sn=null;var an=null;function ln(e,t){var n=de(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);sn?i=sn.delayedCallbacks:an?i=an:(i=an=[],setTimeout(un,0));for(var o=function(e){i.push((function(){return n[e].apply(null,r)}))},s=0;s<n.length;++s)o(s)}}function un(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function cn(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?fn(e,t):"gutter"==o?mn(e,t,n,i):"class"==o?pn(e,t):"widget"==o&&gn(e,t,i)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&a<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function fn(e,t){var n=t.text.className,i=dn(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,pn(e,t)):n&&(t.text.className=n)}function pn(e,t){(function(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 i=hn(t);t.background=i.insertBefore(T("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}})(e,t),t.line.wrapClass?hn(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 mn(e,t,n,i){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 r=hn(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var s=hn(t),a=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),s.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(T("div",Je(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(T("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var i=k("CodeMirror-linewidget"),r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);yn(e,t,n)}function vn(e,t,n,i){var r=dn(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),pn(e,t),mn(e,t,n,i),yn(e,t,i),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)bn(e,t.rest[i],t,n,!1)}function bn(e,t,n,i,r){if(t.widgets)for(var o=hn(n),s=0,a=t.widgets;s<a.length;++s){var l=a[s],u=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),xn(l,u,n,i),e.display.input.setUneditable(u),r&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),ln(l,"redraw")}}function xn(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!L(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;"),A(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Dn(e,t){for(var n=Ce(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 Cn(e){return e.lineSpace.offsetTop}function kn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _n(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function En(e){return 50-e.display.nativeBarWidth}function Sn(e){return e.display.scroller.clientWidth-En(e)-e.display.barWidth}function An(e){return e.display.scroller.clientHeight-En(e)-e.display.barHeight}function Tn(e,t,n){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 r=0;r<e.rest.length;r++)if(Ye(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fn(e,t,n,i){return Nn(e,Mn(e,t),n,i)}function Ln(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Mn(e,t){var n=Ye(t),i=Ln(e,n);i&&!i.text?i=null:i&&i.changes&&(cn(e,i,n,oi(e)),e.curOp.forceUpdate=!0),i||(i=function(e,t){var n=Ye(t=Pt(t)),i=e.display.externalMeasured=new rn(e.doc,t,n);i.lineN=n;var r=i.built=Zt(e,i);return i.text=r.pre,A(e.display.lineMeasure,r.pre),i}(e,t));var r=Tn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Nn(e,t,n,i,r){t.before&&(n=-1);var o,l=n+(i||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var i=e.options.lineWrapping,r=i&&Sn(e);if(!t.measure.heights||i&&t.measure.width!=r){var o=t.measure.heights=[];if(i){t.measure.width=r;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,i){var r,o=In(t.map,n,i),l=o.node,u=o.start,c=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&ie(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+c));)++c;if((r=s&&a<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():zn(_(l,u,c).getClientRects(),i)).left||r.right||0==u)break;c=u,u-=1,h="right"}s&&a<11&&(r=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Oe)return Oe;var t=A(e,T("span","x")),n=t.getBoundingClientRect(),i=_(t,0,1).getBoundingClientRect();return Oe=Math.abs(n.left-i.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,r))}else{var f;u>0&&(h=i="right"),r=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!u&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+ri(e.display),top:p.top,bottom:p.bottom}:Bn}for(var m=r.top-t.rect.top,g=r.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],D={left:("right"==h?r.right:r.left)-t.rect.left,right:("left"==h?r.left:r.right)-t.rect.left,top:x,bottom:w};return r.left||r.right||(D.bogus=!0),e.options.singleCursorHeightPerLine||(D.rtop=m,D.rbottom=g),D}(e,t,n,i)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var On,Bn={left:0,right:0,top:0,bottom:0};function In(e,t,n){for(var i,r,o,s,a,l,u=0;u<e.length;u+=3)if(a=e[u],l=e[u+1],t<a?(r=0,o=1,s="left"):t<l?o=1+(r=t-a):(u==e.length-3||t==l&&e[u+3]>t)&&(r=(o=l-a)-1,t>=l&&(s="right")),null!=r){if(i=e[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],s="left";if("right"==n&&r==l-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)i=e[(u+=3)+2],s="right";break}return{node:i,start:r,end:o,collapse:s,coverStart:a,coverEnd:l}}function zn(e,t){var n=Bn;if("left"==t)for(var i=0;i<e.length&&(n=e[i]).left==n.right;i++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function Pn(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 Hn(e){e.display.externalMeasure=null,S(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Pn(e.display.view[t])}function Rn(e){Hn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Wn(){return c&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jn(){return c&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function $n(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function qn(e,t,n,i,r){if(!r){var o=$n(t);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var s=$t(t);if("local"==i?s+=Cn(e.display):s-=e.display.viewOffset,"page"==i||"window"==i){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==i?0:jn());var l=a.left+("window"==i?0:Wn());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function Un(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=Wn(),r-=jn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:r-s.top}}function Vn(e,t,n,i,r){return i||(i=Ve(e.doc,t.line)),qn(e,i,Fn(e,i,t.ch,r),n)}function Gn(e,t,n,i,r,o){function s(t,s){var a=Nn(e,r,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,qn(e,i,a,n)}i=i||Ve(e.doc,t.line),r||(r=Mn(e,i));var a=ue(i,e.doc.direction),l=t.ch,u=t.sticky;if(l>=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return s("before"==u?l-1:l,"before"==u);function c(e,t,n){return s(n?e-1:e,1==a[t].level!=n)}var h=ae(a,l,u),d=se,f=c(l,h,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function Kn(e,t){var n=0;t=at(e.doc,t),e.options.lineWrapping||(n=ri(e.display)*t.ch);var i=Ve(e.doc,t.line),r=$t(i)+Cn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Xn(e,t,n,i,r){var o=et(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Yn(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Xn(i.first,0,null,-1,-1);var r=Ze(i,n),o=i.first+i.size-1;if(r>o)return Xn(i.first+i.size-1,Ve(i,o).text.length,null,1,1);t<0&&(t=0);for(var s=Ve(i,r);;){var a=ei(e,s,r,t,n),l=It(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;s=Ve(i,r=u.line)}}function Zn(e,t,n,i){i-=$n(t);var r=t.text.length,o=oe((function(t){return Nn(e,n,t-1).bottom<=i}),r,0);return{begin:o,end:r=oe((function(t){return Nn(e,n,t).top>i}),o,r)}}function Qn(e,t,n,i){return n||(n=Mn(e,t)),Zn(e,t,n,qn(e,t,Nn(e,n,i),"line").top)}function Jn(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function ei(e,t,n,i,r){r-=$t(t);var o=Mn(e,t),s=$n(t),a=0,l=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?ni:ti)(e,t,n,o,c,i,r);a=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var d,f,p=null,m=null,g=oe((function(t){var n=Nn(e,o,t);return n.top+=s,n.bottom+=s,!!Jn(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=t,m=n),!0)}),a,l),v=!1;if(m){var y=i-m.left<m.right-i,b=y==u;g=p+(b?0:1),f=b?"after":"before",d=y?m.left:m.right}else{u||g!=l&&g!=a||g++,f=0==g?"after":g==t.text.length?"before":Nn(e,o,g-(u?1:0)).bottom+s<=r==u?"after":"before";var x=Gn(e,et(n,g,f),"line",t,o);d=x.left,v=r<x.top?-1:r>=x.bottom?1:0}return Xn(n,g=re(t.text,g,1),f,v,i-d)}function ti(e,t,n,i,r,o,s){var a=oe((function(a){var l=r[a],u=1!=l.level;return Jn(Gn(e,et(n,u?l.to:l.from,u?"before":"after"),"line",t,i),o,s,!0)}),0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,c=Gn(e,et(n,u?l.from:l.to,u?"after":"before"),"line",t,i);Jn(c,o,s,!0)&&c.top>s&&(l=r[a-1])}return l}function ni(e,t,n,i,r,o,s){var a=Zn(e,t,i,s),l=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d<r.length;d++){var f=r[d];if(!(f.from>=u||f.to<=l)){var p=Nn(e,i,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=p<o?o-p+1e9:p-o;(!c||h>m)&&(c=f,h=m)}}return c||(c=r[r.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function ii(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==On){On=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)On.appendChild(document.createTextNode("x")),On.appendChild(T("br"));On.appendChild(document.createTextNode("x"))}A(e.measure,On);var n=On.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),S(e.measure),n||1}function ri(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");A(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function oi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+r,i[a]=o.clientWidth}return{fixedPos:si(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function si(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ai(e){var t=ii(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/ri(e.display)-3);return function(r){if(Wt(e.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s<r.widgets.length;s++)r.widgets[s].height&&(o+=r.widgets[s].height);return n?o+(Math.ceil(r.text.length/i)||1)*t:o+t}}function li(e){var t=e.doc,n=ai(e);t.iter((function(e){var t=n(e);t!=e.height&&Xe(e,t)}))}function ui(e,t,n,i){var r=e.display;if(!n&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var o,s,a=r.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(e){return null}var l,u=Yn(e,o,s);if(i&&u.xRel>0&&(l=Ve(e.doc,u.line).text).length==u.ch){var c=P(l,l.length,e.options.tabSize)-l.length;u=et(u.line,Math.max(0,Math.round((o-_n(e.display).left)/ri(e.display))-c))}return u}function ci(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function hi(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Dt&&Ht(e.doc,t)<r.viewTo&&fi(e);else if(n<=r.viewFrom)Dt&&Rt(e.doc,n+i)>r.viewFrom?fi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)fi(e);else if(t<=r.viewFrom){var o=pi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):fi(e)}else if(n>=r.viewTo){var s=pi(e,t,t,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):fi(e)}else{var a=pi(e,t,t,-1),l=pi(e,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(on(e,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):fi(e)}var u=r.externalMeasured;u&&(n<u.lineN?u.lineN+=i:t<u.lineN+u.size&&(r.externalMeasured=null))}function di(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[ci(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==R(s,n)&&s.push(n)}}}function fi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pi(e,t,n,i){var r,o=ci(e,t),s=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=t){if(i>0){if(o==s.length-1)return null;r=a+s[o].size-t,o++}else r=a-t;t+=r,n+=r}for(;Ht(e.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];r.hidden||r.node&&!r.changes||++n}return n}function gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vi(e,t){void 0===t&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&yi(e,a.head,r),l||xi(e,a,o)}}return i}function yi(e,t,n){var i=Gn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(T("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function bi(e,t){return e.top-t.top||e.left-t.left}function xi(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),s=_n(e.display),a=s.left,l=Math.max(i.sizerWidth,Sn(e)-i.sizer.offsetLeft)-s.right,u="ltr"==r.direction;function c(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(i-t)+"px"))}function h(t,n,i){var o,s,h=Ve(r,t),d=h.text.length;function f(n,i){return Vn(e,et(t,n),"div",h,i)}function p(t,n,i){var r=Qn(e,h,null,t),o="ltr"==n==("after"==i)?"left":"right";return f("after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1),o)[o]}var m=ue(h,r.direction);return function(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;o<e.length;++o){var s=e[o];(s.from<n&&s.to>t||t==n&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}(m,n||0,null==i?d:i,(function(e,t,r,h){var g="ltr"==r,v=f(e,g?"left":"right"),y=f(t-1,g?"right":"left"),b=null==n&&0==e,x=null==i&&t==d,w=0==h,D=!m||h==m.length-1;if(y.top-v.top<=3){var C=(u?x:b)&&D,k=(u?b:x)&&w?a:(g?v:y).left,_=C?l:(g?y:v).right;c(k,v.top,_-k,v.bottom)}else{var E,S,A,T;g?(E=u&&b&&w?a:v.left,S=u?l:p(e,r,"before"),A=u?a:p(t,r,"after"),T=u&&x&&D?l:y.right):(E=u?p(e,r,"before"):a,S=!u&&b&&w?l:v.right,A=!u&&x&&D?a:y.left,T=u?p(t,r,"after"):l),c(E,v.top,S-E,v.bottom),v.bottom<y.top&&c(a,v.bottom,null,y.top),c(A,y.top,T-A,y.bottom)}(!o||bi(v,o)<0)&&(o=v),bi(y,o)<0&&(o=y),(!s||bi(v,s)<0)&&(s=v),bi(y,s)<0&&(s=y)})),{start:o,end:s}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Ve(r,d.line),m=Ve(r,f.line),g=Pt(p)==Pt(m),v=h(d.line,d.ch,g?p.text.length+1:null).end,y=h(f.line,g?0:null,f.ch).start;g&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(a,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(a,v.bottom,null,y.top)}n.appendChild(o)}function wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||_i(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Di(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ki(e))}function Ci(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&_i(e))}),100)}function ki(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wi(e))}function _i(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Ei(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],o=e.options.lineWrapping,l=void 0,u=0;if(!r.hidden){if(s&&a<8){var c=r.node.offsetTop+r.node.offsetHeight;l=c-n,n=c}else{var h=r.node.getBoundingClientRect();l=h.bottom-h.top,!o&&r.text.firstChild&&(u=r.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=r.line.height-l;if((d>.005||d<-.005)&&(Xe(r.line,l),Si(r.line),r.rest))for(var f=0;f<r.rest.length;f++)Si(r.rest[f]);if(u>e.display.sizerWidth){var p=Math.ceil(u/ri(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function Si(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Ai(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Cn(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=Ze(t,i),s=Ze(t,r);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=Ze(t,$t(Ve(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=s&&(o=Ze(t,$t(Ve(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Ti(e,t){var n=e.display,i=ii(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=An(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+kn(n),l=t.top<i,u=t.bottom>a-i;if(t.top<r)s.scrollTop=l?0:t.top;else if(t.bottom>r+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=r&&(s.scrollTop=c)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,f=Sn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?s.scrollLeft=0:t.left<d?s.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(s.scrollLeft=t.right+(p?0:10)-f),s}function Fi(e,t){null!=t&&(Ni(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Li(e){Ni(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mi(e,t,n){null==t&&null==n||Ni(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ni(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Oi(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Oi(e,t,n,i){var r=Ti(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Mi(e,r.scrollLeft,r.scrollTop)}function Bi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||lr(e,{top:t}),Ii(e,t,!0),n&&lr(e),ir(e,100))}function Ii(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function zi(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Pi(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+kn(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?n:0,docHeight:i,scrollHeight:i+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Hi=function(e,t,n){this.cm=n;var i=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),he(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),he(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},Hi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hi.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Hi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},Hi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ri=function(){};function Wi(e,t){t||(t=Pi(e));var n=e.display.barWidth,i=e.display.barHeight;ji(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Ei(e),ji(e,Pi(e)),n=e.display.barWidth,i=e.display.barHeight}function ji(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ri.prototype.update=function(){return{bottom:0,right:0}},Ri.prototype.setScrollLeft=function(){},Ri.prototype.setScrollTop=function(){},Ri.prototype.clear=function(){};var $i={native:Hi,null:Ri};function qi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $i[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?zi(e,t):Bi(e,t)}),e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Ui=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:++Ui,markArrays:null},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Gi(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}(n)}finally{sn=null,t(n)}}(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,n=0;n<t.length;n++)Ki(t[n]);for(var i=0;i<t.length;i++)Xi(t[i]);for(var r=0;r<t.length;r++)Yi(t[r]);for(var o=0;o<t.length;o++)Zi(t[o]);for(var s=0;s<t.length;s++)Qi(t[s])}(e)}))}function Ki(e){var t=e.cm,n=t.display;(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=En(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=En(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&Ut(t),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&&t.options.lineWrapping,e.update=e.mustUpdate&&new or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xi(e){e.updatedDisplay=e.mustUpdate&&sr(e.cm,e.update)}function Yi(e){var t=e.cm,n=t.display;e.updatedDisplay&&Ei(t),e.barMeasure=Pi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Sn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&zi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wi(t,e.barMeasure),e.updatedDisplay&&cr(t,e.barMeasure),e.selectionChanged&&wi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Di(e.cm)}function Qi(e){var t=e.cm,n=t.display,i=t.doc;e.updatedDisplay&&ar(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Ii(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&zi(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=T("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,a=Gn(e,t),l=n&&n!=t?Gn(e,n):a,u=Ti(e,r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Bi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(zi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return r}(t,at(i,e.scrollToPos.from),at(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var s=0;s<r.length;++s)r[s].lines.length||pe(r[s],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&pe(o[a],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ji(e,t){if(e.curOp)return t();Vi(e);try{return t()}finally{Gi(e)}}function er(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vi(e);try{return t.apply(e,arguments)}finally{Gi(e)}}}function tr(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{Gi(this)}}}function nr(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{Gi(t)}}}function ir(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(rr,e))}function rr(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=ft(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?je(t.mode,i.state):null,l=ht(e,o,i,!0);a&&(i.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!h&&d<s.length;++d)h=s[d]!=o.styles[d];h&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return ir(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Ji(e,(function(){for(var t=0;t<r.length;t++)di(e,r[t],"text")}))}}var or=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Ai(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Sn(e),this.force=n,this.dims=oi(e),this.events=[]};function sr(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return fi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(e))return!1;dr(e)&&(fi(e),t.dims=oi(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Dt&&(o=Ht(e.doc,o),s=Rt(e.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=on(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=on(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ci(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(on(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,ci(e,n)))),i.viewTo=n})(e,o,s),n.viewOffset=$t(Ve(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=mi(e);if(!a&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=M();if(!t||!L(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&L(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=i.view,c=i.viewFrom,h=0;h<u.length;h++){var d=u[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;s!=d.node;)s=a(s);var f=r&&null!=t&&t<=c&&d.lineNumber;d.changes&&(R(d.changes,"gutter")>-1&&(f=!1),cn(e,d,c,n)),f&&(S(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Je(e.options,c)))),s=d.node.nextSibling}else{var p=vn(e,d,c,n);o.insertBefore(p,s)}c+=d.size}for(;s;)s=a(s)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=M()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&L(document.body,e.anchorNode)&&L(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ir(e,400)),n.updateLineNumbers=null,!0}function ar(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Sn(e))i&&(t.visible=Ai(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-An(e),n.top)}),t.visible=Ai(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!sr(e,t))break;Ei(e);var r=Pi(e);gi(e),Wi(e,r),cr(e,r),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 lr(e,t){var n=new or(e,t);if(sr(e,n)){Ei(e),ar(e,n);var i=Pi(e);gi(e),Wi(e,i),cr(e,i),n.finish()}}function ur(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ln(e,"gutterChanged",e)}function cr(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+En(e)+"px"}function hr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=si(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",s=0;s<n.length;s++)if(!n[s].hidden){e.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=o),n[s].gutterBackground&&(n[s].gutterBackground.style.left=o));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function dr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Je(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,s=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",ur(e.display),!0}return!1}function fr(e,t){for(var n=[],i=!1,r=0;r<e.length;r++){var o=e[r],s=null;if("string"!=typeof o&&(s=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;i=!0}n.push({className:o,style:s})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function pr(e){var t=e.gutters,n=e.gutterSpecs;S(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,s=r.style,a=t.appendChild(T("div",null,"CodeMirror-gutter "+o));s&&(a.style.cssText=s),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ur(e)}function mr(e){pr(e.display),hi(e),hr(e)}function gr(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=F("div",null,"CodeMirror-code"),o.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=T("div",null,"CodeMirror-cursors"),o.measure=T("div",null,"CodeMirror-measure"),o.lineMeasure=T("div",null,"CodeMirror-measure"),o.lineSpace=F("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=F("div",[o.lineSpace],"CodeMirror-lines");o.mover=T("div",[u],null,"position: relative"),o.sizer=T("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=T("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=T("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=T("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&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=fr(r.gutters,r.lineNumbers),pr(o),i.init(o)}or.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},or.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var vr=0,yr=null;function br(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xr(e){var t=br(e);return t.x*=yr,t.y*=yr,t}function wr(e,t){var i=br(t),r=i.x,o=i.y,s=e.display,a=s.scroller,u=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(r&&u||o&&c){if(o&&y&&l)e:for(var d=t.target,f=s.view;d!=a;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){e.display.currentWheelTarget=d;break e}if(r&&!n&&!h&&null!=yr)return o&&c&&Bi(e,Math.max(0,a.scrollTop+o*yr)),zi(e,Math.max(0,a.scrollLeft+r*yr)),(!o||o&&c)&&be(t),void(s.wheelStartX=null);if(o&&null!=yr){var m=o*yr,g=e.doc.scrollTop,v=g+s.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),lr(e,{top:g,bottom:v})}vr<20&&(null==s.wheelStartX?(s.wheelStartX=a.scrollLeft,s.wheelStartY=a.scrollTop,s.wheelDX=r,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var e=a.scrollLeft-s.wheelStartX,t=a.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(yr=(yr*vr+n)/(vr+1),++vr)}}),200)):(s.wheelDX+=r,s.wheelDY+=o))}}s?yr=-.53:n?yr=15:c?yr=-.7:d&&(yr=-1/3);var Dr=function(e,t){this.ranges=e,this.primIndex=t};Dr.prototype.primary=function(){return this.ranges[this.primIndex]},Dr.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 n=this.ranges[t],i=e.ranges[t];if(!nt(n.anchor,i.anchor)||!nt(n.head,i.head))return!1}return!0},Dr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cr(it(this.ranges[t].anchor),it(this.ranges[t].head));return new Dr(e,this.primIndex)},Dr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Dr.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(tt(t,i.from())>=0&&tt(e,i.to())<=0)return n}return-1};var Cr=function(e,t){this.anchor=e,this.head=t};function kr(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=R(t,r);for(var o=1;o<t.length;o++){var s=t[o],a=t[o-1],l=tt(a.to(),s.from());if(i&&!s.empty()?l>0:l>=0){var u=ot(a.from(),s.from()),c=rt(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Cr(h?c:u,h?u:c))}}return new Dr(t,n)}function _r(e,t){return new Dr([new Cr(e,t||e)],0)}function Er(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Sr(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Er(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Er(t).ch-t.to.ch),et(n,i)}function Ar(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new Cr(Sr(r.anchor,t),Sr(r.head,t)))}return kr(e.cm,n,e.sel.primIndex)}function Tr(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Fr(e){e.doc.mode=He(e.options,e.doc.modeOption),Lr(e)}function Lr(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,ir(e,100),e.state.modeGen++,e.curOp&&hi(e)}function Mr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Nr(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){(function(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),At(e),Tt(e,n);var r=i?i(e):1;r!=e.height&&Xe(e,r)})(e,n,r,i),ln(e,"change",e,t)}function s(e,t){for(var n=[],o=e;o<t;++o)n.push(new Vt(u[o],r(o),i));return n}var a=t.from,l=t.to,u=t.text,c=Ve(e,a.line),h=Ve(e,l.line),d=K(u),f=r(u.length-1),p=l.line-a.line;if(t.full)e.insert(0,s(0,u.length)),e.remove(u.length,e.size-u.length);else if(Mr(e,t)){var m=s(0,u.length-1);o(h,h.text,f),p&&e.remove(a.line,p),m.length&&e.insert(a.line,m)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,a.ch)+d+c.text.slice(l.ch),f);else{var g=s(1,u.length-1);g.push(new Vt(d+c.text.slice(l.ch),f,i)),o(c,c.text.slice(0,a.ch)+u[0],r(0)),e.insert(a.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,a.ch)+u[0]+h.text.slice(l.ch),r(0)),e.remove(a.line+1,p);else{o(c,c.text.slice(0,a.ch)+u[0],r(0)),o(h,d+h.text.slice(l.ch),f);var v=s(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,v)}ln(e,"change",e,t)}function Or(e,t,n){!function e(i,r,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var a=i.linked[s];if(a.doc!=r){var l=o&&a.sharedHist;n&&!l||(t(a.doc,l),e(a.doc,i,l))}}}(e,null,!0)}function Br(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,li(e),Fr(e),Ir(e),e.options.direction=t.direction,e.options.lineWrapping||Ut(e),e.options.mode=t.modeOption,hi(e)}function Ir(e){("rtl"==e.doc.direction?N:E)(e.display.lineDiv,"CodeMirror-rtl")}function zr(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Pr(e,t){var n={from:it(t.from),to:Er(t),text:Ge(e,t.from,t.to)};return $r(e,n,t.from.line,t.to.line+1),Or(e,(function(e){return $r(e,n,t.from.line,t.to.line+1)}),!0),n}function Hr(e){for(;e.length&&K(e).ranges;)e.pop()}function Rr(e,t,n,i){var r=e.history;r.undone.length=0;var o,s,a=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Hr(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(r,r.lastOp==i)))s=K(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,s.to)?s.to=Er(t):o.changes.push(Pr(e,t));else{var l=K(r.done);for(l&&l.ranges||jr(e.sel,r.done),o={changes:[Pr(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,s||pe(e,"historyAdded")}function Wr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,K(r.done),t))?r.done[r.done.length-1]=t:jr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Hr(r.undone)}function jr(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $r(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function qr(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Ur(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(qr(n[r]));return i}(e,t),i=Et(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],s=i[r];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else s&&(n[r]=s)}return n}function Vr(e,t,n){for(var i=[],r=0;r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?Dr.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];i.push({changes:a});for(var l=0;l<s.length;++l){var u=s[l],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&R(t,Number(c[1]))>-1&&(K(a)[h]=u[h],delete u[h])}}}return i}function Gr(e,t,n,i){if(i){var r=e.anchor;if(n){var o=tt(t,r)<0;o!=tt(n,r)<0?(r=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Cr(r,t)}return new Cr(n||t,t)}function Kr(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Jr(e,new Dr([Gr(e.sel.primary(),t,n,r)],0),i)}function Xr(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=Gr(e.sel.ranges[o],t[o],null,r);Jr(e,kr(e.cm,i,e.sel.primIndex),n)}function Yr(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Jr(e,kr(e.cm,r,e.sel.primIndex),i)}function Zr(e,t,n,i){Jr(e,_r(t,n),i)}function Qr(e,t,n){var i=e.history.done,r=K(i);r&&r.ranges?(i[i.length-1]=t,eo(e,t,n)):Jr(e,t,n)}function Jr(e,t,n){eo(e,t,n),Wr(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Cr(at(e,t[n].anchor),at(e,t[n].head))},origin:n&&n.origin};return pe(e,"beforeSelectionChange",e,i),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?kr(e.cm,i.ranges,i.ranges.length-1):t}(e,t,n));var i=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,io(e,t,i,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Li(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),ln(e,"cursorActivity",e))}function no(e){to(e,io(e,e.sel,null,!1))}function io(e,t,n,i){for(var r,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=oo(e,s.anchor,a&&a.anchor,n,i),u=oo(e,s.head,a&&a.head,n,i);(r||l!=s.anchor||u!=s.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new Cr(l,u))}return r?kr(e.cm,r,t.primIndex):t}function ro(e,t,n,i,r){var o=Ve(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(u?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(c?a.to>=t.ch:a.to>t.ch))){if(r&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?c:u)&&(h=so(e,h,-i,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=tt(h,n))&&(i<0?d<0:d>0))return ro(e,h,t,i,r)}var f=l.find(i<0?-1:1);return(i<0?u:c)&&(f=so(e,f,i,f.line==t.line?o:null)),f?ro(e,f,t,i,r):null}}return t}function oo(e,t,n,i,r){var o=i||1;return ro(e,t,n,o,r)||!r&&ro(e,t,n,o,!0)||ro(e,t,n,-o,r)||!r&&ro(e,t,n,-o,!0)||(e.cantEdit=!0,et(e.first,0))}function so(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:n>0&&t.ch==(i||Ve(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function ao(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),j)}function lo(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(t,n,r,o){t&&(i.from=at(e,t)),n&&(i.to=at(e,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),pe(e,"beforeChange",e,i),e.cm&&pe(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 uo(e,t,n){if(e.cm){if(!e.cm.curOp)return er(e.cm,uo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=lo(e,t,!0))){var i=wt&&!n&&function(e,t,n){var i=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||i&&-1!=R(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:t,to:n}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<r.length;++l){var u=r[l];if(!(tt(u.to,a.from)<0||tt(u.from,a.to)>0)){var c=[l,1],h=tt(u.from,a.from),d=tt(u.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),r.splice.apply(r,c),l+=c.length-3}}return r}(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)co(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ar(e,t);Rr(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,Et(e,t));var i=[];Or(e,(function(e,n){n||-1!=R(i,e.history)||(yo(e.history,t),i.push(e.history)),po(e,t,null,Et(e,t))}))}}function ho(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u<a.length&&(r=a[u],n?!r.ranges||r.equals(e.sel):r.ranges);u++);if(u!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=a.pop()).ranges){if(i)return void a.push(r);break}if(jr(r,l),n&&!r.equals(e.sel))return void Jr(e,r,{clearRedo:!1});s=r}var c=[];jr(s,l),l.push({changes:c,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var h=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),d=function(n){var i=r.changes[n];if(i.origin=t,h&&!lo(e,i,!1))return a.length=0,{};c.push(Pr(e,i));var o=n?Ar(e,i):K(a);po(e,i,o,Ur(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Er(i)});var s=[];Or(e,(function(e,t){t||-1!=R(s,e.history)||(yo(e.history,i),s.push(e.history)),po(e,i,null,Ur(e,i))}))},f=r.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new Dr(X(e.sel.ranges,(function(e){return new Cr(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)di(e.cm,i,"gutter")}}function po(e,t,n,i){if(e.cm&&!e.cm.curOp)return er(e.cm,po)(e,t,n,i);if(t.to.line<e.first)fo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);fo(e,r),t={from:et(e.first,0),to:et(t.to.line+r,t.to.ch),text:[K(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ve(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ge(e,t.from,t.to),n||(n=Ar(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=Ye(Pt(Ve(i,o.line))),i.iter(l,s.line+1,(function(e){if(e==r.maxLine)return a=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ge(e),Nr(i,t,n,ai(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,(function(e){var t=qt(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,i=t-1;i>n;i--){var r=Ve(e,i).stateAfter;if(r&&(!(r instanceof ut)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(i,o.line),ir(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?hi(e):o.line!=s.line||1!=t.text.length||Mr(e.doc,t)?hi(e,o.line,s.line+1,u):di(e,o.line,"text");var c=ve(e,"changes"),h=ve(e,"change");if(h||c){var d={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&ln(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,i):Nr(e,t,i),eo(e,n,j),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n,i,r){var o;i||(i=n),tt(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),uo(e,{from:n,to:i,text:t,origin:r})}function go(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r],s=!0;if(o.ranges){o.copied||((o=e[r]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)go(o.ranges[a].anchor,t,n,i),go(o.ranges[a].head,t,n,i)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=et(u.from.line+i,u.from.ch),u.to=et(u.to.line+i,u.to.ch);else if(t<=u.to.line){s=!1;break}}s||(e.splice(0,r+1),r=0)}}}function yo(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;vo(e.done,n,i,r),vo(e.undone,n,i,r)}function bo(e,t,n,i){var r=t,o=t;return"number"==typeof t?o=Ve(e,st(e,t)):r=Ye(t),null==r?null:(i(o,r)&&e.cm&&di(e.cm,r,n),o)}function xo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function wo(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}Cr.prototype.from=function(){return ot(this.anchor,this.head)},Cr.prototype.to=function(){return rt(this.anchor,this.head)},Cr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,Gt(r),ln(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,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,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}},wo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),s=i.height;if(i.removeInner(e,o),this.height-=s-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var a=[];this.collapse(a),this.children=[new xo(a)],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,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<=o){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var s=r.lines.length%25+25,a=s;a<r.lines.length;){var l=new xo(r.lines.slice(a,a+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=R(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new wo(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<o){var s=Math.min(t,o-e);if(r.iterN(e,s,n))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var Do=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};function Co(e,t,n){$t(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Fi(e,n)}Do.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=Ye(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var o=wn(this);Xe(n,Math.max(0,n.height-o)),e&&(Ji(e,(function(){Co(e,n,-o),di(e,i,"widget")})),ln(e,"lineWidgetCleared",e,this,i))}},Do.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=wn(this)-t;r&&(Wt(this.doc,i)||Xe(i,i.height+r),n&&Ji(n,(function(){n.curOp.forceUpdate=!0,Co(n,i,r),ln(n,"lineWidgetChanged",n,e,Ye(i))})))},ye(Do);var ko=0,_o=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ko};function Eo(e,t,n,i,r){if(i&&i.shared)return function(e,t,n,i,r){(i=z(i)).shared=!1;var o=[Eo(e,t,n,i,r)],s=o[0],a=i.widgetNode;return Or(e,(function(e){a&&(i.widgetNode=a.cloneNode(!0)),o.push(Eo(e,at(e,t),at(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=K(o)})),new So(o,s)}(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return er(e.cm,Eo)(e,t,n,i,r);var o=new _o(e,r),s=tt(t,n);if(i&&z(i,o,!1),s>0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=F("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(zt(e,t.line,t,n,o)||t.line!=n.line&&zt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Dt=!0}o.addToHistory&&Rr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(i){u&&o.collapsed&&!u.options.lineWrapping&&Pt(i)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Xe(i,0),function(e,t,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));i&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}(i,new Ct(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Wt(e,t)&&Xe(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)hi(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)di(u,c,"text");o.atomic&&no(u.doc),ln(u,"markerAdded",u,o)}return o}_o.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vi(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=kt(s.markedSpans,this);e&&!this.collapsed?di(e,Ye(s),"text"):e&&(null!=a.to&&(r=Ye(s)),null!=a.from&&(i=Ye(s))),s.markedSpans=_t(s.markedSpans,a),null==a.from&&this.collapsed&&!Wt(this.doc,s)&&e&&Xe(s,ii(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Pt(this.lines[l]),c=qt(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&hi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,i,r),t&&Gi(e),this.parent&&this.parent.clear()}},_o.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],s=kt(o.markedSpans,this);if(null!=s.from&&(n=et(t?o:Ye(o),s.from),-1==e))return n;if(null!=s.to&&(i=et(t?o:Ye(o),s.to),1==e))return i}return n&&{from:n,to:i}},_o.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;t&&i&&Ji(i,(function(){var r=t.line,o=Ye(t.line),s=Ln(i,o);if(s&&(Pn(s),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Wt(n.doc,r)&&null!=n.height){var a=n.height;n.height=null;var l=wn(n)-a;l&&Xe(r,r.height+l)}ln(i,"markerChanged",i,e)}))},_o.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=R(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},_o.prototype.detachLine=function(e){if(this.lines.splice(R(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(_o);var So=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ao(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function To(e){for(var t=function(t){var n=e[t],i=[n.primary.doc];Or(n.primary.doc,(function(e){return i.push(e)}));for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==R(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<e.length;n++)t(n)}So.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},So.prototype.find=function(e,t){return this.primary.find(e,t)},ye(So);var Fo=0,Lo=function(e,t,n,i,r){if(!(this instanceof Lo))return new Lo(e,t,n,i,r);null==n&&(n=0),wo.call(this,[new xo([new Vt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=_r(o),this.history=new zr(null),this.id=++Fo,this.modeOption=t,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Nr(this,{from:o,to:o,text:e}),Jr(this,_r(o),j)};Lo.prototype=Z(wo.prototype,{constructor:Lo,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:nr((function(e){var t=et(this.first,0),n=this.first+this.size-1;uo(this,{from:t,to:et(n,Ve(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Mi(this.cm,0,0),Jr(this,_r(t),j)})),replaceRange:function(e,t,n,i){mo(this,e,t=at(this,t),n=n?at(this,n):t,i)},getRange:function(e,t,n){var i=Ge(this,at(this,e),at(this,t));return!1===n?i:""===n?i.join(""):i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ve(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ve(this,e)),Pt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return at(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:nr((function(e,t,n){Zr(this,at(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:nr((function(e,t,n){Zr(this,at(this,e),at(this,t||e),n)})),extendSelection:nr((function(e,t,n){Kr(this,at(this,e),t&&at(this,t),n)})),extendSelections:nr((function(e,t){Xr(this,lt(this,e),t)})),extendSelectionsBy:nr((function(e,t){Xr(this,lt(this,X(this.sel.ranges,e)),t)})),setSelections:nr((function(e,t,n){if(e.length){for(var i=[],r=0;r<e.length;r++)i[r]=new Cr(at(this,e[r].anchor),at(this,e[r].head||e[r].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Jr(this,kr(this.cm,i,t),n)}})),addSelection:nr((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new Cr(at(this,e),at(this,t||e))),Jr(this,kr(this.cm,i,i.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=Ge(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Ge(this,n[i].from(),n[i].to());!1!==e&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:nr((function(e,t,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var s=r.ranges[o];i[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&function(e,t,n){for(var i=[],r=et(e.first,0),o=r,s=0;s<t.length;s++){var a=t[s],l=Tr(a.from,r,o),u=Tr(Er(a),r,o);if(r=a.to,o=u,"around"==n){var c=e.sel.ranges[s],h=tt(c.head,c.anchor)<0;i[s]=new Cr(h?u:l,h?l:u)}else i[s]=new Cr(l,l)}return new Dr(i,e.sel.primIndex)}(this,i,t),l=i.length-1;l>=0;l--)uo(this,i[l]);a?Qr(this,a):this.cm&&Li(this.cm)})),undo:nr((function(){ho(this,"undo")})),redo:nr((function(){ho(this,"redo")})),undoSelection:nr((function(){ho(this,"undo",!0)})),redoSelection:nr((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new zr(this.history),Or(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:Vr(this.history.done),undone:Vr(this.history.undone)}},setHistory:function(e){var t=this.history=new zr(this.history);t.done=Vr(e.done.slice(0),null,!0),t.undone=Vr(e.undone.slice(0),null,!0)},setGutterMarker:nr((function(e,t,n){return bo(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&te(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:nr((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Ve(this,e)))return null}else if(null==(t=Ye(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:nr((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(k(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:nr((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var o=r.match(k(n));if(!o)return!1;var s=o.index+o[0].length;e[i]=r.slice(0,o.index)+(o.index&&s!=r.length?" ":"")+r.slice(s)||null}return!0}))})),addLineWidget:nr((function(e,t,n){return function(e,t,n,i){var r=new Do(e,n,i),o=e.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!Wt(e,t)){var i=$t(t)<e.scrollTop;Xe(t,t.height+wn(r)),i&&Fi(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&ln(o,"lineWidgetAdded",o,r,"number"==typeof t?t:Ye(t)),r}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Eo(this,at(this,e),at(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Eo(this,e=at(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ve(this,(e=at(this,e)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=at(this,e),t=at(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&r==e.line&&e.ch>=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)})),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var o=r.text.length+i;if(o>e)return t=e,!0;e-=o,++n})),at(this,et(n,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Lo(Ke(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var i=new Lo(Ke(this,t,n),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 n=0;n<t.length;n++){var i=t[n],r=i.find(),o=e.clipPos(r.from),s=e.clipPos(r.to);if(tt(o,s)){var a=Eo(e,o,s,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}(i,Ao(this)),i},unlinkDoc:function(e){if(e instanceof Ss&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),To(Ao(this));break}if(e.history==this.history){var n=[e.id];Or(e,(function(e){return n.push(e.id)}),!0),e.history=new zr(null),e.history.done=Vr(this.history.done,n),e.history.undone=Vr(this.history.undone,n)}},iterLinkedDocs:function(e){Or(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Le(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:nr((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Ji(t=this.cm,(function(){Ir(t),hi(t)})))}))}),Lo.prototype.eachLine=Lo.prototype.iter;var Mo=0;function No(e){var t=this;if(Oo(t),!me(t,e)&&!Dn(t.display,e)){be(e),s&&(Mo=+new Date);var n=ui(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),a=0,l=function(){++a==r&&er(t,(function(){var e={from:n=at(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};uo(t.doc,e),Qr(t.doc,_r(at(t.doc,n),at(t.doc,Er(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==R(t.options.allowDropFileTypes,e.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},i.readAsText(e)}},c=0;c<i.length;c++)u(i[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,_r(n,n)),d)for(var f=0;f<d.length;++f)mo(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Oo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Bo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Io=!1;function zo(){var e;Io||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Bo(Po)}),100))})),he(window,"blur",(function(){return Bo(_i)})),Io=!0)}function Po(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ho={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ro=0;Ro<10;Ro++)Ho[Ro+48]=Ho[Ro+96]=String(Ro);for(var Wo=65;Wo<=90;Wo++)Ho[Wo]=String.fromCharCode(Wo);for(var jo=1;jo<=12;jo++)Ho[jo+111]=Ho[jo+63235]="F"+jo;var $o={};function qo(e){var t,n,i,r,o=e.split(/-(?!$)/);e=o[o.length-1];for(var s=0;s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Uo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete e[n];continue}for(var r=X(n.split(" "),qo),o=0;o<r.length;o++){var s=void 0,a=void 0;o==r.length-1?(a=r.join(" "),s=i):(a=r.slice(0,o+1).join(" "),s="...");var l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[n]}for(var u in t)e[u]=t[u];return e}function Vo(e,t,n,i){var r=(t=Yo(t)).call?t.call(e,i):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Vo(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var s=Vo(e,t.fallthrough[o],n,i);if(s)return s}}}function Go(e){var t="string"==typeof e?e:Ho[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ko(e,t,n){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(D?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(D?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Xo(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=Ho[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ko(n,e,t))}function Yo(e){return"string"==typeof e?$o[e]:e}function Zo(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&&tt(o.from,K(i).to)<=0;){var s=i.pop();if(tt(s.from,o.from)<0){o.from=s.from;break}}i.push(o)}Ji(e,(function(){for(var t=i.length-1;t>=0;t--)mo(e.doc,"",i[t].from,i[t].to,"+delete");Li(e)}))}function Qo(e,t,n){var i=re(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Jo(e,t,n){var i=Qo(e,t.ch,n);return null==i?null:new et(t.line,i,n<0?"after":"before")}function es(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=ue(n,t.doc.direction);if(o){var s,a=r<0?K(o):o[0],l=r<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Mn(t,n);s=r<0?n.text.length-1:0;var c=Nn(t,u,s).top;s=oe((function(e){return Nn(t,u,e).top==c}),r<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Qo(n,s,1))}else s=r<0?a.to:a.from;return new et(i,s,l)}}return new et(i,r<0?n.text.length:0,r<0?"before":"after")}$o.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"},$o.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"},$o.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$o.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"]},$o.default=y?$o.macDefault:$o.pcDefault;var ts={selectAll:ao,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=Ve(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zo(e,(function(t){return{from:et(t.from().line,0),to:at(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"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(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ns(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return is(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ve(e.doc,t),i=function(e){for(var t;t=Bt(e);)e=t.find(1,!0).line;return e}(n);return i!=n&&(t=Ye(i)),es(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),q)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),q)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?is(e,t.head):i}),q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},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=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),s=P(e.getLine(o.line),o.ch,i);t.push(G(i-s%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ji(e,(function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++)if(t[i].empty()){var r=t[i].head,o=Ve(e.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new et(r.line,r.ch-1)),r.ch>0)r=new et(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),et(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var s=Ve(e.doc,r.line-1).text;s&&(r=new et(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),et(r.line-1,s.length-1),r,"+transpose"))}n.push(new Cr(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ji(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Li(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ns(e,t){var n=Ve(e.doc,t),i=Pt(n);return i!=n&&(t=Ye(i)),es(!0,e,i,t,1)}function is(e,t){var n=ns(e,t.line),i=Ve(e.doc,n.line),r=ue(i,e.doc.direction);if(!r||0==r[0].level){var o=Math.max(n.ch,i.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,s?0:o,n.sticky)}return n}function rs(e,t,n){if("string"==typeof t&&!(t=ts[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=W}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}var os=new H;function ss(e,t,n,i){var r=e.state.keySeq;if(r){if(Go(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:os.set(50,(function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())})),as(e,r+" "+t,n,i))return!0}return as(e,t,n,i)}function as(e,t,n,i){var r=function(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=Vo(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&Vo(t,e.options.extraKeys,n,e)||Vo(t,e.options.keyMap,n,e)}(e,t,i);return"multi"==r&&(e.state.keySeq=t),"handled"==r&&ln(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(be(n),wi(e)),!!r}function ls(e,t){var n=Xo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ss(e,"Shift-"+n,t,(function(t){return rs(e,t,!0)}))||ss(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return rs(e,t)})):ss(e,n,t,(function(t){return rs(e,t)})))}var us=null;function cs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=M(),me(t,e)))){s&&a<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var r=ls(t,e);h&&(us=r?i:null,r||88!=i||Ne||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n))}N(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n)}(t)}}function hs(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function ds(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Dn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(h&&n==us)return us=null,void be(e);if(!h||e.which&&!(e.which<10)||!ls(t,e)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(function(e,t,n){return ss(e,"'"+n+"'",t,(function(t){return rs(e,t,!0)}))}(t,e,r)||t.display.input.onKeyPress(e))}}}var fs,ps,ms=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gs(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Dn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!bs(t,e)){var i=ui(t,e),r=ke(e),o=i?function(e,t){var n=+new Date;return ps&&ps.compare(n,e,t)?(fs=ps=null,"triple"):fs&&fs.compare(n,e,t)?(ps=new ms(n,e,t),fs=null,"double"):(fs=new ms(n,e,t),ps=null,"single")}(i,r):"single";window.focus(),1==r&&t.state.selectingText&&t.state.selectingText(e),i&&function(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),ss(e,Ko(o=(1==t?"Left":2==t?"Middle":"Right")+o,r),r,(function(t){if("string"==typeof t&&(t=ts[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,n)!=W}finally{e.state.suppressEdits=!1}return i}))}(t,r,i,o,e)||(1==r?i?function(e,t,n,i){s?setTimeout(I(Di,e),0):e.curOp.focus=M();var r,o=function(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(null==r.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}(e,n,i),u=e.doc.sel;e.options.dragDrop&&Se&&!e.isReadOnly()&&"single"==n&&(r=u.contains(t))>-1&&(tt((r=u.ranges[r]).from(),t)<0||t.xRel>0)&&(tt(r.to(),t)>0||t.xRel<0)?function(e,t,n,i){var r=e.display,o=!1,u=er(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ci(e)),fe(r.wrapper.ownerDocument,"mouseup",u),fe(r.wrapper.ownerDocument,"mousemove",c),fe(r.scroller,"dragstart",h),fe(r.scroller,"drop",u),o||(be(t),i.addNew||Kr(e.doc,n,null,null,i.extend),l&&!d||s&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=u,u.copy=!i.moveOnDrag,he(r.wrapper.ownerDocument,"mouseup",u),he(r.wrapper.ownerDocument,"mousemove",c),he(r.scroller,"dragstart",h),he(r.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}(e,i,t,o):function(e,t,n,i){s&&Ci(e);var r=e.display,o=e.doc;be(t);var a,l,u=o.sel,c=u.ranges;if(i.addNew&&!i.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new Cr(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new Cr(n,n)),n=ui(e,t,!0,!0),l=-1;else{var h=vs(e,n,i.unit);a=i.extend?Gr(a,h.anchor,h.head,i.extend):h}i.addNew?-1==l?(l=c.length,Jr(o,kr(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==i.unit&&!i.extend?(Jr(o,kr(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Yr(o,l,a,$):(l=0,Jr(o,new Dr([a],0),$),u=o.sel);var d=n;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==i.unit){for(var r=[],s=e.options.tabSize,c=P(Ve(o,n.line).text,n.ch,s),h=P(Ve(o,t.line).text,t.ch,s),f=Math.min(c,h),p=Math.max(c,h),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ve(o,m).text,y=U(v,f,s);f==p?r.push(new Cr(et(m,y),et(m,y))):v.length>y&&r.push(new Cr(et(m,y),et(m,U(v,p,s))))}r.length||r.push(new Cr(n,n)),Jr(o,kr(e,u.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=vs(e,t,i.unit),D=x.anchor;tt(w.anchor,D)>0?(b=w.head,D=ot(x.from(),w.anchor)):(b=w.anchor,D=rt(x.to(),w.head));var C=u.ranges.slice(0);C[l]=function(e,t){var n=t.anchor,i=t.head,r=Ve(e.doc,n.line);if(0==tt(n,i)&&n.sticky==i.sticky)return t;var o=ue(r);if(!o)return t;var s=ae(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ae(o,i.ch,i.sticky),h=c-s||(i.ch-n.ch)*(1==a.level?-1:1);l=c==u-1||c==u?h<0:h>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,m=f?"after":"before";return n.ch==p&&n.sticky==m?t:new Cr(new et(n.line,p,m),i)}(e,new Cr(at(o,D),b)),Jr(o,kr(e,C,l),$)}}var p=r.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,s=ui(e,t,!0,"rectangle"==i.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=M(),f(s);var a=Ai(r,o);(s.line>=a.to||s.line<a.from)&&setTimeout(er(e,(function(){m==n&&g(t)})),150)}else{var l=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;l&&setTimeout(er(e,(function(){m==n&&(r.scroller.scrollTop+=l,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(be(t),r.input.focus()),fe(r.wrapper.ownerDocument,"mousemove",y),fe(r.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=er(e,(function(e){0!==e.buttons&&ke(e)?g(e):v(e)})),b=er(e,v);e.state.selectingText=b,he(r.wrapper.ownerDocument,"mousemove",y),he(r.wrapper.ownerDocument,"mouseup",b)}(e,i,t,o)}(t,i,o,e):Ce(e)==n.scroller&&be(e):2==r?(i&&Kr(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(C?t.display.input.onContextMenu(e):Ci(t)))}}function vs(e,t,n){if("char"==n)return new Cr(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Cr(et(t.line,0),at(e.doc,et(t.line+1,0)));var i=n(e,t);return new Cr(i.from,i.to)}function ys(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&be(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ve(e,n))return we(t);o-=a.top-s.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=s.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=r)return pe(e,n,e,Ze(e.doc,o),e.display.gutterSpecs[l].className,t),we(t)}}function bs(e,t){return ys(e,t,"gutterClick",!0)}function xs(e,t){Dn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ys(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ws(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}ms.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Ds={toString:function(){return"CodeMirror.Init"}},Cs={},ks={};function _s(e,t,n){if(!t!=!(n&&n!=Ds)){var i=e.display.dragFunctions,r=t?he:fe;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function Es(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Ut(e)),li(e),hi(e),Rn(e),setTimeout((function(){return Wi(e)}),100)}function Ss(e,t){var n=this;if(!(this instanceof Ss))return new Ss(e,t);this.options=t=t?z(t):{},z(Cs,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 r=new Ss.inputStyles[t.inputStyle](this),o=this.display=new gr(e,i,r,t);for(var u in o.wrapper.CodeMirror=this,ws(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qi(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 H,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",er(e,gs)),he(t.scroller,"dblclick",s&&a<11?er(e,(function(t){if(!me(e,t)){var n=ui(e,t);if(n&&!bs(e,t)&&!Dn(e.display,t)){be(t);var i=e.findWordAt(n);Kr(e.doc,i.anchor,i.head)}}})):function(t){return me(e,t)||be(t)}),he(t.scroller,"contextmenu",(function(t){return xs(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xs(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}he(t.scroller,"touchstart",(function(r){if(!me(e,r)&&!o(r)&&!bs(e,r)){t.input.ensurePolled(),clearTimeout(n);var s=+new Date;t.activeTouch={start:s,moved:!1,prev:s-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Dn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!i.prev||l(i,i.prev)?new Cr(s,s):!i.prev.prev||l(i,i.prev.prev)?e.findWordAt(s):new Cr(et(s.line,0),at(e.doc,et(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),be(n)}r()})),he(t.scroller,"touchcancel",r),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Bi(e,t.scroller.scrollTop),zi(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return wr(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return wr(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||De(t)},over:function(t){me(e,t)||(function(e,t){var n=ui(e,t);if(n){var i=document.createDocumentFragment();yi(e,n,i),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,i)}}(e,t),De(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Mo<100))De(t);else if(!me(e,t)&&!Dn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:er(e,No),leave:function(t){me(e,t)||Oo(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return hs.call(e,t)})),he(u,"keydown",er(e,cs)),he(u,"keypress",er(e,ds)),he(u,"focus",(function(t){return ki(e,t)})),he(u,"blur",(function(t){return _i(e,t)}))}(this),zo(),Vi(this),this.curOp.forceUpdate=!0,Br(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&ki(n)}),20):_i(this),ks)ks.hasOwnProperty(u)&&ks[u](this,t[u],Ds);dr(this),t.finishInit&&t.finishInit(this);for(var c=0;c<As.length;++c)As[c](this);Gi(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ss.defaults=Cs,Ss.optionHandlers=ks;var As=[];function Ts(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=ft(e,t).state:n="prev");var s=e.options.tabSize,a=Ve(o,t),l=P(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(r,a.text.slice(c.length),a.text))==W||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?P(Ve(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)d+=s,h+="\t";if(d<u&&(h+=G(u-d)),h!=c)return mo(o,h,et(t,0),et(t,c.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var g=et(t,c.length);Yr(o,p,new Cr(g,g));break}}}Ss.defineInitHook=function(e){return As.push(e)};var Fs=null;function Ls(e){Fs=e}function Ms(e,t,n,i,r){var o=e.doc;e.display.shift=!1,i||(i=o.sel);var s=+new Date-200,a="paste"==r||e.state.pasteIncoming>s,l=Le(t),u=null;if(a&&i.ranges.length>1)if(Fs&&Fs.text.join("\n")==t){if(i.ranges.length%Fs.text.length==0){u=[];for(var c=0;c<Fs.text.length;c++)u.push(o.splitLines(Fs.text[c]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(u=X(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var f=i.ranges[d],p=f.from(),m=f.to();f.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!a?m=et(m.line,Math.min(Ve(o,m.line).text.length,m.ch+K(l).length)):a&&Fs&&Fs.lineWise&&Fs.text.join("\n")==l.join("\n")&&(p=m=et(p.line,0)));var g={from:p,to:m,text:u?u[d%u.length]:l,origin:r||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};uo(e.doc,g),ln(e,"inputRead",e,g)}t&&!a&&Os(e,t),Li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ns(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ji(t,(function(){return Ms(t,n,0,null,"paste")})),!0}function Os(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){s=Ts(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ve(e.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Ts(e,r.head.line,"smart"));s&&ln(e,"electricInput",e,r.head.line)}}}function Bs(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,o={anchor:et(r,0),head:et(r+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Is(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function zs(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Is(e),t}function Ps(e,t,n,i,r){var o=t,s=n,a=Ve(e,t.line),l=r&&"rtl"==e.direction?-n:n;function u(o){var s,u;if("codepoint"==i){var c=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))s=null;else{var h=n>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(h?2:1))),-n)}}else s=r?function(e,t,n,i){var r=ue(t,e.doc.direction);if(!r)return Jo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ae(r,n.ch,n.sticky),s=r[o];if("ltr"==e.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from<n.ch))return Jo(t,n,i);var a,l=function(e,n){return Qo(t,e instanceof et?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(a=a||Mn(e,t),Qn(e,t,a,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==s.level){var h=1==s.level==i<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=s.to&&d<=c.end:d>=s.from&&d>=c.begin)){var f=h?"before":"after";return new et(n.line,d,f)}}var p=function(e,t,i){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<r.length;e+=t){var s=r[e],a=t>0==(1!=s.level),u=a?i.begin:l(i.end,-1);if(s.from<=u&&u<s.to)return o(u,a);if(u=a?s.from:l(s.to,-1),i.begin<=u&&u<i.end)return o(u,a)}},m=p(o+i,i,c);if(m)return m;var g=i>0?c.end:l(c.begin,-1);return null==g||i>0&&g==t.text.length||!(m=p(i>0?0:r.length-1,i,u(g)))?null:m}(e.cm,a,t,n):Jo(a,t,n);if(null==s){if(o||((u=t.line+l)<e.first||u>=e.first+e.size||(t=new et(u,t.ch,t.sticky),!(a=Ve(e,u)))))return!1;t=es(r,e.cm,a,t.line,l)}else t=s;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var c=null,h="group"==i,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var p=a.text.charAt(t.ch)||"\n",m=ee(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||m||(m="s"),c&&c!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(c=m),n>0&&!u(!f))break}var g=oo(e,t,o,s,!0);return nt(o,g)&&(g.hitSide=!0),g}function Hs(e,t,n,i){var r,o,s=e.doc,a=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*ii(e.display),3);r=(n>0?t.bottom:t.top)+n*u}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Yn(e,a,r)).outside;){if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Rs=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ws(e,t){var n=Ln(e,t.line);if(!n||n.hidden)return null;var i=Ve(e.doc,t.line),r=Tn(n,i,t.line),o=ue(i,e.doc.direction),s="left";o&&(s=ae(o,t.ch)%2?"right":"left");var a=In(r.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function js(e,t){return t&&(e.bad=!0),e}function $s(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return js(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=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 r=0;r<e.display.view.length;r++){var o=e.display.view[r];if(o.node==i)return qs(o,t,n)}}function qs(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!L(i,t))return js(et(Ye(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var o=e.rest?K(e.rest):e.line;return js(et(Ye(o),o.text.length),r)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var l=e.measure,u=l.maps;function c(t,n,i){for(var r=-1;r<(u?u.length:0);r++)for(var o=r<0?l.map:u[r],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==n){var c=Ye(r<0?e.line:e.rest[r]),h=o[s]+i;return(i<0||a!=t)&&(h=o[s+(i?1:0)]),et(c,h)}}}var h=c(s,a,n);if(h)return js(h,r);for(var d=a.nextSibling,f=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(h=c(d,d.firstChild,0))return js(et(h.line,h.ch-f),r);f+=d.textContent.length}for(var p=a.previousSibling,m=n;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return js(et(h.line,h.ch+m),r);m+=p.textContent.length}}Rs.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function s(e){if(o(e)&&!me(i,e)){if(i.somethingSelected())Ls({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Bs(i);Ls({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,j),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var s=Fs.text.join("\n");if(e.clipboardData.setData("Text",s),e.clipboardData.getData("Text")==s)return void e.preventDefault()}var a=zs(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Fs.text.join("\n");var u=M();B(l),setTimeout((function(){i.display.lineSpace.removeChild(a),u.focus(),u==r&&n.showPrimarySelection()}),50)}}r.contentEditable=!0,Is(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),he(r,"paste",(function(e){!o(e)||me(i,e)||Ns(e,i)||a<=11&&setTimeout(er(i,(function(){return t.updateFromDOM()})),20)})),he(r,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(r,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(r,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(r,"touchstart",(function(){return n.forceCompositionEnd()})),he(r,"input",(function(){t.composing||t.readFromDOMSoon()})),he(r,"copy",s),he(r,"cut",s)},Rs.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Rs.prototype.prepareSelection=function(){var e=vi(this.cm,!1);return e.focus=M()==this.div,e},Rs.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Rs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Rs.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var s=$s(t,e.anchorNode,e.anchorOffset),a=$s(t,e.focusNode,e.focusOffset);if(!s||s.bad||!a||a.bad||0!=tt(ot(s,a),r)||0!=tt(rt(s,a),o)){var l=t.display.view,u=r.line>=t.display.viewFrom&&Ws(t,r)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ws(t,o);if(!c){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=_(u.node,u.offset,c.offset,c.node)}catch(e){}f&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Rs.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)},Rs.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Rs.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Rs.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return L(this.div,t)},Rs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&M()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Rs.prototype.blur=function(){this.div.blur()},Rs.prototype.getField=function(){return this.div},Rs.prototype.supportsTouch=function(){return!0},Rs.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ji(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))}))},Rs.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Rs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=$s(t,e.anchorNode,e.anchorOffset),i=$s(t,e.focusNode,e.focusOffset);n&&i&&Ji(t,(function(){Jr(t.doc,_r(n,i),j),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},Rs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),s=o.from(),a=o.to();if(0==s.ch&&s.line>i.firstLine()&&(s=et(s.line-1,Ve(i.doc,s.line-1).length)),a.ch==Ve(i.doc,a.line).text.length&&a.line<i.lastLine()&&(a=et(a.line+1,0)),s.line<r.viewFrom||a.line>r.viewTo-1)return!1;s.line==r.viewFrom||0==(e=ci(i,s.line))?(t=Ye(r.view[0].line),n=r.view[0].node):(t=Ye(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,u,c=ci(i,a.line);if(c==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=Ye(r.view[c+1].line)-1,u=r.view[c+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(function(e,t,n,i,r){var o="",s=!1,a=e.doc.lineSeparator(),l=!1;function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function c(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(et(i,0),et(r+1,0),(g=+d,function(e){return e.id==g}));return void(f.length&&(o=f[0].find(0))&&c(Ge(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var m=0;m<t.childNodes.length;m++)h(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),p&&(s=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;h(t),t!=n;)t=t.nextSibling,l=!1;return o}(i,n,u,t,l)),d=Ge(i.doc,et(t,0),et(l,Ve(i.doc,l).text.length));h.length>1&&d.length>1;)if(K(h)==K(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);f<v&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var y=K(h),b=K(d),x=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&t==s.line)for(;f&&f>s.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var w=et(t,f),D=et(l,d.length?K(d).length-p:0);return h.length>1||h[0]||tt(w,D)?(mo(i.doc,h,w,D,"+input"),!0):void 0},Rs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Rs.prototype.reset=function(){this.forceCompositionEnd()},Rs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Rs.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))},Rs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ji(this.cm,(function(){return hi(e.cm)}))},Rs.prototype.setUneditable=function(e){e.contentEditable="false"},Rs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ms)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Rs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Rs.prototype.onContextMenu=function(){},Rs.prototype.resetPosition=function(){},Rs.prototype.needsContentAttribute=!0;var Us=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};Us.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!me(i,e)){if(i.somethingSelected())Ls({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Bs(i);Ls({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,j):(n.prevInput="",r.value=t.text.join("\n"),B(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),he(r,"input",(function(){s&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(r,"paste",(function(e){me(i,e)||Ns(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),he(r,"cut",o),he(r,"copy",o),he(e.scroller,"paste",(function(t){if(!Dn(e,t)&&!me(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){Dn(e,t)||be(t)})),he(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),he(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Us.prototype.createField=function(e){this.wrapper=zs(),this.textarea=this.wrapper.firstChild},Us.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Us.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=vi(e);if(e.options.moveInputWithCursor){var r=Gn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},Us.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Us.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&B(this.textarea),s&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},Us.prototype.getField=function(){return this.textarea},Us.prototype.supportsTouch=function(){return!1},Us.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Us.prototype.blur=function(){this.textarea.blur()},Us.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Us.prototype.receivedFocus=function(){this.slowPoll()},Us.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Us.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Us.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Me(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(i.length,r.length);l<u&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Ji(t,(function(){Ms(t,r.slice(l),i.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Us.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Us.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Us.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ui(n,e),u=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&er(n,Jr)(n.doc,_r(o),j);var c,d=r.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),i.input.focus(),l&&window.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&g(),C){De(e);var m=function(){fe(window,"mouseup",m),setTimeout(v,20)};he(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var e=n.somethingSelected(),o=""+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,r.style.cssText=d,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!s||s&&a<9)&&g();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==t.prevInput?er(n,ao)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Us.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Us.prototype.setUneditable=function(){},Us.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=Ds&&r(e,t,n)}:r)}e.defineOption=n,e.Init=Ds,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Fr(e)}),!0),n("indentUnit",2,Fr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Lr(e),Rn(e),hi(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(et(i,o))}i++}));for(var r=n.length-1;r>=0;r--)mo(e.doc,t,n[r],et(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ds&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){ws(e),mr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Yo(t),r=n!=Ds&&Yo(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Es,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fr(t,e.options.lineNumbers),mr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?si(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Wi(e)}),!0),n("scrollbarStyle","native",(function(e){qi(e),Wi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fr(e.options.gutters,t),mr(e)}),!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",(function(e){return e}),mr,!0),n("showCursorWhenSelecting",!1,gi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(_i(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,_s),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gi,!0),n("singleCursorHeightPerLine",!0,gi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Lr,!0),n("addModeClass",!1,Lr,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Lr,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ss),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&er(this,t[e])(this,n,r),pe(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"](Yo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:tr((function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");(function(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)})(this.state.overlays,{mode:i,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,hi(this)})),removeOverlay:tr((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void hi(this)}})),indentLine:tr((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ts(this,e,t,n)})),indentSelection:tr((function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(Ts(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&Li(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l<n;++l)Ts(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[i].from().ch>0&&Yr(this.doc,i,new Cr(o,u[i].to()),j)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,n=dt(this,Ve(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]<o)){t=n[2*s+2];break}i=s+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!n.hasOwnProperty(t))return i;var r=n[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&i.push(r[o[t]]);else if(o[t])for(var s=0;s<o[t].length;s++){var a=r[o[t][s]];a&&i.push(a)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var u=r._global[l];u.pred(o,this)&&-1==R(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(e,t){var n=this.doc;return ft(this,(e=st(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Gn(this,null==e?n.head:"object"==typeof e?at(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Vn(this,at(this.doc,e),t||"page")},coordsChar:function(e,t){return Yn(this,(e=Un(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Un(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var i,r=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,r=!0),i=Ve(this.doc,e)}else i=e;return qn(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-$t(i):0)},defaultTextHeight:function(){return ii(this.display)},defaultCharWidth:function(){return ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o,s,a,l=this.display,u=(e=Gn(this,at(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)u=e.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==r?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?c=0:"middle"==r&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,s={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=Ti(o,s)).scrollTop&&Bi(o,a.scrollTop),null!=a.scrollLeft&&zi(o,a.scrollLeft))},triggerOnKeyDown:tr(cs),triggerOnKeyPress:tr(ds),triggerOnKeyUp:hs,triggerOnMouseDown:tr(gs),execCommand:function(e){if(ts.hasOwnProperty(e))return ts[e].call(null,this)},triggerElectric:tr((function(e){Os(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=at(this.doc,e),s=0;s<t&&!(o=Ps(this.doc,o,r,n,i)).hitSide;++s);return o},moveH:tr((function(e,t){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Ps(n.doc,i.head,e,t,n.options.rtlMoveVisually):e<0?i.from():i.to()}),q)})),deleteH:tr((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Zo(this,(function(n){var r=Ps(i,n.head,e,t,!1);return e<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1,o=i;t<0&&(r=-1,t=-t);for(var s=at(this.doc,e),a=0;a<t;++a){var l=Gn(this,s,"div");if(null==o?o=l.left:l.left=o,(s=Hs(this,l,r,n)).hitSide)break}return s},moveV:tr((function(e,t){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(s){if(o)return e<0?s.from():s.to();var a=Gn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),r.push(a.left);var l=Hs(n,a,e,t);return"page"==t&&s==i.sel.primary()&&Fi(n,Vn(n,l,"div").top-a.top),l}),q),r.length)for(var s=0;s<i.sel.ranges.length;s++)i.sel.ranges[s].goalColumn=r[s]})),findWordAt:function(e){var t=Ve(this.doc,e.line).text,n=e.ch,i=e.ch;if(t){var r=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!n?++i:--n;for(var o=t.charAt(n),s=ee(o,r)?function(e){return ee(e,r)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&s(t.charAt(n-1));)--n;for(;i<t.length&&s(t.charAt(i));)++i}return new Cr(et(e.line,n),et(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:tr((function(e,t){Mi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-En(this)-this.display.barHeight,width:e.scrollWidth-En(this)-this.display.barWidth,clientHeight:An(this),clientWidth:Sn(this)}},scrollIntoView:tr((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(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?function(e,t){Ni(e),e.curOp.scrollToPos=t}(this,e):Oi(this,e.from,e.to,e.margin)})),setSize:tr((function(e,t){var n=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&Hn(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){di(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return Ji(this,e)},startOperation:function(){return Vi(this)},endOperation:function(){return Gi(this)},refresh:tr((function(){var e=this.display.cachedTextHeight;hi(this),this.curOp.forceUpdate=!0,Rn(this),Mi(this,this.doc.scrollLeft,this.doc.scrollTop),ur(this.display),(null==e||Math.abs(e-ii(this.display))>.5||this.options.lineWrapping)&&li(this),pe(this,"refresh",this)})),swapDoc:tr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Br(this,e),Rn(this),this.display.input.reset(),Mi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(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}},ye(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}(Ss);var Vs="iter insert remove copy getEditor constructor".split(" ");for(var Gs in Lo.prototype)Lo.prototype.hasOwnProperty(Gs)&&R(Vs,Gs)<0&&(Ss.prototype[Gs]=function(e){return function(){return e.apply(this.doc,arguments)}}(Lo.prototype[Gs]));return ye(Lo),Ss.inputStyles={textarea:Us,contenteditable:Rs},Ss.defineMode=function(e){Ss.defaults.mode||"null"==e||(Ss.defaults.mode=e),ze.apply(this,arguments)},Ss.defineMIME=function(e,t){Ie[e]=t},Ss.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ss.defineMIME("text/plain","null"),Ss.defineExtension=function(e,t){Ss.prototype[e]=t},Ss.defineDocExtension=function(e,t){Lo.prototype[e]=t},Ss.fromTextArea=function(e,t){if((t=t?z(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=M();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=a.getValue()}var r;if(e.form&&(he(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var a=Ss((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=fe,e.on=he,e.wheelEventPixels=xr,e.Doc=Lo,e.splitLines=Le,e.countColumn=P,e.findColumn=U,e.isWordChar=J,e.Pass=W,e.signal=pe,e.Line=Vt,e.changeEnd=Er,e.scrollbarModel=$i,e.Pos=et,e.cmpPos=tt,e.modes=Be,e.mimeModes=Ie,e.resolveMode=Pe,e.getMode=He,e.modeExtensions=Re,e.extendMode=We,e.copyState=je,e.startState=qe,e.innerMode=$e,e.commands=ts,e.keyMap=$o,e.keyName=Xo,e.isModifierKey=Go,e.lookupKey=Vo,e.normalizeKeyMap=Uo,e.StringStream=Ue,e.SharedTextMarker=So,e.TextMarker=_o,e.LineWidget=Do,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=De,e.addClass=N,e.contains=L,e.rmClass=E,e.keyNames=Ho}(Ss),Ss.version="5.62.2",Ss}()},425:(e,t,n)=>{!function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",(function(n,i){var r=0;var o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var s=1+e.pos-o;return n.code?s===r&&(n.code=!1):(r=s,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,!1!==i.gitHubSpice)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},s={taskLists:!0,strikethrough:!0,emoji:!0};for(var a in i)s[a]=i[a];return s.name="markdown",e.overlayMode(e.getMode(n,s),o)}),"markdown"),e.defineMIME("text/x-gfm","gfm")}(n(631),n(47),n(146))},47:(e,t,n)=>{!function(e){"use strict";e.defineMode("markdown",(function(t,n){var i=e.getMode(t,"text/html"),r="null"==i.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in o)o.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(o[s]=n.tokenTypeOverrides[s]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,c=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==x){var n=r;if(!n){var o=e.innerMode(i,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=k,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(i,r){var s,d=i.column()===r.indentation,m=!(s=r.prevLine.stream)||!/\S/.test(s.string),v=r.indentedCode,y=r.prevLine.hr,b=!1!==r.list,x=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var C=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,b)){for(r.list=null;C<r.listStack[r.listStack.length-1];)r.listStack.pop(),r.listStack.length?r.indentation=r.listStack[r.listStack.length-1]:r.list=!1;!1!==r.list&&(r.indentationDiff=C-r.listStack[r.listStack.length-1])}var k=!(m||y||r.prevLine.header||b&&v||r.prevLine.fencedCodeEnd),_=(!1===r.list||y||m)&&r.indentation<=x&&i.match(a),E=null;if(r.indentationDiff>=4&&(v||r.prevLine.fencedCodeEnd||r.prevLine.header||m))return i.skipToEnd(),r.indentedCode=!0,o.code;if(i.eatSpace())return null;if(d&&r.indentation<=x&&(E=i.match(c))&&E[1].length<=6)return r.quote=0,r.header=E[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,D(r);if(r.indentation<=x&&i.eat(">"))return r.quote=d?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),i.eatSpace(),D(r);if(!_&&!r.setext&&d&&r.indentation<=x&&(E=i.match(l))){var S=E[1]?"ol":"ul";return r.indentation=C+i.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&i.match(u,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+S]),D(r)}return d&&r.indentation<=x&&(E=i.match(f,!0))?(r.quote=0,r.fencedEndRE=new RegExp(E[1]+"+ *$"),r.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}(E[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=w,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,D(r)):r.setext||!(k&&b||r.quote||!1!==r.list||r.code||_||p.test(i.string))&&(E=i.lookAhead(1))&&(E=E.match(h))?(r.setext?(r.header=r.setext,r.setext=0,i.skipToEnd(),n.highlightFormatting&&(r.formatting="header")):(r.header="="==E[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,D(r)):_?(i.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):"["===i.peek()?g(i,r,A):g(i,r,r.inline)}function x(t,n){var o=i.token(t,n.htmlState);if(!r){var s=e.innerMode(i,n.htmlState);("xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=k,n.block=b,n.htmlState=null)}return o}function w(e,t){var i,r=t.listStack[t.listStack.length-1]||0,s=t.indentation<r,a=r+3;return t.fencedEndRE&&t.indentation<=a&&(s||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),s||(i=D(t)),t.localMode=t.localState=null,t.block=b,t.f=k,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,s?v(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function D(e){var t=[];if(e.formatting){t.push(o.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(o.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(o.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function C(e,t){if(e.match(d,!0))return D(t)}function k(t,r){var s=r.text(t,r);if(void 0!==s)return s;if(r.list)return r.list=null,D(r);if(r.taskList)return" "===t.match(u,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,D(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),D(r);var a=t.next();if(r.linkTitle){r.linkTitle=!1;var l=a;"("===a&&(l=")");var c="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(c),!0))return o.linkHref}if("`"===a){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var f=D(r);return r.code=0,f}return r.formatting=h,D(r)}return r.code=d,D(r)}if(r.code)return D(r);if("\\"===a&&(t.next(),n.highlightFormatting)){var p=D(r),g=o.formatting+"-escape";return p?p+" "+g:g}if("!"===a&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),D(r);if("["===a&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),D(r);if("]"===a&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");p=D(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=E,p}if("["===a&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),D(r);if("]"===a&&r.linkText){n.highlightFormatting&&(r.formatting="link");p=D(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?E:k,p}if("<"===a&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=_,n.highlightFormatting&&(r.formatting="link"),(p=D(r))?p+=" ":p="",p+o.linkInline;if("<"===a&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=_,n.highlightFormatting&&(r.formatting="link"),(p=D(r))?p+=" ":p="",p+o.linkEmail;if(n.xml&&"<"===a&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var b=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),v(t,r,x)}if(n.xml&&"<"===a&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===a||"_"===a){for(var w=1,C=1==t.pos?" ":t.string.charAt(t.pos-2);w<3&&t.eat(a);)w++;var S=t.peek()||" ",A=!/\s/.test(S)&&(!m.test(S)||/\s/.test(C)||m.test(C)),T=!/\s/.test(C)&&(!m.test(C)||/\s/.test(S)||m.test(S)),F=null,L=null;if(w%2&&(r.em||!A||"*"!==a&&T&&!m.test(C)?r.em!=a||!T||"*"!==a&&A&&!m.test(S)||(F=!1):F=!0),w>1&&(r.strong||!A||"*"!==a&&T&&!m.test(C)?r.strong!=a||!T||"*"!==a&&A&&!m.test(S)||(L=!1):L=!0),null!=L||null!=F)return n.highlightFormatting&&(r.formatting=null==F?"strong":null==L?"em":"strong em"),!0===F&&(r.em=a),!0===L&&(r.strong=a),f=D(r),!1===F&&(r.em=!1),!1===L&&(r.strong=!1),f}else if(" "===a&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return D(r);t.backUp(1)}if(n.strikethrough)if("~"===a&&t.eatWhile(a)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),f=D(r),r.strikethrough=!1,f;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),D(r)}else if(" "===a&&t.match("~~",!0)){if(" "===t.peek())return D(r);t.backUp(2)}if(n.emoji&&":"===a&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var M=D(r);return r.emoji=!1,M}return" "===a&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),D(r)}function _(e,t){if(">"===e.next()){t.f=t.inline=k,n.highlightFormatting&&(t.formatting="link");var i=D(t);return i?i+=" ":i="",i+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function E(e,t){if(e.eatSpace())return null;var i,r=e.next();return"("===r||"["===r?(t.f=t.inline=(i="("===r?")":"]",function(e,t){if(e.next()===i){t.f=t.inline=k,n.highlightFormatting&&(t.formatting="link-string");var r=D(t);return t.linkHref=!1,r}return e.match(S[i]),t.linkHref=!0,D(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,D(t)):"error"}var S={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=T,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,D(t)):g(e,t,k)}function T(e,t){if(e.match("]:",!0)){t.f=t.inline=F,n.highlightFormatting&&(t.formatting="link");var i=D(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function F(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=k,o.linkHref+" url")}var L={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:k,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=x)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==x?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:L}},indent:function(t,n,r){return t.block==x&&i.indent?i.indent(t.htmlState,n,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},blankLine:y,getType:D,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(631),n(589),n(539))},539:(e,t,n)=>{!function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.mime==t)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==t)return i}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==t)return i}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.file&&i.file.test(t))return i}var r=t.lastIndexOf("."),o=r>-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==t)return i}}}(n(631))},589:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,r){var o,s,a=i.indentUnit,l={},u=r.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in r)l[c]=r[c];function h(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(f("atom","]]>")):null:e.match("--")?n(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(p(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n,i,r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=h,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=h,t.state=y,t.tagName=t.tagStart=null;var s=t.tokenize(e,t);return s?s+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=d;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=h;break}n.next()}return e}}function p(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=p(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=h;break}return n.tokenize=p(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function y(e,t,n){return"openTag"==e?(n.tagStart=t.column(),b):"closeTag"==e?x:y}function b(e,t,n){return"word"==e?(n.tagName=t.current(),s="tag",C):l.allowMissingTagName&&"endTag"==e?(s="tag bracket",C(e,0,n)):(s="error",b)}function x(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(s="tag",w):(s="tag error",D)}return l.allowMissingTagName&&"endTag"==e?(s="tag bracket",w(e,0,n)):(s="error",D)}function w(e,t,n){return"endTag"!=e?(s="error",w):(g(n),y)}function D(e,t,n){return s="error",w(e,0,n)}function C(e,t,n){if("word"==e)return s="attribute",k;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(i)?v(n,i):(v(n,i),n.context=new m(n,i,r==n.indented)),y}return s="error",C}function k(e,t,n){return"equals"==e?_:(l.allowMissing||(s="error"),C(e,0,n))}function _(e,t,n){return"string"==e?E:"word"==e&&l.allowUnquoted?(s="string",C):(s="error",C(e,0,n))}function E(e,t,n){return"string"==e?E:C(e,0,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:y,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(s=null,t.state=t.state(o||n,e,t),s&&(n="error"==s?n+" error":s)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var s=l.contextGrabbers[r.tagName];if(!s||!s.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==_&&(e.state=C)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(631))},912:(e,t,n)=>{var i=n(631);i.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections()[0].head;if(!1!==e.getStateAfter(t.line).list)e.execCommand("indentMore");else if(e.options.indentWithTabs)e.execCommand("insertTab");else{var n=Array(e.options.tabSize+1).join(" ");e.replaceSelection(n)}},i.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections()[0].head;if(!1!==e.getStateAfter(t.line).list)e.execCommand("indentLess");else if(e.options.indentWithTabs)e.execCommand("insertTab");else{var n=Array(e.options.tabSize+1).join(" ");e.replaceSelection(n)}}},442:(e,t,n)=>{"use strict";var i=n(631);n(350),n(912),n(960),n(47),n(146),n(386),n(994),n(20),n(95),n(425),n(589);var r=n(354),o=n(84),s=/Mac/.test(navigator.platform),a=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),l={toggleBold:D,toggleItalic:C,drawLink:B,toggleHeadingSmaller:S,toggleHeadingBigger:A,drawImage:I,toggleBlockquote:E,toggleOrderedList:N,toggleUnorderedList:M,toggleCodeBlock:_,togglePreview:q,toggleStrikethrough:k,toggleHeading1:T,toggleHeading2:F,toggleHeading3:L,cleanBlock:O,drawTable:H,drawHorizontalRule:R,undo:W,redo:j,toggleSideBySide:$,toggleFullScreen:w},u={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},c=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.substr(0,4)))&&(t=!0),t};function h(e){return s?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}var d={};function f(e){return d[e]||(d[e]=new RegExp("\\s*"+e+"(\\s*)","g"))}function p(e,t){if(e&&t){var n=f(t);e.className.match(n)||(e.className+=" "+t)}}function m(e,t){if(e&&t){var n=f(t);e.className.match(n)&&(e.className=e.className.replace(n,"$1"))}}function g(e,t,n,i){var r=v(e,!1,t,n,"button",i);r.className+=" easymde-dropdown";var o=document.createElement("div");o.className="easymde-dropdown-content";for(var s=0;s<e.children.length;s++){var a,l=e.children[s];a=v("string"==typeof l&&l in J?J[l]:l,!0,t,n,"button",i),o.appendChild(a)}return r.appendChild(o),r}function v(e,t,n,i,r,o){e=e||{};var a=document.createElement(r);a.className=e.name,a.setAttribute("type",r),n=null==n||n,e.name&&e.name in i&&(l[e.name]=e.action),e.title&&n&&(a.title=function(e,t,n){var i,r=e;return t&&n[i=function(e){for(var t in l)if(l[t]===e)return t;return null}(t)]&&(r+=" ("+h(n[i])+")"),r}(e.title,e.action,i),s&&(a.title=a.title.replace("Ctrl","⌘"),a.title=a.title.replace("Alt","⌥"))),e.noDisable&&a.classList.add("no-disable"),e.noMobile&&a.classList.add("no-mobile");var u=[];void 0!==e.className&&(u=e.className.split(" "));for(var c=[],d=0;d<u.length;d++){var f=u[d];f.match(/^fa([srlb]|(-[\w-]*)|$)/)?c.push(f):a.classList.add(f)}a.tabIndex=-1;for(var p=document.createElement("i"),m=0;m<c.length;m++){var g=c[m];p.classList.add(g)}return a.appendChild(p),void 0!==e.icon&&(a.innerHTML=e.icon),e.action&&t&&("function"==typeof e.action?a.onclick=function(t){t.preventDefault(),e.action(o)}:"string"==typeof e.action&&(a.onclick=function(t){t.preventDefault(),window.open(e.action,"_blank")})),a}function y(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function b(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var i,r,o=n.type.split(" "),s={},a=0;a<o.length;a++)"strong"===(i=o[a])?s.bold=!0:"variable-2"===i?(r=e.getLine(t.line),/^\s*\d+\.\s/.test(r)?s["ordered-list"]=!0:s["unordered-list"]=!0):"atom"===i?s.quote=!0:"em"===i?s.italic=!0:"quote"===i?s.quote=!0:"strikethrough"===i?s.strikethrough=!0:"comment"===i?s.code=!0:"link"===i?s.link=!0:"tag"===i?s.image=!0:i.match(/^header(-[1-6])?$/)&&(s[i.replace("header","heading")]=!0);return s}var x="";function w(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(x=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=x;var n=t.getWrapperElement(),i=n.nextSibling;if(/editor-preview-active-side/.test(i.className))if(!1===e.options.sideBySideFullscreen){var r=n.parentNode;t.getOption("fullScreen")?m(r,"sided--no-fullscreen"):p(r,"sided--no-fullscreen")}else $(e);if(e.options.onToggleFullScreen&&e.options.onToggleFullScreen(t.getOption("fullScreen")||!1),void 0!==e.options.maxHeight&&(t.getOption("fullScreen")?(t.getScrollerElement().style.removeProperty("height"),i.style.removeProperty("height")):(t.getScrollerElement().style.height=e.options.maxHeight,e.setPreviewMaxHeight())),/fullscreen/.test(e.toolbar_div.className)?e.toolbar_div.className=e.toolbar_div.className.replace(/\s*fullscreen\b/,""):e.toolbar_div.className+=" fullscreen",e.toolbarElements&&e.toolbarElements.fullscreen){var o=e.toolbarElements.fullscreen;/active/.test(o.className)?o.className=o.className.replace(/\s*active\s*/g,""):o.className+=" active"}}function D(e){K(e,"bold",e.options.blockStyles.bold)}function C(e){K(e,"italic",e.options.blockStyles.italic)}function k(e){K(e,"strikethrough","~~")}function _(e){var t=e.options.blockStyles.code;function n(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function i(e){return e.state.base.base||e.state.base}function r(e,t,r,o,s){r=r||e.getLineHandle(t),o=o||e.getTokenAt({line:t,ch:1}),s=s||!!r.text&&e.getTokenAt({line:t,ch:r.text.length-1});var a=o.type?o.type.split(" "):[];return s&&i(s).indentedCode?"indented":-1!==a.indexOf("comment")&&(i(o).fencedChars||i(s).fencedChars||n(r)?"fenced":"single")}var o,s,a,l=e.codemirror,u=l.getCursor("start"),c=l.getCursor("end"),h=l.getTokenAt({line:u.line,ch:u.ch||1}),d=l.getLineHandle(u.line),f=r(l,u.line,d,h);if("single"===f){var p=d.text.slice(0,u.ch).replace("`",""),m=d.text.slice(u.ch).replace("`","");l.replaceRange(p+m,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),u.ch--,u!==c&&c.ch--,l.setSelection(u,c),l.focus()}else if("fenced"===f)if(u.line!==c.line||u.ch!==c.ch){for(o=u.line;o>=0&&!n(d=l.getLineHandle(o));o--);var g,v,y,b,x=i(l.getTokenAt({line:o,ch:1})).fencedChars;n(l.getLineHandle(u.line))?(g="",v=u.line):n(l.getLineHandle(u.line-1))?(g="",v=u.line-1):(g=x+"\n",v=u.line),n(l.getLineHandle(c.line))?(y="",b=c.line,0===c.ch&&(b+=1)):0!==c.ch&&n(l.getLineHandle(c.line+1))?(y="",b=c.line+1):(y=x+"\n",b=c.line+1),0===c.ch&&(b-=1),l.operation((function(){l.replaceRange(y,{line:b,ch:0},{line:b+(y?0:1),ch:0}),l.replaceRange(g,{line:v,ch:0},{line:v+(g?0:1),ch:0})})),l.setSelection({line:v+(g?1:0),ch:0},{line:b+(g?1:-1),ch:0}),l.focus()}else{var w=u.line;if(n(l.getLineHandle(u.line))&&("fenced"===r(l,u.line+1)?(o=u.line,w=u.line+1):(s=u.line,w=u.line-1)),void 0===o)for(o=w;o>=0&&!n(d=l.getLineHandle(o));o--);if(void 0===s)for(a=l.lineCount(),s=w;s<a&&!n(d=l.getLineHandle(s));s++);l.operation((function(){l.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),l.replaceRange("",{line:s-1,ch:0},{line:s,ch:0})})),l.focus()}else if("indented"===f){if(u.line!==c.line||u.ch!==c.ch)o=u.line,s=c.line,0===c.ch&&s--;else{for(o=u.line;o>=0;o--)if(!(d=l.getLineHandle(o)).text.match(/^\s*$/)&&"indented"!==r(l,o,d)){o+=1;break}for(a=l.lineCount(),s=u.line;s<a;s++)if(!(d=l.getLineHandle(s)).text.match(/^\s*$/)&&"indented"!==r(l,s,d)){s-=1;break}}var D=l.getLineHandle(s+1),C=D&&l.getTokenAt({line:s+1,ch:D.text.length-1});C&&i(C).indentedCode&&l.replaceRange("\n",{line:s+1,ch:0});for(var k=o;k<=s;k++)l.indentLine(k,"subtract");l.focus()}else{var _=u.line===c.line&&u.ch===c.ch&&0===u.ch,E=u.line!==c.line;_||E?function(e,t,n,i){var r=t.line+1,o=n.line+1,s=t.line!==n.line,a=i+"\n",l="\n"+i;s&&o++,s&&0===n.ch&&(l=i+"\n",o--),U(e,!1,[a,l]),e.setSelection({line:r,ch:0},{line:o,ch:0})}(l,u,c,t):U(l,!1,["`","`"])}}function E(e){G(e.codemirror,"quote")}function S(e){V(e.codemirror,"smaller")}function A(e){V(e.codemirror,"bigger")}function T(e){V(e.codemirror,void 0,1)}function F(e){V(e.codemirror,void 0,2)}function L(e){V(e.codemirror,void 0,3)}function M(e){G(e.codemirror,"unordered-list")}function N(e){G(e.codemirror,"ordered-list")}function O(e){!function(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),i=e.getCursor("end"),r=n.line;r<=i.line;r++)t=(t=e.getLine(r)).replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:r,ch:0},{line:r,ch:99999999999999})}(e.codemirror)}function B(e){var t=e.codemirror,n=b(t),i=e.options,r="https://";if(i.promptURLs&&!(r=prompt(i.promptTexts.link,"https://")))return!1;U(t,n.link,i.insertTexts.link,r)}function I(e){var t=e.codemirror,n=b(t),i=e.options,r="https://";if(i.promptURLs&&!(r=prompt(i.promptTexts.image,"https://")))return!1;U(t,n.image,i.insertTexts.image,r)}function z(e){e.openBrowseFileWindow()}function P(e,t){var n=e.codemirror,i=b(n),r=e.options,o=t.substr(t.lastIndexOf("/")+1),s=o.substring(o.lastIndexOf(".")+1).replace(/\?.*$/,"");if(["png","jpg","jpeg","gif","svg"].includes(s))U(n,i.image,r.insertTexts.uploadedImage,t);else{var a=r.insertTexts.link;a[0]="["+o,U(n,i.link,a,t)}e.updateStatusBar("upload-image",e.options.imageTexts.sbOnUploaded.replace("#image_name#",o)),setTimeout((function(){e.updateStatusBar("upload-image",e.options.imageTexts.sbInit)}),1e3)}function H(e){var t=e.codemirror,n=b(t),i=e.options;U(t,n.table,i.insertTexts.table)}function R(e){var t=e.codemirror,n=b(t),i=e.options;U(t,n.image,i.insertTexts.horizontalRule)}function W(e){var t=e.codemirror;t.undo(),t.focus()}function j(e){var t=e.codemirror;t.redo(),t.focus()}function $(e){var t=e.codemirror,n=t.getWrapperElement(),i=n.nextSibling,r=e.toolbarElements&&e.toolbarElements["side-by-side"],o=!1,s=n.parentNode;/editor-preview-active-side/.test(i.className)?(!1===e.options.sideBySideFullscreen&&m(s,"sided--no-fullscreen"),i.className=i.className.replace(/\s*editor-preview-active-side\s*/g,""),r&&(r.className=r.className.replace(/\s*active\s*/g,"")),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout((function(){t.getOption("fullScreen")||(!1===e.options.sideBySideFullscreen?p(s,"sided--no-fullscreen"):w(e)),i.className+=" editor-preview-active-side"}),1),r&&(r.className+=" active"),n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,u=e.toolbar_div;l.className=l.className.replace(/\s*active\s*/g,""),u.className=u.className.replace(/\s*disabled-for-preview*/g,"")}if(t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){var t=e.options.previewRender(e.value(),i);null!=t&&(i.innerHTML=t)}),o){var c=e.options.previewRender(e.value(),i);null!=c&&(i.innerHTML=c),t.on("update",t.sideBySideRenderingFunction)}else t.off("update",t.sideBySideRenderingFunction);t.refresh()}function q(e){var t=e.codemirror,n=t.getWrapperElement(),i=e.toolbar_div,r=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild,s=t.getWrapperElement().nextSibling;if(/editor-preview-active-side/.test(s.className)&&$(e),!o||!/editor-preview-full/.test(o.className)){if((o=document.createElement("div")).className="editor-preview-full",e.options.previewClass)if(Array.isArray(e.options.previewClass))for(var a=0;a<e.options.previewClass.length;a++)o.className+=" "+e.options.previewClass[a];else"string"==typeof e.options.previewClass&&(o.className+=" "+e.options.previewClass);n.appendChild(o)}/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),r&&(r.className=r.className.replace(/\s*active\s*/g,""),i.className=i.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout((function(){o.className+=" editor-preview-active"}),1),r&&(r.className+=" active",i.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o)}function U(e,t,n,i){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var r,o=n[0],s=n[1],a={},l={};Object.assign(a,e.getCursor("start")),Object.assign(l,e.getCursor("end")),i&&(o=o.replace("#url#",i),s=s.replace("#url#",i)),t?(o=(r=e.getLine(a.line)).slice(0,a.ch),s=r.slice(a.ch),e.replaceRange(o+s,{line:a.line,ch:0})):(r=e.getSelection(),e.replaceSelection(o+r+s),a.ch+=o.length,a!==l&&(l.ch+=o.length)),e.setSelection(a,l),e.focus()}}function V(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var i=e.getCursor("start"),r=e.getCursor("end"),o=i.line;o<=r.line;o++)!function(i){var r=e.getLine(i),o=r.search(/[^#]/);r=void 0!==t?o<=0?"bigger"==t?"###### "+r:"# "+r:6==o&&"smaller"==t?r.substr(7):1==o&&"bigger"==t?r.substr(2):"bigger"==t?r.substr(1):"#"+r:1==n?o<=0?"# "+r:o==n?r.substr(o+1):"# "+r.substr(o+1):2==n?o<=0?"## "+r:o==n?r.substr(o+1):"## "+r.substr(o+1):o<=0?"### "+r:o==n?r.substr(o+1):"### "+r.substr(o+1),e.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}(o);e.focus()}}function G(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,i=/^\s*/,r=b(e),o=e.getCursor("start"),s=e.getCursor("end"),a={quote:/^(\s*)>\s+/,"unordered-list":n,"ordered-list":n},l=function(e,t,r){var o=n.exec(t),s=function(e,t){return{quote:">","unordered-list":"*","ordered-list":"%%i."}[e].replace("%%i",t)}(e,u);return null!==o?(function(e,t){var n=new RegExp({quote:">","unordered-list":"*","ordered-list":"\\d+."}[e]);return t&&n.test(t)}(e,o[2])&&(s=""),t=o[1]+s+o[3]+t.replace(i,"").replace(a[e],"$1")):0==r&&(t=s+" "+t),t},u=1,c=o.line;c<=s.line;c++)!function(n){var i=e.getLine(n);r[t]?i=i.replace(a[t],"$1"):("unordered-list"==t&&(i=l("ordered-list",i,!0)),i=l(t,i,!1),u+=1),e.replaceRange(i,{line:n,ch:0},{line:n,ch:99999999999999})}(c);e.focus()}}function K(e,t,n,i){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){i=void 0===i?n:i;var r,o=e.codemirror,s=b(o),a=n,l=i,u=o.getCursor("start"),c=o.getCursor("end");s[t]?(a=(r=o.getLine(u.line)).slice(0,u.ch),l=r.slice(u.ch),"bold"==t?(a=a.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),l=l.replace(/(\*\*|__)/,"")):"italic"==t?(a=a.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),l=l.replace(/(\*|_)/,"")):"strikethrough"==t&&(a=a.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),l=l.replace(/(\*\*|~~)/,"")),o.replaceRange(a+l,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==c&&(c.ch-=2)):"italic"==t&&(u.ch-=1,u!==c&&(c.ch-=1))):(r=o.getSelection(),"bold"==t?r=(r=r.split("**").join("")).split("__").join(""):"italic"==t?r=(r=r.split("*").join("")).split("_").join(""):"strikethrough"==t&&(r=r.split("~~").join("")),o.replaceSelection(a+r+l),u.ch+=n.length,c.ch=u.ch+r.length),o.setSelection(u,c),o.focus()}}function X(e,t){if(Math.abs(e)<1024)return""+e+t[0];var n=0;do{e/=1024,++n}while(Math.abs(e)>=1024&&n<t.length);return""+e.toFixed(1)+t[n]}function Y(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=Y(e[n]||{},t[n]):e[n]=t[n]);return e}function Z(e){for(var t=1;t<arguments.length;t++)e=Y(e,arguments[t]);return e}function Q(e){var t=e.match(/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),n=0;if(null===t)return n;for(var i=0;i<t.length;i++)t[i].charCodeAt(0)>=19968?n+=t[i].length:n+=1;return n}var J={bold:{name:"bold",action:D,className:"fa fa-bold",title:"Bold",default:!0},italic:{name:"italic",action:C,className:"fa fa-italic",title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:k,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:S,className:"fa fa-header fa-heading",title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:S,className:"fa fa-header fa-heading header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:A,className:"fa fa-header fa-heading header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:T,className:"fa fa-header fa-heading header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:F,className:"fa fa-header fa-heading header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:L,className:"fa fa-header fa-heading header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:_,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:E,className:"fa fa-quote-left",title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:M,className:"fa fa-list-ul",title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:N,className:"fa fa-list-ol",title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:O,className:"fa fa-eraser",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:B,className:"fa fa-link",title:"Create Link",default:!0},image:{name:"image",action:I,className:"fa fa-image",title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:z,className:"fa fa-image",title:"Import an image"},table:{name:"table",action:H,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:R,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:q,className:"fa fa-eye",noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:$,className:"fa fa-columns",noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:w,className:"fa fa-arrows-alt",noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:"fa fa-question-circle",noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:W,className:"fa fa-undo",noDisable:!0,title:"Undo"},redo:{name:"redo",action:j,className:"fa fa-repeat fa-redo",noDisable:!0,title:"Redo"}},ee={link:["[","](#url#)"],image:[""],uploadedImage:["",""],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},te={link:"URL for the link:",image:"URL of the image:"},ne={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},ie={bold:"**",code:"```",italic:"*"},re={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},oe={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:"Image #image_name# is too big (#image_size#).\nMaximum file size is #image_max_size#.",importError:"Something went wrong when uploading the image #image_name#."};function se(e){(e=e||{}).parent=this;var t=!0;if(!1===e.autoDownloadFontAwesome&&(t=!1),!0!==e.autoDownloadFontAwesome)for(var n=document.styleSheets,i=0;i<n.length;i++)n[i].href&&n[i].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var r=document.createElement("link");r.rel="stylesheet",r.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(r)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("EasyMDE: Error. No element was found.");if(void 0===e.toolbar)for(var o in e.toolbar=[],J)Object.prototype.hasOwnProperty.call(J,o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(!0===J[o].default||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o));if(Object.prototype.hasOwnProperty.call(e,"previewClass")||(e.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(e,"status")||(e.status=["autosave","lines","words","cursor"],e.uploadImage&&e.status.unshift("upload-image")),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=Z({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=Z({},ee,e.insertTexts||{}),e.promptTexts=Z({},te,e.promptTexts||{}),e.blockStyles=Z({},ie,e.blockStyles||{}),null!=e.autosave&&(e.autosave.timeFormat=Z({},ne,e.autosave.timeFormat||{})),e.shortcuts=Z({},u,e.shortcuts||{}),e.maxHeight=e.maxHeight||void 0,void 0!==e.maxHeight?e.minHeight=e.maxHeight:e.minHeight=e.minHeight||"300px",e.errorCallback=e.errorCallback||function(e){alert(e)},e.uploadImage=e.uploadImage||!1,e.imageMaxSize=e.imageMaxSize||2097152,e.imageAccept=e.imageAccept||"image/png, image/jpeg",e.imageTexts=Z({},re,e.imageTexts||{}),e.errorMessages=Z({},oe,e.errorMessages||{}),null!=e.autosave&&null!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),e.overlayMode&&void 0===e.overlayMode.combine&&(e.overlayMode.combine=!0),this.options=e,this.render(),!e.initialValue||this.options.autosave&&!0===this.options.autosave.foundSavedValue||this.value(e.initialValue),e.uploadImage){var s=this;this.codemirror.on("dragenter",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbOnDragEnter),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("dragend",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("dragleave",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("dragover",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbOnDragEnter),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("drop",(function(t,n){n.stopPropagation(),n.preventDefault(),e.imageUploadFunction?s.uploadImagesUsingCustomFunction(e.imageUploadFunction,n.dataTransfer.files):s.uploadImages(n.dataTransfer.files)})),this.codemirror.on("paste",(function(t,n){e.imageUploadFunction?s.uploadImagesUsingCustomFunction(e.imageUploadFunction,n.clipboardData.files):s.uploadImages(n.clipboardData.files)}))}}function ae(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}se.prototype.uploadImages=function(e,t,n){if(0!==e.length){for(var i=[],r=0;r<e.length;r++)i.push(e[r].name),this.uploadImage(e[r],t,n);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",i.join(", ")))}},se.prototype.uploadImagesUsingCustomFunction=function(e,t){if(0!==t.length){for(var n=[],i=0;i<t.length;i++)n.push(t[i].name),this.uploadImageUsingCustomFunction(e,t[i]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",n.join(", ")))}},se.prototype.updateStatusBar=function(e,t){if(this.gui.statusbar){var n=this.gui.statusbar.getElementsByClassName(e);1===n.length?this.gui.statusbar.getElementsByClassName(e)[0].textContent=t:0===n.length?console.log("EasyMDE: status bar item "+e+" was not found."):console.log("EasyMDE: Several status bar items named "+e+" was found.")}},se.prototype.markdown=function(e){if(o){var t;if(t=this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?this.options.renderingConfig.markedOptions:{},this.options&&this.options.renderingConfig&&!1===this.options.renderingConfig.singleLineBreaks?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&!0===this.options.renderingConfig.codeSyntaxHighlighting){var n=this.options.renderingConfig.hljs||window.hljs;n&&(t.highlight=function(e,t){return t&&n.getLanguage(t)?n.highlight(t,e).value:n.highlightAuto(e).value})}o.setOptions(t);var i=o(e);return this.options.renderingConfig&&"function"==typeof this.options.renderingConfig.sanitizerFunction&&(i=this.options.renderingConfig.sanitizerFunction.call(this,i)),function(e){for(var t=(new DOMParser).parseFromString(e,"text/html"),n=t.getElementsByTagName("li"),i=0;i<n.length;i++)for(var r=n[i],o=0;o<r.children.length;o++){var s=r.children[o];s instanceof HTMLInputElement&&"checkbox"===s.type&&(r.style.marginLeft="-1.5em",r.style.listStyleType="none")}return t.documentElement.innerHTML}(i=function(e){for(var t;null!==(t=a.exec(e));){var n=t[0];if(-1===n.indexOf("target=")){var i=n.replace(/>$/,' target="_blank">');e=e.replace(n,i)}}return e}(i))}},se.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t,n,o=this.options,s=this,a={};for(var u in o.shortcuts)null!==o.shortcuts[u]&&null!==l[u]&&function(e){a[h(o.shortcuts[e])]=function(){var t=l[e];"function"==typeof t?t(s):"string"==typeof t&&window.open(t,"_blank")}}(u);if(a.Enter="newlineAndIndentContinueMarkdownList",a.Tab="tabAndIndentMarkdownList",a["Shift-Tab"]="shiftTabAndUnindentMarkdownList",a.Esc=function(e){e.getOption("fullScreen")&&w(s)},this.documentOnKeyDown=function(e){27==(e=e||window.event).keyCode&&s.codemirror.getOption("fullScreen")&&w(s)},document.addEventListener("keydown",this.documentOnKeyDown,!1),o.overlayMode?(i.defineMode("overlay-mode",(function(e){return i.overlayMode(i.getMode(e,!1!==o.spellChecker?"spell-checker":"gfm"),o.overlayMode.mode,o.overlayMode.combine)})),t="overlay-mode",(n=o.parsingConfig).gitHubSpice=!1):((t=o.parsingConfig).name="gfm",t.gitHubSpice=!1),!1!==o.spellChecker&&(t="spell-checker",(n=o.parsingConfig).name="gfm",n.gitHubSpice=!1,r({codeMirrorInstance:i})),this.codemirror=i.fromTextArea(e,{mode:t,backdrop:n,theme:null!=o.theme?o.theme:"easymde",tabSize:null!=o.tabSize?o.tabSize:2,indentUnit:null!=o.tabSize?o.tabSize:2,indentWithTabs:!1!==o.indentWithTabs,lineNumbers:!0===o.lineNumbers,autofocus:!0===o.autofocus,extraKeys:a,lineWrapping:!1!==o.lineWrapping,allowDropFileTypes:["text/plain"],placeholder:o.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:null!=o.styleSelectedText?o.styleSelectedText:!c(),scrollbarStyle:null!=o.scrollbarStyle?o.scrollbarStyle:"native",configureMouse:function(e,t,n){return{addNew:!1}},inputStyle:null!=o.inputStyle?o.inputStyle:c()?"contenteditable":"textarea",spellcheck:null==o.nativeSpellcheck||o.nativeSpellcheck,autoRefresh:null!=o.autoRefresh&&o.autoRefresh}),this.codemirror.getScrollerElement().style.minHeight=o.minHeight,void 0!==o.maxHeight&&(this.codemirror.getScrollerElement().style.height=o.maxHeight),!0===o.forceSync){var d=this.codemirror;d.on("change",(function(){d.save()}))}this.gui={};var f=document.createElement("div");f.classList.add("EasyMDEContainer");var p=this.codemirror.getWrapperElement();p.parentNode.insertBefore(f,p),f.appendChild(p),!1!==o.toolbar&&(this.gui.toolbar=this.createToolbar()),!1!==o.status&&(this.gui.statusbar=this.createStatusbar()),null!=o.autosave&&!0===o.autosave.enabled&&(this.autosave(),this.codemirror.on("change",(function(){clearTimeout(s._autosave_timeout),s._autosave_timeout=setTimeout((function(){s.autosave()}),s.options.autosave.submit_delay||s.options.autosave.delay||1e3)})));var m=this;this.codemirror.on("update",(function(){o.previewImagesInEditor&&f.querySelectorAll(".cm-image-marker").forEach((function(e){var t=e.parentElement;if(t.innerText.match(/^!\[.*?\]\(.*\)/g)&&!t.hasAttribute("data-img-src")){var n=t.innerText.match("\\((.*)\\)");if(window.EMDEimagesCache||(window.EMDEimagesCache={}),n&&n.length>=2){var i=n[1];if(window.EMDEimagesCache[i])v(t,window.EMDEimagesCache[i]);else{var r=document.createElement("img");r.onload=function(){window.EMDEimagesCache[i]={naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,url:i},v(t,window.EMDEimagesCache[i])},r.src=i}}}}))})),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var g=this.codemirror;setTimeout(function(){g.refresh()}.bind(g),0)}function v(e,t){var n,i;e.setAttribute("data-img-src",t.url),e.setAttribute("style","--bg-image:url("+t.url+");--width:"+t.naturalWidth+"px;--height:"+(n=t.naturalWidth,i=t.naturalHeight,n<window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","")?i+"px":i/n*100+"%")),m.codemirror.setSize()}},se.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)},se.prototype.autosave=function(){if(ae()){var e=this;if(null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("EasyMDE: You must set a uniqueId to use the autosave feature");!0!==this.options.autosave.binded&&(null!=e.element.form&&null!=e.element.form&&e.element.form.addEventListener("submit",(function(){clearTimeout(e.autosaveTimeoutId),e.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+e.options.autosave.uniqueId)})),this.options.autosave.binded=!0),!0!==this.options.autosave.loaded&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var t=e.value();""!==t?localStorage.setItem("smde_"+this.options.autosave.uniqueId,t):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var n=document.getElementById("autosaved");if(null!=n&&null!=n&&""!=n){var i=new Date,r=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(i),o=null==this.options.autosave.text?"Autosaved: ":this.options.autosave.text;n.innerHTML=o+r}}else console.log("EasyMDE: localStorage not available, cannot autosave")},se.prototype.clearAutosavedValue=function(){if(ae()){if(null==this.options.autosave||null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("EasyMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")},se.prototype.openBrowseFileWindow=function(e,t){var n=this,i=this.gui.toolbar.getElementsByClassName("imageInput")[0];i.click(),i.addEventListener("change",(function r(o){n.options.imageUploadFunction?n.uploadImagesUsingCustomFunction(n.options.imageUploadFunction,o.target.files):n.uploadImages(o.target.files,e,t),i.removeEventListener("change",r)}))},se.prototype.uploadImage=function(e,t,n){var i=this;function r(e){i.updateStatusBar("upload-image",e),setTimeout((function(){i.updateStatusBar("upload-image",i.options.imageTexts.sbInit)}),1e4),n&&"function"==typeof n&&n(e),i.options.errorCallback(e)}function o(t){var n=i.options.imageTexts.sizeUnits.split(",");return t.replace("#image_name#",e.name).replace("#image_size#",X(e.size,n)).replace("#image_max_size#",X(i.options.imageMaxSize,n))}if(t=t||function(e){P(i,e)},e.size>this.options.imageMaxSize)r(o(this.options.errorMessages.fileTooLarge));else{var s=new FormData;s.append("image",e),i.options.imageCSRFToken&&s.append("csrfmiddlewaretoken",i.options.imageCSRFToken);var a=new XMLHttpRequest;a.upload.onprogress=function(t){if(t.lengthComputable){var n=""+Math.round(100*t.loaded/t.total);i.updateStatusBar("upload-image",i.options.imageTexts.sbProgress.replace("#file_name#",e.name).replace("#progress#",n))}},a.open("POST",this.options.imageUploadEndpoint),a.onload=function(){try{var e=JSON.parse(this.responseText)}catch(e){return console.error("EasyMDE: The server did not return a valid json."),void r(o(i.options.errorMessages.importError))}200===this.status&&e&&!e.error&&e.data&&e.data.filePath?t((i.options.imagePathAbsolute?"":window.location.origin+"/")+e.data.filePath):e.error&&e.error in i.options.errorMessages?r(o(i.options.errorMessages[e.error])):e.error?r(o(e.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),r(o(i.options.errorMessages.importError)))},a.onerror=function(e){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+e.target.status+" ("+e.target.statusText+")"),r(i.options.errorMessages.importError)},a.send(s)}},se.prototype.uploadImageUsingCustomFunction=function(e,t){var n=this;e.apply(this,[t,function(e){P(n,e)},function(e){var i=function(e){var i=n.options.imageTexts.sizeUnits.split(",");return e.replace("#image_name#",t.name).replace("#image_size#",X(t.size,i)).replace("#image_max_size#",X(n.options.imageMaxSize,i))}(e);n.updateStatusBar("upload-image",i),setTimeout((function(){n.updateStatusBar("upload-image",n.options.imageTexts.sbInit)}),1e4),n.options.errorCallback(i)}])},se.prototype.setPreviewMaxHeight=function(){var e=this.codemirror.getWrapperElement(),t=e.nextSibling,n=parseInt(window.getComputedStyle(e).paddingTop),i=parseInt(window.getComputedStyle(e).borderTopWidth),r=(parseInt(this.options.maxHeight)+2*n+2*i).toString()+"px";t.style.height=r},se.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;if(!n||!/editor-preview-side/.test(n.className)){if((n=document.createElement("div")).className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var i=0;i<this.options.previewClass.length;i++)n.className+=" "+this.options.previewClass[i];else"string"==typeof this.options.previewClass&&(n.className+=" "+this.options.previewClass);t.parentNode.insertBefore(n,t.nextSibling)}if(void 0!==this.options.maxHeight&&this.setPreviewMaxHeight(),!1===this.options.syncSideBySidePreviewScroll)return n;var r=!1,o=!1;return e.on("scroll",(function(e){if(r)r=!1;else{o=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,i=parseFloat(e.getScrollInfo().top)/t,s=(n.scrollHeight-n.clientHeight)*i;n.scrollTop=s}})),n.onscroll=function(){if(o)o=!1;else{r=!0;var t=n.scrollHeight-n.clientHeight,i=parseFloat(n.scrollTop)/t,s=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*i;e.scrollTo(0,s)}},n},se.prototype.createToolbar=function(e){if((e=e||this.options.toolbar)&&0!==e.length){var t;for(t=0;t<e.length;t++)null!=J[e[t]]&&(e[t]=J[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var i=this,r={};for(i.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||!1!==i.options.toolbarGuideIcon)&&!(i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&c())){if("|"===e[t]){for(var o=!1,s=t+1;s<e.length;s++)"|"===e[s]||i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(e[s].name)||(o=!0);if(!o)continue}!function(e){var t;if(t="|"===e?y():e.children?g(e,i.options.toolbarTips,i.options.shortcuts,i):v(e,!0,i.options.toolbarTips,i.options.shortcuts,"button",i),r[e.name||e]=t,n.appendChild(t),"upload-image"===e.name){var o=document.createElement("input");o.className="imageInput",o.type="file",o.multiple=!0,o.name="image",o.accept=i.options.imageAccept,o.style.display="none",o.style.opacity=0,n.appendChild(o)}}(e[t])}i.toolbar_div=n,i.toolbarElements=r;var a=this.codemirror;a.on("cursorActivity",(function(){var e=b(a);for(var t in r)!function(t){var n=r[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)}));var l=a.getWrapperElement();return l.parentNode.insertBefore(n,l),n}},se.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var i,r,o,s,a=[];for(i=0;i<e.length;i++)if(r=void 0,o=void 0,s=void 0,"object"==typeof e[i])a.push({className:e[i].className,defaultValue:e[i].defaultValue,onUpdate:e[i].onUpdate,onActivity:e[i].onActivity});else{var l=e[i];"words"===l?(s=function(e){e.innerHTML=Q(n.getValue())},r=function(e){e.innerHTML=Q(n.getValue())}):"lines"===l?(s=function(e){e.innerHTML=n.lineCount()},r=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(s=function(e){e.innerHTML="0:0"},o=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===l?s=function(e){null!=t.autosave&&!0===t.autosave.enabled&&e.setAttribute("id","autosaved")}:"upload-image"===l&&(s=function(e){e.innerHTML=t.imageTexts.sbInit}),a.push({className:l,defaultValue:s,onUpdate:r,onActivity:o})}var u=document.createElement("div");for(u.className="editor-statusbar",i=0;i<a.length;i++){var c=a[i],h=document.createElement("span");h.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(h),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(h,c)),"function"==typeof c.onActivity&&this.codemirror.on("cursorActivity",function(e,t){return function(){t.onActivity(e)}}(h,c)),u.appendChild(h)}var d=this.codemirror.getWrapperElement();return d.parentNode.insertBefore(u,d.nextSibling),u}},se.prototype.value=function(e){var t=this.codemirror;if(void 0===e)return t.getValue();if(t.getDoc().setValue(e),this.isPreviewActive()){var n=t.getWrapperElement().lastChild;n.innerHTML=this.options.previewRender(e,n)}return this},se.toggleBold=D,se.toggleItalic=C,se.toggleStrikethrough=k,se.toggleBlockquote=E,se.toggleHeadingSmaller=S,se.toggleHeadingBigger=A,se.toggleHeading1=T,se.toggleHeading2=F,se.toggleHeading3=L,se.toggleCodeBlock=_,se.toggleUnorderedList=M,se.toggleOrderedList=N,se.cleanBlock=O,se.drawLink=B,se.drawImage=I,se.drawUploadedImage=z,se.drawTable=H,se.drawHorizontalRule=R,se.undo=W,se.redo=j,se.togglePreview=q,se.toggleSideBySide=$,se.toggleFullScreen=w,se.prototype.toggleBold=function(){D(this)},se.prototype.toggleItalic=function(){C(this)},se.prototype.toggleStrikethrough=function(){k(this)},se.prototype.toggleBlockquote=function(){E(this)},se.prototype.toggleHeadingSmaller=function(){S(this)},se.prototype.toggleHeadingBigger=function(){A(this)},se.prototype.toggleHeading1=function(){T(this)},se.prototype.toggleHeading2=function(){F(this)},se.prototype.toggleHeading3=function(){L(this)},se.prototype.toggleCodeBlock=function(){_(this)},se.prototype.toggleUnorderedList=function(){M(this)},se.prototype.toggleOrderedList=function(){N(this)},se.prototype.cleanBlock=function(){O(this)},se.prototype.drawLink=function(){B(this)},se.prototype.drawImage=function(){I(this)},se.prototype.drawUploadedImage=function(){z(this)},se.prototype.drawTable=function(){H(this)},se.prototype.drawHorizontalRule=function(){R(this)},se.prototype.undo=function(){W(this)},se.prototype.redo=function(){j(this)},se.prototype.togglePreview=function(){q(this)},se.prototype.toggleSideBySide=function(){$(this)},se.prototype.toggleFullScreen=function(){w(this)},se.prototype.isPreviewActive=function(){var e=this.codemirror.getWrapperElement().lastChild;return/editor-preview-active/.test(e.className)},se.prototype.isSideBySideActive=function(){var e=this.codemirror.getWrapperElement().nextSibling;return/editor-preview-active-side/.test(e.className)},se.prototype.isFullscreenActive=function(){return this.codemirror.getOption("fullScreen")},se.prototype.getState=function(){return b(this.codemirror)},se.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.parentNode;n&&(this.gui.toolbar&&n.removeChild(this.gui.toolbar),this.gui.statusbar&&n.removeChild(this.gui.statusbar),this.gui.sideBySide&&n.removeChild(this.gui.sideBySide)),n.parentNode.insertBefore(t,n),n.remove(),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},e.exports=se},84:function(e){e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function n(e,n){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,n){if(e){if("string"==typeof e)return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){i&&(e=i);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(e){i.exports.defaults=e}};var o=/[&<>"']/,s=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return u[e]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(h,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var f=/(^|[^\[])\^/g;var p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var g={},v=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(e,t){g[" "+e]||(v.test(e)?g[" "+e]=e+"/":g[" "+e]=w(e,"/",!0));var n=-1===(e=g[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(b,"$1")+t:e+t}function w(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r<i;){var o=e.charAt(i-r-1);if(o!==t||n){if(o===t||!n)break;r++}else r++}return e.substr(0,i-r)}var D=function(e,t){if(t){if(o.test(e))return e.replace(s,c)}else if(a.test(e))return e.replace(l,c);return e},C=d,k=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(f,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n},_=function(e,t,n){if(e){var i;try{i=decodeURIComponent(d(n)).replace(p,"").toLowerCase()}catch(e){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!m.test(n)&&(n=x(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},E={exec:function(){}},S=function(e){for(var t,n,i=1;i<arguments.length;i++)for(n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},A=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var i=!1,r=t;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},T=w,F=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,r=0;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&--i<0)return r;return-1},L=function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},M=function(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e},N=i.exports.defaults,O=T,B=A,I=D,z=F;function P(e,t,n){var i=t.href,r=t.title?I(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:o}:{type:"image",raw:n,href:i,title:r,text:I(o)}}var H=function(){function e(e){this.options=e||N}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:O(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var i=O(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:B(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=B(n.cells[i],n.header.length);return n}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,i,r,o,s,a,l,u,c,h=t[0],d=t[2],f=d.length>1,p={type:"list",raw:h,ordered:f,start:f?+d.slice(0,-1):"",loose:!1,items:[]},m=t[0].match(this.rules.block.item),g=!1,v=m.length;r=this.rules.block.listItemStart.exec(m[0]);for(var y=0;y<v;y++){if(h=n=m[y],this.options.pedantic||(c=n.match(new RegExp("\\n\\s*\\n {0,"+(r[0].length-1)+"}\\S")))&&(s=n.length-c.index+m.slice(y+1).join("\n").length,p.raw=p.raw.substring(0,p.raw.length-s),h=n=n.substring(0,c.index),v=y+1),y!==v-1){if(o=this.rules.block.listItemStart.exec(m[y+1]),this.options.pedantic?o[1].length>r[1].length:o[1].length>=r[0].length||o[1].length>3){m.splice(y,2,m[y]+(!this.options.pedantic&&o[1].length<r[0].length&&!m[y].match(/\n$/)?"":"\n")+m[y+1]),y--,v--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==d[d.length-1]:f===(1===o[2].length))&&(s=m.slice(y+1).join("\n").length,p.raw=p.raw.substring(0,p.raw.length-s),y=v-1),r=o}i=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(i-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+i+"}","gm"),"")),n=O(n,"\n"),y!==v-1&&(h+="\n"),a=g||/\n\n(?!\s*$)/.test(h),y!==v-1&&(g="\n\n"===h.slice(-2),a||(a=g)),a&&(p.loose=!0),this.options.gfm&&(u=void 0,(l=/^\[[ xX]\] /.test(n))&&(u=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,""))),p.items.push({type:"list_item",raw:h,task:l,checked:u,loose:a,text:n})}return p}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):I(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:B(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=B(n.cells[i].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0]}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}},t.tag=function(e,t,n){var i=this.rules.inline.tag.exec(e);if(i)return!t&&/^<a /i.test(i[0])?t=!0:t&&/^<\/a>/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):I(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var i=O(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=z(t[2],"()");if(r>-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var s=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(s=this.options.pedantic&&!/>$/.test(n)?s.slice(1):s.slice(1,-1)),P(t,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return P(n,i,n[0])}},t.emStrong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(e);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var o,s,a=i[0].length-1,l=a,u=0,c="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+a);null!=(i=c.exec(t));)if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6])if(s=o.length,i[3]||i[4])l+=s;else if(!((i[5]||i[6])&&a%3)||(a+s)%3){if(!((l-=s)>0))return s=Math.min(s,s+l+u),Math.min(a,s)%2?{type:"em",raw:e.slice(0,a+i.index+s+1),text:e.slice(1,a+i.index+s)}:{type:"strong",raw:e.slice(0,a+i.index+s+1),text:e.slice(2,a+i.index+s-1)}}else u+=s}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=I(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=I(this.options.mangle?t(r[1]):r[1])):n=I(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=I(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=I(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):I(r[0]):r[0]:I(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),R=E,W=k,j=S,$={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:R,table:R,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};$.def=W($.def).replace("label",$._label).replace("title",$._title).getRegex(),$.bullet=/(?:[*+-]|\d{1,9}[.)])/,$.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,$.item=W($.item,"gm").replace(/bull/g,$.bullet).getRegex(),$.listItemStart=W(/^( *)(bull) */).replace("bull",$.bullet).getRegex(),$.list=W($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex(),$._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",$._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,$.html=W($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$.paragraph=W($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex(),$.blockquote=W($.blockquote).replace("paragraph",$.paragraph).getRegex(),$.normal=j({},$),$.gfm=j({},$.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),$.gfm.nptable=W($.gfm.nptable).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex(),$.gfm.table=W($.gfm.table).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex(),$.pedantic=j({},$.normal,{html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",$._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:R,paragraph:W($.normal._paragraph).replace("hr",$.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:R,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:R,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};q.punctuation=W(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,q.escapedEmSt=/\\\*|\\_/g,q._comment=W($._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),q.emStrong.lDelim=W(q.emStrong.lDelim).replace(/punct/g,q._punctuation).getRegex(),q.emStrong.rDelimAst=W(q.emStrong.rDelimAst,"g").replace(/punct/g,q._punctuation).getRegex(),q.emStrong.rDelimUnd=W(q.emStrong.rDelimUnd,"g").replace(/punct/g,q._punctuation).getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,q.autolink=W(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=W(q.tag).replace("comment",q._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=W(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=W(q.reflink).replace("label",q._label).getRegex(),q.reflinkSearch=W(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=j({},q),q.pedantic=j({},q.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=j({},q.normal,{escape:W(q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),q.gfm.url=W(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=j({},q.gfm,{br:W(q.br).replace("{2,}","*").getRegex(),text:W(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var U={block:$,inline:q},V=H,G=i.exports.defaults,K=U.block,X=U.inline,Y=M;function Z(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Q(e){var t,n,i="",r=e.length;for(t=0;t<r;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var J=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G,this.options.tokenizer=this.options.tokenizer||new V,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:K.normal,inline:X.normal};this.options.pedantic?(t.block=K.pedantic,t.inline=X.pedantic):this.options.gfm&&(t.block=K.gfm,this.options.breaks?t.inline=X.breaks:t.inline=X.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n,i,r,o=t.prototype;return o.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(e,t,n){var i,r,o,s,a,l,u=this;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call(u,e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),i.type&&t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),(s=t[t.length-1])&&"paragraph"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.nptable(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);else if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),o=i.items.length,r=0;r<o;r++)i.items[r].tokens=this.blockTokens(i.items[r].text,[],!1);t.push(i)}else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(n&&(i=this.tokenizer.def(e)))e=e.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(a=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,n=e.slice(1),i=void 0;u.options.extensions.startBlock.forEach((function(e){"number"==typeof(i=e.call(this,n))&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}(),n&&(i=this.tokenizer.paragraph(a)))s=t[t.length-1],l&&"paragraph"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i),l=a.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(s=t[t.length-1])&&"text"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}return t},o.inline=function(e){var t,n,i,r,o,s,a=e.length;for(t=0;t<a;t++)switch((s=e[t]).type){case"paragraph":case"text":case"heading":s.tokens=[],this.inlineTokens(s.text,s.tokens);break;case"table":for(s.tokens={header:[],cells:[]},r=s.header.length,n=0;n<r;n++)s.tokens.header[n]=[],this.inlineTokens(s.header[n],s.tokens.header[n]);for(r=s.cells.length,n=0;n<r;n++)for(o=s.cells[n],s.tokens.cells[n]=[],i=0;i<o.length;i++)s.tokens.cells[n][i]=[],this.inlineTokens(o[i],s.tokens.cells[n][i]);break;case"blockquote":this.inline(s.tokens);break;case"list":for(r=s.items.length,n=0;n<r;n++)this.inline(s.items[n].tokens)}return e},o.inlineTokens=function(e,t,n,i){var r,o,s,a=this;void 0===t&&(t=[]),void 0===n&&(n=!1),void 0===i&&(i=!1);var l,u,c,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+Y("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+Y("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(u||(c=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(r=n.call(a,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)}))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e,n,i))e=e.substring(r.raw.length),n=r.inLink,i=r.inRawBlock,(o=t[t.length-1])&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,i)),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),o=t[t.length-1],"link"===r.type?(r.tokens=this.inlineTokens(r.text,[],!0,i),t.push(r)):o&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,h,c))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),t.push(r);else if(r=this.tokenizer.autolink(e,Q))e=e.substring(r.raw.length),t.push(r);else if(n||!(r=this.tokenizer.url(e,Q))){if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,n=e.slice(1),i=void 0;a.options.extensions.startInline.forEach((function(e){"number"==typeof(i=e.call(this,n))&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),r=this.tokenizer.inlineText(s,i,Z))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),u=!0,(o=t[t.length-1])&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):t.push(r);else if(e){var f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}throw new Error(f)}}else e=e.substring(r.raw.length),t.push(r);return t},n=t,r=[{key:"rules",get:function(){return{block:K,inline:X}}}],(i=null)&&e(n.prototype,i),r&&e(n,r),t}(),ee=i.exports.defaults,te=_,ne=D,ie=function(){function e(e){this.options=e||ee}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return e=e.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+ne(i,!0)+'">'+(n?e:ne(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:ne(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+i.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+i+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<a href="'+ne(e)+'"';return t&&(i+=' title="'+t+'"'),i+">"+n+"</a>"},t.image=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<img src="'+e+'" alt="'+n+'"';return t&&(i+=' title="'+t+'"'),i+(this.options.xhtml?"/>":">")},t.text=function(e){return e},e}(),re=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),oe=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{n=e+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),se=ie,ae=re,le=oe,ue=i.exports.defaults,ce=C,he=J,de=function(){function e(e){this.options=e||ue,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ae,this.slugger=new le}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,y,b,x,w="",D=e.length;for(n=0;n<D;n++)if(h=e[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type])||!1===(x=this.options.extensions.renderers[h.type].call(this,h))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))switch(h.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ce(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(u="",l="",o=h.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[i]),{header:!0,align:h.align[i]});for(u+=this.renderer.tablerow(l),c="",o=h.cells.length,i=0;i<o;i++){for(l="",s=(a=h.tokens.cells[i]).length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:h.align[r]});c+=this.renderer.tablerow(l)}w+=this.renderer.table(u,c);continue;case"blockquote":c=this.parse(h.tokens),w+=this.renderer.blockquote(c);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,o=h.items.length,c="",i=0;i<o;i++)v=(g=h.items[i]).checked,y=g.task,m="",g.task&&(b=this.renderer.checkbox(v),p?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,p),c+=this.renderer.listitem(m,y,v);w+=this.renderer.list(c,d,f);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(c=h.tokens?this.parseInline(h.tokens):h.text;n+1<D&&"text"===e[n+1].type;)c+="\n"+((h=e[++n]).tokens?this.parseInline(h.tokens):h.text);w+=t?this.renderer.paragraph(c):c;continue;default:var C='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(C);throw new Error(C)}else w+=x||"";return w},t.parseInline=function(e,t){t=t||this.renderer;var n,i,r,o="",s=e.length;for(n=0;n<s;n++)if(i=e[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type])||!1===(r=this.options.extensions.renderers[i.type].call(this,i))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))switch(i.type){case"escape":o+=t.text(i.text);break;case"html":o+=t.html(i.text);break;case"link":o+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":o+=t.image(i.href,i.title,i.text);break;case"strong":o+=t.strong(this.parseInline(i.tokens,t));break;case"em":o+=t.em(this.parseInline(i.tokens,t));break;case"codespan":o+=t.codespan(i.text);break;case"br":o+=t.br();break;case"del":o+=t.del(this.parseInline(i.tokens,t));break;case"text":o+=t.text(i.text);break;default:var a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}else o+=r||"";return o},e}(),fe=H,pe=ie,me=re,ge=oe,ve=S,ye=L,be=D,xe=i.exports.getDefaults,we=i.exports.changeDefaults,De=i.exports.defaults;function Ce(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=ve({},Ce.defaults,t||{}),ye(t),n){var i,r=t.highlight;try{i=he.lex(e,t)}catch(e){return n(e)}var o=function(e){var o;if(!e)try{t.walkTokens&&Ce.walkTokens(i,t.walkTokens),o=de.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,o)};if(!r||r.length<3)return o();if(delete t.highlight,!i.length)return o();var s=0;return Ce.walkTokens(i,(function(e){"code"===e.type&&(s++,setTimeout((function(){r(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--s&&o()}))}),0))})),void(0===s&&o())}try{var a=he.lex(e,t);return t.walkTokens&&Ce.walkTokens(a,t.walkTokens),de.parse(a,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+be(e.message+"",!0)+"</pre>";throw e}}return Ce.options=Ce.setOptions=function(e){return ve(Ce.defaults,e),we(Ce.defaults),Ce},Ce.getDefaults=xe,Ce.defaults=De,Ce.use=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r,o=ve.apply(void 0,[{}].concat(n)),s=Ce.defaults.extensions||{renderers:{},childTokens:{}};n.forEach((function(t){if(t.extensions&&(r=!0,t.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=s.renderers?s.renderers[e.name]:null;s.renderers[e.name]=t?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=e.renderer.apply(this,i);return!1===o&&(o=t.apply(this,i)),o}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");s[e.level]?s[e.level].unshift(e.tokenizer):s[e.level]=[e.tokenizer],e.start&&("block"===e.level?s.startBlock?s.startBlock.push(e.start):s.startBlock=[e.start]:"inline"===e.level&&(s.startInline?s.startInline.push(e.start):s.startInline=[e.start]))}e.childTokens&&(s.childTokens[e.name]=e.childTokens)}))),t.renderer&&function(){var e=Ce.defaults.renderer||new pe,n=function(n){var i=e[n];e[n]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.renderer[n].apply(e,o);return!1===a&&(a=i.apply(e,o)),a}};for(var i in t.renderer)n(i);o.renderer=e}(),t.tokenizer&&function(){var e=Ce.defaults.tokenizer||new fe,n=function(n){var i=e[n];e[n]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.tokenizer[n].apply(e,o);return!1===a&&(a=i.apply(e,o)),a}};for(var i in t.tokenizer)n(i);o.tokenizer=e}(),t.walkTokens){var n=Ce.defaults.walkTokens;o.walkTokens=function(i){t.walkTokens.call(e,i),n&&n(i)}}r&&(o.extensions=s),Ce.setOptions(o)}))},Ce.walkTokens=function(e,t){for(var i,r=function(){var e=i.value;switch(t(e),e.type){case"table":for(var r,o=n(e.tokens.header);!(r=o()).done;){var s=r.value;Ce.walkTokens(s,t)}for(var a,l=n(e.tokens.cells);!(a=l()).done;)for(var u,c=n(a.value);!(u=c()).done;){var h=u.value;Ce.walkTokens(h,t)}break;case"list":Ce.walkTokens(e.items,t);break;default:Ce.defaults.extensions&&Ce.defaults.extensions.childTokens&&Ce.defaults.extensions.childTokens[e.type]?Ce.defaults.extensions.childTokens[e.type].forEach((function(n){Ce.walkTokens(e[n],t)})):e.tokens&&Ce.walkTokens(e.tokens,t)}},o=n(e);!(i=o()).done;)r()},Ce.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=ve({},Ce.defaults,t||{}),ye(t);try{var n=he.lexInline(e,t);return t.walkTokens&&Ce.walkTokens(n,t.walkTokens),de.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+be(e.message+"",!0)+"</pre>";throw e}},Ce.Parser=de,Ce.parser=de.parse,Ce.Renderer=pe,Ce.TextRenderer=me,Ce.Lexer=he,Ce.lexer=he.lex,Ce.Tokenizer=fe,Ce.Slugger=ge,Ce.parse=Ce,Ce}()},581:(e,t,n)=>{var i;!function(){"use strict";(i=function(e,t,n,i){i=i||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=i.flags||{},this.memoized={},this.loaded=!1;var r,o,s,a,l,u=this;function c(e,t){var n=u._readFile(e,null,i.asyncLoad);i.asyncLoad?n.then((function(e){t(e)})):t(n)}function h(e){t=e,n&&f()}function d(e){n=e,t&&f()}function f(){for(u.rules=u._parseAFF(t),u.compoundRuleCodes={},o=0,a=u.compoundRules.length;o<a;o++){var e=u.compoundRules[o];for(s=0,l=e.length;s<l;s++)u.compoundRuleCodes[e[s]]=[]}for(o in"ONLYINCOMPOUND"in u.flags&&(u.compoundRuleCodes[u.flags.ONLYINCOMPOUND]=[]),u.dictionaryTable=u._parseDIC(n),u.compoundRuleCodes)0===u.compoundRuleCodes[o].length&&delete u.compoundRuleCodes[o];for(o=0,a=u.compoundRules.length;o<a;o++){var r=u.compoundRules[o],c="";for(s=0,l=r.length;s<l;s++){var h=r[s];h in u.compoundRuleCodes?c+="("+u.compoundRuleCodes[h].join("|")+")":c+=h}u.compoundRules[o]=new RegExp(c,"i")}u.loaded=!0,i.asyncLoad&&i.loadedCallback&&i.loadedCallback(u)}return e&&(u.dictionary=e,t&&n?f():"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(r=i.dictionaryPath?i.dictionaryPath:"typo/dictionaries",t||c(chrome.extension.getURL(r+"/"+e+"/"+e+".aff"),h),n||c(chrome.extension.getURL(r+"/"+e+"/"+e+".dic"),d)):(r=i.dictionaryPath?i.dictionaryPath:"//dictionaries",t||c(r+"/"+e+"/"+e+".aff",h),n||c(r+"/"+e+"/"+e+".dic",d))),this}).prototype={load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);return this},_readFile:function(e,t,i){if(t=t||"utf8","undefined"!=typeof XMLHttpRequest){var r,o=new XMLHttpRequest;return o.open("GET",e,i),i&&(r=new Promise((function(e,t){o.onload=function(){200===o.status?e(o.responseText):t(o.statusText)},o.onerror=function(){t(o.statusText)}}))),o.overrideMimeType&&o.overrideMimeType("text/plain; charset="+t),o.send(null),i?r:o.responseText}var s=n(562);try{if(s.existsSync(e))return s.readFileSync(e,t);console.log("Path "+e+" does not exist.")}catch(e){return console.log(e),""}},_parseAFF:function(e){var t,n,i,r,o,s,a,l={},u=(e=this._removeAffixComments(e)).split(/\r?\n/);for(r=0,s=u.length;r<s;r++){var c=(t=u[r]).split(/\s+/),h=c[0];if("PFX"==h||"SFX"==h){var d=c[1],f=c[2],p=[];for(o=r+1,a=r+1+(n=parseInt(c[3],10));o<a;o++){var m=(i=u[o].split(/\s+/))[2],g=i[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),b=i[4],x={};x.add=v,y.length>0&&(x.continuationClasses=y),"."!==b&&(x.match="SFX"===h?new RegExp(b+"$"):new RegExp("^"+b)),"0"!=m&&(x.remove="SFX"===h?new RegExp(m+"$"):m),p.push(x)}l[d]={type:h,combineable:"Y"==f,entries:p},r+=n}else if("COMPOUNDRULE"===h){for(o=r+1,a=r+1+(n=parseInt(c[1],10));o<a;o++)i=(t=u[o]).split(/\s+/),this.compoundRules.push(i[1]);r+=n}else"REP"===h?3===(i=t.split(/\s+/)).length&&this.replacementTable.push([i[1],i[2]]):this.flags[h]=c[1]}return l},_removeAffixComments:function(e){return(e=(e=(e=e.replace(/^\s*#.*$/gm,"")).replace(/^\s\s*/m,"").replace(/\s\s*$/m,"")).replace(/\n{2,}/g,"\n")).replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){var t=(e=this._removeDicComments(e)).split(/\r?\n/),n={};function i(e,t){n.hasOwnProperty(e)||(n[e]=null),t.length>0&&(null===n[e]&&(n[e]=[]),n[e].push(t))}for(var r=1,o=t.length;r<o;r++){var s=t[r];if(s){var a=s.split("/",2),l=a[0];if(a.length>1){var u=this.parseRuleCodes(a[1]);"NEEDAFFIX"in this.flags&&-1!=u.indexOf(this.flags.NEEDAFFIX)||i(l,u);for(var c=0,h=u.length;c<h;c++){var d=u[c],f=this.rules[d];if(f)for(var p=this._applyRule(l,f),m=0,g=p.length;m<g;m++){var v=p[m];if(i(v,[]),f.combineable)for(var y=c+1;y<h;y++){var b=u[y],x=this.rules[b];if(x&&x.combineable&&f.type!=x.type)for(var w=this._applyRule(v,x),D=0,C=w.length;D<C;D++)i(w[D],[])}}d in this.compoundRuleCodes&&this.compoundRuleCodes[d].push(l)}}else i(l.trim(),[])}}return n},_removeDicComments:function(e){return e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,i=e.length;n<i;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?e.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,i=[],r=0,o=n.length;r<o;r++){var s=n[r];if(!s.match||e.match(s.match)){var a=e;if(s.remove&&(a=a.replace(s.remove,"")),"SFX"===t.type?a+=s.add:a=s.add+a,i.push(a),"continuationClasses"in s)for(var l=0,u=s.continuationClasses.length;l<u;l++){var c=this.rules[s.continuationClasses[l]];c&&(i=i.concat(this._applyRule(a,c)))}}}return i},check:function(e){if(!this.loaded)throw"Dictionary not loaded.";var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0;if(this.checkExact(t.toLowerCase()))return!0}var i=t[0].toLowerCase()+t.substring(1);if(i!==t){if(this.hasFlag(i,"KEEPCASE"))return!1;if(this.checkExact(i))return!0}return!1},checkExact:function(e){if(!this.loaded)throw"Dictionary not loaded.";var t,n,i=this.dictionaryTable[e];if(void 0===i){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(t=0,n=this.compoundRules.length;t<n;t++)if(e.match(this.compoundRules[t]))return!0}else{if(null===i)return!0;if("object"==typeof i)for(t=0,n=i.length;t<n;t++)if(!this.hasFlag(e,"ONLYINCOMPOUND",i[t]))return!0}return!1},hasFlag:function(e,t,n){if(!this.loaded)throw"Dictionary not loaded.";return!(!(t in this.flags)||(void 0===n&&(n=Array.prototype.concat.apply([],this.dictionaryTable[e])),!n||-1===n.indexOf(this.flags[t])))},alphabet:"",suggest:function(e,t){if(!this.loaded)throw"Dictionary not loaded.";if(t=t||5,this.memoized.hasOwnProperty(e)){var n=this.memoized[e].limit;if(t<=n||this.memoized[e].suggestions.length<n)return this.memoized[e].suggestions.slice(0,t)}if(this.check(e))return[];for(var i=0,r=this.replacementTable.length;i<r;i++){var o=this.replacementTable[i];if(-1!==e.indexOf(o[0])){var s=e.replace(o[0],o[1]);if(this.check(s))return[s]}}var a=this;function l(e,t){var n,i,r,o,s={},l=a.alphabet.length;if("string"==typeof e){var u=e;(e={})[u]=!0}for(var u in e)for(n=0,r=u.length+1;n<r;n++){var c=[u.substring(0,n),u.substring(n)];if(c[1]&&(o=c[0]+c[1].substring(1),t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1)),c[1].length>1&&c[1][1]!==c[1][0]&&(o=c[0]+c[1][1]+c[1][0]+c[1].substring(2),t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1)),c[1]){var h=c[1].substring(0,1).toUpperCase()===c[1].substring(0,1)?"uppercase":"lowercase";for(i=0;i<l;i++){var d=a.alphabet[i];"uppercase"===h&&(d=d.toUpperCase()),d!=c[1].substring(0,1)&&(o=c[0]+d+c[1].substring(1),t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1))}}if(c[1])for(i=0;i<l;i++)h=c[0].substring(-1).toUpperCase()===c[0].substring(-1)&&c[1].substring(0,1).toUpperCase()===c[1].substring(0,1)?"uppercase":"lowercase",d=a.alphabet[i],"uppercase"===h&&(d=d.toUpperCase()),o=c[0]+d+c[1],t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1)}return s}return a.alphabet="abcdefghijklmnopqrstuvwxyz",this.memoized[e]={suggestions:function(e){var n,i=l(e),r=l(i,!0);for(var o in i)a.check(o)&&(o in r?r[o]+=i[o]:r[o]=i[o]);var s=[];for(n in r)r.hasOwnProperty(n)&&s.push([n,r[n]]);s.sort((function(e,t){var n=e[1],i=t[1];return n<i?-1:n>i?1:t[0].localeCompare(e[0])})).reverse();var u=[],c="lowercase";e.toUpperCase()===e?c="uppercase":e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase()===e&&(c="capitalized");var h=t;for(n=0;n<Math.min(h,s.length);n++)"uppercase"===c?s[n][0]=s[n][0].toUpperCase():"capitalized"===c&&(s[n][0]=s[n][0].substr(0,1).toUpperCase()+s[n][0].substr(1)),a.hasFlag(s[n][0],"NOSUGGEST")||-1!=u.indexOf(s[n][0])?h++:u.push(s[n][0]);return u}(e),limit:t},this.memoized[e].suggestions}}}(),e.exports=i},649:(e,t,n)=>{var i={"./avatar.svg":611,"./avatar100x100.png":897,"./avatar150x150.png":796,"./avatar400x400.png":896,"./avatar80x80.png":916,"./favicon.ico":989};function r(e){var t=o(e);return n(t)}function o(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=o,e.exports=r,r.id=649},562:()=>{}}]);
|
|
|
|
|
|
+(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[216],{169:(e,t,n)=>{"use strict";n.d(t,{u_:()=>Wn,u:()=>pi});var i={};n.r(i),n.d(i,{afterMain:()=>C,afterRead:()=>x,afterWrite:()=>E,applyStyles:()=>N,arrow:()=>Q,auto:()=>l,basePlacements:()=>u,beforeMain:()=>w,beforeRead:()=>y,beforeWrite:()=>k,bottom:()=>o,clippingParents:()=>d,computeStyles:()=>te,createPopper:()=>Le,createPopperBase:()=>Fe,createPopperLite:()=>Me,detectOverflow:()=>ve,end:()=>h,eventListeners:()=>ie,flip:()=>ye,hide:()=>we,left:()=>a,main:()=>D,modifierPhases:()=>S,offset:()=>De,placements:()=>v,popper:()=>p,popperGenerator:()=>Te,popperOffsets:()=>Ce,preventOverflow:()=>ke,read:()=>b,reference:()=>m,right:()=>s,start:()=>c,top:()=>r,variationPlacements:()=>g,viewport:()=>f,write:()=>_});var r="top",o="bottom",s="right",a="left",l="auto",u=[r,o,s,a],c="start",h="end",d="clippingParents",f="viewport",p="popper",m="reference",g=u.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+h])}),[]),v=[].concat(u,[l]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+h])}),[]),y="beforeRead",b="read",x="afterRead",w="beforeMain",D="main",C="afterMain",k="beforeWrite",_="write",E="afterWrite",S=[y,b,x,w,D,C,k,_,E];function A(e){return e?(e.nodeName||"").toLowerCase():null}function T(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function F(e){return e instanceof T(e).Element||e instanceof Element}function L(e){return e instanceof T(e).HTMLElement||e instanceof HTMLElement}function M(e){return"undefined"!=typeof ShadowRoot&&(e instanceof T(e).ShadowRoot||e instanceof ShadowRoot)}const N={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];L(r)&&A(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});L(i)&&A(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function O(e){return e.split("-")[0]}var B=Math.round;function I(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),i=1,r=1;return L(e)&&t&&(i=n.width/e.offsetWidth||1,r=n.height/e.offsetHeight||1),{width:B(n.width/i),height:B(n.height/r),top:B(n.top/r),right:B(n.right/i),bottom:B(n.bottom/r),left:B(n.left/i),x:B(n.left/i),y:B(n.top/r)}}function z(e){var t=I(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function P(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&M(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function H(e){return T(e).getComputedStyle(e)}function R(e){return["table","td","th"].indexOf(A(e))>=0}function W(e){return((F(e)?e.ownerDocument:e.document)||window.document).documentElement}function j(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(M(e)?e.host:null)||W(e)}function q(e){return L(e)&&"fixed"!==H(e).position?e.offsetParent:null}function $(e){for(var t=T(e),n=q(e);n&&R(n)&&"static"===H(n).position;)n=q(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===H(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&L(e)&&"fixed"===H(e).position)return null;for(var n=j(e);L(n)&&["html","body"].indexOf(A(n))<0;){var i=H(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function U(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}var V=Math.max,G=Math.min,K=Math.round;function X(e,t,n){return V(e,G(t,n))}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,l=e.options,c=n.elements.arrow,h=n.modifiersData.popperOffsets,d=O(n.placement),f=U(d),p=[a,s].indexOf(d)>=0?"height":"width";if(c&&h){var m=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,u))}(l.padding,n),g=z(c),v="y"===f?r:a,y="y"===f?o:s,b=n.rects.reference[p]+n.rects.reference[f]-h[f]-n.rects.popper[p],x=h[f]-n.rects.reference[f],w=$(c),D=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,C=b/2-x/2,k=m[v],_=D-g[p]-m[y],E=D/2-g[p]/2+C,S=X(k,E,_),A=f;n.modifiersData[i]=((t={})[A]=S,t.centerOffset=S-E,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&P(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};var J={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ee(e){var t,n=e.popper,i=e.popperRect,l=e.placement,u=e.offsets,c=e.position,h=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,p=!0===f?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:K(K(t*i)/i)||0,y:K(K(n*i)/i)||0}}(u):"function"==typeof f?f(u):u,m=p.x,g=void 0===m?0:m,v=p.y,y=void 0===v?0:v,b=u.hasOwnProperty("x"),x=u.hasOwnProperty("y"),w=a,D=r,C=window;if(d){var k=$(n),_="clientHeight",E="clientWidth";k===T(n)&&"static"!==H(k=W(n)).position&&(_="scrollHeight",E="scrollWidth"),k=k,l===r&&(D=o,y-=k[_]-i.height,y*=h?1:-1),l===a&&(w=s,g-=k[E]-i.width,g*=h?1:-1)}var S,A=Object.assign({position:c},d&&J);return h?Object.assign({},A,((S={})[D]=x?"0":"",S[w]=b?"0":"",S.transform=(C.devicePixelRatio||1)<2?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",S)):Object.assign({},A,((t={})[D]=x?y+"px":"",t[w]=b?g+"px":"",t.transform="",t))}const te={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:O(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ee(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ee(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ne={passive:!0};const ie={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=void 0===r||r,s=i.resize,a=void 0===s||s,l=T(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,ne)})),a&&l.addEventListener("resize",n.update,ne),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,ne)})),a&&l.removeEventListener("resize",n.update,ne)}},data:{}};var re={left:"right",right:"left",bottom:"top",top:"bottom"};function oe(e){return e.replace(/left|right|bottom|top/g,(function(e){return re[e]}))}var se={start:"end",end:"start"};function ae(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function le(e){var t=T(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return I(W(e)).left+le(e).scrollLeft}function ce(e){var t=H(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function he(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:L(e)&&ce(e)?e:he(j(e))}function de(e,t){var n;void 0===t&&(t=[]);var i=he(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=T(i),s=r?[o].concat(o.visualViewport||[],ce(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(de(j(s)))}function fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function pe(e,t){return t===f?fe(function(e){var t=T(e),n=W(e),i=t.visualViewport,r=n.clientWidth,o=n.clientHeight,s=0,a=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=i.offsetLeft,a=i.offsetTop)),{width:r,height:o,x:s+ue(e),y:a}}(e)):L(t)?function(e){var t=I(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):fe(function(e){var t,n=W(e),i=le(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=V(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=V(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+ue(e),l=-i.scrollTop;return"rtl"===H(r||n).direction&&(a+=V(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(W(e)))}function me(e){return e.split("-")[1]}function ge(e){var t,n=e.reference,i=e.element,l=e.placement,u=l?O(l):null,d=l?me(l):null,f=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2;switch(u){case r:t={x:f,y:n.y-i.height};break;case o:t={x:f,y:n.y+n.height};break;case s:t={x:n.x+n.width,y:p};break;case a:t={x:n.x-i.width,y:p};break;default:t={x:n.x,y:n.y}}var m=u?U(u):null;if(null!=m){var g="y"===m?"height":"width";switch(d){case c:t[m]=t[m]-(n[g]/2-i[g]/2);break;case h:t[m]=t[m]+(n[g]/2-i[g]/2)}}return t}function ve(e,t){void 0===t&&(t={});var n=t,i=n.placement,a=void 0===i?e.placement:i,l=n.boundary,c=void 0===l?d:l,h=n.rootBoundary,g=void 0===h?f:h,v=n.elementContext,y=void 0===v?p:v,b=n.altBoundary,x=void 0!==b&&b,w=n.padding,D=void 0===w?0:w,C=Y("number"!=typeof D?D:Z(D,u)),k=y===p?m:p,_=e.elements.reference,E=e.rects.popper,S=e.elements[x?k:y],T=function(e,t,n){var i="clippingParents"===t?function(e){var t=de(j(e)),n=["absolute","fixed"].indexOf(H(e).position)>=0&&L(e)?$(e):e;return F(n)?t.filter((function(e){return F(e)&&P(e,n)&&"body"!==A(e)})):[]}(e):[].concat(t),r=[].concat(i,[n]),o=r[0],s=r.reduce((function(t,n){var i=pe(e,n);return t.top=V(i.top,t.top),t.right=G(i.right,t.right),t.bottom=G(i.bottom,t.bottom),t.left=V(i.left,t.left),t}),pe(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(F(S)?S:S.contextElement||W(e.elements.popper),c,g),M=I(_),N=ge({reference:M,element:E,strategy:"absolute",placement:a}),O=fe(Object.assign({},E,N)),B=y===p?O:M,z={top:T.top-B.top+C.top,bottom:B.bottom-T.bottom+C.bottom,left:T.left-B.left+C.left,right:B.right-T.right+C.right},R=e.modifiersData.offset;if(y===p&&R){var q=R[a];Object.keys(z).forEach((function(e){var t=[s,o].indexOf(e)>=0?1:-1,n=[r,o].indexOf(e)>=0?"y":"x";z[e]+=q[n]*t}))}return z}const ye={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var h=n.mainAxis,d=void 0===h||h,f=n.altAxis,p=void 0===f||f,m=n.fallbackPlacements,y=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,D=n.flipVariations,C=void 0===D||D,k=n.allowedAutoPlacements,_=t.options.placement,E=O(_),S=m||(E!==_&&C?function(e){if(O(e)===l)return[];var t=oe(e);return[ae(e),t,ae(t)]}(_):[oe(_)]),A=[_].concat(S).reduce((function(e,n){return e.concat(O(n)===l?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?v:l,h=me(i),d=h?a?g:g.filter((function(e){return me(e)===h})):u,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=ve(e,{placement:n,boundary:r,rootBoundary:o,padding:s})[O(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:y,flipVariations:C,allowedAutoPlacements:k}):n)}),[]),T=t.rects.reference,F=t.rects.popper,L=new Map,M=!0,N=A[0],B=0;B<A.length;B++){var I=A[B],z=O(I),P=me(I)===c,H=[r,o].indexOf(z)>=0,R=H?"width":"height",W=ve(t,{placement:I,boundary:b,rootBoundary:x,altBoundary:w,padding:y}),j=H?P?s:a:P?o:r;T[R]>F[R]&&(j=oe(j));var q=oe(j),$=[];if(d&&$.push(W[z]<=0),p&&$.push(W[j]<=0,W[q]<=0),$.every((function(e){return e}))){N=I,M=!1;break}L.set(I,$)}if(M)for(var U=function(e){var t=A.find((function(t){var n=L.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return N=t,"break"},V=C?3:1;V>0&&"break"!==U(V);V--);t.placement!==N&&(t.modifiersData[i]._skip=!0,t.placement=N,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xe(e){return[r,s,o,a].some((function(t){return e[t]>=0}))}const we={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,s=ve(t,{elementContext:"reference"}),a=ve(t,{altBoundary:!0}),l=be(s,i),u=be(a,r,o),c=xe(l),h=xe(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}},De={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,o=n.offset,l=void 0===o?[0,0]:o,u=v.reduce((function(e,n){return e[n]=function(e,t,n){var i=O(e),o=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,u=l[0],c=l[1];return u=u||0,c=(c||0)*o,[a,s].indexOf(i)>=0?{x:c,y:u}:{x:u,y:c}}(n,t.rects,l),e}),{}),c=u[t.placement],h=c.x,d=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=h,t.modifiersData.popperOffsets.y+=d),t.modifiersData[i]=u}},Ce={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ge({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ke={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,l=n.mainAxis,u=void 0===l||l,h=n.altAxis,d=void 0!==h&&h,f=n.boundary,p=n.rootBoundary,m=n.altBoundary,g=n.padding,v=n.tether,y=void 0===v||v,b=n.tetherOffset,x=void 0===b?0:b,w=ve(t,{boundary:f,rootBoundary:p,padding:g,altBoundary:m}),D=O(t.placement),C=me(t.placement),k=!C,_=U(D),E="x"===_?"y":"x",S=t.modifiersData.popperOffsets,A=t.rects.reference,T=t.rects.popper,F="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,L={x:0,y:0};if(S){if(u||d){var M="y"===_?r:a,N="y"===_?o:s,B="y"===_?"height":"width",I=S[_],P=S[_]+w[M],H=S[_]-w[N],R=y?-T[B]/2:0,W=C===c?A[B]:T[B],j=C===c?-T[B]:-A[B],q=t.elements.arrow,K=y&&q?z(q):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[M],Q=Y[N],J=X(0,A[B],K[B]),ee=k?A[B]/2-R-J-Z-F:W-J-Z-F,te=k?-A[B]/2+R+J+Q+F:j+J+Q+F,ne=t.elements.arrow&&$(t.elements.arrow),ie=ne?"y"===_?ne.clientTop||0:ne.clientLeft||0:0,re=t.modifiersData.offset?t.modifiersData.offset[t.placement][_]:0,oe=S[_]+ee-re-ie,se=S[_]+te-re;if(u){var ae=X(y?G(P,oe):P,I,y?V(H,se):H);S[_]=ae,L[_]=ae-I}if(d){var le="x"===_?r:a,ue="x"===_?o:s,ce=S[E],he=ce+w[le],de=ce-w[ue],fe=X(y?G(he,oe):he,ce,y?V(de,se):de);S[E]=fe,L[E]=fe-ce}}t.modifiersData[i]=L}},requiresIfExists:["offset"]};function _e(e,t,n){void 0===n&&(n=!1);var i,r,o=L(t),s=L(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return 1!==n||1!==i}(t),a=W(t),l=I(e,s),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==A(t)||ce(a))&&(u=(i=t)!==T(i)&&L(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:le(i)),L(t)?((c=I(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=ue(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Ee(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var Se={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Te(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,r=t.defaultOptions,o=void 0===r?Se:r;return function(e,t,n){void 0===n&&(n=o);var r,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Se,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:a,setOptions:function(n){h(),a.options=Object.assign({},o,a.options,n),a.scrollParents={reference:F(e)?de(e):e.contextElement?de(e.contextElement):[],popper:de(t)};var r,s,u=function(e){var t=Ee(e);return S.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((r=[].concat(i,a.options.modifiers),s=r.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(s).map((function(e){return s[e]}))));return a.orderedModifiers=u.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,r=e.effect;if("function"==typeof r){var o=r({state:a,name:t,instance:c,options:i});l.push(o||function(){})}})),c.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(Ae(t,n)){a.rects={reference:_e(t,$(n),"fixed"===a.options.strategy),popper:z(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],o=r.fn,s=r.options,l=void 0===s?{}:s,h=r.name;"function"==typeof o&&(a=o({state:a,options:l,name:h,instance:c})||a)}else a.reset=!1,i=-1}}},update:(r=function(){return new Promise((function(e){c.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(r())}))}))),s}),destroy:function(){h(),u=!0}};if(!Ae(e,t))return c;function h(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var Fe=Te(),Le=Te({defaultModifiers:[ie,Ce,te,N,De,ye,ke,Q,we]}),Me=Te({defaultModifiers:[ie,Ce,te,N]});const Ne="transitionend",Oe=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t},Be=e=>{const t=Oe(e);return t&&document.querySelector(t)?t:null},Ie=e=>{const t=Oe(e);return t?document.querySelector(t):null},ze=e=>{e.dispatchEvent(new Event(Ne))},Pe=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),He=e=>Pe(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(e):null,Re=(e,t,n)=>{Object.keys(n).forEach((i=>{const r=n[i],o=t[i],s=o&&Pe(o)?"element":null==(a=o)?`${a}`:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();var a;if(!new RegExp(r).test(s))throw new TypeError(`${e.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${r}".`)}))},We=e=>!(!Pe(e)||0===e.getClientRects().length)&&"visible"===getComputedStyle(e).getPropertyValue("visibility"),je=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),qe=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?qe(e.parentNode):null},$e=()=>{},Ue=e=>{e.offsetHeight},Ve=()=>{const{jQuery:e}=window;return e&&!document.body.hasAttribute("data-bs-no-jquery")?e:null},Ge=[],Ke=()=>"rtl"===document.documentElement.dir,Xe=e=>{var t;t=()=>{const t=Ve();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}},"loading"===document.readyState?(Ge.length||document.addEventListener("DOMContentLoaded",(()=>{Ge.forEach((e=>e()))})),Ge.push(t)):t()},Ye=e=>{"function"==typeof e&&e()},Ze=(e,t,n=!0)=>{if(!n)return void Ye(e);const i=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),r=Number.parseFloat(n);return i||r?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let r=!1;const o=({target:n})=>{n===t&&(r=!0,t.removeEventListener(Ne,o),Ye(e))};t.addEventListener(Ne,o),setTimeout((()=>{r||ze(t)}),i)},Qe=(e,t,n,i)=>{let r=e.indexOf(t);if(-1===r)return e[!n&&i?e.length-1:0];const o=e.length;return r+=n?1:-1,i&&(r=(r+o)%o),e[Math.max(0,Math.min(r,o-1))]},Je=/[^.]*(?=\..*)\.|.*/,et=/\..*/,tt=/::\d+$/,nt={};let it=1;const rt={mouseenter:"mouseover",mouseleave:"mouseout"},ot=/^(mouseenter|mouseleave)/i,st=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function at(e,t){return t&&`${t}::${it++}`||e.uidEvent||it++}function lt(e){const t=at(e);return e.uidEvent=t,nt[t]=nt[t]||{},nt[t]}function ut(e,t,n=null){const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){const o=e[i[r]];if(o.originalHandler===t&&o.delegationSelector===n)return o}return null}function ct(e,t,n){const i="string"==typeof t,r=i?n:t;let o=ft(e);return st.has(o)||(o=e),[i,r,o]}function ht(e,t,n,i,r){if("string"!=typeof t||!e)return;if(n||(n=i,i=null),ot.test(t)){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};i?i=e(i):n=e(n)}const[o,s,a]=ct(t,n,i),l=lt(e),u=l[a]||(l[a]={}),c=ut(u,s,o?n:null);if(c)return void(c.oneOff=c.oneOff&&r);const h=at(s,t.replace(Je,"")),d=o?function(e,t,n){return function i(r){const o=e.querySelectorAll(t);for(let{target:s}=r;s&&s!==this;s=s.parentNode)for(let a=o.length;a--;)if(o[a]===s)return r.delegateTarget=s,i.oneOff&&pt.off(e,r.type,t,n),n.apply(s,[r]);return null}}(e,n,i):function(e,t){return function n(i){return i.delegateTarget=e,n.oneOff&&pt.off(e,i.type,t),t.apply(e,[i])}}(e,n);d.delegationSelector=o?n:null,d.originalHandler=s,d.oneOff=r,d.uidEvent=h,u[h]=d,e.addEventListener(a,d,o)}function dt(e,t,n,i,r){const o=ut(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function ft(e){return e=e.replace(et,""),rt[e]||e}const pt={on(e,t,n,i){ht(e,t,n,i,!1)},one(e,t,n,i){ht(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[r,o,s]=ct(t,n,i),a=s!==t,l=lt(e),u=t.startsWith(".");if(void 0!==o){if(!l||!l[s])return;return void dt(e,l,s,o,r?n:null)}u&&Object.keys(l).forEach((n=>{!function(e,t,n,i){const r=t[n]||{};Object.keys(r).forEach((o=>{if(o.includes(i)){const i=r[o];dt(e,t,n,i.originalHandler,i.delegationSelector)}}))}(e,l,n,t.slice(1))}));const c=l[s]||{};Object.keys(c).forEach((n=>{const i=n.replace(tt,"");if(!a||t.includes(i)){const t=c[n];dt(e,l,s,t.originalHandler,t.delegationSelector)}}))},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=Ve(),r=ft(t),o=t!==r,s=st.has(r);let a,l=!0,u=!0,c=!1,h=null;return o&&i&&(a=i.Event(t,n),i(e).trigger(a),l=!a.isPropagationStopped(),u=!a.isImmediatePropagationStopped(),c=a.isDefaultPrevented()),s?(h=document.createEvent("HTMLEvents"),h.initEvent(r,l,!0)):h=new CustomEvent(t,{bubbles:l,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(h,e,{get:()=>n[e]})})),c&&h.preventDefault(),u&&e.dispatchEvent(h),h.defaultPrevented&&void 0!==a&&a.preventDefault(),h}},mt=new Map;var gt={set(e,t,n){mt.has(e)||mt.set(e,new Map);const i=mt.get(e);i.has(t)||0===i.size?i.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(e,t)=>mt.has(e)&&mt.get(e).get(t)||null,remove(e,t){if(!mt.has(e))return;const n=mt.get(e);n.delete(t),0===n.size&&mt.delete(e)}};class vt{constructor(e){(e=He(e))&&(this._element=e,gt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){gt.remove(this._element,this.constructor.DATA_KEY),pt.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((e=>{this[e]=null}))}_queueCallback(e,t,n=!0){Ze(e,t,n)}static getInstance(e){return gt.get(He(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.1.0"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}}const yt=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;pt.on(document,n,`[data-bs-dismiss="${i}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),je(this))return;const r=Ie(this)||this.closest(`.${i}`);e.getOrCreateInstance(r)[t]()}))};class bt extends vt{static get NAME(){return"alert"}close(){if(pt.trigger(this._element,"close.bs.alert").defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),pt.trigger(this._element,"closed.bs.alert"),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=bt.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}yt(bt,"close"),Xe(bt);const xt='[data-bs-toggle="button"]';class wt extends vt{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=wt.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}function Dt(e){return"true"===e||"false"!==e&&(e===Number(e).toString()?Number(e):""===e||"null"===e?null:e)}function Ct(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}pt.on(document,"click.bs.button.data-api",xt,(e=>{e.preventDefault();const t=e.target.closest(xt);wt.getOrCreateInstance(t).toggle()})),Xe(wt);const kt={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${Ct(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${Ct(t)}`)},getDataAttributes(e){if(!e)return{};const t={};return Object.keys(e.dataset).filter((e=>e.startsWith("bs"))).forEach((n=>{let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),t[i]=Dt(e.dataset[n])})),t},getDataAttribute:(e,t)=>Dt(e.getAttribute(`data-bs-${Ct(t)}`)),offset(e){const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},position:e=>({top:e.offsetTop,left:e.offsetLeft})},_t={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let i=e.parentNode;for(;i&&i.nodeType===Node.ELEMENT_NODE&&3!==i.nodeType;)i.matches(t)&&n.push(i),i=i.parentNode;return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(", ");return this.find(t,e).filter((e=>!je(e)&&We(e)))}},Et="carousel",St={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},At={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},Tt="next",Ft="prev",Lt="left",Mt="right",Nt={ArrowLeft:Mt,ArrowRight:Lt},Ot="slid.bs.carousel",Bt="active",It=".active.carousel-item",zt="touch";class Pt extends vt{constructor(e,t){super(e),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(t),this._indicatorsElement=_t.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return St}static get NAME(){return Et}next(){this._slide(Tt)}nextWhenVisible(){!document.hidden&&We(this._element)&&this.next()}prev(){this._slide(Ft)}pause(e){e||(this._isPaused=!0),_t.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&(ze(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(e){this._activeElement=_t.findOne(It,this._element);const t=this._getItemIndex(this._activeElement);if(e>this._items.length-1||e<0)return;if(this._isSliding)return void pt.one(this._element,Ot,(()=>this.to(e)));if(t===e)return this.pause(),void this.cycle();const n=e>t?Tt:Ft;this._slide(n,this._items[e])}_getConfig(e){return e={...St,...kt.getDataAttributes(this._element),..."object"==typeof e?e:{}},Re(Et,e,At),e}_handleSwipe(){const e=Math.abs(this.touchDeltaX);if(e<=40)return;const t=e/this.touchDeltaX;this.touchDeltaX=0,t&&this._slide(t>0?Mt:Lt)}_addEventListeners(){this._config.keyboard&&pt.on(this._element,"keydown.bs.carousel",(e=>this._keydown(e))),"hover"===this._config.pause&&(pt.on(this._element,"mouseenter.bs.carousel",(e=>this.pause(e))),pt.on(this._element,"mouseleave.bs.carousel",(e=>this.cycle(e)))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}_addTouchEventListeners(){const e=e=>{!this._pointerEvent||"pen"!==e.pointerType&&e.pointerType!==zt?this._pointerEvent||(this.touchStartX=e.touches[0].clientX):this.touchStartX=e.clientX},t=e=>{this.touchDeltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this.touchStartX},n=e=>{!this._pointerEvent||"pen"!==e.pointerType&&e.pointerType!==zt||(this.touchDeltaX=e.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((e=>this.cycle(e)),500+this._config.interval))};_t.find(".carousel-item img",this._element).forEach((e=>{pt.on(e,"dragstart.bs.carousel",(e=>e.preventDefault()))})),this._pointerEvent?(pt.on(this._element,"pointerdown.bs.carousel",(t=>e(t))),pt.on(this._element,"pointerup.bs.carousel",(e=>n(e))),this._element.classList.add("pointer-event")):(pt.on(this._element,"touchstart.bs.carousel",(t=>e(t))),pt.on(this._element,"touchmove.bs.carousel",(e=>t(e))),pt.on(this._element,"touchend.bs.carousel",(e=>n(e))))}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Nt[e.key];t&&(e.preventDefault(),this._slide(t))}_getItemIndex(e){return this._items=e&&e.parentNode?_t.find(".carousel-item",e.parentNode):[],this._items.indexOf(e)}_getItemByOrder(e,t){const n=e===Tt;return Qe(this._items,t,n,this._config.wrap)}_triggerSlideEvent(e,t){const n=this._getItemIndex(e),i=this._getItemIndex(_t.findOne(It,this._element));return pt.trigger(this._element,"slide.bs.carousel",{relatedTarget:e,direction:t,from:i,to:n})}_setActiveIndicatorElement(e){if(this._indicatorsElement){const t=_t.findOne(".active",this._indicatorsElement);t.classList.remove(Bt),t.removeAttribute("aria-current");const n=_t.find("[data-bs-target]",this._indicatorsElement);for(let t=0;t<n.length;t++)if(Number.parseInt(n[t].getAttribute("data-bs-slide-to"),10)===this._getItemIndex(e)){n[t].classList.add(Bt),n[t].setAttribute("aria-current","true");break}}}_updateInterval(){const e=this._activeElement||_t.findOne(It,this._element);if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);t?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=t):this._config.interval=this._config.defaultInterval||this._config.interval}_slide(e,t){const n=this._directionToOrder(e),i=_t.findOne(It,this._element),r=this._getItemIndex(i),o=t||this._getItemByOrder(n,i),s=this._getItemIndex(o),a=Boolean(this._interval),l=n===Tt,u=l?"carousel-item-start":"carousel-item-end",c=l?"carousel-item-next":"carousel-item-prev",h=this._orderToDirection(n);if(o&&o.classList.contains(Bt))return void(this._isSliding=!1);if(this._isSliding)return;if(this._triggerSlideEvent(o,h).defaultPrevented)return;if(!i||!o)return;this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(o),this._activeElement=o;const d=()=>{pt.trigger(this._element,Ot,{relatedTarget:o,direction:h,from:r,to:s})};if(this._element.classList.contains("slide")){o.classList.add(c),Ue(o),i.classList.add(u),o.classList.add(u);const e=()=>{o.classList.remove(u,c),o.classList.add(Bt),i.classList.remove(Bt,c,u),this._isSliding=!1,setTimeout(d,0)};this._queueCallback(e,i,!0)}else i.classList.remove(Bt),o.classList.add(Bt),this._isSliding=!1,d();a&&this.cycle()}_directionToOrder(e){return[Mt,Lt].includes(e)?Ke()?e===Lt?Ft:Tt:e===Lt?Tt:Ft:e}_orderToDirection(e){return[Tt,Ft].includes(e)?Ke()?e===Ft?Lt:Mt:e===Ft?Mt:Lt:e}static carouselInterface(e,t){const n=Pt.getOrCreateInstance(e,t);let{_config:i}=n;"object"==typeof t&&(i={...i,...t});const r="string"==typeof t?t:i.slide;if("number"==typeof t)n.to(t);else if("string"==typeof r){if(void 0===n[r])throw new TypeError(`No method named "${r}"`);n[r]()}else i.interval&&i.ride&&(n.pause(),n.cycle())}static jQueryInterface(e){return this.each((function(){Pt.carouselInterface(this,e)}))}static dataApiClickHandler(e){const t=Ie(this);if(!t||!t.classList.contains("carousel"))return;const n={...kt.getDataAttributes(t),...kt.getDataAttributes(this)},i=this.getAttribute("data-bs-slide-to");i&&(n.interval=!1),Pt.carouselInterface(t,n),i&&Pt.getInstance(t).to(i),e.preventDefault()}}pt.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",Pt.dataApiClickHandler),pt.on(window,"load.bs.carousel.data-api",(()=>{const e=_t.find('[data-bs-ride="carousel"]');for(let t=0,n=e.length;t<n;t++)Pt.carouselInterface(e[t],Pt.getInstance(e[t]))})),Xe(Pt);const Ht="collapse",Rt={toggle:!0,parent:null},Wt={toggle:"boolean",parent:"(null|element)"},jt="show",qt="collapse",$t="collapsing",Ut="collapsed",Vt='[data-bs-toggle="collapse"]';class Gt extends vt{constructor(e,t){super(e),this._isTransitioning=!1,this._config=this._getConfig(t),this._triggerArray=[];const n=_t.find(Vt);for(let e=0,t=n.length;e<t;e++){const t=n[e],i=Be(t),r=_t.find(i).filter((e=>e===this._element));null!==i&&r.length&&(this._selector=i,this._triggerArray.push(t))}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Rt}static get NAME(){return Ht}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e,t=[];if(this._config.parent){const e=_t.find(".collapse .collapse",this._config.parent);t=_t.find(".show, .collapsing",this._config.parent).filter((t=>!e.includes(t)))}const n=_t.findOne(this._selector);if(t.length){const i=t.find((e=>n!==e));if(e=i?Gt.getInstance(i):null,e&&e._isTransitioning)return}if(pt.trigger(this._element,"show.bs.collapse").defaultPrevented)return;t.forEach((t=>{n!==t&&Gt.getOrCreateInstance(t,{toggle:!1}).hide(),e||gt.set(t,"bs.collapse",null)}));const i=this._getDimension();this._element.classList.remove(qt),this._element.classList.add($t),this._element.style[i]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const r=`scroll${i[0].toUpperCase()+i.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove($t),this._element.classList.add(qt,jt),this._element.style[i]="",pt.trigger(this._element,"shown.bs.collapse")}),this._element,!0),this._element.style[i]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(pt.trigger(this._element,"hide.bs.collapse").defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,Ue(this._element),this._element.classList.add($t),this._element.classList.remove(qt,jt);const t=this._triggerArray.length;for(let e=0;e<t;e++){const t=this._triggerArray[e],n=Ie(t);n&&!this._isShown(n)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove($t),this._element.classList.add(qt),pt.trigger(this._element,"hidden.bs.collapse")}),this._element,!0)}_isShown(e=this._element){return e.classList.contains(jt)}_getConfig(e){return(e={...Rt,...kt.getDataAttributes(this._element),...e}).toggle=Boolean(e.toggle),e.parent=He(e.parent),Re(Ht,e,Wt),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=_t.find(".collapse .collapse",this._config.parent);_t.find(Vt,this._config.parent).filter((t=>!e.includes(t))).forEach((e=>{const t=Ie(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}))}_addAriaAndCollapsedClass(e,t){e.length&&e.forEach((e=>{t?e.classList.remove(Ut):e.classList.add(Ut),e.setAttribute("aria-expanded",t)}))}static jQueryInterface(e){return this.each((function(){const t={};"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1);const n=Gt.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e]()}}))}}pt.on(document,"click.bs.collapse.data-api",Vt,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();const t=Be(this);_t.find(t).forEach((e=>{Gt.getOrCreateInstance(e,{toggle:!1}).toggle()}))})),Xe(Gt);const Kt="dropdown",Xt="Escape",Yt="Space",Zt="ArrowUp",Qt="ArrowDown",Jt=new RegExp("ArrowUp|ArrowDown|Escape"),en="click.bs.dropdown.data-api",tn="keydown.bs.dropdown.data-api",nn="show",rn='[data-bs-toggle="dropdown"]',on=".dropdown-menu",sn=Ke()?"top-end":"top-start",an=Ke()?"top-start":"top-end",ln=Ke()?"bottom-end":"bottom-start",un=Ke()?"bottom-start":"bottom-end",cn=Ke()?"left-start":"right-start",hn=Ke()?"right-start":"left-start",dn={offset:[0,2],boundary:"clippingParents",reference:"toggle",display:"dynamic",popperConfig:null,autoClose:!0},fn={offset:"(array|string|function)",boundary:"(string|element)",reference:"(string|element|object)",display:"string",popperConfig:"(null|object|function)",autoClose:"(boolean|string)"};class pn extends vt{constructor(e,t){super(e),this._popper=null,this._config=this._getConfig(t),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar()}static get Default(){return dn}static get DefaultType(){return fn}static get NAME(){return Kt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(je(this._element)||this._isShown(this._menu))return;const e={relatedTarget:this._element};if(pt.trigger(this._element,"show.bs.dropdown",e).defaultPrevented)return;const t=pn.getParentFromElement(this._element);this._inNavbar?kt.setDataAttribute(this._menu,"popper","none"):this._createPopper(t),"ontouchstart"in document.documentElement&&!t.closest(".navbar-nav")&&[].concat(...document.body.children).forEach((e=>pt.on(e,"mouseover",$e))),this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(nn),this._element.classList.add(nn),pt.trigger(this._element,"shown.bs.dropdown",e)}hide(){if(je(this._element)||!this._isShown(this._menu))return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){pt.trigger(this._element,"hide.bs.dropdown",e).defaultPrevented||("ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((e=>pt.off(e,"mouseover",$e))),this._popper&&this._popper.destroy(),this._menu.classList.remove(nn),this._element.classList.remove(nn),this._element.setAttribute("aria-expanded","false"),kt.removeDataAttribute(this._menu,"popper"),pt.trigger(this._element,"hidden.bs.dropdown",e))}_getConfig(e){if(e={...this.constructor.Default,...kt.getDataAttributes(this._element),...e},Re(Kt,e,this.constructor.DefaultType),"object"==typeof e.reference&&!Pe(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Kt.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(e){if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=e:Pe(this._config.reference)?t=He(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const n=this._getPopperConfig(),r=n.modifiers.find((e=>"applyStyles"===e.name&&!1===e.enabled));this._popper=Le(t,this._menu,n),r&&kt.setDataAttribute(this._menu,"popper","static")}_isShown(e=this._element){return e.classList.contains(nn)}_getMenuElement(){return _t.next(this._element,on)[0]}_getPlacement(){const e=this._element.parentNode;if(e.classList.contains("dropend"))return cn;if(e.classList.contains("dropstart"))return hn;const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?an:sn:t?un:ln}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return"static"===this._config.display&&(e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_selectMenuItem({key:e,target:t}){const n=_t.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(We);n.length&&Qe(n,t,e===Qt,!n.includes(t)).focus()}static jQueryInterface(e){return this.each((function(){const t=pn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}static clearMenus(e){if(e&&(2===e.button||"keyup"===e.type&&"Tab"!==e.key))return;const t=_t.find(rn);for(let n=0,i=t.length;n<i;n++){const i=pn.getInstance(t[n]);if(!i||!1===i._config.autoClose)continue;if(!i._isShown())continue;const r={relatedTarget:i._element};if(e){const t=e.composedPath(),n=t.includes(i._menu);if(t.includes(i._element)||"inside"===i._config.autoClose&&!n||"outside"===i._config.autoClose&&n)continue;if(i._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;"click"===e.type&&(r.clickEvent=e)}i._completeHide(r)}}static getParentFromElement(e){return Ie(e)||e.parentNode}static dataApiKeydownHandler(e){if(/input|textarea/i.test(e.target.tagName)?e.key===Yt||e.key!==Xt&&(e.key!==Qt&&e.key!==Zt||e.target.closest(on)):!Jt.test(e.key))return;const t=this.classList.contains(nn);if(!t&&e.key===Xt)return;if(e.preventDefault(),e.stopPropagation(),je(this))return;const n=this.matches(rn)?this:_t.prev(this,rn)[0],i=pn.getOrCreateInstance(n);if(e.key!==Xt)return e.key===Zt||e.key===Qt?(t||i.show(),void i._selectMenuItem(e)):void(t&&e.key!==Yt||pn.clearMenus());i.hide()}}pt.on(document,tn,rn,pn.dataApiKeydownHandler),pt.on(document,tn,on,pn.dataApiKeydownHandler),pt.on(document,en,pn.clearMenus),pt.on(document,"keyup.bs.dropdown.data-api",pn.clearMenus),pt.on(document,en,rn,(function(e){e.preventDefault(),pn.getOrCreateInstance(this).toggle()})),Xe(pn);const mn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",gn=".sticky-top";class vn{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"paddingRight",(t=>t+e)),this._setElementAttributes(mn,"paddingRight",(t=>t+e)),this._setElementAttributes(gn,"marginRight",(t=>t-e))}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e)[t];e.style[t]=`${n(Number.parseFloat(r))}px`}))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(mn,"paddingRight"),this._resetElementAttributes(gn,"marginRight")}_saveInitialAttribute(e,t){const n=e.style[t];n&&kt.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const n=kt.getDataAttribute(e,t);void 0===n?e.style.removeProperty(t):(kt.removeDataAttribute(e,t),e.style[t]=n)}))}_applyManipulationCallback(e,t){Pe(e)?t(e):_t.find(e,this._element).forEach(t)}isOverflowing(){return this.getWidth()>0}}const yn={className:"modal-backdrop",isVisible:!0,isAnimated:!1,rootElement:"body",clickCallback:null},bn={className:"string",isVisible:"boolean",isAnimated:"boolean",rootElement:"(element|string)",clickCallback:"(function|null)"},xn="show",wn="mousedown.bs.backdrop";class Dn{constructor(e){this._config=this._getConfig(e),this._isAppended=!1,this._element=null}show(e){this._config.isVisible?(this._append(),this._config.isAnimated&&Ue(this._getElement()),this._getElement().classList.add(xn),this._emulateAnimation((()=>{Ye(e)}))):Ye(e)}hide(e){this._config.isVisible?(this._getElement().classList.remove(xn),this._emulateAnimation((()=>{this.dispose(),Ye(e)}))):Ye(e)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_getConfig(e){return(e={...yn,..."object"==typeof e?e:{}}).rootElement=He(e.rootElement),Re("backdrop",e,bn),e}_append(){this._isAppended||(this._config.rootElement.append(this._getElement()),pt.on(this._getElement(),wn,(()=>{Ye(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(pt.off(this._element,wn),this._element.remove(),this._isAppended=!1)}_emulateAnimation(e){Ze(e,this._getElement(),this._config.isAnimated)}}const Cn={trapElement:null,autofocus:!0},kn={trapElement:"element",autofocus:"boolean"},_n=".bs.focustrap",En="backward";class Sn{constructor(e){this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}activate(){const{trapElement:e,autofocus:t}=this._config;this._isActive||(t&&e.focus(),pt.off(document,_n),pt.on(document,"focusin.bs.focustrap",(e=>this._handleFocusin(e))),pt.on(document,"keydown.tab.bs.focustrap",(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,pt.off(document,_n))}_handleFocusin(e){const{target:t}=e,{trapElement:n}=this._config;if(t===document||t===n||n.contains(t))return;const i=_t.focusableChildren(n);0===i.length?n.focus():this._lastTabNavDirection===En?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?En:"forward")}_getConfig(e){return e={...Cn,..."object"==typeof e?e:{}},Re("focustrap",e,kn),e}}const An="modal",Tn="Escape",Fn={backdrop:!0,keyboard:!0,focus:!0},Ln={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},Mn="hidden.bs.modal",Nn="show.bs.modal",On="resize.bs.modal",Bn="click.dismiss.bs.modal",In="keydown.dismiss.bs.modal",zn="mousedown.dismiss.bs.modal",Pn="modal-open",Hn="show",Rn="modal-static";class Wn extends vt{constructor(e,t){super(e),this._config=this._getConfig(t),this._dialog=_t.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new vn}static get Default(){return Fn}static get NAME(){return An}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||pt.trigger(this._element,Nn,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(Pn),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),pt.on(this._dialog,zn,(()=>{pt.one(this._element,"mouseup.dismiss.bs.modal",(e=>{e.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(e))))}hide(){if(!this._isShown||this._isTransitioning)return;if(pt.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();e&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),this._focustrap.deactivate(),this._element.classList.remove(Hn),pt.off(this._element,Bn),pt.off(this._dialog,zn),this._queueCallback((()=>this._hideModal()),this._element,e)}dispose(){[window,this._dialog].forEach((e=>pt.off(e,".bs.modal"))),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Dn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Sn({trapElement:this._element})}_getConfig(e){return e={...Fn,...kt.getDataAttributes(this._element),..."object"==typeof e?e:{}},Re(An,e,Ln),e}_showElement(e){const t=this._isAnimated(),n=_t.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,n&&(n.scrollTop=0),t&&Ue(this._element),this._element.classList.add(Hn),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,pt.trigger(this._element,"shown.bs.modal",{relatedTarget:e})}),this._dialog,t)}_setEscapeEvent(){this._isShown?pt.on(this._element,In,(e=>{this._config.keyboard&&e.key===Tn?(e.preventDefault(),this.hide()):this._config.keyboard||e.key!==Tn||this._triggerBackdropTransition()})):pt.off(this._element,In)}_setResizeEvent(){this._isShown?pt.on(window,On,(()=>this._adjustDialog())):pt.off(window,On)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Pn),this._resetAdjustments(),this._scrollBar.reset(),pt.trigger(this._element,Mn)}))}_showBackdrop(e){pt.on(this._element,Bn,(e=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:e.target===e.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(e)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(pt.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const{classList:e,scrollHeight:t,style:n}=this._element,i=t>document.documentElement.clientHeight;!i&&"hidden"===n.overflowY||e.contains(Rn)||(i||(n.overflowY="hidden"),e.add(Rn),this._queueCallback((()=>{e.remove(Rn),i||this._queueCallback((()=>{n.overflowY=""}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;(!n&&e&&!Ke()||n&&!e&&Ke())&&(this._element.style.paddingLeft=`${t}px`),(n&&!e&&!Ke()||!n&&e&&Ke())&&(this._element.style.paddingRight=`${t}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const n=Wn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e](t)}}))}}pt.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',(function(e){const t=Ie(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),pt.one(t,Nn,(e=>{e.defaultPrevented||pt.one(t,Mn,(()=>{We(this)&&this.focus()}))})),Wn.getOrCreateInstance(t).toggle(this)})),yt(Wn),Xe(Wn);const jn="offcanvas",qn={backdrop:!0,keyboard:!0,scroll:!1},$n={backdrop:"boolean",keyboard:"boolean",scroll:"boolean"},Un="show",Vn=".offcanvas.show",Gn="hidden.bs.offcanvas";class Kn extends vt{constructor(e,t){super(e),this._config=this._getConfig(t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get NAME(){return jn}static get Default(){return qn}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||pt.trigger(this._element,"show.bs.offcanvas",{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._element.style.visibility="visible",this._backdrop.show(),this._config.scroll||(new vn).hide(),this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Un),this._queueCallback((()=>{this._config.scroll||this._focustrap.activate(),pt.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:e})}),this._element,!0))}hide(){this._isShown&&(pt.trigger(this._element,"hide.bs.offcanvas").defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.remove(Un),this._backdrop.hide(),this._queueCallback((()=>{this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._element.style.visibility="hidden",this._config.scroll||(new vn).reset(),pt.trigger(this._element,Gn)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_getConfig(e){return e={...qn,...kt.getDataAttributes(this._element),..."object"==typeof e?e:{}},Re(jn,e,$n),e}_initializeBackDrop(){return new Dn({className:"offcanvas-backdrop",isVisible:this._config.backdrop,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:()=>this.hide()})}_initializeFocusTrap(){return new Sn({trapElement:this._element})}_addEventListeners(){pt.on(this._element,"keydown.dismiss.bs.offcanvas",(e=>{this._config.keyboard&&"Escape"===e.key&&this.hide()}))}static jQueryInterface(e){return this.each((function(){const t=Kn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}pt.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',(function(e){const t=Ie(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),je(this))return;pt.one(t,Gn,(()=>{We(this)&&this.focus()}));const n=_t.findOne(Vn);n&&n!==t&&Kn.getInstance(n).hide(),Kn.getOrCreateInstance(t).toggle(this)})),pt.on(window,"load.bs.offcanvas.data-api",(()=>_t.find(Vn).forEach((e=>Kn.getOrCreateInstance(e).show())))),yt(Kn),Xe(Kn);const Xn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Yn=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i,Zn=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,Qn=(e,t)=>{const n=e.nodeName.toLowerCase();if(t.includes(n))return!Xn.has(n)||Boolean(Yn.test(e.nodeValue)||Zn.test(e.nodeValue));const i=t.filter((e=>e instanceof RegExp));for(let e=0,t=i.length;e<t;e++)if(i[e].test(n))return!0;return!1};function Jn(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),r=Object.keys(t),o=[].concat(...i.body.querySelectorAll("*"));for(let e=0,n=o.length;e<n;e++){const n=o[e],i=n.nodeName.toLowerCase();if(!r.includes(i)){n.remove();continue}const s=[].concat(...n.attributes),a=[].concat(t["*"]||[],t[i]||[]);s.forEach((e=>{Qn(e,a)||n.removeAttribute(e.nodeName)}))}return i.body.innerHTML}const ei="tooltip",ti=new Set(["sanitize","allowList","sanitizeFn"]),ni={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(array|string|function)",container:"(string|element|boolean)",fallbackPlacements:"array",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",allowList:"object",popperConfig:"(null|object|function)"},ii={AUTO:"auto",TOP:"top",RIGHT:Ke()?"left":"right",BOTTOM:"bottom",LEFT:Ke()?"right":"left"},ri={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:[0,0],container:!1,fallbackPlacements:["top","right","bottom","left"],boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},oi={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},si="fade",ai="show",li="show",ui="out",ci=".modal",hi="hide.bs.modal",di="hover",fi="focus";class pi extends vt{constructor(e,t){if(void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this._config=this._getConfig(t),this.tip=null,this._setListeners()}static get Default(){return ri}static get NAME(){return ei}static get Event(){return oi}static get DefaultType(){return ni}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(e){if(this._isEnabled)if(e){const t=this._initializeOnDelegatedTarget(e);t._activeTrigger.click=!t._activeTrigger.click,t._isWithActiveTrigger()?t._enter(null,t):t._leave(null,t)}else{if(this.getTipElement().classList.contains(ai))return void this._leave(null,this);this._enter(null,this)}}dispose(){clearTimeout(this._timeout),pt.off(this._element.closest(ci),hi,this._hideModalHandler),this.tip&&this.tip.remove(),this._popper&&this._popper.destroy(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this.isWithContent()||!this._isEnabled)return;const e=pt.trigger(this._element,this.constructor.Event.SHOW),t=qe(this._element),n=null===t?this._element.ownerDocument.documentElement.contains(this._element):t.contains(this._element);if(e.defaultPrevented||!n)return;const i=this.getTipElement(),r=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME);i.setAttribute("id",r),this._element.setAttribute("aria-describedby",r),this._config.animation&&i.classList.add(si);const o="function"==typeof this._config.placement?this._config.placement.call(this,i,this._element):this._config.placement,s=this._getAttachment(o);this._addAttachmentClass(s);const{container:a}=this._config;gt.set(i,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||(a.append(i),pt.trigger(this._element,this.constructor.Event.INSERTED)),this._popper?this._popper.update():this._popper=Le(this._element,i,this._getPopperConfig(s)),i.classList.add(ai);const l=this._resolvePossibleFunction(this._config.customClass);l&&i.classList.add(...l.split(" ")),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((e=>{pt.on(e,"mouseover",$e)}));const u=this.tip.classList.contains(si);this._queueCallback((()=>{const e=this._hoverState;this._hoverState=null,pt.trigger(this._element,this.constructor.Event.SHOWN),e===ui&&this._leave(null,this)}),this.tip,u)}hide(){if(!this._popper)return;const e=this.getTipElement();if(pt.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented)return;e.classList.remove(ai),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((e=>pt.off(e,"mouseover",$e))),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1;const t=this.tip.classList.contains(si);this._queueCallback((()=>{this._isWithActiveTrigger()||(this._hoverState!==li&&e.remove(),this._cleanTipClass(),this._element.removeAttribute("aria-describedby"),pt.trigger(this._element,this.constructor.Event.HIDDEN),this._popper&&(this._popper.destroy(),this._popper=null))}),this.tip,t),this._hoverState=""}update(){null!==this._popper&&this._popper.update()}isWithContent(){return Boolean(this.getTitle())}getTipElement(){if(this.tip)return this.tip;const e=document.createElement("div");e.innerHTML=this._config.template;const t=e.children[0];return this.setContent(t),t.classList.remove(si,ai),this.tip=t,this.tip}setContent(e){this._sanitizeAndSetContent(e,this.getTitle(),".tooltip-inner")}_sanitizeAndSetContent(e,t,n){const i=_t.findOne(n,e);t||!i?this.setElementContent(i,t):i.remove()}setElementContent(e,t){if(null!==e)return Pe(t)?(t=He(t),void(this._config.html?t.parentNode!==e&&(e.innerHTML="",e.append(t)):e.textContent=t.textContent)):void(this._config.html?(this._config.sanitize&&(t=Jn(t,this._config.allowList,this._config.sanitizeFn)),e.innerHTML=t):e.textContent=t)}getTitle(){const e=this._element.getAttribute("data-bs-original-title")||this._config.title;return this._resolvePossibleFunction(e)}updateAttachment(e){return"right"===e?"end":"left"===e?"start":e}_initializeOnDelegatedTarget(e,t){return t||this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return"function"==typeof e?e.call(this._element):e}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:e=>this._handlePopperPlacementChange(e)}],onFirstUpdate:e=>{e.options.placement!==e.placement&&this._handlePopperPlacementChange(e)}};return{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_addAttachmentClass(e){this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(e)}`)}_getAttachment(e){return ii[e.toUpperCase()]}_setListeners(){this._config.trigger.split(" ").forEach((e=>{if("click"===e)pt.on(this._element,this.constructor.Event.CLICK,this._config.selector,(e=>this.toggle(e)));else if("manual"!==e){const t=e===di?this.constructor.Event.MOUSEENTER:this.constructor.Event.FOCUSIN,n=e===di?this.constructor.Event.MOUSELEAVE:this.constructor.Event.FOCUSOUT;pt.on(this._element,t,this._config.selector,(e=>this._enter(e))),pt.on(this._element,n,this._config.selector,(e=>this._leave(e)))}})),this._hideModalHandler=()=>{this._element&&this.hide()},pt.on(this._element.closest(ci),hi,this._hideModalHandler),this._config.selector?this._config={...this._config,trigger:"manual",selector:""}:this._fixTitle()}_fixTitle(){const e=this._element.getAttribute("title"),t=typeof this._element.getAttribute("data-bs-original-title");(e||"string"!==t)&&(this._element.setAttribute("data-bs-original-title",e||""),!e||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",e),this._element.setAttribute("title",""))}_enter(e,t){t=this._initializeOnDelegatedTarget(e,t),e&&(t._activeTrigger["focusin"===e.type?fi:di]=!0),t.getTipElement().classList.contains(ai)||t._hoverState===li?t._hoverState=li:(clearTimeout(t._timeout),t._hoverState=li,t._config.delay&&t._config.delay.show?t._timeout=setTimeout((()=>{t._hoverState===li&&t.show()}),t._config.delay.show):t.show())}_leave(e,t){t=this._initializeOnDelegatedTarget(e,t),e&&(t._activeTrigger["focusout"===e.type?fi:di]=t._element.contains(e.relatedTarget)),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState=ui,t._config.delay&&t._config.delay.hide?t._timeout=setTimeout((()=>{t._hoverState===ui&&t.hide()}),t._config.delay.hide):t.hide())}_isWithActiveTrigger(){for(const e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1}_getConfig(e){const t=kt.getDataAttributes(this._element);return Object.keys(t).forEach((e=>{ti.has(e)&&delete t[e]})),(e={...this.constructor.Default,...t,..."object"==typeof e&&e?e:{}}).container=!1===e.container?document.body:He(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),Re(ei,e,this.constructor.DefaultType),e.sanitize&&(e.template=Jn(e.template,e.allowList,e.sanitizeFn)),e}_getDelegateConfig(){const e={};for(const t in this._config)this.constructor.Default[t]!==this._config[t]&&(e[t]=this._config[t]);return e}_cleanTipClass(){const e=this.getTipElement(),t=new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`,"g"),n=e.getAttribute("class").match(t);null!==n&&n.length>0&&n.map((e=>e.trim())).forEach((t=>e.classList.remove(t)))}_getBasicClassPrefix(){return"bs-tooltip"}_handlePopperPlacementChange(e){const{state:t}=e;t&&(this.tip=t.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(t.placement)))}static jQueryInterface(e){return this.each((function(){const t=pi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Xe(pi);const mi={...pi.Default,placement:"right",offset:[0,8],trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'},gi={...pi.DefaultType,content:"(string|element|function)"},vi={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"};class yi extends pi{static get Default(){return mi}static get NAME(){return"popover"}static get Event(){return vi}static get DefaultType(){return gi}isWithContent(){return this.getTitle()||this._getContent()}setContent(e){this._sanitizeAndSetContent(e,this.getTitle(),".popover-header"),this._sanitizeAndSetContent(e,this._getContent(),".popover-body")}_getContent(){return this._resolvePossibleFunction(this._config.content)}_getBasicClassPrefix(){return"bs-popover"}static jQueryInterface(e){return this.each((function(){const t=yi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}Xe(yi);const bi="scrollspy",xi={offset:10,method:"auto",target:""},wi={offset:"number",method:"string",target:"(string|element)"},Di="active",Ci=".nav-link, .list-group-item, .dropdown-item",ki="position";class _i extends vt{constructor(e,t){super(e),this._scrollElement="BODY"===this._element.tagName?window:this._element,this._config=this._getConfig(t),this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,pt.on(this._scrollElement,"scroll.bs.scrollspy",(()=>this._process())),this.refresh(),this._process()}static get Default(){return xi}static get NAME(){return bi}refresh(){const e=this._scrollElement===this._scrollElement.window?"offset":ki,t="auto"===this._config.method?e:this._config.method,n=t===ki?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),_t.find(Ci,this._config.target).map((e=>{const i=Be(e),r=i?_t.findOne(i):null;if(r){const e=r.getBoundingClientRect();if(e.width||e.height)return[kt[t](r).top+n,i]}return null})).filter((e=>e)).sort(((e,t)=>e[0]-t[0])).forEach((e=>{this._offsets.push(e[0]),this._targets.push(e[1])}))}dispose(){pt.off(this._scrollElement,".bs.scrollspy"),super.dispose()}_getConfig(e){return(e={...xi,...kt.getDataAttributes(this._element),..."object"==typeof e&&e?e:{}}).target=He(e.target)||document.documentElement,Re(bi,e,wi),e}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),n=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=n){const e=this._targets[this._targets.length-1];this._activeTarget!==e&&this._activate(e)}else{if(this._activeTarget&&e<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(let t=this._offsets.length;t--;)this._activeTarget!==this._targets[t]&&e>=this._offsets[t]&&(void 0===this._offsets[t+1]||e<this._offsets[t+1])&&this._activate(this._targets[t])}}_activate(e){this._activeTarget=e,this._clear();const t=Ci.split(",").map((t=>`${t}[data-bs-target="${e}"],${t}[href="${e}"]`)),n=_t.findOne(t.join(","),this._config.target);n.classList.add(Di),n.classList.contains("dropdown-item")?_t.findOne(".dropdown-toggle",n.closest(".dropdown")).classList.add(Di):_t.parents(n,".nav, .list-group").forEach((e=>{_t.prev(e,".nav-link, .list-group-item").forEach((e=>e.classList.add(Di))),_t.prev(e,".nav-item").forEach((e=>{_t.children(e,".nav-link").forEach((e=>e.classList.add(Di)))}))})),pt.trigger(this._scrollElement,"activate.bs.scrollspy",{relatedTarget:e})}_clear(){_t.find(Ci,this._config.target).filter((e=>e.classList.contains(Di))).forEach((e=>e.classList.remove(Di)))}static jQueryInterface(e){return this.each((function(){const t=_i.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}pt.on(window,"load.bs.scrollspy.data-api",(()=>{_t.find('[data-bs-spy="scroll"]').forEach((e=>new _i(e)))})),Xe(_i);const Ei="active",Si="fade",Ai="show",Ti=".active",Fi=":scope > li > .active";class Li extends vt{static get NAME(){return"tab"}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains(Ei))return;let e;const t=Ie(this._element),n=this._element.closest(".nav, .list-group");if(n){const t="UL"===n.nodeName||"OL"===n.nodeName?Fi:Ti;e=_t.find(t,n),e=e[e.length-1]}const i=e?pt.trigger(e,"hide.bs.tab",{relatedTarget:this._element}):null;if(pt.trigger(this._element,"show.bs.tab",{relatedTarget:e}).defaultPrevented||null!==i&&i.defaultPrevented)return;this._activate(this._element,n);const r=()=>{pt.trigger(e,"hidden.bs.tab",{relatedTarget:this._element}),pt.trigger(this._element,"shown.bs.tab",{relatedTarget:e})};t?this._activate(t,t.parentNode,r):r()}_activate(e,t,n){const i=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?_t.children(t,Ti):_t.find(Fi,t))[0],r=n&&i&&i.classList.contains(Si),o=()=>this._transitionComplete(e,i,n);i&&r?(i.classList.remove(Ai),this._queueCallback(o,e,!0)):o()}_transitionComplete(e,t,n){if(t){t.classList.remove(Ei);const e=_t.findOne(":scope > .dropdown-menu .active",t.parentNode);e&&e.classList.remove(Ei),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}e.classList.add(Ei),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),Ue(e),e.classList.contains(Si)&&e.classList.add(Ai);let i=e.parentNode;if(i&&"LI"===i.nodeName&&(i=i.parentNode),i&&i.classList.contains("dropdown-menu")){const t=e.closest(".dropdown");t&&_t.find(".dropdown-toggle",t).forEach((e=>e.classList.add(Ei))),e.setAttribute("aria-expanded",!0)}n&&n()}static jQueryInterface(e){return this.each((function(){const t=Li.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}pt.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),je(this)||Li.getOrCreateInstance(this).show()})),Xe(Li);const Mi="toast",Ni="hide",Oi="show",Bi="showing",Ii={animation:"boolean",autohide:"boolean",delay:"number"},zi={animation:!0,autohide:!0,delay:5e3};class Pi extends vt{constructor(e,t){super(e),this._config=this._getConfig(t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get DefaultType(){return Ii}static get Default(){return zi}static get NAME(){return Mi}show(){pt.trigger(this._element,"show.bs.toast").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Ni),Ue(this._element),this._element.classList.add(Oi),this._element.classList.add(Bi),this._queueCallback((()=>{this._element.classList.remove(Bi),pt.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this._element.classList.contains(Oi)&&(pt.trigger(this._element,"hide.bs.toast").defaultPrevented||(this._element.classList.add(Bi),this._queueCallback((()=>{this._element.classList.add(Ni),this._element.classList.remove(Bi),this._element.classList.remove(Oi),pt.trigger(this._element,"hidden.bs.toast")}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this._element.classList.contains(Oi)&&this._element.classList.remove(Oi),super.dispose()}_getConfig(e){return e={...zi,...kt.getDataAttributes(this._element),..."object"==typeof e&&e?e:{}},Re(Mi,e,this.constructor.DefaultType),e}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){pt.on(this._element,"mouseover.bs.toast",(e=>this._onInteraction(e,!0))),pt.on(this._element,"mouseout.bs.toast",(e=>this._onInteraction(e,!1))),pt.on(this._element,"focusin.bs.toast",(e=>this._onInteraction(e,!0))),pt.on(this._element,"focusout.bs.toast",(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=Pi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}yt(Pi),Xe(Pi)},354:(e,t,n)=>{"use strict";var i=n(581);function r(e){"function"==typeof(e=e||{}).codeMirrorInstance&&"function"==typeof e.codeMirrorInstance.defineMode?(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),e.codeMirrorInstance.defineMode("spell-checker",(function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var s='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',a={token:function(e){var t=e.peek(),n="";if(s.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!s.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},l=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(l,a,!0)}))):console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`")}r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,e.exports=r},994:(e,t,n)=>{!function(e){"use strict";function t(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(n,i){n.state.autoRefresh&&(t(0,n.state.autoRefresh),n.state.autoRefresh=null),i&&0==n.display.wrapper.offsetHeight&&function(n,i){function r(){n.display.wrapper.offsetHeight?(t(0,i),n.display.lastWrapHeight!=n.display.wrapper.clientHeight&&n.refresh()):i.timeout=setTimeout(r,i.delay)}i.timeout=setTimeout(r,i.delay),i.hurry=function(){clearTimeout(i.timeout),i.timeout=setTimeout(r,50)},e.on(window,"mouseup",i.hurry),e.on(window,"keyup",i.hurry)}(n,n.state.autoRefresh={delay:i.delay||250})}))}(n(631))},960:(e,t,n)=>{!function(e){"use strict";e.defineOption("fullScreen",!1,(function(t,n,i){i==e.Init&&(i=!1),!i!=!n&&(n?function(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}(t):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}(t))}))}(n(631))},386:(e,t,n)=>{!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){o(e)&&n(e)}function r(e){var i=e.getWrapperElement(),r=o(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(o,s,a){var l=a&&a!=e.Init;if(s&&!l)o.on("blur",i),o.on("change",r),o.on("swapDoc",r),e.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(e){setTimeout((function(){var i=!1;if(1==e.lineCount()){var r=e.getInputField();i="TEXTAREA"==r.nodeName?!e.getLine(0).length:!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)}i?n(e):t(e)}),20)}(o)}),r(o);else if(!s&&l){o.off("blur",i),o.off("change",r),o.off("swapDoc",r),e.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),t(o);var u=o.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}s&&!o.hasFocus()&&i(o)}))}(n(631))},350:(e,t,n)=>{!function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;function r(e,n){var i=n.line,r=0,o=0,s=t.exec(e.getLine(i)),a=s[1];do{var l=i+(r+=1),u=e.getLine(l),c=t.exec(u);if(c){var h=c[1],d=parseInt(s[3],10)+r-o,f=parseInt(c[3],10),p=f;if(a!==h||isNaN(f)){if(a.length>h.length)return;if(a.length<h.length&&1===r)return;o+=1}else d===f&&(p=f+1),d>f&&(p=d+1),e.replaceRange(u.replace(t,h+p+c[4]+c[5]),{line:l,ch:0},{line:l,ch:u.length})}}while(c)}e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var s=o.listSelections(),a=[],l=0;l<s.length;l++){var u=s[l].head,c=o.getStateAfter(u.line),h=e.innerMode(o.getMode(),c);if("markdown"!==h.mode.name)return void o.execCommand("newlineAndIndent");var d=!1!==(c=h.state).list,f=0!==c.quote,p=o.getLine(u.line),m=t.exec(p),g=/^\s*$/.test(p.slice(0,u.ch));if(!s[l].empty()||!d&&!f||!m||g)return void o.execCommand("newlineAndIndent");if(n.test(p)){var v=f&&/>\s*$/.test(p),y=!/>\s*$/.test(p);(v||y)&&o.replaceRange("",{line:u.line,ch:0},{line:u.line,ch:u.ch+1}),a[l]="\n"}else{var b=m[1],x=m[5],w=!(i.test(m[2])||m[2].indexOf(">")>=0),D=w?parseInt(m[3],10)+1+m[4]:m[2].replace("x"," ");a[l]="\n"+b+D+x,w&&r(o,u)}}o.replaceSelections(a)}}(n(631))},146:(e,t,n)=>{!function(e){"use strict";e.overlayMode=function(t,n,i){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(i){return{base:e.copyState(t,i.base),overlay:e.copyState(n,i.overlay),basePos:i.basePos,baseCur:null,overlayPos:i.overlayPos,overlayCur:null}},token:function(e,r){return(e!=r.streamSeen||Math.min(r.basePos,r.overlayPos)<e.start)&&(r.streamSeen=e,r.basePos=r.overlayPos=e.start),e.start==r.basePos&&(r.baseCur=t.token(e,r.base),r.basePos=e.pos),e.start==r.overlayPos&&(e.pos=e.start,r.overlayCur=n.token(e,r.overlay),r.overlayPos=e.pos),e.pos=Math.min(r.basePos,r.overlayPos),null==r.overlayCur?r.baseCur:null!=r.baseCur&&r.overlay.combineTokens||i&&null==r.overlay.combineTokens?r.baseCur+" "+r.overlayCur:r.overlayCur},indent:t.indent&&function(e,n,i){return t.indent(e.base,n,i)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var r,o;return t.blankLine&&(r=t.blankLine(e.base)),n.blankLine&&(o=n.blankLine(e.overlay)),null==o?r:i&&null!=r?r+" "+o:o}}}}(n(631))},95:(e,t,n)=>{!function(e){"use strict";var t,n,i=e.Pos;function r(e,t){for(var n=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),i=n,r=0;r<t.length;r++)-1==i.indexOf(t.charAt(r))&&(i+=t.charAt(r));return n==i?e:new RegExp(e.source,i)}function o(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function s(e,t,n){t=r(t,"g");for(var o=n.line,s=n.ch,a=e.lastLine();o<=a;o++,s=0){t.lastIndex=s;var l=e.getLine(o),u=t.exec(l);if(u)return{from:i(o,u.index),to:i(o,u.index+u[0].length),match:u}}}function a(e,t,n){if(!o(t))return s(e,t,n);t=r(t,"gm");for(var a,l=1,u=n.line,c=e.lastLine();u<=c;){for(var h=0;h<l&&!(u>c);h++){var d=e.getLine(u++);a=null==a?d:a+"\n"+d}l*=2,t.lastIndex=n.ch;var f=t.exec(a);if(f){var p=a.slice(0,f.index).split("\n"),m=f[0].split("\n"),g=n.line+p.length-1,v=p[p.length-1].length;return{from:i(g,v),to:i(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:f}}}}function l(e,t,n){for(var i,r=0;r<=e.length;){t.lastIndex=r;var o=t.exec(e);if(!o)break;var s=o.index+o[0].length;if(s>e.length-n)break;(!i||s>i.index+i[0].length)&&(i=o),r=o.index+1}return i}function u(e,t,n){t=r(t,"g");for(var o=n.line,s=n.ch,a=e.firstLine();o>=a;o--,s=-1){var u=e.getLine(o),c=l(u,t,s<0?0:u.length-s);if(c)return{from:i(o,c.index),to:i(o,c.index+c[0].length),match:c}}}function c(e,t,n){if(!o(t))return u(e,t,n);t=r(t,"gm");for(var s,a=1,c=e.getLine(n.line).length-n.ch,h=n.line,d=e.firstLine();h>=d;){for(var f=0;f<a&&h>=d;f++){var p=e.getLine(h--);s=null==s?p:p+"\n"+s}a*=2;var m=l(s,t,c);if(m){var g=s.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=h+g.length,b=g[g.length-1].length;return{from:i(y,b),to:i(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:m}}}}function h(e,t,n,i){if(e.length==t.length)return n;for(var r=0,o=n+Math.max(0,e.length-t.length);;){if(r==o)return r;var s=r+o>>1,a=i(e.slice(0,s)).length;if(a==n)return s;a>n?o=s:r=s+1}}function d(e,r,o,s){if(!r.length)return null;var a=s?t:n,l=a(r).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-l.length;u<=d;u++,c=0){var f=e.getLine(u).slice(c),p=a(f);if(1==l.length){var m=p.indexOf(l[0]);if(-1==m)continue e;return o=h(f,p,m,a)+c,{from:i(u,h(f,p,m,a)+c),to:i(u,h(f,p,m+l[0].length,a)+c)}}var g=p.length-l[0].length;if(p.slice(g)==l[0]){for(var v=1;v<l.length-1;v++)if(a(e.getLine(u+v))!=l[v])continue e;var y=e.getLine(u+l.length-1),b=a(y),x=l[l.length-1];if(b.slice(0,x.length)==x)return{from:i(u,h(f,p,g,a)+c),to:i(u+l.length-1,h(y,b,x.length,a))}}}}function f(e,r,o,s){if(!r.length)return null;var a=s?t:n,l=a(r).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.firstLine()-1+l.length;u>=d;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var p=a(f);if(1==l.length){var m=p.lastIndexOf(l[0]);if(-1==m)continue e;return{from:i(u,h(f,p,m,a)),to:i(u,h(f,p,m+l[0].length,a))}}var g=l[l.length-1];if(p.slice(0,g.length)==g){var v=1;for(o=u-l.length+1;v<l.length-1;v++)if(a(e.getLine(o+v))!=l[v])continue e;var y=e.getLine(u+1-l.length),b=a(y);if(b.slice(b.length-l[0].length)==l[0])return{from:i(u+1-l.length,h(y,b,y.length-l[0].length,a)),to:i(u,h(f,p,g.length,a))}}}}function p(e,t,n,o){var l;this.atOccurrence=!1,this.doc=e,n=n?e.clipPos(n):i(0,0),this.pos={from:n,to:n},"object"==typeof o?l=o.caseFold:(l=o,o=null),"string"==typeof t?(null==l&&(l=!1),this.matches=function(n,i){return(n?f:d)(e,t,i,l)}):(t=r(t,"gm"),o&&!1===o.multiline?this.matches=function(n,i){return(n?u:s)(e,t,i)}:this.matches=function(n,i){return(n?c:a)(e,t,i)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},n=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},n=function(e){return e}),p.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));n&&0==e.cmpPos(n.from,n.to);)t?n.from.ch?n.from=i(n.from.line,n.from.ch-1):n=n.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(i(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=i(n.to.line,n.to.ch+1):n=n.to.line==this.doc.lastLine()?null:this.matches(t,i(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var r=i(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:r,to:r},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new p(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new p(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)}))}(n(631))},20:(e,t,n)=>{!function(e){"use strict";function t(e){e.state.markedSelection&&e.operation((function(){!function(e){if(!e.somethingSelected())return s(e);if(e.listSelections().length>1)return a(e);var t=e.getCursor("start"),n=e.getCursor("end"),i=e.state.markedSelection;if(!i.length)return o(e,t,n);var l=i[0].find(),u=i[i.length-1].find();if(!l||!u||n.line-t.line<=8||r(t,u.to)>=0||r(n,l.from)<=0)return a(e);for(;r(t,l.from)>0;)i.shift().clear(),l=i[0].find();for(r(t,l.from)<0&&(l.to.line-t.line<8?(i.shift().clear(),o(e,t,l.to,0)):o(e,t,l.from,0));r(n,u.to)<0;)i.pop().clear(),u=i[i.length-1].find();r(n,u.to)>0&&(n.line-u.from.line<8?(i.pop().clear(),o(e,u.from,n)):o(e,u.to,n))}(e)}))}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation((function(){s(e)}))}e.defineOption("styleSelectedText",!1,(function(i,r,o){var l=o&&o!=e.Init;r&&!l?(i.state.markedSelection=[],i.state.markedSelectionStyle="string"==typeof r?r:"CodeMirror-selectedtext",a(i),i.on("cursorActivity",t),i.on("change",n)):!r&&l&&(i.off("cursorActivity",t),i.off("change",n),s(i),i.state.markedSelection=i.state.markedSelectionStyle=null)}));var i=e.Pos,r=e.cmpPos;function o(e,t,n,o){if(0!=r(t,n))for(var s=e.state.markedSelection,a=e.state.markedSelectionStyle,l=t.line;;){var u=l==t.line?t:i(l,0),c=l+8,h=c>=n.line,d=h?n:i(c,0),f=e.markText(u,d,{className:a});if(null==o?s.push(f):s.splice(o++,0,f),h)break;l=c}}function s(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function a(e){s(e);for(var t=e.listSelections(),n=0;n<t.length;n++)o(e,t[n].from(),t[n].to())}}(n(631))},631:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),s=i||r||o,a=s&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=h&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,l=!0);var D=y&&(u||h&&(null==w||w<12.11)),C=n||s&&a>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,E=function(e,t){var n=e.className,i=k(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return S(e).appendChild(t)}function T(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)r.appendChild(t[o]);return r}function F(e,t,n,i){var r=T(e,t,n,i);return r.setAttribute("role","presentation"),r}function L(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 M(){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 N(e,t){var n=e.className;k(t).test(n)||(e.className+=(n?" ":"")+t)}function O(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!k(n[i]).test(t)&&(t+=" "+n[i]);return t}_=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var B=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function z(e,t,n){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===n&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function P(e,t,n,i,r){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,s=r||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}m?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(B=function(e){try{e.select()}catch(e){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function R(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.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 W={toString:function(){return"CodeMirror.Pass"}},j={scroll:!1},q={origin:"*mouse"},$={origin:"+move"};function U(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var s=o-i;if(o==e.length||r+s>=t)return i+Math.min(s,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var V=[""];function G(e){for(;V.length<=e;)V.push(K(V)+" ");return V[e]}function K(e){return e[e.length-1]}function X(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function Y(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&z(t,n),n}var Q=/[\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()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 e.charCodeAt(0)>=768&&ne.test(e)}function re(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}var se=null;function ae(e,t,n){var i;se=null;for(var r=0;r<e.length;++r){var o=e[r];if(o.from<t&&o.to>t)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:se=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:se=r)}return null!=i?i:se}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,r=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,a){var l,u="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!e.test(s))return!1;for(var c=s.length,h=[],d=0;d<c;++d)h.push((l=s.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(l):1424<=l&&l<=1524?"R":1536<=l&&l<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(l-1536):1774<=l&&l<=2220?"r":8192<=l&&l<=8203?"w":8204==l?"b":"L");for(var f=0,p=u;f<c;++f){var m=h[f];"m"==m?h[f]=p:p=m}for(var g=0,v=u;g<c;++g){var y=h[g];"1"==y&&"r"==v?h[g]="n":n.test(y)&&(v=y,"r"==y&&(h[g]="R"))}for(var b=1,x=h[0];b<c-1;++b){var w=h[b];"+"==w&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=w||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=w}for(var D=0;D<c;++D){var C=h[D];if(","==C)h[D]="N";else if("%"==C){var k=void 0;for(k=D+1;k<c&&"%"==h[k];++k);for(var _=D&&"!"==h[D-1]||k<c&&"1"==h[k]?"1":"N",E=D;E<k;++E)h[E]=_;D=k-1}}for(var S=0,A=u;S<c;++S){var T=h[S];"L"==A&&"1"==T?h[S]="L":n.test(T)&&(A=T)}for(var F=0;F<c;++F)if(t.test(h[F])){var L=void 0;for(L=F+1;L<c&&t.test(h[L]);++L);for(var M="L"==(F?h[F-1]:u),N=M==("L"==(L<c?h[L]:u))?M?"L":"R":u,O=F;O<L;++O)h[O]=N;F=L-1}for(var B,I=[],z=0;z<c;)if(i.test(h[z])){var P=z;for(++z;z<c&&i.test(h[z]);++z);I.push(new o(0,P,z))}else{var H=z,R=I.length,W="rtl"==a?1:0;for(++z;z<c&&"L"!=h[z];++z);for(var j=H;j<z;)if(r.test(h[j])){H<j&&(I.splice(R,0,new o(1,H,j)),R+=W);var q=j;for(++j;j<z&&r.test(h[j]);++j);I.splice(R,0,new o(2,q,j)),R+=W,H=j}else++j;H<z&&I.splice(R,0,new o(1,H,z))}return"ltr"==a&&(1==I[0].level&&(B=s.match(/^\s+/))&&(I[0].from=B[0].length,I.unshift(new o(0,0,B[0].length))),1==K(I).level&&(B=s.match(/\s+$/))&&(K(I).to-=B[0].length,I.push(new o(0,c-B[0].length,c)))),"rtl"==a?I.reverse():I}}();function ue(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var ce=[],he=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ce).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ce}function fe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var o=R(r,n);o>-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function pe(e,t){var n=de(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,n||t.type,e,t),we(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==R(n,t[i])&&n.push(t[i])}function ve(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function De(e){be(e),xe(e)}function Ce(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var _e,Ee,Se=function(){if(s&&a<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==_e){var t=T("span","");A(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(_e=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&a<8))}var n=_e?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=Ee)return Ee;var t=A(e,document.createTextNode("AخA")),n=_(t,0,1).getBoundingClientRect(),i=_(t,1,2).getBoundingClientRect();return S(e),!(!n||n.left==n.right)&&(Ee=i.right-n.right<3)}var Fe,Le=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Me=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)},Ne="oncopy"in(Fe=T("div"))||(Fe.setAttribute("oncopy","return;"),"function"==typeof Fe.oncopy),Oe=null;var Be={},Ie={};function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}function Pe(e){if("string"==typeof e&&Ie.hasOwnProperty(e))e=Ie[e];else if(e&&"string"==typeof e.name&&Ie.hasOwnProperty(e.name)){var t=Ie[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=Pe(t);var n=Be[t.name];if(!n)return He(e,"text/plain");var i=n(e,t);if(Re.hasOwnProperty(t.name)){var r=Re[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)i[s]=t.modeProps[s];return i}var Re={};function We(e,t){z(t,Re.hasOwnProperty(e)?Re[e]:Re[e]={})}function je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function qe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $e(e,t,n){return!e.startState||e.startState(t,n)}var Ue=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 Ve(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 n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t<o){n=r;break}t-=o}return n.lines[t]}function Ge(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;r==n.line&&(o=o.slice(0,n.ch)),r==t.line&&(o=o.slice(t.ch)),i.push(o),++r})),i}function Ke(e,t,n){var i=[];return e.iter(t,n,(function(e){i.push(e.text)})),i}function Xe(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,n=R(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function Ze(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],o=r.height;if(t<o){e=r;continue e}t-=o,n+=r.chunkSize()}return n}while(!e.lines);for(var s=0;s<e.lines.length;++s){var a=e.lines[s].height;if(t<a)break;t-=a}return n+s}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function it(e){return et(e.line,e.ch)}function rt(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function st(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function at(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ve(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ve(e,t.line).text.length)}function lt(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=at(e,t[i]);return n}Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.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},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.match=function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,i){var r=[e.state.modeGen],o={};xt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=e.state.overlays[i],l=1,u=0;n.state=!0,xt(e,t.text,a.mode,n,(function(e,t){for(var n=l;u<e;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,u=Math.min(e,i)}if(t)if(a.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=s,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)a(l);return{styles:r,classes:o.bgClass||o.textClass?o:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=ft(e,Ye(t)),r=t.text.length>e.options.maxHighlightLength&&je(e.doc.mode,i.state),o=ht(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),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 ft(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new ct(i,!0,t);var o=function(e,t,n){for(var i,r,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Ve(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return a;var c=P(l.text,null,e.options.tabSize);(null==r||i>c)&&(r=a-1,i=c)}return r}(e,t,n),s=o>i.first&&Ve(i,o-1).stateAfter,a=s?ct.fromSaved(i,s,o):new ct(i,$e(i.mode),o);return i.iter(o,t,(function(n){pt(e,n.text,a);var i=a.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?a.save():null,a.nextLine()})),n&&(i.modeFrontier=a.line),a}function pt(e,t,n,i){var r=e.doc.mode,o=new Ue(t,e.options.tabSize,n);for(o.start=o.pos=i||0,""==t&&mt(r,n.state);!o.eol();)gt(r,o,n.state),o.start=o.pos}function mt(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 gt(e,t,n,i){for(var r=0;r<10;r++){i&&(i[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.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.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}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof ut?new ct(e,je(e.mode,t.state),n,t.lookAhead):new ct(e,je(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,i){var r,o,s=e.doc,a=s.mode,l=Ve(s,(t=at(s,t)).line),u=ft(e,t.line,n),c=new Ue(l.text,e.options.tabSize,u);for(i&&(o=[]);(i||c.pos<t.ch)&&!c.eol();)c.start=c.pos,r=gt(a,c,u.state),i&&o.push(new vt(c,r,je(s.mode,u.state)));return i?o:new vt(c,r,u.state)}function bt(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 i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function xt(e,t,n,i,r,o,s){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,u=0,c=null,h=new Ue(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,i.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,s&&pt(e,t,i,h.pos),h.pos=t.length,l=null):l=bt(gt(n,h,i.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u<h.start;)r(u=Math.min(h.start,u+5e3),c);c=l}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);r(p,c),u=p}}var wt=!1,Dt=!1;function Ct(e,t,n){this.marker=e,this.from=t,this.to=n}function kt(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function _t(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function Et(e,t){if(t.full)return null;var n=Qe(e,t.from.line)&&Ve(e,t.from.line).markedSpans,i=Qe(e,t.to.line)&&Ve(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,o=t.to.ch,s=0==tt(t.from,t.to),a=function(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],s=o.marker;if(null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Ct(s,o.from,a?null:o.to))}}return i}(n,r,s),l=function(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],s=o.marker;if(null==o.to||(s.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Ct(s,a?null:o.from-t,null==o.to?null:o.to-t))}}return i}(i,o,s),u=1==t.text.length,c=K(t.text).length+(u?r:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(null==d.to){var f=kt(l,d.marker);f?u&&(d.to=null==f.to?null:f.to+c):d.to=r}}if(l)for(var p=0;p<l.length;++p){var m=l[p];null!=m.to&&(m.to+=c),null==m.from?kt(a,m.marker)||(m.from=c,u&&(a||(a=[])).push(m)):(m.from+=c,u&&(a||(a=[])).push(m))}a&&(a=St(a)),l&&l!=a&&(l=St(l));var g=[a];if(!u){var v,y=t.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(v||(v=[])).push(new Ct(a[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function St(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 At(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Ft(e){return e.inclusiveLeft?-1:0}function Lt(e){return e.inclusiveRight?1:0}function Mt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),o=tt(i.from,r.from)||Ft(e)-Ft(t);return o?-o:tt(i.to,r.to)||Lt(e)-Lt(t)||t.id-e.id}function Nt(e,t){var n,i=Dt&&e.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(t?r.from:r.to)&&(!n||Mt(n,r.marker)<0)&&(n=r.marker);return n}function Ot(e){return Nt(e,!0)}function Bt(e){return Nt(e,!1)}function It(e,t){var n,i=Dt&&e.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Mt(n,o.marker)<0)&&(n=o.marker)}return n}function zt(e,t,n,i,r){var o=Ve(e,t),s=Dt&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),c=tt(u.from,n)||Ft(l.marker)-Ft(r),h=tt(u.to,i)||Lt(l.marker)-Lt(r);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(u.to,n)>=0:tt(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(u.from,i)<=0:tt(u.from,i)<0)))return!0}}}function Pt(e){for(var t;t=Ot(e);)e=t.find(-1,!0).line;return e}function Ht(e,t){var n=Ve(e,t),i=Pt(n);return n==i?t:Ye(i)}function Rt(e,t){if(t>e.lastLine())return t;var n,i=Ve(e,t);if(!Wt(e,i))return t;for(;n=Bt(i);)i=n.find(1,!0).line;return Ye(i)+1}function Wt(e,t){var n=Dt&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&jt(e,t,i))return!0}}function jt(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return jt(e,i.line,kt(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,o=0;o<t.markedSpans.length;++o)if((r=t.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&jt(e,t,r))return!0}function qt(e){for(var t=0,n=(e=Pt(e)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==n)break;t+=a.height}return t}function $t(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=Ot(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=Bt(i);){var o=t.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function Ut(e){var t=e.display,n=e.doc;t.maxLine=Ve(n,n.first),t.maxLineLength=$t(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=$t(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Vt=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,At(e)}Vt.prototype.lineNo=function(){return Ye(this)},ye(Vt);var Kt={},Xt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Xt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=F("span",null,null,l?"padding-right: .1px":null),i={pre:F("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,s=void 0;i.pos=0,i.addToken=Jt,Te(e.display.measure)&&(s=ue(o,e.doc.direction))&&(i.addToken=en(i.addToken,s)),i.map=[],nn(o,i,dt(e,o,t!=e.display.externalMeasured&&Ye(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=O(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=O(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ae(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=i.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=O(i.pre.className,i.textClass||"")),i}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,n,i,r,o,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var o=e.charAt(r);" "!=o||!n||r!=e.length-1&&32!=e.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){u=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),m=p?p.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));s&&a<9?u.appendChild(T("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(T("span",G(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(T("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),s&&a<9?u.appendChild(T("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),s&&a<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||r||d||o||l){var x=n||"";i&&(x+=i),r&&(x+=r);var w=T("span",[u],x,o);if(l)for(var D in l)l.hasOwnProperty(D)&&"style"!=D&&"class"!=D&&w.setAttribute(D,l[D]);return e.content.appendChild(w)}e.content.appendChild(u)}}function en(e,t){return function(n,i,r,o,s,a,l){r=r?r+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+i.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>u&&h.from<=u);d++);if(h.to>=c)return e(n,i,r,o,s,a,l);e(n,i.slice(0,h.to-u),r,o,null,a,l),o=null,i=i.slice(h.to-u),u=h.to}}}function tn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var s,a,l,u,c,h,d,f=r.length,p=0,m=1,g="",v=0;;){if(v==p){l=u=c=a="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;x<i.length;++x){var w=i[x],D=w.marker;if("bookmark"==D.type&&w.from==p&&D.widgetNode)y.push(D);else if(w.from<=p&&(null==w.to||w.to>p||D.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),D.className&&(l+=" "+D.className),D.css&&(a=(a?a+";":"")+D.css),D.startStyle&&w.from==p&&(c+=" "+D.startStyle),D.endStyle&&w.to==v&&(b||(b=[])).push(D.endStyle,w.to),D.title&&((d||(d={})).title=D.title),D.attributes)for(var C in D.attributes)(d||(d={}))[C]=D.attributes[C];D.collapsed&&(!h||Mt(h.marker,D)<0)&&(h=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(u+=" "+b[k]);if(!h||h.from==p)for(var _=0;_<y.length;++_)tn(t,0,y[_]);if(h&&(h.from||0)==p){if(tn(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var E=Math.min(f,v);;){if(g){var S=p+g.length;if(!h){var A=S>E?g.slice(0,E-p):g;t.addToken(t,A,s?s+l:l,c,p+A.length==v?u:"",a,d)}if(S>=E){g=g.slice(E-p),p=E;break}p=S,c=""}g=r.slice(o,o=n[m++]),s=Yt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,r.slice(o,o=n[T]),Yt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Bt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function on(e,t,n){for(var i,r=[],o=t;o<n;o=i){var s=new rn(e.doc,Ve(e.doc,o),o);i=o+s.size,r.push(s)}return r}var sn=null;var an=null;function ln(e,t){var n=de(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);sn?i=sn.delayedCallbacks:an?i=an:(i=an=[],setTimeout(un,0));for(var o=function(e){i.push((function(){return n[e].apply(null,r)}))},s=0;s<n.length;++s)o(s)}}function un(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function cn(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?fn(e,t):"gutter"==o?mn(e,t,n,i):"class"==o?pn(e,t):"widget"==o&&gn(e,t,i)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&a<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function fn(e,t){var n=t.text.className,i=dn(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,pn(e,t)):n&&(t.text.className=n)}function pn(e,t){(function(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 i=hn(t);t.background=i.insertBefore(T("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}})(e,t),t.line.wrapClass?hn(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 mn(e,t,n,i){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 r=hn(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var s=hn(t),a=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),s.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(T("div",Je(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(T("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var i=k("CodeMirror-linewidget"),r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);yn(e,t,n)}function vn(e,t,n,i){var r=dn(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),pn(e,t),mn(e,t,n,i),yn(e,t,i),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)bn(e,t.rest[i],t,n,!1)}function bn(e,t,n,i,r){if(t.widgets)for(var o=hn(n),s=0,a=t.widgets;s<a.length;++s){var l=a[s],u=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),xn(l,u,n,i),e.display.input.setUneditable(u),r&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),ln(l,"redraw")}}function xn(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!L(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;"),A(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Dn(e,t){for(var n=Ce(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 Cn(e){return e.lineSpace.offsetTop}function kn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _n(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function En(e){return 50-e.display.nativeBarWidth}function Sn(e){return e.display.scroller.clientWidth-En(e)-e.display.barWidth}function An(e){return e.display.scroller.clientHeight-En(e)-e.display.barHeight}function Tn(e,t,n){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 r=0;r<e.rest.length;r++)if(Ye(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fn(e,t,n,i){return Nn(e,Mn(e,t),n,i)}function Ln(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Mn(e,t){var n=Ye(t),i=Ln(e,n);i&&!i.text?i=null:i&&i.changes&&(cn(e,i,n,oi(e)),e.curOp.forceUpdate=!0),i||(i=function(e,t){var n=Ye(t=Pt(t)),i=e.display.externalMeasured=new rn(e.doc,t,n);i.lineN=n;var r=i.built=Zt(e,i);return i.text=r.pre,A(e.display.lineMeasure,r.pre),i}(e,t));var r=Tn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Nn(e,t,n,i,r){t.before&&(n=-1);var o,l=n+(i||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var i=e.options.lineWrapping,r=i&&Sn(e);if(!t.measure.heights||i&&t.measure.width!=r){var o=t.measure.heights=[];if(i){t.measure.width=r;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,i){var r,o=In(t.map,n,i),l=o.node,u=o.start,c=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&ie(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+c));)++c;if((r=s&&a<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():zn(_(l,u,c).getClientRects(),i)).left||r.right||0==u)break;c=u,u-=1,h="right"}s&&a<11&&(r=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Oe)return Oe;var t=A(e,T("span","x")),n=t.getBoundingClientRect(),i=_(t,0,1).getBoundingClientRect();return Oe=Math.abs(n.left-i.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,r))}else{var f;u>0&&(h=i="right"),r=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!u&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+ri(e.display),top:p.top,bottom:p.bottom}:Bn}for(var m=r.top-t.rect.top,g=r.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],D={left:("right"==h?r.right:r.left)-t.rect.left,right:("left"==h?r.left:r.right)-t.rect.left,top:x,bottom:w};return r.left||r.right||(D.bogus=!0),e.options.singleCursorHeightPerLine||(D.rtop=m,D.rbottom=g),D}(e,t,n,i)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var On,Bn={left:0,right:0,top:0,bottom:0};function In(e,t,n){for(var i,r,o,s,a,l,u=0;u<e.length;u+=3)if(a=e[u],l=e[u+1],t<a?(r=0,o=1,s="left"):t<l?o=1+(r=t-a):(u==e.length-3||t==l&&e[u+3]>t)&&(r=(o=l-a)-1,t>=l&&(s="right")),null!=r){if(i=e[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],s="left";if("right"==n&&r==l-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)i=e[(u+=3)+2],s="right";break}return{node:i,start:r,end:o,collapse:s,coverStart:a,coverEnd:l}}function zn(e,t){var n=Bn;if("left"==t)for(var i=0;i<e.length&&(n=e[i]).left==n.right;i++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function Pn(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 Hn(e){e.display.externalMeasure=null,S(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Pn(e.display.view[t])}function Rn(e){Hn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Wn(){return c&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jn(){return c&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function $n(e,t,n,i,r){if(!r){var o=qn(t);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var s=qt(t);if("local"==i?s+=Cn(e.display):s-=e.display.viewOffset,"page"==i||"window"==i){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==i?0:jn());var l=a.left+("window"==i?0:Wn());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function Un(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=Wn(),r-=jn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:r-s.top}}function Vn(e,t,n,i,r){return i||(i=Ve(e.doc,t.line)),$n(e,i,Fn(e,i,t.ch,r),n)}function Gn(e,t,n,i,r,o){function s(t,s){var a=Nn(e,r,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,$n(e,i,a,n)}i=i||Ve(e.doc,t.line),r||(r=Mn(e,i));var a=ue(i,e.doc.direction),l=t.ch,u=t.sticky;if(l>=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return s("before"==u?l-1:l,"before"==u);function c(e,t,n){return s(n?e-1:e,1==a[t].level!=n)}var h=ae(a,l,u),d=se,f=c(l,h,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function Kn(e,t){var n=0;t=at(e.doc,t),e.options.lineWrapping||(n=ri(e.display)*t.ch);var i=Ve(e.doc,t.line),r=qt(i)+Cn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Xn(e,t,n,i,r){var o=et(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Yn(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Xn(i.first,0,null,-1,-1);var r=Ze(i,n),o=i.first+i.size-1;if(r>o)return Xn(i.first+i.size-1,Ve(i,o).text.length,null,1,1);t<0&&(t=0);for(var s=Ve(i,r);;){var a=ei(e,s,r,t,n),l=It(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==r)return u;s=Ve(i,r=u.line)}}function Zn(e,t,n,i){i-=qn(t);var r=t.text.length,o=oe((function(t){return Nn(e,n,t-1).bottom<=i}),r,0);return{begin:o,end:r=oe((function(t){return Nn(e,n,t).top>i}),o,r)}}function Qn(e,t,n,i){return n||(n=Mn(e,t)),Zn(e,t,n,$n(e,t,Nn(e,n,i),"line").top)}function Jn(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function ei(e,t,n,i,r){r-=qt(t);var o=Mn(e,t),s=qn(t),a=0,l=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?ni:ti)(e,t,n,o,c,i,r);a=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var d,f,p=null,m=null,g=oe((function(t){var n=Nn(e,o,t);return n.top+=s,n.bottom+=s,!!Jn(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=t,m=n),!0)}),a,l),v=!1;if(m){var y=i-m.left<m.right-i,b=y==u;g=p+(b?0:1),f=b?"after":"before",d=y?m.left:m.right}else{u||g!=l&&g!=a||g++,f=0==g?"after":g==t.text.length?"before":Nn(e,o,g-(u?1:0)).bottom+s<=r==u?"after":"before";var x=Gn(e,et(n,g,f),"line",t,o);d=x.left,v=r<x.top?-1:r>=x.bottom?1:0}return Xn(n,g=re(t.text,g,1),f,v,i-d)}function ti(e,t,n,i,r,o,s){var a=oe((function(a){var l=r[a],u=1!=l.level;return Jn(Gn(e,et(n,u?l.to:l.from,u?"before":"after"),"line",t,i),o,s,!0)}),0,r.length-1),l=r[a];if(a>0){var u=1!=l.level,c=Gn(e,et(n,u?l.from:l.to,u?"after":"before"),"line",t,i);Jn(c,o,s,!0)&&c.top>s&&(l=r[a-1])}return l}function ni(e,t,n,i,r,o,s){var a=Zn(e,t,i,s),l=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d<r.length;d++){var f=r[d];if(!(f.from>=u||f.to<=l)){var p=Nn(e,i,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=p<o?o-p+1e9:p-o;(!c||h>m)&&(c=f,h=m)}}return c||(c=r[r.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function ii(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==On){On=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)On.appendChild(document.createTextNode("x")),On.appendChild(T("br"));On.appendChild(document.createTextNode("x"))}A(e.measure,On);var n=On.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),S(e.measure),n||1}function ri(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");A(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function oi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+r,i[a]=o.clientWidth}return{fixedPos:si(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function si(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ai(e){var t=ii(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/ri(e.display)-3);return function(r){if(Wt(e.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s<r.widgets.length;s++)r.widgets[s].height&&(o+=r.widgets[s].height);return n?o+(Math.ceil(r.text.length/i)||1)*t:o+t}}function li(e){var t=e.doc,n=ai(e);t.iter((function(e){var t=n(e);t!=e.height&&Xe(e,t)}))}function ui(e,t,n,i){var r=e.display;if(!n&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var o,s,a=r.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(e){return null}var l,u=Yn(e,o,s);if(i&&u.xRel>0&&(l=Ve(e.doc,u.line).text).length==u.ch){var c=P(l,l.length,e.options.tabSize)-l.length;u=et(u.line,Math.max(0,Math.round((o-_n(e.display).left)/ri(e.display))-c))}return u}function ci(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function hi(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Dt&&Ht(e.doc,t)<r.viewTo&&fi(e);else if(n<=r.viewFrom)Dt&&Rt(e.doc,n+i)>r.viewFrom?fi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)fi(e);else if(t<=r.viewFrom){var o=pi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):fi(e)}else if(n>=r.viewTo){var s=pi(e,t,t,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):fi(e)}else{var a=pi(e,t,t,-1),l=pi(e,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(on(e,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):fi(e)}var u=r.externalMeasured;u&&(n<u.lineN?u.lineN+=i:t<u.lineN+u.size&&(r.externalMeasured=null))}function di(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[ci(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==R(s,n)&&s.push(n)}}}function fi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pi(e,t,n,i){var r,o=ci(e,t),s=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=t){if(i>0){if(o==s.length-1)return null;r=a+s[o].size-t,o++}else r=a-t;t+=r,n+=r}for(;Ht(e.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];r.hidden||r.node&&!r.changes||++n}return n}function gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vi(e,t){void 0===t&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&yi(e,a.head,r),l||xi(e,a,o)}}return i}function yi(e,t,n){var i=Gn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(T("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function bi(e,t){return e.top-t.top||e.left-t.left}function xi(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),s=_n(e.display),a=s.left,l=Math.max(i.sizerWidth,Sn(e)-i.sizer.offsetLeft)-s.right,u="ltr"==r.direction;function c(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(i-t)+"px"))}function h(t,n,i){var o,s,h=Ve(r,t),d=h.text.length;function f(n,i){return Vn(e,et(t,n),"div",h,i)}function p(t,n,i){var r=Qn(e,h,null,t),o="ltr"==n==("after"==i)?"left":"right";return f("after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1),o)[o]}var m=ue(h,r.direction);return function(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;o<e.length;++o){var s=e[o];(s.from<n&&s.to>t||t==n&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}(m,n||0,null==i?d:i,(function(e,t,r,h){var g="ltr"==r,v=f(e,g?"left":"right"),y=f(t-1,g?"right":"left"),b=null==n&&0==e,x=null==i&&t==d,w=0==h,D=!m||h==m.length-1;if(y.top-v.top<=3){var C=(u?x:b)&&D,k=(u?b:x)&&w?a:(g?v:y).left,_=C?l:(g?y:v).right;c(k,v.top,_-k,v.bottom)}else{var E,S,A,T;g?(E=u&&b&&w?a:v.left,S=u?l:p(e,r,"before"),A=u?a:p(t,r,"after"),T=u&&x&&D?l:y.right):(E=u?p(e,r,"before"):a,S=!u&&b&&w?l:v.right,A=!u&&x&&D?a:y.left,T=u?p(t,r,"after"):l),c(E,v.top,S-E,v.bottom),v.bottom<y.top&&c(a,v.bottom,null,y.top),c(A,y.top,T-A,y.bottom)}(!o||bi(v,o)<0)&&(o=v),bi(y,o)<0&&(o=y),(!s||bi(v,s)<0)&&(s=v),bi(y,s)<0&&(s=y)})),{start:o,end:s}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Ve(r,d.line),m=Ve(r,f.line),g=Pt(p)==Pt(m),v=h(d.line,d.ch,g?p.text.length+1:null).end,y=h(f.line,g?0:null,f.ch).start;g&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(a,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(a,v.bottom,null,y.top)}n.appendChild(o)}function wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||_i(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Di(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ki(e))}function Ci(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&_i(e))}),100)}function ki(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wi(e))}function _i(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Ei(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],o=e.options.lineWrapping,l=void 0,u=0;if(!r.hidden){if(s&&a<8){var c=r.node.offsetTop+r.node.offsetHeight;l=c-n,n=c}else{var h=r.node.getBoundingClientRect();l=h.bottom-h.top,!o&&r.text.firstChild&&(u=r.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=r.line.height-l;if((d>.005||d<-.005)&&(Xe(r.line,l),Si(r.line),r.rest))for(var f=0;f<r.rest.length;f++)Si(r.rest[f]);if(u>e.display.sizerWidth){var p=Math.ceil(u/ri(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function Si(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Ai(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Cn(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=Ze(t,i),s=Ze(t,r);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=Ze(t,qt(Ve(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=s&&(o=Ze(t,qt(Ve(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Ti(e,t){var n=e.display,i=ii(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=An(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+kn(n),l=t.top<i,u=t.bottom>a-i;if(t.top<r)s.scrollTop=l?0:t.top;else if(t.bottom>r+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=r&&(s.scrollTop=c)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,f=Sn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?s.scrollLeft=0:t.left<d?s.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(s.scrollLeft=t.right+(p?0:10)-f),s}function Fi(e,t){null!=t&&(Ni(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Li(e){Ni(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mi(e,t,n){null==t&&null==n||Ni(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ni(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Oi(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Oi(e,t,n,i){var r=Ti(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Mi(e,r.scrollLeft,r.scrollTop)}function Bi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||lr(e,{top:t}),Ii(e,t,!0),n&&lr(e),ir(e,100))}function Ii(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function zi(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Pi(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+kn(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?n:0,docHeight:i,scrollHeight:i+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Hi=function(e,t,n){this.cm=n;var i=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),he(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),he(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},Hi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hi.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Hi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},Hi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ri=function(){};function Wi(e,t){t||(t=Pi(e));var n=e.display.barWidth,i=e.display.barHeight;ji(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Ei(e),ji(e,Pi(e)),n=e.display.barWidth,i=e.display.barHeight}function ji(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ri.prototype.update=function(){return{bottom:0,right:0}},Ri.prototype.setScrollLeft=function(){},Ri.prototype.setScrollTop=function(){},Ri.prototype.clear=function(){};var qi={native:Hi,null:Ri};function $i(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new qi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?zi(e,t):Bi(e,t)}),e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Ui=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:++Ui,markArrays:null},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Gi(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}(n)}finally{sn=null,t(n)}}(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,n=0;n<t.length;n++)Ki(t[n]);for(var i=0;i<t.length;i++)Xi(t[i]);for(var r=0;r<t.length;r++)Yi(t[r]);for(var o=0;o<t.length;o++)Zi(t[o]);for(var s=0;s<t.length;s++)Qi(t[s])}(e)}))}function Ki(e){var t=e.cm,n=t.display;(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=En(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=En(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&Ut(t),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&&t.options.lineWrapping,e.update=e.mustUpdate&&new or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xi(e){e.updatedDisplay=e.mustUpdate&&sr(e.cm,e.update)}function Yi(e){var t=e.cm,n=t.display;e.updatedDisplay&&Ei(t),e.barMeasure=Pi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Sn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&zi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wi(t,e.barMeasure),e.updatedDisplay&&cr(t,e.barMeasure),e.selectionChanged&&wi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Di(e.cm)}function Qi(e){var t=e.cm,n=t.display,i=t.doc;e.updatedDisplay&&ar(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Ii(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&zi(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=T("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,a=Gn(e,t),l=n&&n!=t?Gn(e,n):a,u=Ti(e,r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Bi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(zi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return r}(t,at(i,e.scrollToPos.from),at(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var s=0;s<r.length;++s)r[s].lines.length||pe(r[s],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&pe(o[a],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ji(e,t){if(e.curOp)return t();Vi(e);try{return t()}finally{Gi(e)}}function er(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vi(e);try{return t.apply(e,arguments)}finally{Gi(e)}}}function tr(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{Gi(this)}}}function nr(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{Gi(t)}}}function ir(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(rr,e))}function rr(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=ft(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?je(t.mode,i.state):null,l=ht(e,o,i,!0);a&&(i.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!h&&d<s.length;++d)h=s[d]!=o.styles[d];h&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return ir(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Ji(e,(function(){for(var t=0;t<r.length;t++)di(e,r[t],"text")}))}}var or=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Ai(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Sn(e),this.force=n,this.dims=oi(e),this.events=[]};function sr(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return fi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(e))return!1;dr(e)&&(fi(e),t.dims=oi(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Dt&&(o=Ht(e.doc,o),s=Rt(e.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=on(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=on(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ci(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(on(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,ci(e,n)))),i.viewTo=n})(e,o,s),n.viewOffset=qt(Ve(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=mi(e);if(!a&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=M();if(!t||!L(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&L(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=i.view,c=i.viewFrom,h=0;h<u.length;h++){var d=u[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;s!=d.node;)s=a(s);var f=r&&null!=t&&t<=c&&d.lineNumber;d.changes&&(R(d.changes,"gutter")>-1&&(f=!1),cn(e,d,c,n)),f&&(S(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Je(e.options,c)))),s=d.node.nextSibling}else{var p=vn(e,d,c,n);o.insertBefore(p,s)}c+=d.size}for(;s;)s=a(s)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=M()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&L(document.body,e.anchorNode)&&L(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ir(e,400)),n.updateLineNumbers=null,!0}function ar(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Sn(e))i&&(t.visible=Ai(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-An(e),n.top)}),t.visible=Ai(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!sr(e,t))break;Ei(e);var r=Pi(e);gi(e),Wi(e,r),cr(e,r),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 lr(e,t){var n=new or(e,t);if(sr(e,n)){Ei(e),ar(e,n);var i=Pi(e);gi(e),Wi(e,i),cr(e,i),n.finish()}}function ur(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ln(e,"gutterChanged",e)}function cr(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+En(e)+"px"}function hr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=si(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",s=0;s<n.length;s++)if(!n[s].hidden){e.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=o),n[s].gutterBackground&&(n[s].gutterBackground.style.left=o));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function dr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Je(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,s=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",ur(e.display),!0}return!1}function fr(e,t){for(var n=[],i=!1,r=0;r<e.length;r++){var o=e[r],s=null;if("string"!=typeof o&&(s=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;i=!0}n.push({className:o,style:s})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function pr(e){var t=e.gutters,n=e.gutterSpecs;S(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,s=r.style,a=t.appendChild(T("div",null,"CodeMirror-gutter "+o));s&&(a.style.cssText=s),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ur(e)}function mr(e){pr(e.display),hi(e),hr(e)}function gr(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=F("div",null,"CodeMirror-code"),o.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=T("div",null,"CodeMirror-cursors"),o.measure=T("div",null,"CodeMirror-measure"),o.lineMeasure=T("div",null,"CodeMirror-measure"),o.lineSpace=F("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=F("div",[o.lineSpace],"CodeMirror-lines");o.mover=T("div",[u],null,"position: relative"),o.sizer=T("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=T("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=T("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=T("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&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=fr(r.gutters,r.lineNumbers),pr(o),i.init(o)}or.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},or.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var vr=0,yr=null;function br(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xr(e){var t=br(e);return t.x*=yr,t.y*=yr,t}function wr(e,t){var i=br(t),r=i.x,o=i.y,s=e.display,a=s.scroller,u=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(r&&u||o&&c){if(o&&y&&l)e:for(var d=t.target,f=s.view;d!=a;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){e.display.currentWheelTarget=d;break e}if(r&&!n&&!h&&null!=yr)return o&&c&&Bi(e,Math.max(0,a.scrollTop+o*yr)),zi(e,Math.max(0,a.scrollLeft+r*yr)),(!o||o&&c)&&be(t),void(s.wheelStartX=null);if(o&&null!=yr){var m=o*yr,g=e.doc.scrollTop,v=g+s.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),lr(e,{top:g,bottom:v})}vr<20&&(null==s.wheelStartX?(s.wheelStartX=a.scrollLeft,s.wheelStartY=a.scrollTop,s.wheelDX=r,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var e=a.scrollLeft-s.wheelStartX,t=a.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(yr=(yr*vr+n)/(vr+1),++vr)}}),200)):(s.wheelDX+=r,s.wheelDY+=o))}}s?yr=-.53:n?yr=15:c?yr=-.7:d&&(yr=-1/3);var Dr=function(e,t){this.ranges=e,this.primIndex=t};Dr.prototype.primary=function(){return this.ranges[this.primIndex]},Dr.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 n=this.ranges[t],i=e.ranges[t];if(!nt(n.anchor,i.anchor)||!nt(n.head,i.head))return!1}return!0},Dr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cr(it(this.ranges[t].anchor),it(this.ranges[t].head));return new Dr(e,this.primIndex)},Dr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Dr.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(tt(t,i.from())>=0&&tt(e,i.to())<=0)return n}return-1};var Cr=function(e,t){this.anchor=e,this.head=t};function kr(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=R(t,r);for(var o=1;o<t.length;o++){var s=t[o],a=t[o-1],l=tt(a.to(),s.from());if(i&&!s.empty()?l>0:l>=0){var u=ot(a.from(),s.from()),c=rt(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Cr(h?c:u,h?u:c))}}return new Dr(t,n)}function _r(e,t){return new Dr([new Cr(e,t||e)],0)}function Er(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Sr(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Er(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Er(t).ch-t.to.ch),et(n,i)}function Ar(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new Cr(Sr(r.anchor,t),Sr(r.head,t)))}return kr(e.cm,n,e.sel.primIndex)}function Tr(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Fr(e){e.doc.mode=He(e.options,e.doc.modeOption),Lr(e)}function Lr(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,ir(e,100),e.state.modeGen++,e.curOp&&hi(e)}function Mr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Nr(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){(function(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),At(e),Tt(e,n);var r=i?i(e):1;r!=e.height&&Xe(e,r)})(e,n,r,i),ln(e,"change",e,t)}function s(e,t){for(var n=[],o=e;o<t;++o)n.push(new Vt(u[o],r(o),i));return n}var a=t.from,l=t.to,u=t.text,c=Ve(e,a.line),h=Ve(e,l.line),d=K(u),f=r(u.length-1),p=l.line-a.line;if(t.full)e.insert(0,s(0,u.length)),e.remove(u.length,e.size-u.length);else if(Mr(e,t)){var m=s(0,u.length-1);o(h,h.text,f),p&&e.remove(a.line,p),m.length&&e.insert(a.line,m)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,a.ch)+d+c.text.slice(l.ch),f);else{var g=s(1,u.length-1);g.push(new Vt(d+c.text.slice(l.ch),f,i)),o(c,c.text.slice(0,a.ch)+u[0],r(0)),e.insert(a.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,a.ch)+u[0]+h.text.slice(l.ch),r(0)),e.remove(a.line+1,p);else{o(c,c.text.slice(0,a.ch)+u[0],r(0)),o(h,d+h.text.slice(l.ch),f);var v=s(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,v)}ln(e,"change",e,t)}function Or(e,t,n){!function e(i,r,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var a=i.linked[s];if(a.doc!=r){var l=o&&a.sharedHist;n&&!l||(t(a.doc,l),e(a.doc,i,l))}}}(e,null,!0)}function Br(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,li(e),Fr(e),Ir(e),e.options.direction=t.direction,e.options.lineWrapping||Ut(e),e.options.mode=t.modeOption,hi(e)}function Ir(e){("rtl"==e.doc.direction?N:E)(e.display.lineDiv,"CodeMirror-rtl")}function zr(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Pr(e,t){var n={from:it(t.from),to:Er(t),text:Ge(e,t.from,t.to)};return qr(e,n,t.from.line,t.to.line+1),Or(e,(function(e){return qr(e,n,t.from.line,t.to.line+1)}),!0),n}function Hr(e){for(;e.length&&K(e).ranges;)e.pop()}function Rr(e,t,n,i){var r=e.history;r.undone.length=0;var o,s,a=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Hr(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(r,r.lastOp==i)))s=K(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,s.to)?s.to=Er(t):o.changes.push(Pr(e,t));else{var l=K(r.done);for(l&&l.ranges||jr(e.sel,r.done),o={changes:[Pr(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,s||pe(e,"historyAdded")}function Wr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,K(r.done),t))?r.done[r.done.length-1]=t:jr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Hr(r.undone)}function jr(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function qr(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function $r(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Ur(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push($r(n[r]));return i}(e,t),i=Et(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],s=i[r];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else s&&(n[r]=s)}return n}function Vr(e,t,n){for(var i=[],r=0;r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?Dr.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];i.push({changes:a});for(var l=0;l<s.length;++l){var u=s[l],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&R(t,Number(c[1]))>-1&&(K(a)[h]=u[h],delete u[h])}}}return i}function Gr(e,t,n,i){if(i){var r=e.anchor;if(n){var o=tt(t,r)<0;o!=tt(n,r)<0?(r=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Cr(r,t)}return new Cr(n||t,t)}function Kr(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Jr(e,new Dr([Gr(e.sel.primary(),t,n,r)],0),i)}function Xr(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=Gr(e.sel.ranges[o],t[o],null,r);Jr(e,kr(e.cm,i,e.sel.primIndex),n)}function Yr(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Jr(e,kr(e.cm,r,e.sel.primIndex),i)}function Zr(e,t,n,i){Jr(e,_r(t,n),i)}function Qr(e,t,n){var i=e.history.done,r=K(i);r&&r.ranges?(i[i.length-1]=t,eo(e,t,n)):Jr(e,t,n)}function Jr(e,t,n){eo(e,t,n),Wr(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Cr(at(e,t[n].anchor),at(e,t[n].head))},origin:n&&n.origin};return pe(e,"beforeSelectionChange",e,i),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?kr(e.cm,i.ranges,i.ranges.length-1):t}(e,t,n));var i=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,io(e,t,i,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Li(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),ln(e,"cursorActivity",e))}function no(e){to(e,io(e,e.sel,null,!1))}function io(e,t,n,i){for(var r,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=oo(e,s.anchor,a&&a.anchor,n,i),u=oo(e,s.head,a&&a.head,n,i);(r||l!=s.anchor||u!=s.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new Cr(l,u))}return r?kr(e.cm,r,t.primIndex):t}function ro(e,t,n,i,r){var o=Ve(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(u?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(c?a.to>=t.ch:a.to>t.ch))){if(r&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?c:u)&&(h=so(e,h,-i,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=tt(h,n))&&(i<0?d<0:d>0))return ro(e,h,t,i,r)}var f=l.find(i<0?-1:1);return(i<0?u:c)&&(f=so(e,f,i,f.line==t.line?o:null)),f?ro(e,f,t,i,r):null}}return t}function oo(e,t,n,i,r){var o=i||1;return ro(e,t,n,o,r)||!r&&ro(e,t,n,o,!0)||ro(e,t,n,-o,r)||!r&&ro(e,t,n,-o,!0)||(e.cantEdit=!0,et(e.first,0))}function so(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:n>0&&t.ch==(i||Ve(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function ao(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),j)}function lo(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(t,n,r,o){t&&(i.from=at(e,t)),n&&(i.to=at(e,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),pe(e,"beforeChange",e,i),e.cm&&pe(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 uo(e,t,n){if(e.cm){if(!e.cm.curOp)return er(e.cm,uo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=lo(e,t,!0))){var i=wt&&!n&&function(e,t,n){var i=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||i&&-1!=R(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:t,to:n}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<r.length;++l){var u=r[l];if(!(tt(u.to,a.from)<0||tt(u.from,a.to)>0)){var c=[l,1],h=tt(u.from,a.from),d=tt(u.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),r.splice.apply(r,c),l+=c.length-3}}return r}(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)co(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ar(e,t);Rr(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,Et(e,t));var i=[];Or(e,(function(e,n){n||-1!=R(i,e.history)||(yo(e.history,t),i.push(e.history)),po(e,t,null,Et(e,t))}))}}function ho(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u<a.length&&(r=a[u],n?!r.ranges||r.equals(e.sel):r.ranges);u++);if(u!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=a.pop()).ranges){if(i)return void a.push(r);break}if(jr(r,l),n&&!r.equals(e.sel))return void Jr(e,r,{clearRedo:!1});s=r}var c=[];jr(s,l),l.push({changes:c,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var h=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),d=function(n){var i=r.changes[n];if(i.origin=t,h&&!lo(e,i,!1))return a.length=0,{};c.push(Pr(e,i));var o=n?Ar(e,i):K(a);po(e,i,o,Ur(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Er(i)});var s=[];Or(e,(function(e,t){t||-1!=R(s,e.history)||(yo(e.history,i),s.push(e.history)),po(e,i,null,Ur(e,i))}))},f=r.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new Dr(X(e.sel.ranges,(function(e){return new Cr(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)di(e.cm,i,"gutter")}}function po(e,t,n,i){if(e.cm&&!e.cm.curOp)return er(e.cm,po)(e,t,n,i);if(t.to.line<e.first)fo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);fo(e,r),t={from:et(e.first,0),to:et(t.to.line+r,t.to.ch),text:[K(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ve(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ge(e,t.from,t.to),n||(n=Ar(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=Ye(Pt(Ve(i,o.line))),i.iter(l,s.line+1,(function(e){if(e==r.maxLine)return a=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ge(e),Nr(i,t,n,ai(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,(function(e){var t=$t(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,i=t-1;i>n;i--){var r=Ve(e,i).stateAfter;if(r&&(!(r instanceof ut)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(i,o.line),ir(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?hi(e):o.line!=s.line||1!=t.text.length||Mr(e.doc,t)?hi(e,o.line,s.line+1,u):di(e,o.line,"text");var c=ve(e,"changes"),h=ve(e,"change");if(h||c){var d={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&ln(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,i):Nr(e,t,i),eo(e,n,j),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n,i,r){var o;i||(i=n),tt(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),uo(e,{from:n,to:i,text:t,origin:r})}function go(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r],s=!0;if(o.ranges){o.copied||((o=e[r]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)go(o.ranges[a].anchor,t,n,i),go(o.ranges[a].head,t,n,i)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=et(u.from.line+i,u.from.ch),u.to=et(u.to.line+i,u.to.ch);else if(t<=u.to.line){s=!1;break}}s||(e.splice(0,r+1),r=0)}}}function yo(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;vo(e.done,n,i,r),vo(e.undone,n,i,r)}function bo(e,t,n,i){var r=t,o=t;return"number"==typeof t?o=Ve(e,st(e,t)):r=Ye(t),null==r?null:(i(o,r)&&e.cm&&di(e.cm,r,n),o)}function xo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function wo(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}Cr.prototype.from=function(){return ot(this.anchor,this.head)},Cr.prototype.to=function(){return rt(this.anchor,this.head)},Cr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,Gt(r),ln(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,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,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}},wo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),s=i.height;if(i.removeInner(e,o),this.height-=s-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var a=[];this.collapse(a),this.children=[new xo(a)],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,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<=o){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var s=r.lines.length%25+25,a=s;a<r.lines.length;){var l=new xo(r.lines.slice(a,a+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=R(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new wo(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<o){var s=Math.min(t,o-e);if(r.iterN(e,s,n))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var Do=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};function Co(e,t,n){qt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Fi(e,n)}Do.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=Ye(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var o=wn(this);Xe(n,Math.max(0,n.height-o)),e&&(Ji(e,(function(){Co(e,n,-o),di(e,i,"widget")})),ln(e,"lineWidgetCleared",e,this,i))}},Do.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=wn(this)-t;r&&(Wt(this.doc,i)||Xe(i,i.height+r),n&&Ji(n,(function(){n.curOp.forceUpdate=!0,Co(n,i,r),ln(n,"lineWidgetChanged",n,e,Ye(i))})))},ye(Do);var ko=0,_o=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ko};function Eo(e,t,n,i,r){if(i&&i.shared)return function(e,t,n,i,r){(i=z(i)).shared=!1;var o=[Eo(e,t,n,i,r)],s=o[0],a=i.widgetNode;return Or(e,(function(e){a&&(i.widgetNode=a.cloneNode(!0)),o.push(Eo(e,at(e,t),at(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=K(o)})),new So(o,s)}(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return er(e.cm,Eo)(e,t,n,i,r);var o=new _o(e,r),s=tt(t,n);if(i&&z(i,o,!1),s>0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=F("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(zt(e,t.line,t,n,o)||t.line!=n.line&&zt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Dt=!0}o.addToHistory&&Rr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(i){u&&o.collapsed&&!u.options.lineWrapping&&Pt(i)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Xe(i,0),function(e,t,n){var i=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));i&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}(i,new Ct(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Wt(e,t)&&Xe(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)hi(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)di(u,c,"text");o.atomic&&no(u.doc),ln(u,"markerAdded",u,o)}return o}_o.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vi(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=kt(s.markedSpans,this);e&&!this.collapsed?di(e,Ye(s),"text"):e&&(null!=a.to&&(r=Ye(s)),null!=a.from&&(i=Ye(s))),s.markedSpans=_t(s.markedSpans,a),null==a.from&&this.collapsed&&!Wt(this.doc,s)&&e&&Xe(s,ii(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Pt(this.lines[l]),c=$t(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&hi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,i,r),t&&Gi(e),this.parent&&this.parent.clear()}},_o.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],s=kt(o.markedSpans,this);if(null!=s.from&&(n=et(t?o:Ye(o),s.from),-1==e))return n;if(null!=s.to&&(i=et(t?o:Ye(o),s.to),1==e))return i}return n&&{from:n,to:i}},_o.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;t&&i&&Ji(i,(function(){var r=t.line,o=Ye(t.line),s=Ln(i,o);if(s&&(Pn(s),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Wt(n.doc,r)&&null!=n.height){var a=n.height;n.height=null;var l=wn(n)-a;l&&Xe(r,r.height+l)}ln(i,"markerChanged",i,e)}))},_o.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=R(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},_o.prototype.detachLine=function(e){if(this.lines.splice(R(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(_o);var So=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ao(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function To(e){for(var t=function(t){var n=e[t],i=[n.primary.doc];Or(n.primary.doc,(function(e){return i.push(e)}));for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==R(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<e.length;n++)t(n)}So.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},So.prototype.find=function(e,t){return this.primary.find(e,t)},ye(So);var Fo=0,Lo=function(e,t,n,i,r){if(!(this instanceof Lo))return new Lo(e,t,n,i,r);null==n&&(n=0),wo.call(this,[new xo([new Vt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=_r(o),this.history=new zr(null),this.id=++Fo,this.modeOption=t,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Nr(this,{from:o,to:o,text:e}),Jr(this,_r(o),j)};Lo.prototype=Z(wo.prototype,{constructor:Lo,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:nr((function(e){var t=et(this.first,0),n=this.first+this.size-1;uo(this,{from:t,to:et(n,Ve(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Mi(this.cm,0,0),Jr(this,_r(t),j)})),replaceRange:function(e,t,n,i){mo(this,e,t=at(this,t),n=n?at(this,n):t,i)},getRange:function(e,t,n){var i=Ge(this,at(this,e),at(this,t));return!1===n?i:""===n?i.join(""):i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ve(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ve(this,e)),Pt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return at(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:nr((function(e,t,n){Zr(this,at(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:nr((function(e,t,n){Zr(this,at(this,e),at(this,t||e),n)})),extendSelection:nr((function(e,t,n){Kr(this,at(this,e),t&&at(this,t),n)})),extendSelections:nr((function(e,t){Xr(this,lt(this,e),t)})),extendSelectionsBy:nr((function(e,t){Xr(this,lt(this,X(this.sel.ranges,e)),t)})),setSelections:nr((function(e,t,n){if(e.length){for(var i=[],r=0;r<e.length;r++)i[r]=new Cr(at(this,e[r].anchor),at(this,e[r].head||e[r].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Jr(this,kr(this.cm,i,t),n)}})),addSelection:nr((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new Cr(at(this,e),at(this,t||e))),Jr(this,kr(this.cm,i,i.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=Ge(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Ge(this,n[i].from(),n[i].to());!1!==e&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:nr((function(e,t,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var s=r.ranges[o];i[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&function(e,t,n){for(var i=[],r=et(e.first,0),o=r,s=0;s<t.length;s++){var a=t[s],l=Tr(a.from,r,o),u=Tr(Er(a),r,o);if(r=a.to,o=u,"around"==n){var c=e.sel.ranges[s],h=tt(c.head,c.anchor)<0;i[s]=new Cr(h?u:l,h?l:u)}else i[s]=new Cr(l,l)}return new Dr(i,e.sel.primIndex)}(this,i,t),l=i.length-1;l>=0;l--)uo(this,i[l]);a?Qr(this,a):this.cm&&Li(this.cm)})),undo:nr((function(){ho(this,"undo")})),redo:nr((function(){ho(this,"redo")})),undoSelection:nr((function(){ho(this,"undo",!0)})),redoSelection:nr((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new zr(this.history),Or(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:Vr(this.history.done),undone:Vr(this.history.undone)}},setHistory:function(e){var t=this.history=new zr(this.history);t.done=Vr(e.done.slice(0),null,!0),t.undone=Vr(e.undone.slice(0),null,!0)},setGutterMarker:nr((function(e,t,n){return bo(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&te(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:nr((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Ve(this,e)))return null}else if(null==(t=Ye(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:nr((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(k(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:nr((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var o=r.match(k(n));if(!o)return!1;var s=o.index+o[0].length;e[i]=r.slice(0,o.index)+(o.index&&s!=r.length?" ":"")+r.slice(s)||null}return!0}))})),addLineWidget:nr((function(e,t,n){return function(e,t,n,i){var r=new Do(e,n,i),o=e.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!Wt(e,t)){var i=qt(t)<e.scrollTop;Xe(t,t.height+wn(r)),i&&Fi(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&ln(o,"lineWidgetAdded",o,r,"number"==typeof t?t:Ye(t)),r}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Eo(this,at(this,e),at(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Eo(this,e=at(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ve(this,(e=at(this,e)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=at(this,e),t=at(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&r==e.line&&e.ch>=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)})),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var o=r.text.length+i;if(o>e)return t=e,!0;e-=o,++n})),at(this,et(n,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Lo(Ke(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var i=new Lo(Ke(this,t,n),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 n=0;n<t.length;n++){var i=t[n],r=i.find(),o=e.clipPos(r.from),s=e.clipPos(r.to);if(tt(o,s)){var a=Eo(e,o,s,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}(i,Ao(this)),i},unlinkDoc:function(e){if(e instanceof Ss&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),To(Ao(this));break}if(e.history==this.history){var n=[e.id];Or(e,(function(e){return n.push(e.id)}),!0),e.history=new zr(null),e.history.done=Vr(this.history.done,n),e.history.undone=Vr(this.history.undone,n)}},iterLinkedDocs:function(e){Or(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Le(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:nr((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Ji(t=this.cm,(function(){Ir(t),hi(t)})))}))}),Lo.prototype.eachLine=Lo.prototype.iter;var Mo=0;function No(e){var t=this;if(Oo(t),!me(t,e)&&!Dn(t.display,e)){be(e),s&&(Mo=+new Date);var n=ui(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),a=0,l=function(){++a==r&&er(t,(function(){var e={from:n=at(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};uo(t.doc,e),Qr(t.doc,_r(at(t.doc,n),at(t.doc,Er(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==R(t.options.allowDropFileTypes,e.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},i.readAsText(e)}},c=0;c<i.length;c++)u(i[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,_r(n,n)),d)for(var f=0;f<d.length;++f)mo(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Oo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Bo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Io=!1;function zo(){var e;Io||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Bo(Po)}),100))})),he(window,"blur",(function(){return Bo(_i)})),Io=!0)}function Po(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ho={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ro=0;Ro<10;Ro++)Ho[Ro+48]=Ho[Ro+96]=String(Ro);for(var Wo=65;Wo<=90;Wo++)Ho[Wo]=String.fromCharCode(Wo);for(var jo=1;jo<=12;jo++)Ho[jo+111]=Ho[jo+63235]="F"+jo;var qo={};function $o(e){var t,n,i,r,o=e.split(/-(?!$)/);e=o[o.length-1];for(var s=0;s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Uo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete e[n];continue}for(var r=X(n.split(" "),$o),o=0;o<r.length;o++){var s=void 0,a=void 0;o==r.length-1?(a=r.join(" "),s=i):(a=r.slice(0,o+1).join(" "),s="...");var l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[n]}for(var u in t)e[u]=t[u];return e}function Vo(e,t,n,i){var r=(t=Yo(t)).call?t.call(e,i):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Vo(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var s=Vo(e,t.fallthrough[o],n,i);if(s)return s}}}function Go(e){var t="string"==typeof e?e:Ho[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ko(e,t,n){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(D?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(D?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Xo(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=Ho[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ko(n,e,t))}function Yo(e){return"string"==typeof e?qo[e]:e}function Zo(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&&tt(o.from,K(i).to)<=0;){var s=i.pop();if(tt(s.from,o.from)<0){o.from=s.from;break}}i.push(o)}Ji(e,(function(){for(var t=i.length-1;t>=0;t--)mo(e.doc,"",i[t].from,i[t].to,"+delete");Li(e)}))}function Qo(e,t,n){var i=re(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Jo(e,t,n){var i=Qo(e,t.ch,n);return null==i?null:new et(t.line,i,n<0?"after":"before")}function es(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=ue(n,t.doc.direction);if(o){var s,a=r<0?K(o):o[0],l=r<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Mn(t,n);s=r<0?n.text.length-1:0;var c=Nn(t,u,s).top;s=oe((function(e){return Nn(t,u,e).top==c}),r<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Qo(n,s,1))}else s=r<0?a.to:a.from;return new et(i,s,l)}}return new et(i,r<0?n.text.length:0,r<0?"before":"after")}qo.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"},qo.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"},qo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},qo.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"]},qo.default=y?qo.macDefault:qo.pcDefault;var ts={selectAll:ao,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=Ve(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zo(e,(function(t){return{from:et(t.from().line,0),to:at(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"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(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ns(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return is(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ve(e.doc,t),i=function(e){for(var t;t=Bt(e);)e=t.find(1,!0).line;return e}(n);return i!=n&&(t=Ye(i)),es(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),$)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),$)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?is(e,t.head):i}),$)},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,"codepoint")},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=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),s=P(e.getLine(o.line),o.ch,i);t.push(G(i-s%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ji(e,(function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++)if(t[i].empty()){var r=t[i].head,o=Ve(e.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new et(r.line,r.ch-1)),r.ch>0)r=new et(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),et(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var s=Ve(e.doc,r.line-1).text;s&&(r=new et(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),et(r.line-1,s.length-1),r,"+transpose"))}n.push(new Cr(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ji(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Li(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ns(e,t){var n=Ve(e.doc,t),i=Pt(n);return i!=n&&(t=Ye(i)),es(!0,e,i,t,1)}function is(e,t){var n=ns(e,t.line),i=Ve(e.doc,n.line),r=ue(i,e.doc.direction);if(!r||0==r[0].level){var o=Math.max(n.ch,i.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,s?0:o,n.sticky)}return n}function rs(e,t,n){if("string"==typeof t&&!(t=ts[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=W}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}var os=new H;function ss(e,t,n,i){var r=e.state.keySeq;if(r){if(Go(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:os.set(50,(function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())})),as(e,r+" "+t,n,i))return!0}return as(e,t,n,i)}function as(e,t,n,i){var r=function(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=Vo(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&Vo(t,e.options.extraKeys,n,e)||Vo(t,e.options.keyMap,n,e)}(e,t,i);return"multi"==r&&(e.state.keySeq=t),"handled"==r&&ln(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(be(n),wi(e)),!!r}function ls(e,t){var n=Xo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ss(e,"Shift-"+n,t,(function(t){return rs(e,t,!0)}))||ss(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return rs(e,t)})):ss(e,n,t,(function(t){return rs(e,t)})))}var us=null;function cs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=M(),me(t,e)))){s&&a<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var r=ls(t,e);h&&(us=r?i:null,r||88!=i||Ne||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n))}N(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n)}(t)}}function hs(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function ds(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Dn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(h&&n==us)return us=null,void be(e);if(!h||e.which&&!(e.which<10)||!ls(t,e)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(function(e,t,n){return ss(e,"'"+n+"'",t,(function(t){return rs(e,t,!0)}))}(t,e,r)||t.display.input.onKeyPress(e))}}}var fs,ps,ms=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gs(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Dn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!bs(t,e)){var i=ui(t,e),r=ke(e),o=i?function(e,t){var n=+new Date;return ps&&ps.compare(n,e,t)?(fs=ps=null,"triple"):fs&&fs.compare(n,e,t)?(ps=new ms(n,e,t),fs=null,"double"):(fs=new ms(n,e,t),ps=null,"single")}(i,r):"single";window.focus(),1==r&&t.state.selectingText&&t.state.selectingText(e),i&&function(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),ss(e,Ko(o=(1==t?"Left":2==t?"Middle":"Right")+o,r),r,(function(t){if("string"==typeof t&&(t=ts[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,n)!=W}finally{e.state.suppressEdits=!1}return i}))}(t,r,i,o,e)||(1==r?i?function(e,t,n,i){s?setTimeout(I(Di,e),0):e.curOp.focus=M();var r,o=function(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(null==r.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}(e,n,i),u=e.doc.sel;e.options.dragDrop&&Se&&!e.isReadOnly()&&"single"==n&&(r=u.contains(t))>-1&&(tt((r=u.ranges[r]).from(),t)<0||t.xRel>0)&&(tt(r.to(),t)>0||t.xRel<0)?function(e,t,n,i){var r=e.display,o=!1,u=er(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ci(e)),fe(r.wrapper.ownerDocument,"mouseup",u),fe(r.wrapper.ownerDocument,"mousemove",c),fe(r.scroller,"dragstart",h),fe(r.scroller,"drop",u),o||(be(t),i.addNew||Kr(e.doc,n,null,null,i.extend),l&&!d||s&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=u,u.copy=!i.moveOnDrag,he(r.wrapper.ownerDocument,"mouseup",u),he(r.wrapper.ownerDocument,"mousemove",c),he(r.scroller,"dragstart",h),he(r.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}(e,i,t,o):function(e,t,n,i){s&&Ci(e);var r=e.display,o=e.doc;be(t);var a,l,u=o.sel,c=u.ranges;if(i.addNew&&!i.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new Cr(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new Cr(n,n)),n=ui(e,t,!0,!0),l=-1;else{var h=vs(e,n,i.unit);a=i.extend?Gr(a,h.anchor,h.head,i.extend):h}i.addNew?-1==l?(l=c.length,Jr(o,kr(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==i.unit&&!i.extend?(Jr(o,kr(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Yr(o,l,a,q):(l=0,Jr(o,new Dr([a],0),q),u=o.sel);var d=n;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==i.unit){for(var r=[],s=e.options.tabSize,c=P(Ve(o,n.line).text,n.ch,s),h=P(Ve(o,t.line).text,t.ch,s),f=Math.min(c,h),p=Math.max(c,h),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ve(o,m).text,y=U(v,f,s);f==p?r.push(new Cr(et(m,y),et(m,y))):v.length>y&&r.push(new Cr(et(m,y),et(m,U(v,p,s))))}r.length||r.push(new Cr(n,n)),Jr(o,kr(e,u.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=vs(e,t,i.unit),D=x.anchor;tt(w.anchor,D)>0?(b=w.head,D=ot(x.from(),w.anchor)):(b=w.anchor,D=rt(x.to(),w.head));var C=u.ranges.slice(0);C[l]=function(e,t){var n=t.anchor,i=t.head,r=Ve(e.doc,n.line);if(0==tt(n,i)&&n.sticky==i.sticky)return t;var o=ue(r);if(!o)return t;var s=ae(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ae(o,i.ch,i.sticky),h=c-s||(i.ch-n.ch)*(1==a.level?-1:1);l=c==u-1||c==u?h<0:h>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,m=f?"after":"before";return n.ch==p&&n.sticky==m?t:new Cr(new et(n.line,p,m),i)}(e,new Cr(at(o,D),b)),Jr(o,kr(e,C,l),q)}}var p=r.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,s=ui(e,t,!0,"rectangle"==i.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=M(),f(s);var a=Ai(r,o);(s.line>=a.to||s.line<a.from)&&setTimeout(er(e,(function(){m==n&&g(t)})),150)}else{var l=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;l&&setTimeout(er(e,(function(){m==n&&(r.scroller.scrollTop+=l,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(be(t),r.input.focus()),fe(r.wrapper.ownerDocument,"mousemove",y),fe(r.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=er(e,(function(e){0!==e.buttons&&ke(e)?g(e):v(e)})),b=er(e,v);e.state.selectingText=b,he(r.wrapper.ownerDocument,"mousemove",y),he(r.wrapper.ownerDocument,"mouseup",b)}(e,i,t,o)}(t,i,o,e):Ce(e)==n.scroller&&be(e):2==r?(i&&Kr(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(C?t.display.input.onContextMenu(e):Ci(t)))}}function vs(e,t,n){if("char"==n)return new Cr(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Cr(et(t.line,0),at(e.doc,et(t.line+1,0)));var i=n(e,t);return new Cr(i.from,i.to)}function ys(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&be(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ve(e,n))return we(t);o-=a.top-s.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=s.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=r)return pe(e,n,e,Ze(e.doc,o),e.display.gutterSpecs[l].className,t),we(t)}}function bs(e,t){return ys(e,t,"gutterClick",!0)}function xs(e,t){Dn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ys(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ws(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}ms.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Ds={toString:function(){return"CodeMirror.Init"}},Cs={},ks={};function _s(e,t,n){if(!t!=!(n&&n!=Ds)){var i=e.display.dragFunctions,r=t?he:fe;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function Es(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Ut(e)),li(e),hi(e),Rn(e),setTimeout((function(){return Wi(e)}),100)}function Ss(e,t){var n=this;if(!(this instanceof Ss))return new Ss(e,t);this.options=t=t?z(t):{},z(Cs,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 r=new Ss.inputStyles[t.inputStyle](this),o=this.display=new gr(e,i,r,t);for(var u in o.wrapper.CodeMirror=this,ws(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$i(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 H,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",er(e,gs)),he(t.scroller,"dblclick",s&&a<11?er(e,(function(t){if(!me(e,t)){var n=ui(e,t);if(n&&!bs(e,t)&&!Dn(e.display,t)){be(t);var i=e.findWordAt(n);Kr(e.doc,i.anchor,i.head)}}})):function(t){return me(e,t)||be(t)}),he(t.scroller,"contextmenu",(function(t){return xs(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xs(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}he(t.scroller,"touchstart",(function(r){if(!me(e,r)&&!o(r)&&!bs(e,r)){t.input.ensurePolled(),clearTimeout(n);var s=+new Date;t.activeTouch={start:s,moved:!1,prev:s-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Dn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!i.prev||l(i,i.prev)?new Cr(s,s):!i.prev.prev||l(i,i.prev.prev)?e.findWordAt(s):new Cr(et(s.line,0),at(e.doc,et(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),be(n)}r()})),he(t.scroller,"touchcancel",r),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Bi(e,t.scroller.scrollTop),zi(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return wr(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return wr(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||De(t)},over:function(t){me(e,t)||(function(e,t){var n=ui(e,t);if(n){var i=document.createDocumentFragment();yi(e,n,i),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,i)}}(e,t),De(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Mo<100))De(t);else if(!me(e,t)&&!Dn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:er(e,No),leave:function(t){me(e,t)||Oo(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return hs.call(e,t)})),he(u,"keydown",er(e,cs)),he(u,"keypress",er(e,ds)),he(u,"focus",(function(t){return ki(e,t)})),he(u,"blur",(function(t){return _i(e,t)}))}(this),zo(),Vi(this),this.curOp.forceUpdate=!0,Br(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&ki(n)}),20):_i(this),ks)ks.hasOwnProperty(u)&&ks[u](this,t[u],Ds);dr(this),t.finishInit&&t.finishInit(this);for(var c=0;c<As.length;++c)As[c](this);Gi(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ss.defaults=Cs,Ss.optionHandlers=ks;var As=[];function Ts(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=ft(e,t).state:n="prev");var s=e.options.tabSize,a=Ve(o,t),l=P(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(r,a.text.slice(c.length),a.text))==W||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?P(Ve(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)d+=s,h+="\t";if(d<u&&(h+=G(u-d)),h!=c)return mo(o,h,et(t,0),et(t,c.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var g=et(t,c.length);Yr(o,p,new Cr(g,g));break}}}Ss.defineInitHook=function(e){return As.push(e)};var Fs=null;function Ls(e){Fs=e}function Ms(e,t,n,i,r){var o=e.doc;e.display.shift=!1,i||(i=o.sel);var s=+new Date-200,a="paste"==r||e.state.pasteIncoming>s,l=Le(t),u=null;if(a&&i.ranges.length>1)if(Fs&&Fs.text.join("\n")==t){if(i.ranges.length%Fs.text.length==0){u=[];for(var c=0;c<Fs.text.length;c++)u.push(o.splitLines(Fs.text[c]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(u=X(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var f=i.ranges[d],p=f.from(),m=f.to();f.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!a?m=et(m.line,Math.min(Ve(o,m.line).text.length,m.ch+K(l).length)):a&&Fs&&Fs.lineWise&&Fs.text.join("\n")==l.join("\n")&&(p=m=et(p.line,0)));var g={from:p,to:m,text:u?u[d%u.length]:l,origin:r||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};uo(e.doc,g),ln(e,"inputRead",e,g)}t&&!a&&Os(e,t),Li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ns(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ji(t,(function(){return Ms(t,n,0,null,"paste")})),!0}function Os(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){s=Ts(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ve(e.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Ts(e,r.head.line,"smart"));s&&ln(e,"electricInput",e,r.head.line)}}}function Bs(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,o={anchor:et(r,0),head:et(r+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Is(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function zs(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Is(e),t}function Ps(e,t,n,i,r){var o=t,s=n,a=Ve(e,t.line),l=r&&"rtl"==e.direction?-n:n;function u(o){var s,u;if("codepoint"==i){var c=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))s=null;else{var h=n>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(h?2:1))),-n)}}else s=r?function(e,t,n,i){var r=ue(t,e.doc.direction);if(!r)return Jo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ae(r,n.ch,n.sticky),s=r[o];if("ltr"==e.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from<n.ch))return Jo(t,n,i);var a,l=function(e,n){return Qo(t,e instanceof et?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(a=a||Mn(e,t),Qn(e,t,a,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==s.level){var h=1==s.level==i<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=s.to&&d<=c.end:d>=s.from&&d>=c.begin)){var f=h?"before":"after";return new et(n.line,d,f)}}var p=function(e,t,i){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<r.length;e+=t){var s=r[e],a=t>0==(1!=s.level),u=a?i.begin:l(i.end,-1);if(s.from<=u&&u<s.to)return o(u,a);if(u=a?s.from:l(s.to,-1),i.begin<=u&&u<i.end)return o(u,a)}},m=p(o+i,i,c);if(m)return m;var g=i>0?c.end:l(c.begin,-1);return null==g||i>0&&g==t.text.length||!(m=p(i>0?0:r.length-1,i,u(g)))?null:m}(e.cm,a,t,n):Jo(a,t,n);if(null==s){if(o||((u=t.line+l)<e.first||u>=e.first+e.size||(t=new et(u,t.ch,t.sticky),!(a=Ve(e,u)))))return!1;t=es(r,e.cm,a,t.line,l)}else t=s;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var c=null,h="group"==i,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var p=a.text.charAt(t.ch)||"\n",m=ee(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||m||(m="s"),c&&c!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(c=m),n>0&&!u(!f))break}var g=oo(e,t,o,s,!0);return nt(o,g)&&(g.hitSide=!0),g}function Hs(e,t,n,i){var r,o,s=e.doc,a=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*ii(e.display),3);r=(n>0?t.bottom:t.top)+n*u}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Yn(e,a,r)).outside;){if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Rs=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ws(e,t){var n=Ln(e,t.line);if(!n||n.hidden)return null;var i=Ve(e.doc,t.line),r=Tn(n,i,t.line),o=ue(i,e.doc.direction),s="left";o&&(s=ae(o,t.ch)%2?"right":"left");var a=In(r.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function js(e,t){return t&&(e.bad=!0),e}function qs(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return js(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=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 r=0;r<e.display.view.length;r++){var o=e.display.view[r];if(o.node==i)return $s(o,t,n)}}function $s(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!L(i,t))return js(et(Ye(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var o=e.rest?K(e.rest):e.line;return js(et(Ye(o),o.text.length),r)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var l=e.measure,u=l.maps;function c(t,n,i){for(var r=-1;r<(u?u.length:0);r++)for(var o=r<0?l.map:u[r],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==n){var c=Ye(r<0?e.line:e.rest[r]),h=o[s]+i;return(i<0||a!=t)&&(h=o[s+(i?1:0)]),et(c,h)}}}var h=c(s,a,n);if(h)return js(h,r);for(var d=a.nextSibling,f=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(h=c(d,d.firstChild,0))return js(et(h.line,h.ch-f),r);f+=d.textContent.length}for(var p=a.previousSibling,m=n;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return js(et(h.line,h.ch+m),r);m+=p.textContent.length}}Rs.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function s(e){if(o(e)&&!me(i,e)){if(i.somethingSelected())Ls({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Bs(i);Ls({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,j),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var s=Fs.text.join("\n");if(e.clipboardData.setData("Text",s),e.clipboardData.getData("Text")==s)return void e.preventDefault()}var a=zs(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Fs.text.join("\n");var u=M();B(l),setTimeout((function(){i.display.lineSpace.removeChild(a),u.focus(),u==r&&n.showPrimarySelection()}),50)}}r.contentEditable=!0,Is(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),he(r,"paste",(function(e){!o(e)||me(i,e)||Ns(e,i)||a<=11&&setTimeout(er(i,(function(){return t.updateFromDOM()})),20)})),he(r,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(r,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(r,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(r,"touchstart",(function(){return n.forceCompositionEnd()})),he(r,"input",(function(){t.composing||t.readFromDOMSoon()})),he(r,"copy",s),he(r,"cut",s)},Rs.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Rs.prototype.prepareSelection=function(){var e=vi(this.cm,!1);return e.focus=M()==this.div,e},Rs.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Rs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Rs.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var s=qs(t,e.anchorNode,e.anchorOffset),a=qs(t,e.focusNode,e.focusOffset);if(!s||s.bad||!a||a.bad||0!=tt(ot(s,a),r)||0!=tt(rt(s,a),o)){var l=t.display.view,u=r.line>=t.display.viewFrom&&Ws(t,r)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Ws(t,o);if(!c){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=_(u.node,u.offset,c.offset,c.node)}catch(e){}f&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Rs.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)},Rs.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Rs.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Rs.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return L(this.div,t)},Rs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&M()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Rs.prototype.blur=function(){this.div.blur()},Rs.prototype.getField=function(){return this.div},Rs.prototype.supportsTouch=function(){return!0},Rs.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ji(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))}))},Rs.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Rs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=qs(t,e.anchorNode,e.anchorOffset),i=qs(t,e.focusNode,e.focusOffset);n&&i&&Ji(t,(function(){Jr(t.doc,_r(n,i),j),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},Rs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),s=o.from(),a=o.to();if(0==s.ch&&s.line>i.firstLine()&&(s=et(s.line-1,Ve(i.doc,s.line-1).length)),a.ch==Ve(i.doc,a.line).text.length&&a.line<i.lastLine()&&(a=et(a.line+1,0)),s.line<r.viewFrom||a.line>r.viewTo-1)return!1;s.line==r.viewFrom||0==(e=ci(i,s.line))?(t=Ye(r.view[0].line),n=r.view[0].node):(t=Ye(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,u,c=ci(i,a.line);if(c==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=Ye(r.view[c+1].line)-1,u=r.view[c+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(function(e,t,n,i,r){var o="",s=!1,a=e.doc.lineSeparator(),l=!1;function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function c(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(et(i,0),et(r+1,0),(g=+d,function(e){return e.id==g}));return void(f.length&&(o=f[0].find(0))&&c(Ge(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var m=0;m<t.childNodes.length;m++)h(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),p&&(s=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;h(t),t!=n;)t=t.nextSibling,l=!1;return o}(i,n,u,t,l)),d=Ge(i.doc,et(t,0),et(l,Ve(i.doc,l).text.length));h.length>1&&d.length>1;)if(K(h)==K(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);f<v&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var y=K(h),b=K(d),x=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&t==s.line)for(;f&&f>s.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var w=et(t,f),D=et(l,d.length?K(d).length-p:0);return h.length>1||h[0]||tt(w,D)?(mo(i.doc,h,w,D,"+input"),!0):void 0},Rs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Rs.prototype.reset=function(){this.forceCompositionEnd()},Rs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Rs.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))},Rs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ji(this.cm,(function(){return hi(e.cm)}))},Rs.prototype.setUneditable=function(e){e.contentEditable="false"},Rs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ms)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Rs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Rs.prototype.onContextMenu=function(){},Rs.prototype.resetPosition=function(){},Rs.prototype.needsContentAttribute=!0;var Us=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};Us.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!me(i,e)){if(i.somethingSelected())Ls({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Bs(i);Ls({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,j):(n.prevInput="",r.value=t.text.join("\n"),B(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),he(r,"input",(function(){s&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(r,"paste",(function(e){me(i,e)||Ns(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),he(r,"cut",o),he(r,"copy",o),he(e.scroller,"paste",(function(t){if(!Dn(e,t)&&!me(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){Dn(e,t)||be(t)})),he(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),he(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Us.prototype.createField=function(e){this.wrapper=zs(),this.textarea=this.wrapper.firstChild},Us.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Us.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=vi(e);if(e.options.moveInputWithCursor){var r=Gn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},Us.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Us.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&B(this.textarea),s&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},Us.prototype.getField=function(){return this.textarea},Us.prototype.supportsTouch=function(){return!1},Us.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Us.prototype.blur=function(){this.textarea.blur()},Us.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Us.prototype.receivedFocus=function(){this.slowPoll()},Us.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Us.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Us.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Me(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(i.length,r.length);l<u&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Ji(t,(function(){Ms(t,r.slice(l),i.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Us.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Us.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Us.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ui(n,e),u=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&er(n,Jr)(n.doc,_r(o),j);var c,d=r.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),i.input.focus(),l&&window.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&g(),C){De(e);var m=function(){fe(window,"mouseup",m),setTimeout(v,20)};he(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var e=n.somethingSelected(),o=""+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,r.style.cssText=d,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!s||s&&a<9)&&g();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==t.prevInput?er(n,ao)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Us.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Us.prototype.setUneditable=function(){},Us.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=Ds&&r(e,t,n)}:r)}e.defineOption=n,e.Init=Ds,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Fr(e)}),!0),n("indentUnit",2,Fr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Lr(e),Rn(e),hi(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(et(i,o))}i++}));for(var r=n.length-1;r>=0;r--)mo(e.doc,t,n[r],et(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ds&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){ws(e),mr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Yo(t),r=n!=Ds&&Yo(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Es,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fr(t,e.options.lineNumbers),mr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?si(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Wi(e)}),!0),n("scrollbarStyle","native",(function(e){$i(e),Wi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fr(e.options.gutters,t),mr(e)}),!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",(function(e){return e}),mr,!0),n("showCursorWhenSelecting",!1,gi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(_i(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,_s),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gi,!0),n("singleCursorHeightPerLine",!0,gi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Lr,!0),n("addModeClass",!1,Lr,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Lr,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ss),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&er(this,t[e])(this,n,r),pe(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"](Yo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:tr((function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");(function(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)})(this.state.overlays,{mode:i,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,hi(this)})),removeOverlay:tr((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void hi(this)}})),indentLine:tr((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ts(this,e,t,n)})),indentSelection:tr((function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(Ts(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&Li(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l<n;++l)Ts(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[i].from().ch>0&&Yr(this.doc,i,new Cr(o,u[i].to()),j)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,n=dt(this,Ve(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]<o)){t=n[2*s+2];break}i=s+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!n.hasOwnProperty(t))return i;var r=n[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&i.push(r[o[t]]);else if(o[t])for(var s=0;s<o[t].length;s++){var a=r[o[t][s]];a&&i.push(a)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var u=r._global[l];u.pred(o,this)&&-1==R(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(e,t){var n=this.doc;return ft(this,(e=st(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Gn(this,null==e?n.head:"object"==typeof e?at(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Vn(this,at(this.doc,e),t||"page")},coordsChar:function(e,t){return Yn(this,(e=Un(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Un(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var i,r=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,r=!0),i=Ve(this.doc,e)}else i=e;return $n(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-qt(i):0)},defaultTextHeight:function(){return ii(this.display)},defaultCharWidth:function(){return ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o,s,a,l=this.display,u=(e=Gn(this,at(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)u=e.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==r?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?c=0:"middle"==r&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,s={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=Ti(o,s)).scrollTop&&Bi(o,a.scrollTop),null!=a.scrollLeft&&zi(o,a.scrollLeft))},triggerOnKeyDown:tr(cs),triggerOnKeyPress:tr(ds),triggerOnKeyUp:hs,triggerOnMouseDown:tr(gs),execCommand:function(e){if(ts.hasOwnProperty(e))return ts[e].call(null,this)},triggerElectric:tr((function(e){Os(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=at(this.doc,e),s=0;s<t&&!(o=Ps(this.doc,o,r,n,i)).hitSide;++s);return o},moveH:tr((function(e,t){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Ps(n.doc,i.head,e,t,n.options.rtlMoveVisually):e<0?i.from():i.to()}),$)})),deleteH:tr((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Zo(this,(function(n){var r=Ps(i,n.head,e,t,!1);return e<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1,o=i;t<0&&(r=-1,t=-t);for(var s=at(this.doc,e),a=0;a<t;++a){var l=Gn(this,s,"div");if(null==o?o=l.left:l.left=o,(s=Hs(this,l,r,n)).hitSide)break}return s},moveV:tr((function(e,t){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(s){if(o)return e<0?s.from():s.to();var a=Gn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),r.push(a.left);var l=Hs(n,a,e,t);return"page"==t&&s==i.sel.primary()&&Fi(n,Vn(n,l,"div").top-a.top),l}),$),r.length)for(var s=0;s<i.sel.ranges.length;s++)i.sel.ranges[s].goalColumn=r[s]})),findWordAt:function(e){var t=Ve(this.doc,e.line).text,n=e.ch,i=e.ch;if(t){var r=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!n?++i:--n;for(var o=t.charAt(n),s=ee(o,r)?function(e){return ee(e,r)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&s(t.charAt(n-1));)--n;for(;i<t.length&&s(t.charAt(i));)++i}return new Cr(et(e.line,n),et(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:tr((function(e,t){Mi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-En(this)-this.display.barHeight,width:e.scrollWidth-En(this)-this.display.barWidth,clientHeight:An(this),clientWidth:Sn(this)}},scrollIntoView:tr((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(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?function(e,t){Ni(e),e.curOp.scrollToPos=t}(this,e):Oi(this,e.from,e.to,e.margin)})),setSize:tr((function(e,t){var n=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&Hn(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){di(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return Ji(this,e)},startOperation:function(){return Vi(this)},endOperation:function(){return Gi(this)},refresh:tr((function(){var e=this.display.cachedTextHeight;hi(this),this.curOp.forceUpdate=!0,Rn(this),Mi(this,this.doc.scrollLeft,this.doc.scrollTop),ur(this.display),(null==e||Math.abs(e-ii(this.display))>.5||this.options.lineWrapping)&&li(this),pe(this,"refresh",this)})),swapDoc:tr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Br(this,e),Rn(this),this.display.input.reset(),Mi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(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}},ye(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}(Ss);var Vs="iter insert remove copy getEditor constructor".split(" ");for(var Gs in Lo.prototype)Lo.prototype.hasOwnProperty(Gs)&&R(Vs,Gs)<0&&(Ss.prototype[Gs]=function(e){return function(){return e.apply(this.doc,arguments)}}(Lo.prototype[Gs]));return ye(Lo),Ss.inputStyles={textarea:Us,contenteditable:Rs},Ss.defineMode=function(e){Ss.defaults.mode||"null"==e||(Ss.defaults.mode=e),ze.apply(this,arguments)},Ss.defineMIME=function(e,t){Ie[e]=t},Ss.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ss.defineMIME("text/plain","null"),Ss.defineExtension=function(e,t){Ss.prototype[e]=t},Ss.defineDocExtension=function(e,t){Lo.prototype[e]=t},Ss.fromTextArea=function(e,t){if((t=t?z(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=M();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=a.getValue()}var r;if(e.form&&(he(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var a=Ss((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=fe,e.on=he,e.wheelEventPixels=xr,e.Doc=Lo,e.splitLines=Le,e.countColumn=P,e.findColumn=U,e.isWordChar=J,e.Pass=W,e.signal=pe,e.Line=Vt,e.changeEnd=Er,e.scrollbarModel=qi,e.Pos=et,e.cmpPos=tt,e.modes=Be,e.mimeModes=Ie,e.resolveMode=Pe,e.getMode=He,e.modeExtensions=Re,e.extendMode=We,e.copyState=je,e.startState=$e,e.innerMode=qe,e.commands=ts,e.keyMap=qo,e.keyName=Xo,e.isModifierKey=Go,e.lookupKey=Vo,e.normalizeKeyMap=Uo,e.StringStream=Ue,e.SharedTextMarker=So,e.TextMarker=_o,e.LineWidget=Do,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=De,e.addClass=N,e.contains=L,e.rmClass=E,e.keyNames=Ho}(Ss),Ss.version="5.62.2",Ss}()},425:(e,t,n)=>{!function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",(function(n,i){var r=0;var o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var s=1+e.pos-o;return n.code?s===r&&(n.code=!1):(r=s,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,!1!==i.gitHubSpice)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},s={taskLists:!0,strikethrough:!0,emoji:!0};for(var a in i)s[a]=i[a];return s.name="markdown",e.overlayMode(e.getMode(n,s),o)}),"markdown"),e.defineMIME("text/x-gfm","gfm")}(n(631),n(47),n(146))},47:(e,t,n)=>{!function(e){"use strict";e.defineMode("markdown",(function(t,n){var i=e.getMode(t,"text/html"),r="null"==i.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in o)o.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(o[s]=n.tokenTypeOverrides[s]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,c=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==x){var n=r;if(!n){var o=e.innerMode(i,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=k,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(i,r){var s,d=i.column()===r.indentation,m=!(s=r.prevLine.stream)||!/\S/.test(s.string),v=r.indentedCode,y=r.prevLine.hr,b=!1!==r.list,x=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var C=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,b)){for(r.list=null;C<r.listStack[r.listStack.length-1];)r.listStack.pop(),r.listStack.length?r.indentation=r.listStack[r.listStack.length-1]:r.list=!1;!1!==r.list&&(r.indentationDiff=C-r.listStack[r.listStack.length-1])}var k=!(m||y||r.prevLine.header||b&&v||r.prevLine.fencedCodeEnd),_=(!1===r.list||y||m)&&r.indentation<=x&&i.match(a),E=null;if(r.indentationDiff>=4&&(v||r.prevLine.fencedCodeEnd||r.prevLine.header||m))return i.skipToEnd(),r.indentedCode=!0,o.code;if(i.eatSpace())return null;if(d&&r.indentation<=x&&(E=i.match(c))&&E[1].length<=6)return r.quote=0,r.header=E[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,D(r);if(r.indentation<=x&&i.eat(">"))return r.quote=d?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),i.eatSpace(),D(r);if(!_&&!r.setext&&d&&r.indentation<=x&&(E=i.match(l))){var S=E[1]?"ol":"ul";return r.indentation=C+i.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&i.match(u,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+S]),D(r)}return d&&r.indentation<=x&&(E=i.match(f,!0))?(r.quote=0,r.fencedEndRE=new RegExp(E[1]+"+ *$"),r.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}(E[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=w,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,D(r)):r.setext||!(k&&b||r.quote||!1!==r.list||r.code||_||p.test(i.string))&&(E=i.lookAhead(1))&&(E=E.match(h))?(r.setext?(r.header=r.setext,r.setext=0,i.skipToEnd(),n.highlightFormatting&&(r.formatting="header")):(r.header="="==E[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,D(r)):_?(i.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):"["===i.peek()?g(i,r,A):g(i,r,r.inline)}function x(t,n){var o=i.token(t,n.htmlState);if(!r){var s=e.innerMode(i,n.htmlState);("xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=k,n.block=b,n.htmlState=null)}return o}function w(e,t){var i,r=t.listStack[t.listStack.length-1]||0,s=t.indentation<r,a=r+3;return t.fencedEndRE&&t.indentation<=a&&(s||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),s||(i=D(t)),t.localMode=t.localState=null,t.block=b,t.f=k,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,s?v(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function D(e){var t=[];if(e.formatting){t.push(o.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(o.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(o.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function C(e,t){if(e.match(d,!0))return D(t)}function k(t,r){var s=r.text(t,r);if(void 0!==s)return s;if(r.list)return r.list=null,D(r);if(r.taskList)return" "===t.match(u,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,D(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),D(r);var a=t.next();if(r.linkTitle){r.linkTitle=!1;var l=a;"("===a&&(l=")");var c="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(c),!0))return o.linkHref}if("`"===a){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var f=D(r);return r.code=0,f}return r.formatting=h,D(r)}return r.code=d,D(r)}if(r.code)return D(r);if("\\"===a&&(t.next(),n.highlightFormatting)){var p=D(r),g=o.formatting+"-escape";return p?p+" "+g:g}if("!"===a&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),D(r);if("["===a&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),D(r);if("]"===a&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");p=D(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=E,p}if("["===a&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),D(r);if("]"===a&&r.linkText){n.highlightFormatting&&(r.formatting="link");p=D(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?E:k,p}if("<"===a&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=_,n.highlightFormatting&&(r.formatting="link"),(p=D(r))?p+=" ":p="",p+o.linkInline;if("<"===a&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=_,n.highlightFormatting&&(r.formatting="link"),(p=D(r))?p+=" ":p="",p+o.linkEmail;if(n.xml&&"<"===a&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var b=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),v(t,r,x)}if(n.xml&&"<"===a&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===a||"_"===a){for(var w=1,C=1==t.pos?" ":t.string.charAt(t.pos-2);w<3&&t.eat(a);)w++;var S=t.peek()||" ",A=!/\s/.test(S)&&(!m.test(S)||/\s/.test(C)||m.test(C)),T=!/\s/.test(C)&&(!m.test(C)||/\s/.test(S)||m.test(S)),F=null,L=null;if(w%2&&(r.em||!A||"*"!==a&&T&&!m.test(C)?r.em!=a||!T||"*"!==a&&A&&!m.test(S)||(F=!1):F=!0),w>1&&(r.strong||!A||"*"!==a&&T&&!m.test(C)?r.strong!=a||!T||"*"!==a&&A&&!m.test(S)||(L=!1):L=!0),null!=L||null!=F)return n.highlightFormatting&&(r.formatting=null==F?"strong":null==L?"em":"strong em"),!0===F&&(r.em=a),!0===L&&(r.strong=a),f=D(r),!1===F&&(r.em=!1),!1===L&&(r.strong=!1),f}else if(" "===a&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return D(r);t.backUp(1)}if(n.strikethrough)if("~"===a&&t.eatWhile(a)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),f=D(r),r.strikethrough=!1,f;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),D(r)}else if(" "===a&&t.match("~~",!0)){if(" "===t.peek())return D(r);t.backUp(2)}if(n.emoji&&":"===a&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var M=D(r);return r.emoji=!1,M}return" "===a&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),D(r)}function _(e,t){if(">"===e.next()){t.f=t.inline=k,n.highlightFormatting&&(t.formatting="link");var i=D(t);return i?i+=" ":i="",i+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function E(e,t){if(e.eatSpace())return null;var i,r=e.next();return"("===r||"["===r?(t.f=t.inline=(i="("===r?")":"]",function(e,t){if(e.next()===i){t.f=t.inline=k,n.highlightFormatting&&(t.formatting="link-string");var r=D(t);return t.linkHref=!1,r}return e.match(S[i]),t.linkHref=!0,D(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,D(t)):"error"}var S={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=T,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,D(t)):g(e,t,k)}function T(e,t){if(e.match("]:",!0)){t.f=t.inline=F,n.highlightFormatting&&(t.formatting="link");var i=D(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function F(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=k,o.linkHref+" url")}var L={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:k,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=x)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==x?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:L}},indent:function(t,n,r){return t.block==x&&i.indent?i.indent(t.htmlState,n,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},blankLine:y,getType:D,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(631),n(589),n(539))},539:(e,t,n)=>{!function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.mime==t)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==t)return i}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==t)return i}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.file&&i.file.test(t))return i}var r=t.lastIndexOf("."),o=r>-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==t)return i}}}(n(631))},589:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,r){var o,s,a=i.indentUnit,l={},u=r.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in r)l[c]=r[c];function h(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(f("atom","]]>")):null:e.match("--")?n(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(p(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n,i,r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=h,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=h,t.state=y,t.tagName=t.tagStart=null;var s=t.tokenize(e,t);return s?s+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=d;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=h;break}n.next()}return e}}function p(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=p(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=h;break}return n.tokenize=p(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function y(e,t,n){return"openTag"==e?(n.tagStart=t.column(),b):"closeTag"==e?x:y}function b(e,t,n){return"word"==e?(n.tagName=t.current(),s="tag",C):l.allowMissingTagName&&"endTag"==e?(s="tag bracket",C(e,0,n)):(s="error",b)}function x(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(s="tag",w):(s="tag error",D)}return l.allowMissingTagName&&"endTag"==e?(s="tag bracket",w(e,0,n)):(s="error",D)}function w(e,t,n){return"endTag"!=e?(s="error",w):(g(n),y)}function D(e,t,n){return s="error",w(e,0,n)}function C(e,t,n){if("word"==e)return s="attribute",k;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(i)?v(n,i):(v(n,i),n.context=new m(n,i,r==n.indented)),y}return s="error",C}function k(e,t,n){return"equals"==e?_:(l.allowMissing||(s="error"),C(e,0,n))}function _(e,t,n){return"string"==e?E:"word"==e&&l.allowUnquoted?(s="string",C):(s="error",C(e,0,n))}function E(e,t,n){return"string"==e?E:C(e,0,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:y,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(s=null,t.state=t.state(o||n,e,t),s&&(n="error"==s?n+" error":s)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var s=l.contextGrabbers[r.tagName];if(!s||!s.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==_&&(e.state=C)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(631))},912:(e,t,n)=>{var i=n(631);i.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections()[0].head;if(!1!==e.getStateAfter(t.line).list)e.execCommand("indentMore");else if(e.options.indentWithTabs)e.execCommand("insertTab");else{var n=Array(e.options.tabSize+1).join(" ");e.replaceSelection(n)}},i.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections()[0].head;if(!1!==e.getStateAfter(t.line).list)e.execCommand("indentLess");else if(e.options.indentWithTabs)e.execCommand("insertTab");else{var n=Array(e.options.tabSize+1).join(" ");e.replaceSelection(n)}}},442:(e,t,n)=>{"use strict";var i=n(631);n(350),n(912),n(960),n(47),n(146),n(386),n(994),n(20),n(95),n(425),n(589);var r=n(354),o=n(84),s=/Mac/.test(navigator.platform),a=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),l={toggleBold:D,toggleItalic:C,drawLink:B,toggleHeadingSmaller:S,toggleHeadingBigger:A,drawImage:I,toggleBlockquote:E,toggleOrderedList:N,toggleUnorderedList:M,toggleCodeBlock:_,togglePreview:$,toggleStrikethrough:k,toggleHeading1:T,toggleHeading2:F,toggleHeading3:L,cleanBlock:O,drawTable:H,drawHorizontalRule:R,undo:W,redo:j,toggleSideBySide:q,toggleFullScreen:w},u={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},c=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.substr(0,4)))&&(t=!0),t};function h(e){return s?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}var d={};function f(e){return d[e]||(d[e]=new RegExp("\\s*"+e+"(\\s*)","g"))}function p(e,t){if(e&&t){var n=f(t);e.className.match(n)||(e.className+=" "+t)}}function m(e,t){if(e&&t){var n=f(t);e.className.match(n)&&(e.className=e.className.replace(n,"$1"))}}function g(e,t,n,i){var r=v(e,!1,t,n,"button",i);r.className+=" easymde-dropdown";var o=document.createElement("div");o.className="easymde-dropdown-content";for(var s=0;s<e.children.length;s++){var a,l=e.children[s];a=v("string"==typeof l&&l in J?J[l]:l,!0,t,n,"button",i),o.appendChild(a)}return r.appendChild(o),r}function v(e,t,n,i,r,o){e=e||{};var a=document.createElement(r);a.className=e.name,a.setAttribute("type",r),n=null==n||n,e.name&&e.name in i&&(l[e.name]=e.action),e.title&&n&&(a.title=function(e,t,n){var i,r=e;return t&&n[i=function(e){for(var t in l)if(l[t]===e)return t;return null}(t)]&&(r+=" ("+h(n[i])+")"),r}(e.title,e.action,i),s&&(a.title=a.title.replace("Ctrl","⌘"),a.title=a.title.replace("Alt","⌥"))),e.noDisable&&a.classList.add("no-disable"),e.noMobile&&a.classList.add("no-mobile");var u=[];void 0!==e.className&&(u=e.className.split(" "));for(var c=[],d=0;d<u.length;d++){var f=u[d];f.match(/^fa([srlb]|(-[\w-]*)|$)/)?c.push(f):a.classList.add(f)}a.tabIndex=-1;for(var p=document.createElement("i"),m=0;m<c.length;m++){var g=c[m];p.classList.add(g)}return a.appendChild(p),void 0!==e.icon&&(a.innerHTML=e.icon),e.action&&t&&("function"==typeof e.action?a.onclick=function(t){t.preventDefault(),e.action(o)}:"string"==typeof e.action&&(a.onclick=function(t){t.preventDefault(),window.open(e.action,"_blank")})),a}function y(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function b(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var i,r,o=n.type.split(" "),s={},a=0;a<o.length;a++)"strong"===(i=o[a])?s.bold=!0:"variable-2"===i?(r=e.getLine(t.line),/^\s*\d+\.\s/.test(r)?s["ordered-list"]=!0:s["unordered-list"]=!0):"atom"===i?s.quote=!0:"em"===i?s.italic=!0:"quote"===i?s.quote=!0:"strikethrough"===i?s.strikethrough=!0:"comment"===i?s.code=!0:"link"===i?s.link=!0:"tag"===i?s.image=!0:i.match(/^header(-[1-6])?$/)&&(s[i.replace("header","heading")]=!0);return s}var x="";function w(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(x=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=x;var n=t.getWrapperElement(),i=n.nextSibling;if(/editor-preview-active-side/.test(i.className))if(!1===e.options.sideBySideFullscreen){var r=n.parentNode;t.getOption("fullScreen")?m(r,"sided--no-fullscreen"):p(r,"sided--no-fullscreen")}else q(e);if(e.options.onToggleFullScreen&&e.options.onToggleFullScreen(t.getOption("fullScreen")||!1),void 0!==e.options.maxHeight&&(t.getOption("fullScreen")?(t.getScrollerElement().style.removeProperty("height"),i.style.removeProperty("height")):(t.getScrollerElement().style.height=e.options.maxHeight,e.setPreviewMaxHeight())),/fullscreen/.test(e.toolbar_div.className)?e.toolbar_div.className=e.toolbar_div.className.replace(/\s*fullscreen\b/,""):e.toolbar_div.className+=" fullscreen",e.toolbarElements&&e.toolbarElements.fullscreen){var o=e.toolbarElements.fullscreen;/active/.test(o.className)?o.className=o.className.replace(/\s*active\s*/g,""):o.className+=" active"}}function D(e){K(e,"bold",e.options.blockStyles.bold)}function C(e){K(e,"italic",e.options.blockStyles.italic)}function k(e){K(e,"strikethrough","~~")}function _(e){var t=e.options.blockStyles.code;function n(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function i(e){return e.state.base.base||e.state.base}function r(e,t,r,o,s){r=r||e.getLineHandle(t),o=o||e.getTokenAt({line:t,ch:1}),s=s||!!r.text&&e.getTokenAt({line:t,ch:r.text.length-1});var a=o.type?o.type.split(" "):[];return s&&i(s).indentedCode?"indented":-1!==a.indexOf("comment")&&(i(o).fencedChars||i(s).fencedChars||n(r)?"fenced":"single")}var o,s,a,l=e.codemirror,u=l.getCursor("start"),c=l.getCursor("end"),h=l.getTokenAt({line:u.line,ch:u.ch||1}),d=l.getLineHandle(u.line),f=r(l,u.line,d,h);if("single"===f){var p=d.text.slice(0,u.ch).replace("`",""),m=d.text.slice(u.ch).replace("`","");l.replaceRange(p+m,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),u.ch--,u!==c&&c.ch--,l.setSelection(u,c),l.focus()}else if("fenced"===f)if(u.line!==c.line||u.ch!==c.ch){for(o=u.line;o>=0&&!n(d=l.getLineHandle(o));o--);var g,v,y,b,x=i(l.getTokenAt({line:o,ch:1})).fencedChars;n(l.getLineHandle(u.line))?(g="",v=u.line):n(l.getLineHandle(u.line-1))?(g="",v=u.line-1):(g=x+"\n",v=u.line),n(l.getLineHandle(c.line))?(y="",b=c.line,0===c.ch&&(b+=1)):0!==c.ch&&n(l.getLineHandle(c.line+1))?(y="",b=c.line+1):(y=x+"\n",b=c.line+1),0===c.ch&&(b-=1),l.operation((function(){l.replaceRange(y,{line:b,ch:0},{line:b+(y?0:1),ch:0}),l.replaceRange(g,{line:v,ch:0},{line:v+(g?0:1),ch:0})})),l.setSelection({line:v+(g?1:0),ch:0},{line:b+(g?1:-1),ch:0}),l.focus()}else{var w=u.line;if(n(l.getLineHandle(u.line))&&("fenced"===r(l,u.line+1)?(o=u.line,w=u.line+1):(s=u.line,w=u.line-1)),void 0===o)for(o=w;o>=0&&!n(d=l.getLineHandle(o));o--);if(void 0===s)for(a=l.lineCount(),s=w;s<a&&!n(d=l.getLineHandle(s));s++);l.operation((function(){l.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),l.replaceRange("",{line:s-1,ch:0},{line:s,ch:0})})),l.focus()}else if("indented"===f){if(u.line!==c.line||u.ch!==c.ch)o=u.line,s=c.line,0===c.ch&&s--;else{for(o=u.line;o>=0;o--)if(!(d=l.getLineHandle(o)).text.match(/^\s*$/)&&"indented"!==r(l,o,d)){o+=1;break}for(a=l.lineCount(),s=u.line;s<a;s++)if(!(d=l.getLineHandle(s)).text.match(/^\s*$/)&&"indented"!==r(l,s,d)){s-=1;break}}var D=l.getLineHandle(s+1),C=D&&l.getTokenAt({line:s+1,ch:D.text.length-1});C&&i(C).indentedCode&&l.replaceRange("\n",{line:s+1,ch:0});for(var k=o;k<=s;k++)l.indentLine(k,"subtract");l.focus()}else{var _=u.line===c.line&&u.ch===c.ch&&0===u.ch,E=u.line!==c.line;_||E?function(e,t,n,i){var r=t.line+1,o=n.line+1,s=t.line!==n.line,a=i+"\n",l="\n"+i;s&&o++,s&&0===n.ch&&(l=i+"\n",o--),U(e,!1,[a,l]),e.setSelection({line:r,ch:0},{line:o,ch:0})}(l,u,c,t):U(l,!1,["`","`"])}}function E(e){G(e.codemirror,"quote")}function S(e){V(e.codemirror,"smaller")}function A(e){V(e.codemirror,"bigger")}function T(e){V(e.codemirror,void 0,1)}function F(e){V(e.codemirror,void 0,2)}function L(e){V(e.codemirror,void 0,3)}function M(e){G(e.codemirror,"unordered-list")}function N(e){G(e.codemirror,"ordered-list")}function O(e){!function(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),i=e.getCursor("end"),r=n.line;r<=i.line;r++)t=(t=e.getLine(r)).replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:r,ch:0},{line:r,ch:99999999999999})}(e.codemirror)}function B(e){var t=e.codemirror,n=b(t),i=e.options,r="https://";if(i.promptURLs&&!(r=prompt(i.promptTexts.link,"https://")))return!1;U(t,n.link,i.insertTexts.link,r)}function I(e){var t=e.codemirror,n=b(t),i=e.options,r="https://";if(i.promptURLs&&!(r=prompt(i.promptTexts.image,"https://")))return!1;U(t,n.image,i.insertTexts.image,r)}function z(e){e.openBrowseFileWindow()}function P(e,t){var n=e.codemirror,i=b(n),r=e.options,o=t.substr(t.lastIndexOf("/")+1),s=o.substring(o.lastIndexOf(".")+1).replace(/\?.*$/,"");if(["png","jpg","jpeg","gif","svg"].includes(s))U(n,i.image,r.insertTexts.uploadedImage,t);else{var a=r.insertTexts.link;a[0]="["+o,U(n,i.link,a,t)}e.updateStatusBar("upload-image",e.options.imageTexts.sbOnUploaded.replace("#image_name#",o)),setTimeout((function(){e.updateStatusBar("upload-image",e.options.imageTexts.sbInit)}),1e3)}function H(e){var t=e.codemirror,n=b(t),i=e.options;U(t,n.table,i.insertTexts.table)}function R(e){var t=e.codemirror,n=b(t),i=e.options;U(t,n.image,i.insertTexts.horizontalRule)}function W(e){var t=e.codemirror;t.undo(),t.focus()}function j(e){var t=e.codemirror;t.redo(),t.focus()}function q(e){var t=e.codemirror,n=t.getWrapperElement(),i=n.nextSibling,r=e.toolbarElements&&e.toolbarElements["side-by-side"],o=!1,s=n.parentNode;/editor-preview-active-side/.test(i.className)?(!1===e.options.sideBySideFullscreen&&m(s,"sided--no-fullscreen"),i.className=i.className.replace(/\s*editor-preview-active-side\s*/g,""),r&&(r.className=r.className.replace(/\s*active\s*/g,"")),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout((function(){t.getOption("fullScreen")||(!1===e.options.sideBySideFullscreen?p(s,"sided--no-fullscreen"):w(e)),i.className+=" editor-preview-active-side"}),1),r&&(r.className+=" active"),n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,u=e.toolbar_div;l.className=l.className.replace(/\s*active\s*/g,""),u.className=u.className.replace(/\s*disabled-for-preview*/g,"")}if(t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){var t=e.options.previewRender(e.value(),i);null!=t&&(i.innerHTML=t)}),o){var c=e.options.previewRender(e.value(),i);null!=c&&(i.innerHTML=c),t.on("update",t.sideBySideRenderingFunction)}else t.off("update",t.sideBySideRenderingFunction);t.refresh()}function $(e){var t=e.codemirror,n=t.getWrapperElement(),i=e.toolbar_div,r=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild,s=t.getWrapperElement().nextSibling;if(/editor-preview-active-side/.test(s.className)&&q(e),!o||!/editor-preview-full/.test(o.className)){if((o=document.createElement("div")).className="editor-preview-full",e.options.previewClass)if(Array.isArray(e.options.previewClass))for(var a=0;a<e.options.previewClass.length;a++)o.className+=" "+e.options.previewClass[a];else"string"==typeof e.options.previewClass&&(o.className+=" "+e.options.previewClass);n.appendChild(o)}/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),r&&(r.className=r.className.replace(/\s*active\s*/g,""),i.className=i.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout((function(){o.className+=" editor-preview-active"}),1),r&&(r.className+=" active",i.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o)}function U(e,t,n,i){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var r,o=n[0],s=n[1],a={},l={};Object.assign(a,e.getCursor("start")),Object.assign(l,e.getCursor("end")),i&&(o=o.replace("#url#",i),s=s.replace("#url#",i)),t?(o=(r=e.getLine(a.line)).slice(0,a.ch),s=r.slice(a.ch),e.replaceRange(o+s,{line:a.line,ch:0})):(r=e.getSelection(),e.replaceSelection(o+r+s),a.ch+=o.length,a!==l&&(l.ch+=o.length)),e.setSelection(a,l),e.focus()}}function V(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var i=e.getCursor("start"),r=e.getCursor("end"),o=i.line;o<=r.line;o++)!function(i){var r=e.getLine(i),o=r.search(/[^#]/);r=void 0!==t?o<=0?"bigger"==t?"###### "+r:"# "+r:6==o&&"smaller"==t?r.substr(7):1==o&&"bigger"==t?r.substr(2):"bigger"==t?r.substr(1):"#"+r:1==n?o<=0?"# "+r:o==n?r.substr(o+1):"# "+r.substr(o+1):2==n?o<=0?"## "+r:o==n?r.substr(o+1):"## "+r.substr(o+1):o<=0?"### "+r:o==n?r.substr(o+1):"### "+r.substr(o+1),e.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}(o);e.focus()}}function G(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,i=/^\s*/,r=b(e),o=e.getCursor("start"),s=e.getCursor("end"),a={quote:/^(\s*)>\s+/,"unordered-list":n,"ordered-list":n},l=function(e,t,r){var o=n.exec(t),s=function(e,t){return{quote:">","unordered-list":"*","ordered-list":"%%i."}[e].replace("%%i",t)}(e,u);return null!==o?(function(e,t){var n=new RegExp({quote:">","unordered-list":"*","ordered-list":"\\d+."}[e]);return t&&n.test(t)}(e,o[2])&&(s=""),t=o[1]+s+o[3]+t.replace(i,"").replace(a[e],"$1")):0==r&&(t=s+" "+t),t},u=1,c=o.line;c<=s.line;c++)!function(n){var i=e.getLine(n);r[t]?i=i.replace(a[t],"$1"):("unordered-list"==t&&(i=l("ordered-list",i,!0)),i=l(t,i,!1),u+=1),e.replaceRange(i,{line:n,ch:0},{line:n,ch:99999999999999})}(c);e.focus()}}function K(e,t,n,i){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){i=void 0===i?n:i;var r,o=e.codemirror,s=b(o),a=n,l=i,u=o.getCursor("start"),c=o.getCursor("end");s[t]?(a=(r=o.getLine(u.line)).slice(0,u.ch),l=r.slice(u.ch),"bold"==t?(a=a.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),l=l.replace(/(\*\*|__)/,"")):"italic"==t?(a=a.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),l=l.replace(/(\*|_)/,"")):"strikethrough"==t&&(a=a.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),l=l.replace(/(\*\*|~~)/,"")),o.replaceRange(a+l,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==c&&(c.ch-=2)):"italic"==t&&(u.ch-=1,u!==c&&(c.ch-=1))):(r=o.getSelection(),"bold"==t?r=(r=r.split("**").join("")).split("__").join(""):"italic"==t?r=(r=r.split("*").join("")).split("_").join(""):"strikethrough"==t&&(r=r.split("~~").join("")),o.replaceSelection(a+r+l),u.ch+=n.length,c.ch=u.ch+r.length),o.setSelection(u,c),o.focus()}}function X(e,t){if(Math.abs(e)<1024)return""+e+t[0];var n=0;do{e/=1024,++n}while(Math.abs(e)>=1024&&n<t.length);return""+e.toFixed(1)+t[n]}function Y(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=Y(e[n]||{},t[n]):e[n]=t[n]);return e}function Z(e){for(var t=1;t<arguments.length;t++)e=Y(e,arguments[t]);return e}function Q(e){var t=e.match(/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),n=0;if(null===t)return n;for(var i=0;i<t.length;i++)t[i].charCodeAt(0)>=19968?n+=t[i].length:n+=1;return n}var J={bold:{name:"bold",action:D,className:"fa fa-bold",title:"Bold",default:!0},italic:{name:"italic",action:C,className:"fa fa-italic",title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:k,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:S,className:"fa fa-header fa-heading",title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:S,className:"fa fa-header fa-heading header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:A,className:"fa fa-header fa-heading header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:T,className:"fa fa-header fa-heading header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:F,className:"fa fa-header fa-heading header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:L,className:"fa fa-header fa-heading header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:_,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:E,className:"fa fa-quote-left",title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:M,className:"fa fa-list-ul",title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:N,className:"fa fa-list-ol",title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:O,className:"fa fa-eraser",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:B,className:"fa fa-link",title:"Create Link",default:!0},image:{name:"image",action:I,className:"fa fa-image",title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:z,className:"fa fa-image",title:"Import an image"},table:{name:"table",action:H,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:R,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:$,className:"fa fa-eye",noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:q,className:"fa fa-columns",noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:w,className:"fa fa-arrows-alt",noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:"fa fa-question-circle",noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:W,className:"fa fa-undo",noDisable:!0,title:"Undo"},redo:{name:"redo",action:j,className:"fa fa-repeat fa-redo",noDisable:!0,title:"Redo"}},ee={link:["[","](#url#)"],image:[""],uploadedImage:["",""],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},te={link:"URL for the link:",image:"URL of the image:"},ne={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},ie={bold:"**",code:"```",italic:"*"},re={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},oe={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:"Image #image_name# is too big (#image_size#).\nMaximum file size is #image_max_size#.",importError:"Something went wrong when uploading the image #image_name#."};function se(e){(e=e||{}).parent=this;var t=!0;if(!1===e.autoDownloadFontAwesome&&(t=!1),!0!==e.autoDownloadFontAwesome)for(var n=document.styleSheets,i=0;i<n.length;i++)n[i].href&&n[i].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var r=document.createElement("link");r.rel="stylesheet",r.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(r)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("EasyMDE: Error. No element was found.");if(void 0===e.toolbar)for(var o in e.toolbar=[],J)Object.prototype.hasOwnProperty.call(J,o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(!0===J[o].default||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o));if(Object.prototype.hasOwnProperty.call(e,"previewClass")||(e.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(e,"status")||(e.status=["autosave","lines","words","cursor"],e.uploadImage&&e.status.unshift("upload-image")),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=Z({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=Z({},ee,e.insertTexts||{}),e.promptTexts=Z({},te,e.promptTexts||{}),e.blockStyles=Z({},ie,e.blockStyles||{}),null!=e.autosave&&(e.autosave.timeFormat=Z({},ne,e.autosave.timeFormat||{})),e.shortcuts=Z({},u,e.shortcuts||{}),e.maxHeight=e.maxHeight||void 0,void 0!==e.maxHeight?e.minHeight=e.maxHeight:e.minHeight=e.minHeight||"300px",e.errorCallback=e.errorCallback||function(e){alert(e)},e.uploadImage=e.uploadImage||!1,e.imageMaxSize=e.imageMaxSize||2097152,e.imageAccept=e.imageAccept||"image/png, image/jpeg",e.imageTexts=Z({},re,e.imageTexts||{}),e.errorMessages=Z({},oe,e.errorMessages||{}),null!=e.autosave&&null!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),e.overlayMode&&void 0===e.overlayMode.combine&&(e.overlayMode.combine=!0),this.options=e,this.render(),!e.initialValue||this.options.autosave&&!0===this.options.autosave.foundSavedValue||this.value(e.initialValue),e.uploadImage){var s=this;this.codemirror.on("dragenter",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbOnDragEnter),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("dragend",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("dragleave",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("dragover",(function(e,t){s.updateStatusBar("upload-image",s.options.imageTexts.sbOnDragEnter),t.stopPropagation(),t.preventDefault()})),this.codemirror.on("drop",(function(t,n){n.stopPropagation(),n.preventDefault(),e.imageUploadFunction?s.uploadImagesUsingCustomFunction(e.imageUploadFunction,n.dataTransfer.files):s.uploadImages(n.dataTransfer.files)})),this.codemirror.on("paste",(function(t,n){e.imageUploadFunction?s.uploadImagesUsingCustomFunction(e.imageUploadFunction,n.clipboardData.files):s.uploadImages(n.clipboardData.files)}))}}function ae(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}se.prototype.uploadImages=function(e,t,n){if(0!==e.length){for(var i=[],r=0;r<e.length;r++)i.push(e[r].name),this.uploadImage(e[r],t,n);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",i.join(", ")))}},se.prototype.uploadImagesUsingCustomFunction=function(e,t){if(0!==t.length){for(var n=[],i=0;i<t.length;i++)n.push(t[i].name),this.uploadImageUsingCustomFunction(e,t[i]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",n.join(", ")))}},se.prototype.updateStatusBar=function(e,t){if(this.gui.statusbar){var n=this.gui.statusbar.getElementsByClassName(e);1===n.length?this.gui.statusbar.getElementsByClassName(e)[0].textContent=t:0===n.length?console.log("EasyMDE: status bar item "+e+" was not found."):console.log("EasyMDE: Several status bar items named "+e+" was found.")}},se.prototype.markdown=function(e){if(o){var t;if(t=this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?this.options.renderingConfig.markedOptions:{},this.options&&this.options.renderingConfig&&!1===this.options.renderingConfig.singleLineBreaks?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&!0===this.options.renderingConfig.codeSyntaxHighlighting){var n=this.options.renderingConfig.hljs||window.hljs;n&&(t.highlight=function(e,t){return t&&n.getLanguage(t)?n.highlight(t,e).value:n.highlightAuto(e).value})}o.setOptions(t);var i=o(e);return this.options.renderingConfig&&"function"==typeof this.options.renderingConfig.sanitizerFunction&&(i=this.options.renderingConfig.sanitizerFunction.call(this,i)),function(e){for(var t=(new DOMParser).parseFromString(e,"text/html"),n=t.getElementsByTagName("li"),i=0;i<n.length;i++)for(var r=n[i],o=0;o<r.children.length;o++){var s=r.children[o];s instanceof HTMLInputElement&&"checkbox"===s.type&&(r.style.marginLeft="-1.5em",r.style.listStyleType="none")}return t.documentElement.innerHTML}(i=function(e){for(var t;null!==(t=a.exec(e));){var n=t[0];if(-1===n.indexOf("target=")){var i=n.replace(/>$/,' target="_blank">');e=e.replace(n,i)}}return e}(i))}},se.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t,n,o=this.options,s=this,a={};for(var u in o.shortcuts)null!==o.shortcuts[u]&&null!==l[u]&&function(e){a[h(o.shortcuts[e])]=function(){var t=l[e];"function"==typeof t?t(s):"string"==typeof t&&window.open(t,"_blank")}}(u);if(a.Enter="newlineAndIndentContinueMarkdownList",a.Tab="tabAndIndentMarkdownList",a["Shift-Tab"]="shiftTabAndUnindentMarkdownList",a.Esc=function(e){e.getOption("fullScreen")&&w(s)},this.documentOnKeyDown=function(e){27==(e=e||window.event).keyCode&&s.codemirror.getOption("fullScreen")&&w(s)},document.addEventListener("keydown",this.documentOnKeyDown,!1),o.overlayMode?(i.defineMode("overlay-mode",(function(e){return i.overlayMode(i.getMode(e,!1!==o.spellChecker?"spell-checker":"gfm"),o.overlayMode.mode,o.overlayMode.combine)})),t="overlay-mode",(n=o.parsingConfig).gitHubSpice=!1):((t=o.parsingConfig).name="gfm",t.gitHubSpice=!1),!1!==o.spellChecker&&(t="spell-checker",(n=o.parsingConfig).name="gfm",n.gitHubSpice=!1,r({codeMirrorInstance:i})),this.codemirror=i.fromTextArea(e,{mode:t,backdrop:n,theme:null!=o.theme?o.theme:"easymde",tabSize:null!=o.tabSize?o.tabSize:2,indentUnit:null!=o.tabSize?o.tabSize:2,indentWithTabs:!1!==o.indentWithTabs,lineNumbers:!0===o.lineNumbers,autofocus:!0===o.autofocus,extraKeys:a,lineWrapping:!1!==o.lineWrapping,allowDropFileTypes:["text/plain"],placeholder:o.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:null!=o.styleSelectedText?o.styleSelectedText:!c(),scrollbarStyle:null!=o.scrollbarStyle?o.scrollbarStyle:"native",configureMouse:function(e,t,n){return{addNew:!1}},inputStyle:null!=o.inputStyle?o.inputStyle:c()?"contenteditable":"textarea",spellcheck:null==o.nativeSpellcheck||o.nativeSpellcheck,autoRefresh:null!=o.autoRefresh&&o.autoRefresh}),this.codemirror.getScrollerElement().style.minHeight=o.minHeight,void 0!==o.maxHeight&&(this.codemirror.getScrollerElement().style.height=o.maxHeight),!0===o.forceSync){var d=this.codemirror;d.on("change",(function(){d.save()}))}this.gui={};var f=document.createElement("div");f.classList.add("EasyMDEContainer");var p=this.codemirror.getWrapperElement();p.parentNode.insertBefore(f,p),f.appendChild(p),!1!==o.toolbar&&(this.gui.toolbar=this.createToolbar()),!1!==o.status&&(this.gui.statusbar=this.createStatusbar()),null!=o.autosave&&!0===o.autosave.enabled&&(this.autosave(),this.codemirror.on("change",(function(){clearTimeout(s._autosave_timeout),s._autosave_timeout=setTimeout((function(){s.autosave()}),s.options.autosave.submit_delay||s.options.autosave.delay||1e3)})));var m=this;this.codemirror.on("update",(function(){o.previewImagesInEditor&&f.querySelectorAll(".cm-image-marker").forEach((function(e){var t=e.parentElement;if(t.innerText.match(/^!\[.*?\]\(.*\)/g)&&!t.hasAttribute("data-img-src")){var n=t.innerText.match("\\((.*)\\)");if(window.EMDEimagesCache||(window.EMDEimagesCache={}),n&&n.length>=2){var i=n[1];if(window.EMDEimagesCache[i])v(t,window.EMDEimagesCache[i]);else{var r=document.createElement("img");r.onload=function(){window.EMDEimagesCache[i]={naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,url:i},v(t,window.EMDEimagesCache[i])},r.src=i}}}}))})),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var g=this.codemirror;setTimeout(function(){g.refresh()}.bind(g),0)}function v(e,t){var n,i;e.setAttribute("data-img-src",t.url),e.setAttribute("style","--bg-image:url("+t.url+");--width:"+t.naturalWidth+"px;--height:"+(n=t.naturalWidth,i=t.naturalHeight,n<window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","")?i+"px":i/n*100+"%")),m.codemirror.setSize()}},se.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)},se.prototype.autosave=function(){if(ae()){var e=this;if(null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("EasyMDE: You must set a uniqueId to use the autosave feature");!0!==this.options.autosave.binded&&(null!=e.element.form&&null!=e.element.form&&e.element.form.addEventListener("submit",(function(){clearTimeout(e.autosaveTimeoutId),e.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+e.options.autosave.uniqueId)})),this.options.autosave.binded=!0),!0!==this.options.autosave.loaded&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var t=e.value();""!==t?localStorage.setItem("smde_"+this.options.autosave.uniqueId,t):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var n=document.getElementById("autosaved");if(null!=n&&null!=n&&""!=n){var i=new Date,r=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(i),o=null==this.options.autosave.text?"Autosaved: ":this.options.autosave.text;n.innerHTML=o+r}}else console.log("EasyMDE: localStorage not available, cannot autosave")},se.prototype.clearAutosavedValue=function(){if(ae()){if(null==this.options.autosave||null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("EasyMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")},se.prototype.openBrowseFileWindow=function(e,t){var n=this,i=this.gui.toolbar.getElementsByClassName("imageInput")[0];i.click(),i.addEventListener("change",(function r(o){n.options.imageUploadFunction?n.uploadImagesUsingCustomFunction(n.options.imageUploadFunction,o.target.files):n.uploadImages(o.target.files,e,t),i.removeEventListener("change",r)}))},se.prototype.uploadImage=function(e,t,n){var i=this;function r(e){i.updateStatusBar("upload-image",e),setTimeout((function(){i.updateStatusBar("upload-image",i.options.imageTexts.sbInit)}),1e4),n&&"function"==typeof n&&n(e),i.options.errorCallback(e)}function o(t){var n=i.options.imageTexts.sizeUnits.split(",");return t.replace("#image_name#",e.name).replace("#image_size#",X(e.size,n)).replace("#image_max_size#",X(i.options.imageMaxSize,n))}if(t=t||function(e){P(i,e)},e.size>this.options.imageMaxSize)r(o(this.options.errorMessages.fileTooLarge));else{var s=new FormData;s.append("image",e),i.options.imageCSRFToken&&s.append("csrfmiddlewaretoken",i.options.imageCSRFToken);var a=new XMLHttpRequest;a.upload.onprogress=function(t){if(t.lengthComputable){var n=""+Math.round(100*t.loaded/t.total);i.updateStatusBar("upload-image",i.options.imageTexts.sbProgress.replace("#file_name#",e.name).replace("#progress#",n))}},a.open("POST",this.options.imageUploadEndpoint),a.onload=function(){try{var e=JSON.parse(this.responseText)}catch(e){return console.error("EasyMDE: The server did not return a valid json."),void r(o(i.options.errorMessages.importError))}200===this.status&&e&&!e.error&&e.data&&e.data.filePath?t((i.options.imagePathAbsolute?"":window.location.origin+"/")+e.data.filePath):e.error&&e.error in i.options.errorMessages?r(o(i.options.errorMessages[e.error])):e.error?r(o(e.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),r(o(i.options.errorMessages.importError)))},a.onerror=function(e){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+e.target.status+" ("+e.target.statusText+")"),r(i.options.errorMessages.importError)},a.send(s)}},se.prototype.uploadImageUsingCustomFunction=function(e,t){var n=this;e.apply(this,[t,function(e){P(n,e)},function(e){var i=function(e){var i=n.options.imageTexts.sizeUnits.split(",");return e.replace("#image_name#",t.name).replace("#image_size#",X(t.size,i)).replace("#image_max_size#",X(n.options.imageMaxSize,i))}(e);n.updateStatusBar("upload-image",i),setTimeout((function(){n.updateStatusBar("upload-image",n.options.imageTexts.sbInit)}),1e4),n.options.errorCallback(i)}])},se.prototype.setPreviewMaxHeight=function(){var e=this.codemirror.getWrapperElement(),t=e.nextSibling,n=parseInt(window.getComputedStyle(e).paddingTop),i=parseInt(window.getComputedStyle(e).borderTopWidth),r=(parseInt(this.options.maxHeight)+2*n+2*i).toString()+"px";t.style.height=r},se.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;if(!n||!/editor-preview-side/.test(n.className)){if((n=document.createElement("div")).className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var i=0;i<this.options.previewClass.length;i++)n.className+=" "+this.options.previewClass[i];else"string"==typeof this.options.previewClass&&(n.className+=" "+this.options.previewClass);t.parentNode.insertBefore(n,t.nextSibling)}if(void 0!==this.options.maxHeight&&this.setPreviewMaxHeight(),!1===this.options.syncSideBySidePreviewScroll)return n;var r=!1,o=!1;return e.on("scroll",(function(e){if(r)r=!1;else{o=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,i=parseFloat(e.getScrollInfo().top)/t,s=(n.scrollHeight-n.clientHeight)*i;n.scrollTop=s}})),n.onscroll=function(){if(o)o=!1;else{r=!0;var t=n.scrollHeight-n.clientHeight,i=parseFloat(n.scrollTop)/t,s=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*i;e.scrollTo(0,s)}},n},se.prototype.createToolbar=function(e){if((e=e||this.options.toolbar)&&0!==e.length){var t;for(t=0;t<e.length;t++)null!=J[e[t]]&&(e[t]=J[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var i=this,r={};for(i.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||!1!==i.options.toolbarGuideIcon)&&!(i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&c())){if("|"===e[t]){for(var o=!1,s=t+1;s<e.length;s++)"|"===e[s]||i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(e[s].name)||(o=!0);if(!o)continue}!function(e){var t;if(t="|"===e?y():e.children?g(e,i.options.toolbarTips,i.options.shortcuts,i):v(e,!0,i.options.toolbarTips,i.options.shortcuts,"button",i),r[e.name||e]=t,n.appendChild(t),"upload-image"===e.name){var o=document.createElement("input");o.className="imageInput",o.type="file",o.multiple=!0,o.name="image",o.accept=i.options.imageAccept,o.style.display="none",o.style.opacity=0,n.appendChild(o)}}(e[t])}i.toolbar_div=n,i.toolbarElements=r;var a=this.codemirror;a.on("cursorActivity",(function(){var e=b(a);for(var t in r)!function(t){var n=r[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)}));var l=a.getWrapperElement();return l.parentNode.insertBefore(n,l),n}},se.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var i,r,o,s,a=[];for(i=0;i<e.length;i++)if(r=void 0,o=void 0,s=void 0,"object"==typeof e[i])a.push({className:e[i].className,defaultValue:e[i].defaultValue,onUpdate:e[i].onUpdate,onActivity:e[i].onActivity});else{var l=e[i];"words"===l?(s=function(e){e.innerHTML=Q(n.getValue())},r=function(e){e.innerHTML=Q(n.getValue())}):"lines"===l?(s=function(e){e.innerHTML=n.lineCount()},r=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(s=function(e){e.innerHTML="0:0"},o=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===l?s=function(e){null!=t.autosave&&!0===t.autosave.enabled&&e.setAttribute("id","autosaved")}:"upload-image"===l&&(s=function(e){e.innerHTML=t.imageTexts.sbInit}),a.push({className:l,defaultValue:s,onUpdate:r,onActivity:o})}var u=document.createElement("div");for(u.className="editor-statusbar",i=0;i<a.length;i++){var c=a[i],h=document.createElement("span");h.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(h),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(h,c)),"function"==typeof c.onActivity&&this.codemirror.on("cursorActivity",function(e,t){return function(){t.onActivity(e)}}(h,c)),u.appendChild(h)}var d=this.codemirror.getWrapperElement();return d.parentNode.insertBefore(u,d.nextSibling),u}},se.prototype.value=function(e){var t=this.codemirror;if(void 0===e)return t.getValue();if(t.getDoc().setValue(e),this.isPreviewActive()){var n=t.getWrapperElement().lastChild;n.innerHTML=this.options.previewRender(e,n)}return this},se.toggleBold=D,se.toggleItalic=C,se.toggleStrikethrough=k,se.toggleBlockquote=E,se.toggleHeadingSmaller=S,se.toggleHeadingBigger=A,se.toggleHeading1=T,se.toggleHeading2=F,se.toggleHeading3=L,se.toggleCodeBlock=_,se.toggleUnorderedList=M,se.toggleOrderedList=N,se.cleanBlock=O,se.drawLink=B,se.drawImage=I,se.drawUploadedImage=z,se.drawTable=H,se.drawHorizontalRule=R,se.undo=W,se.redo=j,se.togglePreview=$,se.toggleSideBySide=q,se.toggleFullScreen=w,se.prototype.toggleBold=function(){D(this)},se.prototype.toggleItalic=function(){C(this)},se.prototype.toggleStrikethrough=function(){k(this)},se.prototype.toggleBlockquote=function(){E(this)},se.prototype.toggleHeadingSmaller=function(){S(this)},se.prototype.toggleHeadingBigger=function(){A(this)},se.prototype.toggleHeading1=function(){T(this)},se.prototype.toggleHeading2=function(){F(this)},se.prototype.toggleHeading3=function(){L(this)},se.prototype.toggleCodeBlock=function(){_(this)},se.prototype.toggleUnorderedList=function(){M(this)},se.prototype.toggleOrderedList=function(){N(this)},se.prototype.cleanBlock=function(){O(this)},se.prototype.drawLink=function(){B(this)},se.prototype.drawImage=function(){I(this)},se.prototype.drawUploadedImage=function(){z(this)},se.prototype.drawTable=function(){H(this)},se.prototype.drawHorizontalRule=function(){R(this)},se.prototype.undo=function(){W(this)},se.prototype.redo=function(){j(this)},se.prototype.togglePreview=function(){$(this)},se.prototype.toggleSideBySide=function(){q(this)},se.prototype.toggleFullScreen=function(){w(this)},se.prototype.isPreviewActive=function(){var e=this.codemirror.getWrapperElement().lastChild;return/editor-preview-active/.test(e.className)},se.prototype.isSideBySideActive=function(){var e=this.codemirror.getWrapperElement().nextSibling;return/editor-preview-active-side/.test(e.className)},se.prototype.isFullscreenActive=function(){return this.codemirror.getOption("fullScreen")},se.prototype.getState=function(){return b(this.codemirror)},se.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.parentNode;n&&(this.gui.toolbar&&n.removeChild(this.gui.toolbar),this.gui.statusbar&&n.removeChild(this.gui.statusbar),this.gui.sideBySide&&n.removeChild(this.gui.sideBySide)),n.parentNode.insertBefore(t,n),n.remove(),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},e.exports=se},84:function(e){e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function n(e,n){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,n){if(e){if("string"==typeof e)return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){i&&(e=i);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(e){i.exports.defaults=e}};var o=/[&<>"']/,s=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return u[e]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(h,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var f=/(^|[^\[])\^/g;var p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var g={},v=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(e,t){g[" "+e]||(v.test(e)?g[" "+e]=e+"/":g[" "+e]=w(e,"/",!0));var n=-1===(e=g[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(b,"$1")+t:e+t}function w(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r<i;){var o=e.charAt(i-r-1);if(o!==t||n){if(o===t||!n)break;r++}else r++}return e.substr(0,i-r)}var D=function(e,t){if(t){if(o.test(e))return e.replace(s,c)}else if(a.test(e))return e.replace(l,c);return e},C=d,k=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(f,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n},_=function(e,t,n){if(e){var i;try{i=decodeURIComponent(d(n)).replace(p,"").toLowerCase()}catch(e){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!m.test(n)&&(n=x(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},E={exec:function(){}},S=function(e){for(var t,n,i=1;i<arguments.length;i++)for(n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},A=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var i=!1,r=t;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},T=w,F=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,r=0;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&--i<0)return r;return-1},L=function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},M=function(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e},N=i.exports.defaults,O=T,B=A,I=D,z=F;function P(e,t,n){var i=t.href,r=t.title?I(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:o}:{type:"image",raw:n,href:i,title:r,text:I(o)}}var H=function(){function e(e){this.options=e||N}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:O(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var i=O(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:B(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=B(n.cells[i],n.header.length);return n}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,i,r,o,s,a,l,u,c,h=t[0],d=t[2],f=d.length>1,p={type:"list",raw:h,ordered:f,start:f?+d.slice(0,-1):"",loose:!1,items:[]},m=t[0].match(this.rules.block.item),g=!1,v=m.length;r=this.rules.block.listItemStart.exec(m[0]);for(var y=0;y<v;y++){if(h=n=m[y],this.options.pedantic||(c=n.match(new RegExp("\\n\\s*\\n {0,"+(r[0].length-1)+"}\\S")))&&(s=n.length-c.index+m.slice(y+1).join("\n").length,p.raw=p.raw.substring(0,p.raw.length-s),h=n=n.substring(0,c.index),v=y+1),y!==v-1){if(o=this.rules.block.listItemStart.exec(m[y+1]),this.options.pedantic?o[1].length>r[1].length:o[1].length>=r[0].length||o[1].length>3){m.splice(y,2,m[y]+(!this.options.pedantic&&o[1].length<r[0].length&&!m[y].match(/\n$/)?"":"\n")+m[y+1]),y--,v--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==d[d.length-1]:f===(1===o[2].length))&&(s=m.slice(y+1).join("\n").length,p.raw=p.raw.substring(0,p.raw.length-s),y=v-1),r=o}i=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(i-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+i+"}","gm"),"")),n=O(n,"\n"),y!==v-1&&(h+="\n"),a=g||/\n\n(?!\s*$)/.test(h),y!==v-1&&(g="\n\n"===h.slice(-2),a||(a=g)),a&&(p.loose=!0),this.options.gfm&&(u=void 0,(l=/^\[[ xX]\] /.test(n))&&(u=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,""))),p.items.push({type:"list_item",raw:h,task:l,checked:u,loose:a,text:n})}return p}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):I(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:B(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=B(n.cells[i].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0]}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}},t.tag=function(e,t,n){var i=this.rules.inline.tag.exec(e);if(i)return!t&&/^<a /i.test(i[0])?t=!0:t&&/^<\/a>/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):I(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var i=O(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=z(t[2],"()");if(r>-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var s=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(s=this.options.pedantic&&!/>$/.test(n)?s.slice(1):s.slice(1,-1)),P(t,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return P(n,i,n[0])}},t.emStrong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(e);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var o,s,a=i[0].length-1,l=a,u=0,c="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+a);null!=(i=c.exec(t));)if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6])if(s=o.length,i[3]||i[4])l+=s;else if(!((i[5]||i[6])&&a%3)||(a+s)%3){if(!((l-=s)>0))return s=Math.min(s,s+l+u),Math.min(a,s)%2?{type:"em",raw:e.slice(0,a+i.index+s+1),text:e.slice(1,a+i.index+s)}:{type:"strong",raw:e.slice(0,a+i.index+s+1),text:e.slice(2,a+i.index+s-1)}}else u+=s}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=I(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=I(this.options.mangle?t(r[1]):r[1])):n=I(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=I(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=I(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):I(r[0]):r[0]:I(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),R=E,W=k,j=S,q={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:R,table:R,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};q.def=W(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}[.)])/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,q.item=W(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.listItemStart=W(/^( *)(bull) */).replace("bull",q.bullet).getRegex(),q.list=W(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",q._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,q.html=W(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=W(q._paragraph).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q._tag).getRegex(),q.blockquote=W(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=j({},q),q.gfm=j({},q.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),q.gfm.nptable=W(q.gfm.nptable).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q._tag).getRegex(),q.gfm.table=W(q.gfm.table).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q._tag).getRegex(),q.pedantic=j({},q.normal,{html:W("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:R,paragraph:W(q.normal._paragraph).replace("hr",q.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:R,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:R,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};$.punctuation=W($.punctuation).replace(/punctuation/g,$._punctuation).getRegex(),$.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,$.escapedEmSt=/\\\*|\\_/g,$._comment=W(q._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),$.emStrong.lDelim=W($.emStrong.lDelim).replace(/punct/g,$._punctuation).getRegex(),$.emStrong.rDelimAst=W($.emStrong.rDelimAst,"g").replace(/punct/g,$._punctuation).getRegex(),$.emStrong.rDelimUnd=W($.emStrong.rDelimUnd,"g").replace(/punct/g,$._punctuation).getRegex(),$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,$._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,$.autolink=W($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex(),$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,$.tag=W($.tag).replace("comment",$._comment).replace("attribute",$._attribute).getRegex(),$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,$.link=W($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex(),$.reflink=W($.reflink).replace("label",$._label).getRegex(),$.reflinkSearch=W($.reflinkSearch,"g").replace("reflink",$.reflink).replace("nolink",$.nolink).getRegex(),$.normal=j({},$),$.pedantic=j({},$.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()}),$.gfm=j({},$.normal,{escape:W($.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),$.gfm.url=W($.gfm.url,"i").replace("email",$.gfm._extended_email).getRegex(),$.breaks=j({},$.gfm,{br:W($.br).replace("{2,}","*").getRegex(),text:W($.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var U={block:q,inline:$},V=H,G=i.exports.defaults,K=U.block,X=U.inline,Y=M;function Z(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Q(e){var t,n,i="",r=e.length;for(t=0;t<r;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var J=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G,this.options.tokenizer=this.options.tokenizer||new V,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:K.normal,inline:X.normal};this.options.pedantic?(t.block=K.pedantic,t.inline=X.pedantic):this.options.gfm&&(t.block=K.gfm,this.options.breaks?t.inline=X.breaks:t.inline=X.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n,i,r,o=t.prototype;return o.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(e,t,n){var i,r,o,s,a,l,u=this;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call(u,e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),i.type&&t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),(s=t[t.length-1])&&"paragraph"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.nptable(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);else if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),o=i.items.length,r=0;r<o;r++)i.items[r].tokens=this.blockTokens(i.items[r].text,[],!1);t.push(i)}else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(n&&(i=this.tokenizer.def(e)))e=e.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(a=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,n=e.slice(1),i=void 0;u.options.extensions.startBlock.forEach((function(e){"number"==typeof(i=e.call(this,n))&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(a=e.substring(0,t+1))}(),n&&(i=this.tokenizer.paragraph(a)))s=t[t.length-1],l&&"paragraph"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i),l=a.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(s=t[t.length-1])&&"text"===s.type?(s.raw+="\n"+i.raw,s.text+="\n"+i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}return t},o.inline=function(e){var t,n,i,r,o,s,a=e.length;for(t=0;t<a;t++)switch((s=e[t]).type){case"paragraph":case"text":case"heading":s.tokens=[],this.inlineTokens(s.text,s.tokens);break;case"table":for(s.tokens={header:[],cells:[]},r=s.header.length,n=0;n<r;n++)s.tokens.header[n]=[],this.inlineTokens(s.header[n],s.tokens.header[n]);for(r=s.cells.length,n=0;n<r;n++)for(o=s.cells[n],s.tokens.cells[n]=[],i=0;i<o.length;i++)s.tokens.cells[n][i]=[],this.inlineTokens(o[i],s.tokens.cells[n][i]);break;case"blockquote":this.inline(s.tokens);break;case"list":for(r=s.items.length,n=0;n<r;n++)this.inline(s.items[n].tokens)}return e},o.inlineTokens=function(e,t,n,i){var r,o,s,a=this;void 0===t&&(t=[]),void 0===n&&(n=!1),void 0===i&&(i=!1);var l,u,c,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+Y("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+Y("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(u||(c=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(r=n.call(a,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)}))))if(r=this.tokenizer.escape(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.tag(e,n,i))e=e.substring(r.raw.length),n=r.inLink,i=r.inRawBlock,(o=t[t.length-1])&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):t.push(r);else if(r=this.tokenizer.link(e))e=e.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,i)),t.push(r);else if(r=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(r.raw.length),o=t[t.length-1],"link"===r.type?(r.tokens=this.inlineTokens(r.text,[],!0,i),t.push(r)):o&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):t.push(r);else if(r=this.tokenizer.emStrong(e,h,c))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),t.push(r);else if(r=this.tokenizer.codespan(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.br(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.del(e))e=e.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),t.push(r);else if(r=this.tokenizer.autolink(e,Q))e=e.substring(r.raw.length),t.push(r);else if(n||!(r=this.tokenizer.url(e,Q))){if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,n=e.slice(1),i=void 0;a.options.extensions.startInline.forEach((function(e){"number"==typeof(i=e.call(this,n))&&i>=0&&(t=Math.min(t,i))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),r=this.tokenizer.inlineText(s,i,Z))e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),u=!0,(o=t[t.length-1])&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):t.push(r);else if(e){var f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}throw new Error(f)}}else e=e.substring(r.raw.length),t.push(r);return t},n=t,r=[{key:"rules",get:function(){return{block:K,inline:X}}}],(i=null)&&e(n.prototype,i),r&&e(n,r),t}(),ee=i.exports.defaults,te=_,ne=D,ie=function(){function e(e){this.options=e||ee}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return e=e.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+ne(i,!0)+'">'+(n?e:ne(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:ne(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+i.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+i+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<a href="'+ne(e)+'"';return t&&(i+=' title="'+t+'"'),i+">"+n+"</a>"},t.image=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<img src="'+e+'" alt="'+n+'"';return t&&(i+=' title="'+t+'"'),i+(this.options.xhtml?"/>":">")},t.text=function(e){return e},e}(),re=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),oe=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{n=e+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),se=ie,ae=re,le=oe,ue=i.exports.defaults,ce=C,he=J,de=function(){function e(e){this.options=e||ue,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ae,this.slugger=new le}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,o,s,a,l,u,c,h,d,f,p,m,g,v,y,b,x,w="",D=e.length;for(n=0;n<D;n++)if(h=e[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type])||!1===(x=this.options.extensions.renderers[h.type].call(this,h))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))switch(h.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ce(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(u="",l="",o=h.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[i]),{header:!0,align:h.align[i]});for(u+=this.renderer.tablerow(l),c="",o=h.cells.length,i=0;i<o;i++){for(l="",s=(a=h.tokens.cells[i]).length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:h.align[r]});c+=this.renderer.tablerow(l)}w+=this.renderer.table(u,c);continue;case"blockquote":c=this.parse(h.tokens),w+=this.renderer.blockquote(c);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,o=h.items.length,c="",i=0;i<o;i++)v=(g=h.items[i]).checked,y=g.task,m="",g.task&&(b=this.renderer.checkbox(v),p?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,p),c+=this.renderer.listitem(m,y,v);w+=this.renderer.list(c,d,f);continue;case"html":w+=this.renderer.html(h.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(c=h.tokens?this.parseInline(h.tokens):h.text;n+1<D&&"text"===e[n+1].type;)c+="\n"+((h=e[++n]).tokens?this.parseInline(h.tokens):h.text);w+=t?this.renderer.paragraph(c):c;continue;default:var C='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(C);throw new Error(C)}else w+=x||"";return w},t.parseInline=function(e,t){t=t||this.renderer;var n,i,r,o="",s=e.length;for(n=0;n<s;n++)if(i=e[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type])||!1===(r=this.options.extensions.renderers[i.type].call(this,i))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))switch(i.type){case"escape":o+=t.text(i.text);break;case"html":o+=t.html(i.text);break;case"link":o+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":o+=t.image(i.href,i.title,i.text);break;case"strong":o+=t.strong(this.parseInline(i.tokens,t));break;case"em":o+=t.em(this.parseInline(i.tokens,t));break;case"codespan":o+=t.codespan(i.text);break;case"br":o+=t.br();break;case"del":o+=t.del(this.parseInline(i.tokens,t));break;case"text":o+=t.text(i.text);break;default:var a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}else o+=r||"";return o},e}(),fe=H,pe=ie,me=re,ge=oe,ve=S,ye=L,be=D,xe=i.exports.getDefaults,we=i.exports.changeDefaults,De=i.exports.defaults;function Ce(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=ve({},Ce.defaults,t||{}),ye(t),n){var i,r=t.highlight;try{i=he.lex(e,t)}catch(e){return n(e)}var o=function(e){var o;if(!e)try{t.walkTokens&&Ce.walkTokens(i,t.walkTokens),o=de.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,o)};if(!r||r.length<3)return o();if(delete t.highlight,!i.length)return o();var s=0;return Ce.walkTokens(i,(function(e){"code"===e.type&&(s++,setTimeout((function(){r(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--s&&o()}))}),0))})),void(0===s&&o())}try{var a=he.lex(e,t);return t.walkTokens&&Ce.walkTokens(a,t.walkTokens),de.parse(a,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+be(e.message+"",!0)+"</pre>";throw e}}return Ce.options=Ce.setOptions=function(e){return ve(Ce.defaults,e),we(Ce.defaults),Ce},Ce.getDefaults=xe,Ce.defaults=De,Ce.use=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r,o=ve.apply(void 0,[{}].concat(n)),s=Ce.defaults.extensions||{renderers:{},childTokens:{}};n.forEach((function(t){if(t.extensions&&(r=!0,t.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=s.renderers?s.renderers[e.name]:null;s.renderers[e.name]=t?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=e.renderer.apply(this,i);return!1===o&&(o=t.apply(this,i)),o}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");s[e.level]?s[e.level].unshift(e.tokenizer):s[e.level]=[e.tokenizer],e.start&&("block"===e.level?s.startBlock?s.startBlock.push(e.start):s.startBlock=[e.start]:"inline"===e.level&&(s.startInline?s.startInline.push(e.start):s.startInline=[e.start]))}e.childTokens&&(s.childTokens[e.name]=e.childTokens)}))),t.renderer&&function(){var e=Ce.defaults.renderer||new pe,n=function(n){var i=e[n];e[n]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.renderer[n].apply(e,o);return!1===a&&(a=i.apply(e,o)),a}};for(var i in t.renderer)n(i);o.renderer=e}(),t.tokenizer&&function(){var e=Ce.defaults.tokenizer||new fe,n=function(n){var i=e[n];e[n]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.tokenizer[n].apply(e,o);return!1===a&&(a=i.apply(e,o)),a}};for(var i in t.tokenizer)n(i);o.tokenizer=e}(),t.walkTokens){var n=Ce.defaults.walkTokens;o.walkTokens=function(i){t.walkTokens.call(e,i),n&&n(i)}}r&&(o.extensions=s),Ce.setOptions(o)}))},Ce.walkTokens=function(e,t){for(var i,r=function(){var e=i.value;switch(t(e),e.type){case"table":for(var r,o=n(e.tokens.header);!(r=o()).done;){var s=r.value;Ce.walkTokens(s,t)}for(var a,l=n(e.tokens.cells);!(a=l()).done;)for(var u,c=n(a.value);!(u=c()).done;){var h=u.value;Ce.walkTokens(h,t)}break;case"list":Ce.walkTokens(e.items,t);break;default:Ce.defaults.extensions&&Ce.defaults.extensions.childTokens&&Ce.defaults.extensions.childTokens[e.type]?Ce.defaults.extensions.childTokens[e.type].forEach((function(n){Ce.walkTokens(e[n],t)})):e.tokens&&Ce.walkTokens(e.tokens,t)}},o=n(e);!(i=o()).done;)r()},Ce.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=ve({},Ce.defaults,t||{}),ye(t);try{var n=he.lexInline(e,t);return t.walkTokens&&Ce.walkTokens(n,t.walkTokens),de.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+be(e.message+"",!0)+"</pre>";throw e}},Ce.Parser=de,Ce.parser=de.parse,Ce.Renderer=pe,Ce.TextRenderer=me,Ce.Lexer=he,Ce.lexer=he.lex,Ce.Tokenizer=fe,Ce.Slugger=ge,Ce.parse=Ce,Ce}()},581:(e,t,n)=>{var i;!function(){"use strict";(i=function(e,t,n,i){i=i||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=i.flags||{},this.memoized={},this.loaded=!1;var r,o,s,a,l,u=this;function c(e,t){var n=u._readFile(e,null,i.asyncLoad);i.asyncLoad?n.then((function(e){t(e)})):t(n)}function h(e){t=e,n&&f()}function d(e){n=e,t&&f()}function f(){for(u.rules=u._parseAFF(t),u.compoundRuleCodes={},o=0,a=u.compoundRules.length;o<a;o++){var e=u.compoundRules[o];for(s=0,l=e.length;s<l;s++)u.compoundRuleCodes[e[s]]=[]}for(o in"ONLYINCOMPOUND"in u.flags&&(u.compoundRuleCodes[u.flags.ONLYINCOMPOUND]=[]),u.dictionaryTable=u._parseDIC(n),u.compoundRuleCodes)0===u.compoundRuleCodes[o].length&&delete u.compoundRuleCodes[o];for(o=0,a=u.compoundRules.length;o<a;o++){var r=u.compoundRules[o],c="";for(s=0,l=r.length;s<l;s++){var h=r[s];h in u.compoundRuleCodes?c+="("+u.compoundRuleCodes[h].join("|")+")":c+=h}u.compoundRules[o]=new RegExp(c,"i")}u.loaded=!0,i.asyncLoad&&i.loadedCallback&&i.loadedCallback(u)}return e&&(u.dictionary=e,t&&n?f():"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(r=i.dictionaryPath?i.dictionaryPath:"typo/dictionaries",t||c(chrome.extension.getURL(r+"/"+e+"/"+e+".aff"),h),n||c(chrome.extension.getURL(r+"/"+e+"/"+e+".dic"),d)):(r=i.dictionaryPath?i.dictionaryPath:"//dictionaries",t||c(r+"/"+e+"/"+e+".aff",h),n||c(r+"/"+e+"/"+e+".dic",d))),this}).prototype={load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);return this},_readFile:function(e,t,i){if(t=t||"utf8","undefined"!=typeof XMLHttpRequest){var r,o=new XMLHttpRequest;return o.open("GET",e,i),i&&(r=new Promise((function(e,t){o.onload=function(){200===o.status?e(o.responseText):t(o.statusText)},o.onerror=function(){t(o.statusText)}}))),o.overrideMimeType&&o.overrideMimeType("text/plain; charset="+t),o.send(null),i?r:o.responseText}var s=n(562);try{if(s.existsSync(e))return s.readFileSync(e,t);console.log("Path "+e+" does not exist.")}catch(e){return console.log(e),""}},_parseAFF:function(e){var t,n,i,r,o,s,a,l={},u=(e=this._removeAffixComments(e)).split(/\r?\n/);for(r=0,s=u.length;r<s;r++){var c=(t=u[r]).split(/\s+/),h=c[0];if("PFX"==h||"SFX"==h){var d=c[1],f=c[2],p=[];for(o=r+1,a=r+1+(n=parseInt(c[3],10));o<a;o++){var m=(i=u[o].split(/\s+/))[2],g=i[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),b=i[4],x={};x.add=v,y.length>0&&(x.continuationClasses=y),"."!==b&&(x.match="SFX"===h?new RegExp(b+"$"):new RegExp("^"+b)),"0"!=m&&(x.remove="SFX"===h?new RegExp(m+"$"):m),p.push(x)}l[d]={type:h,combineable:"Y"==f,entries:p},r+=n}else if("COMPOUNDRULE"===h){for(o=r+1,a=r+1+(n=parseInt(c[1],10));o<a;o++)i=(t=u[o]).split(/\s+/),this.compoundRules.push(i[1]);r+=n}else"REP"===h?3===(i=t.split(/\s+/)).length&&this.replacementTable.push([i[1],i[2]]):this.flags[h]=c[1]}return l},_removeAffixComments:function(e){return(e=(e=(e=e.replace(/^\s*#.*$/gm,"")).replace(/^\s\s*/m,"").replace(/\s\s*$/m,"")).replace(/\n{2,}/g,"\n")).replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){var t=(e=this._removeDicComments(e)).split(/\r?\n/),n={};function i(e,t){n.hasOwnProperty(e)||(n[e]=null),t.length>0&&(null===n[e]&&(n[e]=[]),n[e].push(t))}for(var r=1,o=t.length;r<o;r++){var s=t[r];if(s){var a=s.split("/",2),l=a[0];if(a.length>1){var u=this.parseRuleCodes(a[1]);"NEEDAFFIX"in this.flags&&-1!=u.indexOf(this.flags.NEEDAFFIX)||i(l,u);for(var c=0,h=u.length;c<h;c++){var d=u[c],f=this.rules[d];if(f)for(var p=this._applyRule(l,f),m=0,g=p.length;m<g;m++){var v=p[m];if(i(v,[]),f.combineable)for(var y=c+1;y<h;y++){var b=u[y],x=this.rules[b];if(x&&x.combineable&&f.type!=x.type)for(var w=this._applyRule(v,x),D=0,C=w.length;D<C;D++)i(w[D],[])}}d in this.compoundRuleCodes&&this.compoundRuleCodes[d].push(l)}}else i(l.trim(),[])}}return n},_removeDicComments:function(e){return e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,i=e.length;n<i;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?e.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,i=[],r=0,o=n.length;r<o;r++){var s=n[r];if(!s.match||e.match(s.match)){var a=e;if(s.remove&&(a=a.replace(s.remove,"")),"SFX"===t.type?a+=s.add:a=s.add+a,i.push(a),"continuationClasses"in s)for(var l=0,u=s.continuationClasses.length;l<u;l++){var c=this.rules[s.continuationClasses[l]];c&&(i=i.concat(this._applyRule(a,c)))}}}return i},check:function(e){if(!this.loaded)throw"Dictionary not loaded.";var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0;if(this.checkExact(t.toLowerCase()))return!0}var i=t[0].toLowerCase()+t.substring(1);if(i!==t){if(this.hasFlag(i,"KEEPCASE"))return!1;if(this.checkExact(i))return!0}return!1},checkExact:function(e){if(!this.loaded)throw"Dictionary not loaded.";var t,n,i=this.dictionaryTable[e];if(void 0===i){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(t=0,n=this.compoundRules.length;t<n;t++)if(e.match(this.compoundRules[t]))return!0}else{if(null===i)return!0;if("object"==typeof i)for(t=0,n=i.length;t<n;t++)if(!this.hasFlag(e,"ONLYINCOMPOUND",i[t]))return!0}return!1},hasFlag:function(e,t,n){if(!this.loaded)throw"Dictionary not loaded.";return!(!(t in this.flags)||(void 0===n&&(n=Array.prototype.concat.apply([],this.dictionaryTable[e])),!n||-1===n.indexOf(this.flags[t])))},alphabet:"",suggest:function(e,t){if(!this.loaded)throw"Dictionary not loaded.";if(t=t||5,this.memoized.hasOwnProperty(e)){var n=this.memoized[e].limit;if(t<=n||this.memoized[e].suggestions.length<n)return this.memoized[e].suggestions.slice(0,t)}if(this.check(e))return[];for(var i=0,r=this.replacementTable.length;i<r;i++){var o=this.replacementTable[i];if(-1!==e.indexOf(o[0])){var s=e.replace(o[0],o[1]);if(this.check(s))return[s]}}var a=this;function l(e,t){var n,i,r,o,s={},l=a.alphabet.length;if("string"==typeof e){var u=e;(e={})[u]=!0}for(var u in e)for(n=0,r=u.length+1;n<r;n++){var c=[u.substring(0,n),u.substring(n)];if(c[1]&&(o=c[0]+c[1].substring(1),t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1)),c[1].length>1&&c[1][1]!==c[1][0]&&(o=c[0]+c[1][1]+c[1][0]+c[1].substring(2),t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1)),c[1]){var h=c[1].substring(0,1).toUpperCase()===c[1].substring(0,1)?"uppercase":"lowercase";for(i=0;i<l;i++){var d=a.alphabet[i];"uppercase"===h&&(d=d.toUpperCase()),d!=c[1].substring(0,1)&&(o=c[0]+d+c[1].substring(1),t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1))}}if(c[1])for(i=0;i<l;i++)h=c[0].substring(-1).toUpperCase()===c[0].substring(-1)&&c[1].substring(0,1).toUpperCase()===c[1].substring(0,1)?"uppercase":"lowercase",d=a.alphabet[i],"uppercase"===h&&(d=d.toUpperCase()),o=c[0]+d+c[1],t&&!a.check(o)||(o in s?s[o]+=1:s[o]=1)}return s}return a.alphabet="abcdefghijklmnopqrstuvwxyz",this.memoized[e]={suggestions:function(e){var n,i=l(e),r=l(i,!0);for(var o in i)a.check(o)&&(o in r?r[o]+=i[o]:r[o]=i[o]);var s=[];for(n in r)r.hasOwnProperty(n)&&s.push([n,r[n]]);s.sort((function(e,t){var n=e[1],i=t[1];return n<i?-1:n>i?1:t[0].localeCompare(e[0])})).reverse();var u=[],c="lowercase";e.toUpperCase()===e?c="uppercase":e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase()===e&&(c="capitalized");var h=t;for(n=0;n<Math.min(h,s.length);n++)"uppercase"===c?s[n][0]=s[n][0].toUpperCase():"capitalized"===c&&(s[n][0]=s[n][0].substr(0,1).toUpperCase()+s[n][0].substr(1)),a.hasFlag(s[n][0],"NOSUGGEST")||-1!=u.indexOf(s[n][0])?h++:u.push(s[n][0]);return u}(e),limit:t},this.memoized[e].suggestions}}}(),e.exports=i},649:(e,t,n)=>{var i={"./avatar.svg":985,"./avatar100x100.png":890,"./avatar150x150.png":821,"./avatar400x400.png":996,"./avatar80x80.png":313,"./favicon.ico":986};function r(e){var t=o(e);return n(t)}function o(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=o,e.exports=r,r.id=649},562:()=>{}}]);
|