UNPKG

@rero/rero-ils-ui

Version:

User interface for RERO integrated library system (RERO ILS).

5 lines (4 loc) 2.57 MB
import{$ as Di,$a as Vk,$b as Q,$c as Y,A as _h,Aa as Qx,Ab as w,Ac as Na,Ad as Ih,B as bh,Ba as $a,Bb as Jx,Bc as Ar,Bd as Mg,C as qd,Ca as Et,Cb as Wk,Cc as Rr,D as Du,Da as ji,Db as kg,Dc as Lr,Dd as s5,E as jx,Ea as jt,Eb as Dg,Ec as Eg,F as Ck,Fa as Ek,Fb as e2,Fc as Ze,Fd as Og,G as Io,Ga as Ch,Gb as Yd,Gc as an,H as dr,Ha as Fk,Hb as Gk,Hc as Ae,Hd as l5,I as Ux,Ia as gr,Ib as Il,Ic as Dt,J as pr,Ja as wh,Jb as Kk,Jc as wn,K as _s,Ka as Zx,Kb as El,Kc as Sc,L as Wd,La as Mk,Lb as Qk,Lc as n2,M as qx,Ma as Qd,Mb as Zk,Mc as r2,Md as c5,N as no,Na as Sh,Nb as G,Nc as Ue,O as yh,Oa as Th,Ob as g,Oc as et,P as la,Pa as Iu,Pb as Ki,Pc as Ur,Q as qo,Qa as Zd,Qb as Oi,Qc as Dh,R as Wx,Ra as Ok,Rb as li,Rc as Ye,S as wk,Sa as Ak,Sb as Se,Sc as Ou,T as Sk,Ta as Rk,Tb as Yk,Tc as t5,U as Gd,Ua as Lk,Ub as we,Uc as ep,V as La,Va as Bk,Vb as fo,Vc as i5,W as ki,Wa as $k,Wb as t2,Wc as sn,X as kl,Xa as Pk,Xb as Pi,Xc as o2,Y as wi,Ya as Eu,Yb as Vi,Yc as a2,Z as Si,Za as gn,Zb as S,Zc as n5,_ as Dl,_a as hr,_b as T,_c as r5,a as ae,aa as pe,ab as Cg,ac as Re,ad as at,b as ut,ba as Be,bb as _,bc as Le,bd as Wo,c as vg,ca as Tk,cb as Fu,cc as Me,cd as Ti,d as _g,da as At,db as Nk,dc as be,dd as qr,e as Ra,ea as Gx,eb as zk,ec as Xk,ed as Fg,f as si,fa as bt,fb as Eo,fc as Jk,fd as o5,g as _k,ga as z,gb as kh,gc as Va,gd as Hn,h as bg,ha as Ks,hb as Yx,hc as vr,hd as Ni,i as ir,ia as kk,ib as Pa,ic as ee,id as Fi,j as bk,ja as Qs,jb as rr,jc as v,jd as za,k as io,ka as Ba,kb as je,kc as Nt,kd as Bi,l as Nx,la as Dk,lb as wg,lc as ht,ld as ca,m as zx,ma as yg,mb as Cn,mc as Xd,md as s2,n as Ot,na as ri,nb as Hk,nc as wc,nd as ua,o as Zn,oa as $,ob as Xx,oc as Jd,od as l2,p as yk,pa as P,pb as Mu,pc as ce,q as Hx,qa as Wt,qb as jk,qc as We,r as Tl,ra as ne,rb as Uk,rc as q,s as Or,sa as Kx,sb as qk,sc as W,t as tt,ta as Yi,tb as Sg,tc as i2,u as jo,ua as Kd,ub as re,uc as e5,v as nr,va as xg,vb as $e,vc as Ig,w as xk,wa as xh,wb as Pt,wc as Vt,x as _t,xa as _e,xb as Xi,xc as ye,y as vs,ya as Jt,yb as ve,yc as Je,z as Uo,za as Ik,zb as Tg,zc as Ct,zd as a5}from"./chunk-TSJJCHOH.js";var oa=si((L4,B4)=>{(function(t,n){typeof L4=="object"&&typeof B4<"u"?B4.exports=n():typeof define=="function"&&define.amd?define(n):(t=t||self,t.CodeMirror=n())})(L4,function(){"use strict";var t=navigator.userAgent,n=navigator.platform,e=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=i||r||o,l=a&&(i?document.documentMode||6:+(o||r)[1]),u=!o&&/WebKit\//.test(t),h=u&&/Qt\/\d+\.\d+/.test(t),m=!o&&/Chrome\/(\d+)/.exec(t),b=m&&+m[1],y=/Opera\//.test(t),C=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),F=/PhantomJS/.test(t),M=C&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),E=/Android/.test(t),A=M||E||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),V=M||/Mac/.test(n),H=/\bCrOS\b/.test(t),K=/win/i.test(n),J=y&&t.match(/Version\/(\d*\.\d*)/);J&&(J=Number(J[1])),J&&J>=15&&(y=!1,u=!0);var se=V&&(h||y&&(J==null||J<12.11)),ge=e||a&&l>=9;function le(s){return new RegExp("(^|\\s)"+s+"(?:$|\\s)\\s*")}var Ee=function(s,c){var p=s.className,d=le(c).exec(p);if(d){var f=p.slice(d.index+d[0].length);s.className=p.slice(0,d.index)+(f?d[1]+f:"")}};function fe(s){for(var c=s.childNodes.length;c>0;--c)s.removeChild(s.firstChild);return s}function xe(s,c){return fe(s).appendChild(c)}function X(s,c,p,d){var f=document.createElement(s);if(p&&(f.className=p),d&&(f.style.cssText=d),typeof c=="string")f.appendChild(document.createTextNode(c));else if(c)for(var x=0;x<c.length;++x)f.appendChild(c[x]);return f}function me(s,c,p,d){var f=X(s,c,p,d);return f.setAttribute("role","presentation"),f}var De;document.createRange?De=function(s,c,p,d){var f=document.createRange();return f.setEnd(d||s,p),f.setStart(s,c),f}:De=function(s,c,p){var d=document.body.createTextRange();try{d.moveToElementText(s.parentNode)}catch{return d}return d.collapse(!0),d.moveEnd("character",p),d.moveStart("character",c),d};function Fe(s,c){if(c.nodeType==3&&(c=c.parentNode),s.contains)return s.contains(c);do if(c.nodeType==11&&(c=c.host),c==s)return!0;while(c=c.parentNode)}function Ve(s){var c=s.ownerDocument||s,p;try{p=s.activeElement}catch{p=c.body||null}for(;p&&p.shadowRoot&&p.shadowRoot.activeElement;)p=p.shadowRoot.activeElement;return p}function de(s,c){var p=s.className;le(c).test(p)||(s.className+=(p?" ":"")+c)}function ie(s,c){for(var p=s.split(" "),d=0;d<p.length;d++)p[d]&&!le(p[d]).test(c)&&(c+=" "+p[d]);return c}var U=function(s){s.select()};M?U=function(s){s.selectionStart=0,s.selectionEnd=s.value.length}:a&&(U=function(s){try{s.select()}catch{}});function B(s){return s.display.wrapper.ownerDocument}function Ce(s){return ot(s.display.wrapper)}function ot(s){return s.getRootNode?s.getRootNode():s.ownerDocument}function vt(s){return B(s).defaultView}function gi(s){var c=Array.prototype.slice.call(arguments,1);return function(){return s.apply(null,c)}}function $t(s,c,p){c||(c={});for(var d in s)s.hasOwnProperty(d)&&(p!==!1||!c.hasOwnProperty(d))&&(c[d]=s[d]);return c}function bi(s,c,p,d,f){c==null&&(c=s.search(/[^\s\u00a0]/),c==-1&&(c=s.length));for(var x=d||0,k=f||0;;){var O=s.indexOf(" ",x);if(O<0||O>=c)return k+(c-x);k+=O-x,k+=p-k%p,x=O+1}}var Xe=function(){this.id=null,this.f=null,this.time=0,this.handler=gi(this.onTimeout,this)};Xe.prototype.onTimeout=function(s){s.id=0,s.time<=+new Date?s.f():setTimeout(s.handler,s.time-+new Date)},Xe.prototype.set=function(s,c){this.f=c;var p=+new Date+s;(!this.id||p<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,s),this.time=p)};function Ge(s,c){for(var p=0;p<s.length;++p)if(s[p]==c)return p;return-1}var Oe=50,Ke={toString:function(){return"CodeMirror.Pass"}},ft={scroll:!1},Yt={origin:"*mouse"},St={origin:"+move"};function Kt(s,c,p){for(var d=0,f=0;;){var x=s.indexOf(" ",d);x==-1&&(x=s.length);var k=x-d;if(x==s.length||f+k>=c)return d+Math.min(k,c-f);if(f+=x-d,f+=p-f%p,d=x+1,f>=c)return d}}var qt=[""];function ei(s){for(;qt.length<=s;)qt.push(Tt(qt)+" ");return qt[s]}function Tt(s){return s[s.length-1]}function ii(s,c){for(var p=[],d=0;d<s.length;d++)p[d]=c(s[d],d);return p}function Wi(s,c,p){for(var d=0,f=p(c);d<s.length&&p(s[d])<=f;)d++;s.splice(d,0,c)}function En(){}function lo(s,c){var p;return Object.create?p=Object.create(s):(En.prototype=s,p=new En),c&&$t(c,p),p}var zs=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function yo(s){return/\w/.test(s)||s>"\x80"&&(s.toUpperCase()!=s.toLowerCase()||zs.test(s))}function Oa(s,c){return c?c.source.indexOf("\\w")>-1&&yo(s)?!0:c.test(s):yo(s)}function hc(s){for(var c in s)if(s.hasOwnProperty(c)&&s[c])return!1;return!0}var pu=/[\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 aa(s){return s.charCodeAt(0)>=768&&pu.test(s)}function Aa(s,c,p){for(;(p<0?c>0:c<s.length)&&aa(s.charAt(c));)c+=p;return c}function co(s,c,p){for(var d=c>p?-1:1;;){if(c==p)return c;var f=(c+p)/2,x=d<0?Math.ceil(f):Math.floor(f);if(x==c)return s(x)?c:p;s(x)?p=x:c=x+d}}function bd(s,c,p,d){if(!s)return d(c,p,"ltr",0);for(var f=!1,x=0;x<s.length;++x){var k=s[x];(k.from<p&&k.to>c||c==p&&k.to==c)&&(d(Math.max(k.from,c),Math.min(k.to,p),k.level==1?"rtl":"ltr",x),f=!0)}f||d(c,p,"ltr")}var ps=null;function Vo(s,c,p){var d;ps=null;for(var f=0;f<s.length;++f){var x=s[f];if(x.from<c&&x.to>c)return f;x.to==c&&(x.from!=x.to&&p=="before"?d=f:ps=f),x.from==c&&(x.from!=x.to&&p!="before"?d=f:ps=f)}return d??ps}var xo=function(){var s="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",c="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function p(N){return N<=247?s.charAt(N):1424<=N&&N<=1524?"R":1536<=N&&N<=1785?c.charAt(N-1536):1774<=N&&N<=2220?"r":8192<=N&&N<=8203?"w":N==8204?"b":"L"}var d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,x=/[LRr]/,k=/[Lb1n]/,O=/[1n]/;function L(N,te,oe){this.level=N,this.from=te,this.to=oe}return function(N,te){var oe=te=="ltr"?"L":"R";if(N.length==0||te=="ltr"&&!d.test(N))return!1;for(var Ie=N.length,Te=[],ze=0;ze<Ie;++ze)Te.push(p(N.charCodeAt(ze)));for(var Qe=0,st=oe;Qe<Ie;++Qe){var mt=Te[Qe];mt=="m"?Te[Qe]=st:st=mt}for(var xt=0,gt=oe;xt<Ie;++xt){var Mt=Te[xt];Mt=="1"&&gt=="r"?Te[xt]="n":x.test(Mt)&&(gt=Mt,Mt=="r"&&(Te[xt]="R"))}for(var ni=1,Xt=Te[0];ni<Ie-1;++ni){var Ei=Te[ni];Ei=="+"&&Xt=="1"&&Te[ni+1]=="1"?Te[ni]="1":Ei==","&&Xt==Te[ni+1]&&(Xt=="1"||Xt=="n")&&(Te[ni]=Xt),Xt=Ei}for(var mn=0;mn<Ie;++mn){var Fr=Te[mn];if(Fr==",")Te[mn]="N";else if(Fr=="%"){var zn=void 0;for(zn=mn+1;zn<Ie&&Te[zn]=="%";++zn);for(var Ho=mn&&Te[mn-1]=="!"||zn<Ie&&Te[zn]=="1"?"1":"N",To=mn;To<zn;++To)Te[To]=Ho;mn=zn-1}}for(var cr=0,ko=oe;cr<Ie;++cr){var jr=Te[cr];ko=="L"&&jr=="1"?Te[cr]="L":x.test(jr)&&(ko=jr)}for(var mr=0;mr<Ie;++mr)if(f.test(Te[mr])){var ur=void 0;for(ur=mr+1;ur<Ie&&f.test(Te[ur]);++ur);for(var Qn=(mr?Te[mr-1]:oe)=="L",Do=(ur<Ie?Te[ur]:oe)=="L",jd=Qn==Do?Qn?"L":"R":oe,Cc=mr;Cc<ur;++Cc)Te[Cc]=jd;mr=ur-1}for(var to=[],Gs,Mr=0;Mr<Ie;)if(k.test(Te[Mr])){var Px=Mr;for(++Mr;Mr<Ie&&k.test(Te[Mr]);++Mr);to.push(new L(0,Px,Mr))}else{var Sl=Mr,Tu=to.length,ku=te=="rtl"?1:0;for(++Mr;Mr<Ie&&Te[Mr]!="L";++Mr);for(var ho=Sl;ho<Mr;)if(O.test(Te[ho])){Sl<ho&&(to.splice(Tu,0,new L(1,Sl,ho)),Tu+=ku);var Ud=ho;for(++ho;ho<Mr&&O.test(Te[ho]);++ho);to.splice(Tu,0,new L(2,Ud,ho)),Tu+=ku,Sl=ho}else++ho;Sl<Mr&&to.splice(Tu,0,new L(1,Sl,Mr))}return te=="ltr"&&(to[0].level==1&&(Gs=N.match(/^\s+/))&&(to[0].from=Gs[0].length,to.unshift(new L(0,0,Gs[0].length))),Tt(to).level==1&&(Gs=N.match(/\s+$/))&&(Tt(to).to-=Gs[0].length,to.push(new L(0,Ie-Gs[0].length,Ie)))),te=="rtl"?to.reverse():to}}();function er(s,c){var p=s.order;return p==null&&(p=s.order=xo(s.text,c)),p}var j0=[],ai=function(s,c,p){if(s.addEventListener)s.addEventListener(c,p,!1);else if(s.attachEvent)s.attachEvent("on"+c,p);else{var d=s._handlers||(s._handlers={});d[c]=(d[c]||j0).concat(p)}};function yd(s,c){return s._handlers&&s._handlers[c]||j0}function Co(s,c,p){if(s.removeEventListener)s.removeEventListener(c,p,!1);else if(s.detachEvent)s.detachEvent("on"+c,p);else{var d=s._handlers,f=d&&d[c];if(f){var x=Ge(f,p);x>-1&&(d[c]=f.slice(0,x).concat(f.slice(x+1)))}}}function Nn(s,c){var p=yd(s,c);if(p.length)for(var d=Array.prototype.slice.call(arguments,2),f=0;f<p.length;++f)p[f].apply(null,d)}function sr(s,c,p){return typeof c=="string"&&(c={type:c,preventDefault:function(){this.defaultPrevented=!0}}),Nn(s,p||c.type,s,c),xd(c)||c.codemirrorIgnore}function Bm(s){var c=s._handlers&&s._handlers.cursorActivity;if(c)for(var p=s.curOp.cursorActivityHandlers||(s.curOp.cursorActivityHandlers=[]),d=0;d<c.length;++d)Ge(p,c[d])==-1&&p.push(c[d])}function No(s,c){return yd(s,c).length>0}function _l(s){s.prototype.on=function(c,p){ai(this,c,p)},s.prototype.off=function(c,p){Co(this,c,p)}}function Jr(s){s.preventDefault?s.preventDefault():s.returnValue=!1}function $m(s){s.stopPropagation?s.stopPropagation():s.cancelBubble=!0}function xd(s){return s.defaultPrevented!=null?s.defaultPrevented:s.returnValue==!1}function hu(s){Jr(s),$m(s)}function Cd(s){return s.target||s.srcElement}function uo(s){var c=s.which;return c==null&&(s.button&1?c=1:s.button&2?c=3:s.button&4&&(c=2)),V&&s.ctrlKey&&c==1&&(c=3),c}var Hs=function(){if(a&&l<9)return!1;var s=X("div");return"draggable"in s||"dragDrop"in s}(),wd;function By(s){if(wd==null){var c=X("span","\u200B");xe(s,X("span",[c,document.createTextNode("x")])),s.firstChild.offsetHeight!=0&&(wd=c.offsetWidth<=1&&c.offsetHeight>2&&!(a&&l<8))}var p=wd?X("span","\u200B"):X("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return p.setAttribute("cm-text",""),p}var $y;function cV(s){if($y!=null)return $y;var c=xe(s,document.createTextNode("A\u062EA")),p=De(c,0,1).getBoundingClientRect(),d=De(c,1,2).getBoundingClientRect();return fe(s),!p||p.left==p.right?!1:$y=d.right-p.right<3}var Py=` b`.split(/\n/).length!=3?function(s){for(var c=0,p=[],d=s.length;c<=d;){var f=s.indexOf(` `,c);f==-1&&(f=s.length);var x=s.slice(c,s.charAt(f-1)=="\r"?f-1:f),k=x.indexOf("\r");k!=-1?(p.push(x.slice(0,k)),c+=k+1):(p.push(x),c=f+1)}return p}:function(s){return s.split(/\r\n?|\n/)},uV=window.getSelection?function(s){try{return s.selectionStart!=s.selectionEnd}catch{return!1}}:function(s){var c;try{c=s.ownerDocument.selection.createRange()}catch{}return!c||c.parentElement()!=s?!1:c.compareEndPoints("StartToEnd",c)!=0},dV=function(){var s=X("div");return"oncopy"in s?!0:(s.setAttribute("oncopy","return;"),typeof s.oncopy=="function")}(),Vy=null;function pV(s){if(Vy!=null)return Vy;var c=xe(s,X("span","x")),p=c.getBoundingClientRect(),d=De(c,0,1).getBoundingClientRect();return Vy=Math.abs(p.left-d.left)>1}var Ny={},Sd={};function hV(s,c){arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),Ny[s]=c}function fV(s,c){Sd[s]=c}function Pm(s){if(typeof s=="string"&&Sd.hasOwnProperty(s))s=Sd[s];else if(s&&typeof s.name=="string"&&Sd.hasOwnProperty(s.name)){var c=Sd[s.name];typeof c=="string"&&(c={name:c}),s=lo(c,s),s.name=c.name}else{if(typeof s=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(s))return Pm("application/xml");if(typeof s=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(s))return Pm("application/json")}return typeof s=="string"?{name:s}:s||{name:"null"}}function zy(s,c){c=Pm(c);var p=Ny[c.name];if(!p)return zy(s,"text/plain");var d=p(s,c);if(Td.hasOwnProperty(c.name)){var f=Td[c.name];for(var x in f)f.hasOwnProperty(x)&&(d.hasOwnProperty(x)&&(d["_"+x]=d[x]),d[x]=f[x])}if(d.name=c.name,c.helperType&&(d.helperType=c.helperType),c.modeProps)for(var k in c.modeProps)d[k]=c.modeProps[k];return d}var Td={};function mV(s,c){var p=Td.hasOwnProperty(s)?Td[s]:Td[s]={};$t(c,p)}function fu(s,c){if(c===!0)return c;if(s.copyState)return s.copyState(c);var p={};for(var d in c){var f=c[d];f instanceof Array&&(f=f.concat([])),p[d]=f}return p}function Hy(s,c){for(var p;s.innerMode&&(p=s.innerMode(c),!(!p||p.mode==s));)c=p.state,s=p.mode;return p||{mode:s,state:c}}function _S(s,c,p){return s.startState?s.startState(c,p):!0}var lr=function(s,c,p){this.pos=this.start=0,this.string=s,this.tabSize=c||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=p};lr.prototype.eol=function(){return this.pos>=this.string.length},lr.prototype.sol=function(){return this.pos==this.lineStart},lr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},lr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},lr.prototype.eat=function(s){var c=this.string.charAt(this.pos),p;if(typeof s=="string"?p=c==s:p=c&&(s.test?s.test(c):s(c)),p)return++this.pos,c},lr.prototype.eatWhile=function(s){for(var c=this.pos;this.eat(s););return this.pos>c},lr.prototype.eatSpace=function(){for(var s=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>s},lr.prototype.skipToEnd=function(){this.pos=this.string.length},lr.prototype.skipTo=function(s){var c=this.string.indexOf(s,this.pos);if(c>-1)return this.pos=c,!0},lr.prototype.backUp=function(s){this.pos-=s},lr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=bi(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?bi(this.string,this.lineStart,this.tabSize):0)},lr.prototype.indentation=function(){return bi(this.string,null,this.tabSize)-(this.lineStart?bi(this.string,this.lineStart,this.tabSize):0)},lr.prototype.match=function(s,c,p){if(typeof s=="string"){var d=function(k){return p?k.toLowerCase():k},f=this.string.substr(this.pos,s.length);if(d(f)==d(s))return c!==!1&&(this.pos+=s.length),!0}else{var x=this.string.slice(this.pos).match(s);return x&&x.index>0?null:(x&&c!==!1&&(this.pos+=x[0].length),x)}},lr.prototype.current=function(){return this.string.slice(this.start,this.pos)},lr.prototype.hideFirstChars=function(s,c){this.lineStart+=s;try{return c()}finally{this.lineStart-=s}},lr.prototype.lookAhead=function(s){var c=this.lineOracle;return c&&c.lookAhead(s)},lr.prototype.baseToken=function(){var s=this.lineOracle;return s&&s.baseToken(this.pos)};function Qt(s,c){if(c-=s.first,c<0||c>=s.size)throw new Error("There is no line "+(c+s.first)+" in the document.");for(var p=s;!p.lines;)for(var d=0;;++d){var f=p.children[d],x=f.chunkSize();if(c<x){p=f;break}c-=x}return p.lines[c]}function mu(s,c,p){var d=[],f=c.line;return s.iter(c.line,p.line+1,function(x){var k=x.text;f==p.line&&(k=k.slice(0,p.ch)),f==c.line&&(k=k.slice(c.ch)),d.push(k),++f}),d}function jy(s,c,p){var d=[];return s.iter(c,p,function(f){d.push(f.text)}),d}function js(s,c){var p=c-s.height;if(p)for(var d=s;d;d=d.parent)d.height+=p}function rn(s){if(s.parent==null)return null;for(var c=s.parent,p=Ge(c.lines,s),d=c.parent;d;c=d,d=d.parent)for(var f=0;d.children[f]!=c;++f)p+=d.children[f].chunkSize();return p+c.first}function gu(s,c){var p=s.first;e:do{for(var d=0;d<s.children.length;++d){var f=s.children[d],x=f.height;if(c<x){s=f;continue e}c-=x,p+=f.chunkSize()}return p}while(!s.lines);for(var k=0;k<s.lines.length;++k){var O=s.lines[k],L=O.height;if(c<L)break;c-=L}return p+k}function U0(s,c){return c>=s.first&&c<s.first+s.size}function Uy(s,c){return String(s.lineNumberFormatter(c+s.firstLineNumber))}function nt(s,c,p){if(p===void 0&&(p=null),!(this instanceof nt))return new nt(s,c,p);this.line=s,this.ch=c,this.sticky=p}function yi(s,c){return s.line-c.line||s.ch-c.ch}function qy(s,c){return s.sticky==c.sticky&&yi(s,c)==0}function Wy(s){return nt(s.line,s.ch)}function Vm(s,c){return yi(s,c)<0?c:s}function Nm(s,c){return yi(s,c)<0?s:c}function bS(s,c){return Math.max(s.first,Math.min(c,s.first+s.size-1))}function xi(s,c){if(c.line<s.first)return nt(s.first,0);var p=s.first+s.size-1;return c.line>p?nt(p,Qt(s,p).text.length):gV(c,Qt(s,c.line).text.length)}function gV(s,c){var p=s.ch;return p==null||p>c?nt(s.line,c):p<0?nt(s.line,0):s}function yS(s,c){for(var p=[],d=0;d<c.length;d++)p[d]=xi(s,c[d]);return p}var zm=function(s,c){this.state=s,this.lookAhead=c},Us=function(s,c,p,d){this.state=c,this.doc=s,this.line=p,this.maxLookAhead=d||0,this.baseTokens=null,this.baseTokenPos=1};Us.prototype.lookAhead=function(s){var c=this.doc.getLine(this.line+s);return c!=null&&s>this.maxLookAhead&&(this.maxLookAhead=s),c},Us.prototype.baseToken=function(s){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=s;)this.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-s}},Us.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Us.fromSaved=function(s,c,p){return c instanceof zm?new Us(s,fu(s.mode,c.state),p,c.lookAhead):new Us(s,fu(s.mode,c),p)},Us.prototype.save=function(s){var c=s!==!1?fu(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new zm(c,this.maxLookAhead):c};function xS(s,c,p,d){var f=[s.state.modeGen],x={};DS(s,c.text,s.doc.mode,p,function(N,te){return f.push(N,te)},x,d);for(var k=p.state,O=function(N){p.baseTokens=f;var te=s.state.overlays[N],oe=1,Ie=0;p.state=!0,DS(s,c.text,te.mode,p,function(Te,ze){for(var Qe=oe;Ie<Te;){var st=f[oe];st>Te&&f.splice(oe,1,Te,f[oe+1],st),oe+=2,Ie=Math.min(Te,st)}if(ze)if(te.opaque)f.splice(Qe,oe-Qe,Te,"overlay "+ze),oe=Qe+2;else for(;Qe<oe;Qe+=2){var mt=f[Qe+1];f[Qe+1]=(mt?mt+" ":"")+"overlay "+ze}},x),p.state=k,p.baseTokens=null,p.baseTokenPos=1},L=0;L<s.state.overlays.length;++L)O(L);return{styles:f,classes:x.bgClass||x.textClass?x:null}}function CS(s,c,p){if(!c.styles||c.styles[0]!=s.state.modeGen){var d=q0(s,rn(c)),f=c.text.length>s.options.maxHighlightLength&&fu(s.doc.mode,d.state),x=xS(s,c,d);f&&(d.state=f),c.stateAfter=d.save(!f),c.styles=x.styles,x.classes?c.styleClasses=x.classes:c.styleClasses&&(c.styleClasses=null),p===s.doc.highlightFrontier&&(s.doc.modeFrontier=Math.max(s.doc.modeFrontier,++s.doc.highlightFrontier))}return c.styles}function q0(s,c,p){var d=s.doc,f=s.display;if(!d.mode.startState)return new Us(d,!0,c);var x=vV(s,c,p),k=x>d.first&&Qt(d,x-1).stateAfter,O=k?Us.fromSaved(d,k,x):new Us(d,_S(d.mode),x);return d.iter(x,c,function(L){Gy(s,L.text,O);var N=O.line;L.stateAfter=N==c-1||N%5==0||N>=f.viewFrom&&N<f.viewTo?O.save():null,O.nextLine()}),p&&(d.modeFrontier=O.line),O}function Gy(s,c,p,d){var f=s.doc.mode,x=new lr(c,s.options.tabSize,p);for(x.start=x.pos=d||0,c==""&&wS(f,p.state);!x.eol();)Ky(f,x,p.state),x.start=x.pos}function wS(s,c){if(s.blankLine)return s.blankLine(c);if(s.innerMode){var p=Hy(s,c);if(p.mode.blankLine)return p.mode.blankLine(p.state)}}function Ky(s,c,p,d){for(var f=0;f<10;f++){d&&(d[0]=Hy(s,p).mode);var x=s.token(c,p);if(c.pos>c.start)return x}throw new Error("Mode "+s.name+" failed to advance stream.")}var SS=function(s,c,p){this.start=s.start,this.end=s.pos,this.string=s.current(),this.type=c||null,this.state=p};function TS(s,c,p,d){var f=s.doc,x=f.mode,k;c=xi(f,c);var O=Qt(f,c.line),L=q0(s,c.line,p),N=new lr(O.text,s.options.tabSize,L),te;for(d&&(te=[]);(d||N.pos<c.ch)&&!N.eol();)N.start=N.pos,k=Ky(x,N,L.state),d&&te.push(new SS(N,k,fu(f.mode,L.state)));return d?te:new SS(N,k,L.state)}function kS(s,c){if(s)for(;;){var p=s.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!p)break;s=s.slice(0,p.index)+s.slice(p.index+p[0].length);var d=p[1]?"bgClass":"textClass";c[d]==null?c[d]=p[2]:new RegExp("(?:^|\\s)"+p[2]+"(?:$|\\s)").test(c[d])||(c[d]+=" "+p[2])}return s}function DS(s,c,p,d,f,x,k){var O=p.flattenSpans;O==null&&(O=s.options.flattenSpans);var L=0,N=null,te=new lr(c,s.options.tabSize,d),oe,Ie=s.options.addModeClass&&[null];for(c==""&&kS(wS(p,d.state),x);!te.eol();){if(te.pos>s.options.maxHighlightLength?(O=!1,k&&Gy(s,c,d,te.pos),te.pos=c.length,oe=null):oe=kS(Ky(p,te,d.state,Ie),x),Ie){var Te=Ie[0].name;Te&&(oe="m-"+(oe?Te+" "+oe:Te))}if(!O||N!=oe){for(;L<te.start;)L=Math.min(te.start,L+5e3),f(L,N);N=oe}te.start=te.pos}for(;L<te.pos;){var ze=Math.min(te.pos,L+5e3);f(ze,N),L=ze}}function vV(s,c,p){for(var d,f,x=s.doc,k=p?-1:c-(s.doc.mode.innerMode?1e3:100),O=c;O>k;--O){if(O<=x.first)return x.first;var L=Qt(x,O-1),N=L.stateAfter;if(N&&(!p||O+(N instanceof zm?N.lookAhead:0)<=x.modeFrontier))return O;var te=bi(L.text,null,s.options.tabSize);(f==null||d>te)&&(f=O-1,d=te)}return f}function _V(s,c){if(s.modeFrontier=Math.min(s.modeFrontier,c),!(s.highlightFrontier<c-10)){for(var p=s.first,d=c-1;d>p;d--){var f=Qt(s,d).stateAfter;if(f&&(!(f instanceof zm)||d+f.lookAhead<c)){p=d+1;break}}s.highlightFrontier=Math.min(s.highlightFrontier,p)}}var IS=!1,bl=!1;function bV(){IS=!0}function yV(){bl=!0}function Hm(s,c,p){this.marker=s,this.from=c,this.to=p}function W0(s,c){if(s)for(var p=0;p<s.length;++p){var d=s[p];if(d.marker==c)return d}}function xV(s,c){for(var p,d=0;d<s.length;++d)s[d]!=c&&(p||(p=[])).push(s[d]);return p}function CV(s,c,p){var d=p&&window.WeakSet&&(p.markedSpans||(p.markedSpans=new WeakSet));d&&s.markedSpans&&d.has(s.markedSpans)?s.markedSpans.push(c):(s.markedSpans=s.markedSpans?s.markedSpans.concat([c]):[c],d&&d.add(s.markedSpans)),c.marker.attachLine(s)}function wV(s,c,p){var d;if(s)for(var f=0;f<s.length;++f){var x=s[f],k=x.marker,O=x.from==null||(k.inclusiveLeft?x.from<=c:x.from<c);if(O||x.from==c&&k.type=="bookmark"&&(!p||!x.marker.insertLeft)){var L=x.to==null||(k.inclusiveRight?x.to>=c:x.to>c);(d||(d=[])).push(new Hm(k,x.from,L?null:x.to))}}return d}function SV(s,c,p){var d;if(s)for(var f=0;f<s.length;++f){var x=s[f],k=x.marker,O=x.to==null||(k.inclusiveRight?x.to>=c:x.to>c);if(O||x.from==c&&k.type=="bookmark"&&(!p||x.marker.insertLeft)){var L=x.from==null||(k.inclusiveLeft?x.from<=c:x.from<c);(d||(d=[])).push(new Hm(k,L?null:x.from-c,x.to==null?null:x.to-c))}}return d}function Qy(s,c){if(c.full)return null;var p=U0(s,c.from.line)&&Qt(s,c.from.line).markedSpans,d=U0(s,c.to.line)&&Qt(s,c.to.line).markedSpans;if(!p&&!d)return null;var f=c.from.ch,x=c.to.ch,k=yi(c.from,c.to)==0,O=wV(p,f,k),L=SV(d,x,k),N=c.text.length==1,te=Tt(c.text).length+(N?f:0);if(O)for(var oe=0;oe<O.length;++oe){var Ie=O[oe];if(Ie.to==null){var Te=W0(L,Ie.marker);Te?N&&(Ie.to=Te.to==null?null:Te.to+te):Ie.to=f}}if(L)for(var ze=0;ze<L.length;++ze){var Qe=L[ze];if(Qe.to!=null&&(Qe.to+=te),Qe.from==null){var st=W0(O,Qe.marker);st||(Qe.from=te,N&&(O||(O=[])).push(Qe))}else Qe.from+=te,N&&(O||(O=[])).push(Qe)}O&&(O=ES(O)),L&&L!=O&&(L=ES(L));var mt=[O];if(!N){var xt=c.text.length-2,gt;if(xt>0&&O)for(var Mt=0;Mt<O.length;++Mt)O[Mt].to==null&&(gt||(gt=[])).push(new Hm(O[Mt].marker,null,null));for(var ni=0;ni<xt;++ni)mt.push(gt);mt.push(L)}return mt}function ES(s){for(var c=0;c<s.length;++c){var p=s[c];p.from!=null&&p.from==p.to&&p.marker.clearWhenEmpty!==!1&&s.splice(c--,1)}return s.length?s:null}function TV(s,c,p){var d=null;if(s.iter(c.line,p.line+1,function(Te){if(Te.markedSpans)for(var ze=0;ze<Te.markedSpans.length;++ze){var Qe=Te.markedSpans[ze].marker;Qe.readOnly&&(!d||Ge(d,Qe)==-1)&&(d||(d=[])).push(Qe)}}),!d)return null;for(var f=[{from:c,to:p}],x=0;x<d.length;++x)for(var k=d[x],O=k.find(0),L=0;L<f.length;++L){var N=f[L];if(!(yi(N.to,O.from)<0||yi(N.from,O.to)>0)){var te=[L,1],oe=yi(N.from,O.from),Ie=yi(N.to,O.to);(oe<0||!k.inclusiveLeft&&!oe)&&te.push({from:N.from,to:O.from}),(Ie>0||!k.inclusiveRight&&!Ie)&&te.push({from:O.to,to:N.to}),f.splice.apply(f,te),L+=te.length-3}}return f}function FS(s){var c=s.markedSpans;if(c){for(var p=0;p<c.length;++p)c[p].marker.detachLine(s);s.markedSpans=null}}function MS(s,c){if(c){for(var p=0;p<c.length;++p)c[p].marker.attachLine(s);s.markedSpans=c}}function jm(s){return s.inclusiveLeft?-1:0}function Um(s){return s.inclusiveRight?1:0}function Zy(s,c){var p=s.lines.length-c.lines.length;if(p!=0)return p;var d=s.find(),f=c.find(),x=yi(d.from,f.from)||jm(s)-jm(c);if(x)return-x;var k=yi(d.to,f.to)||Um(s)-Um(c);return k||c.id-s.id}function OS(s,c){var p=bl&&s.markedSpans,d;if(p)for(var f=void 0,x=0;x<p.length;++x)f=p[x],f.marker.collapsed&&(c?f.from:f.to)==null&&(!d||Zy(d,f.marker)<0)&&(d=f.marker);return d}function AS(s){return OS(s,!0)}function qm(s){return OS(s,!1)}function kV(s,c){var p=bl&&s.markedSpans,d;if(p)for(var f=0;f<p.length;++f){var x=p[f];x.marker.collapsed&&(x.from==null||x.from<c)&&(x.to==null||x.to>c)&&(!d||Zy(d,x.marker)<0)&&(d=x.marker)}return d}function RS(s,c,p,d,f){var x=Qt(s,c),k=bl&&x.markedSpans;if(k)for(var O=0;O<k.length;++O){var L=k[O];if(L.marker.collapsed){var N=L.marker.find(0),te=yi(N.from,p)||jm(L.marker)-jm(f),oe=yi(N.to,d)||Um(L.marker)-Um(f);if(!(te>=0&&oe<=0||te<=0&&oe>=0)&&(te<=0&&(L.marker.inclusiveRight&&f.inclusiveLeft?yi(N.to,p)>=0:yi(N.to,p)>0)||te>=0&&(L.marker.inclusiveRight&&f.inclusiveLeft?yi(N.from,d)<=0:yi(N.from,d)<0)))return!0}}}function hs(s){for(var c;c=AS(s);)s=c.find(-1,!0).line;return s}function DV(s){for(var c;c=qm(s);)s=c.find(1,!0).line;return s}function IV(s){for(var c,p;c=qm(s);)s=c.find(1,!0).line,(p||(p=[])).push(s);return p}function Yy(s,c){var p=Qt(s,c),d=hs(p);return p==d?c:rn(d)}function LS(s,c){if(c>s.lastLine())return c;var p=Qt(s,c),d;if(!fc(s,p))return c;for(;d=qm(p);)p=d.find(1,!0).line;return rn(p)+1}function fc(s,c){var p=bl&&c.markedSpans;if(p){for(var d=void 0,f=0;f<p.length;++f)if(d=p[f],!!d.marker.collapsed){if(d.from==null)return!0;if(!d.marker.widgetNode&&d.from==0&&d.marker.inclusiveLeft&&Xy(s,c,d))return!0}}}function Xy(s,c,p){if(p.to==null){var d=p.marker.find(1,!0);return Xy(s,d.line,W0(d.line.markedSpans,p.marker))}if(p.marker.inclusiveRight&&p.to==c.text.length)return!0;for(var f=void 0,x=0;x<c.markedSpans.length;++x)if(f=c.markedSpans[x],f.marker.collapsed&&!f.marker.widgetNode&&f.from==p.to&&(f.to==null||f.to!=p.from)&&(f.marker.inclusiveLeft||p.marker.inclusiveRight)&&Xy(s,c,f))return!0}function yl(s){s=hs(s);for(var c=0,p=s.parent,d=0;d<p.lines.length;++d){var f=p.lines[d];if(f==s)break;c+=f.height}for(var x=p.parent;x;p=x,x=p.parent)for(var k=0;k<x.children.length;++k){var O=x.children[k];if(O==p)break;c+=O.height}return c}function Wm(s){if(s.height==0)return 0;for(var c=s.text.length,p,d=s;p=AS(d);){var f=p.find(0,!0);d=f.from.line,c+=f.from.ch-f.to.ch}for(d=s;p=qm(d);){var x=p.find(0,!0);c-=d.text.length-x.from.ch,d=x.to.line,c+=d.text.length-x.to.ch}return c}function Jy(s){var c=s.display,p=s.doc;c.maxLine=Qt(p,p.first),c.maxLineLength=Wm(c.maxLine),c.maxLineChanged=!0,p.iter(function(d){var f=Wm(d);f>c.maxLineLength&&(c.maxLineLength=f,c.maxLine=d)})}var kd=function(s,c,p){this.text=s,MS(this,c),this.height=p?p(this):1};kd.prototype.lineNo=function(){return rn(this)},_l(kd);function EV(s,c,p,d){s.text=c,s.stateAfter&&(s.stateAfter=null),s.styles&&(s.styles=null),s.order!=null&&(s.order=null),FS(s),MS(s,p);var f=d?d(s):1;f!=s.height&&js(s,f)}function FV(s){s.parent=null,FS(s)}var MV={},OV={};function BS(s,c){if(!s||/^\s*$/.test(s))return null;var p=c.addModeClass?OV:MV;return p[s]||(p[s]=s.replace(/\S+/g,"cm-$&"))}function $S(s,c){var p=me("span",null,null,u?"padding-right: .1px":null),d={pre:me("pre",[p],"CodeMirror-line"),content:p,col:0,pos:0,cm:s,trailingSpace:!1,splitSpaces:s.getOption("lineWrapping")};c.measure={};for(var f=0;f<=(c.rest?c.rest.length:0);f++){var x=f?c.rest[f-1]:c.line,k=void 0;d.pos=0,d.addToken=RV,cV(s.display.measure)&&(k=er(x,s.doc.direction))&&(d.addToken=BV(d.addToken,k)),d.map=[];var O=c!=s.display.externalMeasured&&rn(x);$V(x,d,CS(s,x,O)),x.styleClasses&&(x.styleClasses.bgClass&&(d.bgClass=ie(x.styleClasses.bgClass,d.bgClass||"")),x.styleClasses.textClass&&(d.textClass=ie(x.styleClasses.textClass,d.textClass||""))),d.map.length==0&&d.map.push(0,0,d.content.appendChild(By(s.display.measure))),f==0?(c.measure.map=d.map,c.measure.cache={}):((c.measure.maps||(c.measure.maps=[])).push(d.map),(c.measure.caches||(c.measure.caches=[])).push({}))}if(u){var L=d.content.lastChild;(/\bcm-tab\b/.test(L.className)||L.querySelector&&L.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack")}return Nn(s,"renderLine",s,c.line,d.pre),d.pre.className&&(d.textClass=ie(d.pre.className,d.textClass||"")),d}function AV(s){var c=X("span","\u2022","cm-invalidchar");return c.title="\\u"+s.charCodeAt(0).toString(16),c.setAttribute("aria-label",c.title),c}function RV(s,c,p,d,f,x,k){if(c){var O=s.splitSpaces?LV(c,s.trailingSpace):c,L=s.cm.state.specialChars,N=!1,te;if(!L.test(c))s.col+=c.length,te=document.createTextNode(O),s.map.push(s.pos,s.pos+c.length,te),a&&l<9&&(N=!0),s.pos+=c.length;else{te=document.createDocumentFragment();for(var oe=0;;){L.lastIndex=oe;var Ie=L.exec(c),Te=Ie?Ie.index-oe:c.length-oe;if(Te){var ze=document.createTextNode(O.slice(oe,oe+Te));a&&l<9?te.appendChild(X("span",[ze])):te.appendChild(ze),s.map.push(s.pos,s.pos+Te,ze),s.col+=Te,s.pos+=Te}if(!Ie)break;oe+=Te+1;var Qe=void 0;if(Ie[0]==" "){var st=s.cm.options.tabSize,mt=st-s.col%st;Qe=te.appendChild(X("span",ei(mt),"cm-tab")),Qe.setAttribute("role","presentation"),Qe.setAttribute("cm-text"," "),s.col+=mt}else Ie[0]=="\r"||Ie[0]==` `?(Qe=te.appendChild(X("span",Ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Qe.setAttribute("cm-text",Ie[0]),s.col+=1):(Qe=s.cm.options.specialCharPlaceholder(Ie[0]),Qe.setAttribute("cm-text",Ie[0]),a&&l<9?te.appendChild(X("span",[Qe])):te.appendChild(Qe),s.col+=1);s.map.push(s.pos,s.pos+1,Qe),s.pos++}}if(s.trailingSpace=O.charCodeAt(c.length-1)==32,p||d||f||N||x||k){var xt=p||"";d&&(xt+=d),f&&(xt+=f);var gt=X("span",[te],xt,x);if(k)for(var Mt in k)k.hasOwnProperty(Mt)&&Mt!="style"&&Mt!="class"&&gt.setAttribute(Mt,k[Mt]);return s.content.appendChild(gt)}s.content.appendChild(te)}}function LV(s,c){if(s.length>1&&!/ /.test(s))return s;for(var p=c,d="",f=0;f<s.length;f++){var x=s.charAt(f);x==" "&&p&&(f==s.length-1||s.charCodeAt(f+1)==32)&&(x="\xA0"),d+=x,p=x==" "}return d}function BV(s,c){return function(p,d,f,x,k,O,L){f=f?f+" cm-force-border":"cm-force-border";for(var N=p.pos,te=N+d.length;;){for(var oe=void 0,Ie=0;Ie<c.length&&(oe=c[Ie],!(oe.to>N&&oe.from<=N));Ie++);if(oe.to>=te)return s(p,d,f,x,k,O,L);s(p,d.slice(0,oe.to-N),f,x,null,O,L),x=null,d=d.slice(oe.to-N),N=oe.to}}}function PS(s,c,p,d){var f=!d&&p.widgetNode;f&&s.map.push(s.pos,s.pos+c,f),!d&&s.cm.display.input.needsContentAttribute&&(f||(f=s.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",p.id)),f&&(s.cm.display.input.setUneditable(f),s.content.appendChild(f)),s.pos+=c,s.trailingSpace=!1}function $V(s,c,p){var d=s.markedSpans,f=s.text,x=0;if(!d){for(var k=1;k<p.length;k+=2)c.addToken(c,f.slice(x,x=p[k]),BS(p[k+1],c.cm.options));return}for(var O=f.length,L=0,N=1,te="",oe,Ie,Te=0,ze,Qe,st,mt,xt;;){if(Te==L){ze=Qe=st=Ie="",xt=null,mt=null,Te=1/0;for(var gt=[],Mt=void 0,ni=0;ni<d.length;++ni){var Xt=d[ni],Ei=Xt.marker;if(Ei.type=="bookmark"&&Xt.from==L&&Ei.widgetNode)gt.push(Ei);else if(Xt.from<=L&&(Xt.to==null||Xt.to>L||Ei.collapsed&&Xt.to==L&&Xt.from==L)){if(Xt.to!=null&&Xt.to!=L&&Te>Xt.to&&(Te=Xt.to,Qe=""),Ei.className&&(ze+=" "+Ei.className),Ei.css&&(Ie=(Ie?Ie+";":"")+Ei.css),Ei.startStyle&&Xt.from==L&&(st+=" "+Ei.startStyle),Ei.endStyle&&Xt.to==Te&&(Mt||(Mt=[])).push(Ei.endStyle,Xt.to),Ei.title&&((xt||(xt={})).title=Ei.title),Ei.attributes)for(var mn in Ei.attributes)(xt||(xt={}))[mn]=Ei.attributes[mn];Ei.collapsed&&(!mt||Zy(mt.marker,Ei)<0)&&(mt=Xt)}else Xt.from>L&&Te>Xt.from&&(Te=Xt.from)}if(Mt)for(var Fr=0;Fr<Mt.length;Fr+=2)Mt[Fr+1]==Te&&(Qe+=" "+Mt[Fr]);if(!mt||mt.from==L)for(var zn=0;zn<gt.length;++zn)PS(c,0,gt[zn]);if(mt&&(mt.from||0)==L){if(PS(c,(mt.to==null?O+1:mt.to)-L,mt.marker,mt.from==null),mt.to==null)return;mt.to==L&&(mt=!1)}}if(L>=O)break;for(var Ho=Math.min(O,Te);;){if(te){var To=L+te.length;if(!mt){var cr=To>Ho?te.slice(0,Ho-L):te;c.addToken(c,cr,oe?oe+ze:ze,st,L+cr.length==Te?Qe:"",Ie,xt)}if(To>=Ho){te=te.slice(Ho-L),L=Ho;break}L=To,st=""}te=f.slice(x,x=p[N++]),oe=BS(p[N++],c.cm.options)}}}function VS(s,c,p){this.line=c,this.rest=IV(c),this.size=this.rest?rn(Tt(this.rest))-p+1:1,this.node=this.text=null,this.hidden=fc(s,c)}function Gm(s,c,p){for(var d=[],f,x=c;x<p;x=f){var k=new VS(s.doc,Qt(s.doc,x),x);f=x+k.size,d.push(k)}return d}var Dd=null;function PV(s){Dd?Dd.ops.push(s):s.ownsGroup=Dd={ops:[s],delayedCallbacks:[]}}function VV(s){var c=s.delayedCallbacks,p=0;do{for(;p<c.length;p++)c[p].call(null);for(var d=0;d<s.ops.length;d++){var f=s.ops[d];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(p<c.length)}function NV(s,c){var p=s.ownsGroup;if(p)try{VV(p)}finally{Dd=null,c(p)}}var G0=null;function Dr(s,c){var p=yd(s,c);if(p.length){var d=Array.prototype.slice.call(arguments,2),f;Dd?f=Dd.delayedCallbacks:G0?f=G0:(f=G0=[],setTimeout(zV,0));for(var x=function(O){f.push(function(){return p[O].apply(null,d)})},k=0;k<p.length;++k)x(k)}}function zV(){var s=G0;G0=null;for(var c=0;c<s.length;++c)s[c]()}function NS(s,c,p,d){for(var f=0;f<c.changes.length;f++){var x=c.changes[f];x=="text"?jV(s,c):x=="gutter"?HS(s,c,p,d):x=="class"?ex(s,c):x=="widget"&&UV(s,c,d)}c.changes=null}function K0(s){return s.node==s.text&&(s.node=X("div",null,null,"position: relative"),s.text.parentNode&&s.text.parentNode.replaceChild(s.node,s.text),s.node.appendChild(s.text),a&&l<8&&(s.node.style.zIndex=2)),s.node}function HV(s,c){var p=c.bgClass?c.bgClass+" "+(c.line.bgClass||""):c.line.bgClass;if(p&&(p+=" CodeMirror-linebackground"),c.background)p?c.background.className=p:(c.background.parentNode.removeChild(c.background),c.background=null);else if(p){var d=K0(c);c.background=d.insertBefore(X("div",null,p),d.firstChild),s.display.input.setUneditable(c.background)}}function zS(s,c){var p=s.display.externalMeasured;return p&&p.line==c.line?(s.display.externalMeasured=null,c.measure=p.measure,p.built):$S(s,c)}function jV(s,c){var p=c.text.className,d=zS(s,c);c.text==c.node&&(c.node=d.pre),c.text.parentNode.replaceChild(d.pre,c.text),c.text=d.pre,d.bgClass!=c.bgClass||d.textClass!=c.textClass?(c.bgClass=d.bgClass,c.textClass=d.textClass,ex(s,c)):p&&(c.text.className=p)}function ex(s,c){HV(s,c),c.line.wrapClass?K0(c).className=c.line.wrapClass:c.node!=c.text&&(c.node.className="");var p=c.textClass?c.textClass+" "+(c.line.textClass||""):c.line.textClass;c.text.className=p||""}function HS(s,c,p,d){if(c.gutter&&(c.node.removeChild(c.gutter),c.gutter=null),c.gutterBackground&&(c.node.removeChild(c.gutterBackground),c.gutterBackground=null),c.line.gutterClass){var f=K0(c);c.gutterBackground=X("div",null,"CodeMirror-gutter-background "+c.line.gutterClass,"left: "+(s.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),s.display.input.setUneditable(c.gutterBackground),f.insertBefore(c.gutterBackground,c.text)}var x=c.line.gutterMarkers;if(s.options.lineNumbers||x){var k=K0(c),O=c.gutter=X("div",null,"CodeMirror-gutter-wrapper","left: "+(s.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(O.setAttribute("aria-hidden","true"),s.display.input.setUneditable(O),k.insertBefore(O,c.text),c.line.gutterClass&&(O.className+=" "+c.line.gutterClass),s.options.lineNumbers&&(!x||!x["CodeMirror-linenumbers"])&&(c.lineNumber=O.appendChild(X("div",Uy(s.options,p),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.display.lineNumInnerWidth+"px"))),x)for(var L=0;L<s.display.gutterSpecs.length;++L){var N=s.display.gutterSpecs[L].className,te=x.hasOwnProperty(N)&&x[N];te&&O.appendChild(X("div",[te],"CodeMirror-gutter-elt","left: "+d.gutterLeft[N]+"px; width: "+d.gutterWidth[N]+"px"))}}}function UV(s,c,p){c.alignable&&(c.alignable=null);for(var d=le("CodeMirror-linewidget"),f=c.node.firstChild,x=void 0;f;f=x)x=f.nextSibling,d.test(f.className)&&c.node.removeChild(f);jS(s,c,p)}function qV(s,c,p,d){var f=zS(s,c);return c.text=c.node=f.pre,f.bgClass&&(c.bgClass=f.bgClass),f.textClass&&(c.textClass=f.textClass),ex(s,c),HS(s,c,p,d),jS(s,c,d),c.node}function jS(s,c,p){if(US(s,c.line,c,p,!0),c.rest)for(var d=0;d<c.rest.length;d++)US(s,c.rest[d],c,p,!1)}function US(s,c,p,d,f){if(c.widgets)for(var x=K0(p),k=0,O=c.widgets;k<O.length;++k){var L=O[k],N=X("div",[L.node],"CodeMirror-linewidget"+(L.className?" "+L.className:""));L.handleMouseEvents||N.setAttribute("cm-ignore-events","true"),WV(L,N,p,d),s.display.input.setUneditable(N),f&&L.above?x.insertBefore(N,p.gutter||p.text):x.appendChild(N),Dr(L,"redraw")}}function WV(s,c,p,d){if(s.noHScroll){(p.alignable||(p.alignable=[])).push(c);var f=d.wrapperWidth;c.style.left=d.fixedPos+"px",s.coverGutter||(f-=d.gutterTotalWidth,c.style.paddingLeft=d.gutterTotalWidth+"px"),c.style.width=f+"px"}s.coverGutter&&(c.style.zIndex=5,c.style.position="relative",s.noHScroll||(c.style.marginLeft=-d.gutterTotalWidth+"px"))}function Q0(s){if(s.height!=null)return s.height;var c=s.doc.cm;if(!c)return 0;if(!Fe(document.body,s.node)){var p="position: relative;";s.coverGutter&&(p+="margin-left: -"+c.display.gutters.offsetWidth+"px;"),s.noHScroll&&(p+="width: "+c.display.wrapper.clientWidth+"px;"),xe(c.display.measure,X("div",[s.node],null,p))}return s.height=s.node.parentNode.offsetHeight}function xl(s,c){for(var p=Cd(c);p!=s.wrapper;p=p.parentNode)if(!p||p.nodeType==1&&p.getAttribute("cm-ignore-events")=="true"||p.parentNode==s.sizer&&p!=s.mover)return!0}function Km(s){return s.lineSpace.offsetTop}function tx(s){return s.mover.offsetHeight-s.lineSpace.offsetHeight}function qS(s){if(s.cachedPaddingH)return s.cachedPaddingH;var c=xe(s.measure,X("pre","x","CodeMirror-line-like")),p=window.getComputedStyle?window.getComputedStyle(c):c.currentStyle,d={left:parseInt(p.paddingLeft),right:parseInt(p.paddingRight)};return!isNaN(d.left)&&!isNaN(d.right)&&(s.cachedPaddingH=d),d}function qs(s){return Oe-s.display.nativeBarWidth}function vu(s){return s.display.scroller.clientWidth-qs(s)-s.display.barWidth}function ix(s){return s.display.scroller.clientHeight-qs(s)-s.display.barHeight}function GV(s,c,p){var d=s.options.lineWrapping,f=d&&vu(s);if(!c.measure.heights||d&&c.measure.width!=f){var x=c.measure.heights=[];if(d){c.measure.width=f;for(var k=c.text.firstChild.getClientRects(),O=0;O<k.length-1;O++){var L=k[O],N=k[O+1];Math.abs(L.bottom-N.bottom)>2&&x.push((L.bottom+N.top)/2-p.top)}}x.push(p.bottom-p.top)}}function WS(s,c,p){if(s.line==c)return{map:s.measure.map,cache:s.measure.cache};if(s.rest){for(var d=0;d<s.rest.length;d++)if(s.rest[d]==c)return{map:s.measure.maps[d],cache:s.measure.caches[d]};for(var f=0;f<s.rest.length;f++)if(rn(s.rest[f])>p)return{map:s.measure.maps[f],cache:s.measure.caches[f],before:!0}}}function KV(s,c){c=hs(c);var p=rn(c),d=s.display.externalMeasured=new VS(s.doc,c,p);d.lineN=p;var f=d.built=$S(s,d);return d.text=f.pre,xe(s.display.lineMeasure,f.pre),d}function GS(s,c,p,d){return Ws(s,Id(s,c),p,d)}function nx(s,c){if(c>=s.display.viewFrom&&c<s.display.viewTo)return s.display.view[yu(s,c)];var p=s.display.externalMeasured;if(p&&c>=p.lineN&&c<p.lineN+p.size)return p}function Id(s,c){var p=rn(c),d=nx(s,p);d&&!d.text?d=null:d&&d.changes&&(NS(s,d,p,lx(s)),s.curOp.forceUpdate=!0),d||(d=KV(s,c));var f=WS(d,c,p);return{line:c,view:d,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Ws(s,c,p,d,f){c.before&&(p=-1);var x=p+(d||""),k;return c.cache.hasOwnProperty(x)?k=c.cache[x]:(c.rect||(c.rect=c.view.text.getBoundingClientRect()),c.hasHeights||(GV(s,c.view,c.rect),c.hasHeights=!0),k=ZV(s,c,p,d),k.bogus||(c.cache[x]=k)),{left:k.left,right:k.right,top:f?k.rtop:k.top,bottom:f?k.rbottom:k.bottom}}var KS={left:0,right:0,top:0,bottom:0};function QS(s,c,p){for(var d,f,x,k,O,L,N=0;N<s.length;N+=3)if(O=s[N],L=s[N+1],c<O?(f=0,x=1,k="left"):c<L?(f=c-O,x=f+1):(N==s.length-3||c==L&&s[N+3]>c)&&(x=L-O,f=x-1,c>=L&&(k="right")),f!=null){if(d=s[N+2],O==L&&p==(d.insertLeft?"left":"right")&&(k=p),p=="left"&&f==0)for(;N&&s[N-2]==s[N-3]&&s[N-1].insertLeft;)d=s[(N-=3)+2],k="left";if(p=="right"&&f==L-O)for(;N<s.length-3&&s[N+3]==s[N+4]&&!s[N+5].insertLeft;)d=s[(N+=3)+2],k="right";break}return{node:d,start:f,end:x,collapse:k,coverStart:O,coverEnd:L}}function QV(s,c){var p=KS;if(c=="left")for(var d=0;d<s.length&&(p=s[d]).left==p.right;d++);else for(var f=s.length-1;f>=0&&(p=s[f]).left==p.right;f--);return p}function ZV(s,c,p,d){var f=QS(c.map,p,d),x=f.node,k=f.start,O=f.end,L=f.collapse,N;if(x.nodeType==3){for(var te=0;te<4;te++){for(;k&&aa(c.line.text.charAt(f.coverStart+k));)--k;for(;f.coverStart+O<f.coverEnd&&aa(c.line.text.charAt(f.coverStart+O));)++O;if(a&&l<9&&k==0&&O==f.coverEnd-f.coverStart?N=x.parentNode.getBoundingClientRect():N=QV(De(x,k,O).getClientRects(),d),N.left||N.right||k==0)break;O=k,k=k-1,L="right"}a&&l<11&&(N=YV(s.display.measure,N))}else{k>0&&(L=d="right");var oe;s.options.lineWrapping&&(oe=x.getClientRects()).length>1?N=oe[d=="right"?oe.length-1:0]:N=x.getBoundingClientRect()}if(a&&l<9&&!k&&(!N||!N.left&&!N.right)){var Ie=x.parentNode.getClientRects()[0];Ie?N={left:Ie.left,right:Ie.left+Fd(s.display),top:Ie.top,bottom:Ie.bottom}:N=KS}for(var Te=N.top-c.rect.top,ze=N.bottom-c.rect.top,Qe=(Te+ze)/2,st=c.view.measure.heights,mt=0;mt<st.length-1&&!(Qe<st[mt]);mt++);var xt=mt?st[mt-1]:0,gt=st[mt],Mt={left:(L=="right"?N.right:N.left)-c.rect.left,right:(L=="left"?N.left:N.right)-c.rect.left,top:xt,bottom:gt};return!N.left&&!N.right&&(Mt.bogus=!0),s.options.singleCursorHeightPerLine||(Mt.rtop=Te,Mt.rbottom=ze),Mt}function YV(s,c){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!pV(s))return c;var p=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:c.left*p,right:c.right*p,top:c.top*d,bottom:c.bottom*d}}function ZS(s){if(s.measure&&(s.measure.cache={},s.measure.heights=null,s.rest))for(var c=0;c<s.rest.length;c++)s.measure.caches[c]={}}function YS(s){s.display.externalMeasure=null,fe(s.display.lineMeasure);for(var c=0;c<s.display.view.length;c++)ZS(s.display.view[c])}function Z0(s){YS(s),s.display.cachedCharWidth=s.display.cachedTextHeight=s.display.cachedPaddingH=null,s.options.lineWrapping||(s.display.maxLineChanged=!0),s.display.lineNumChars=null}function XS(s){return m&&E?-(s.body.getBoundingClientRect().left-parseInt(getComputedStyle(s.body).marginLeft)):s.defaultView.pageXOffset||(s.documentElement||s.body).scrollLeft}function JS(s){return m&&E?-(s.body.getBoundingClientRect().top-parseInt(getComputedStyle(s.body).marginTop)):s.defaultView.pageYOffset||(s.documentElement||s.body).scrollTop}function rx(s){var c=hs(s),p=c.widgets,d=0;if(p)for(var f=0;f<p.length;++f)p[f].above&&(d+=Q0(p[f]));return d}function Qm(s,c,p,d,f){if(!f){var x=rx(c);p.top+=x,p.bottom+=x}if(d=="line")return p;d||(d="local");var k=yl(c);if(d=="local"?k+=Km(s.display):k-=s.display.viewOffset,d=="page"||d=="window"){var O=s.display.lineSpace.getBoundingClientRect();k+=O.top+(d=="window"?0:JS(B(s)));var L=O.left+(d=="window"?0:XS(B(s)));p.left+=L,p.right+=L}return p.top+=k,p.bottom+=k,p}function eT(s,c,p){if(p=="div")return c;var d=c.left,f=c.top;if(p=="page")d-=XS(B(s)),f-=JS(B(s));else if(p=="local"||!p){var x=s.display.sizer.getBoundingClientRect();d+=x.left,f+=x.top}var k=s.display.lineSpace.getBoundingClientRect();return{left:d-k.left,top:f-k.top}}function Zm(s,c,p,d,f){return d||(d=Qt(s.doc,c.line)),Qm(s,d,GS(s,d,c.ch,f),p)}function fs(s,c,p,d,f,x){d=d||Qt(s.doc,c.line),f||(f=Id(s,d));function k(ze,Qe){var st=Ws(s,f,ze,Qe?"right":"left",x);return Qe?st.left=st.right:st.right=st.left,Qm(s,d,st,p)}var O=er(d,s.doc.direction),L=c.ch,N=c.sticky;if(L>=d.text.length?(L=d.text.length,N="before"):L<=0&&(L=0,N="after"),!O)return k(N=="before"?L-1:L,N=="before");function te(ze,Qe,st){var mt=O[Qe],xt=mt.level==1;return k(st?ze-1:ze,xt!=st)}var oe=Vo(O,L,N),Ie=ps,Te=te(L,oe,N=="before");return Ie!=null&&(Te.other=te(L,Ie,N!="before")),Te}function tT(s,c){var p=0;c=xi(s.doc,c),s.options.lineWrapping||(p=Fd(s.display)*c.ch);var d=Qt(s.doc,c.line),f=yl(d)+Km(s.display);return{left:p,right:p,top:f,bottom:f+d.height}}function ox(s,c,p,d,f){var x=nt(s,c,p);return x.xRel=f,d&&(x.outside=d),x}function ax(s,c,p){var d=s.doc;if(p+=s.display.viewOffset,p<0)return ox(d.first,0,null,-1,-1);var f=gu(d,p),x=d.first+d.size-1;if(f>x)return ox(d.first+d.size-1,Qt(d,x).text.length,null,1,1);c<0&&(c=0);for(var k=Qt(d,f);;){var O=XV(s,k,f,c,p),L=kV(k,O.ch+(O.xRel>0||O.outside>0?1:0));if(!L)return O;var N=L.find(1);if(N.line==f)return N;k=Qt(d,f=N.line)}}function iT(s,c,p,d){d-=rx(c);var f=c.text.length,x=co(function(k){return Ws(s,p,k-1).bottom<=d},f,0);return f=co(function(k){return Ws(s,p,k).top>d},x,f),{begin:x,end:f}}function nT(s,c,p,d){p||(p=Id(s,c));var f=Qm(s,c,Ws(s,p,d),"line").top;return iT(s,c,p,f)}function sx(s,c,p,d){return s.bottom<=p?!1:s.top>p?!0:(d?s.left:s.right)>c}function XV(s,c,p,d,f){f-=yl(c);var x=Id(s,c),k=rx(c),O=0,L=c.text.length,N=!0,te=er(c,s.doc.direction);if(te){var oe=(s.options.lineWrapping?eN:JV)(s,c,p,x,te,d,f);N=oe.level!=1,O=N?oe.from:oe.to-1,L=N?oe.to:oe.from-1}var Ie=null,Te=null,ze=co(function(ni){var Xt=Ws(s,x,ni);return Xt.top+=k,Xt.bottom+=k,sx(Xt,d,f,!1)?(Xt.top<=f&&Xt.left<=d&&(Ie=ni,Te=Xt),!0):!1},O,L),Qe,st,mt=!1;if(Te){var xt=d-Te.left<Te.right-d,gt=xt==N;ze=Ie+(gt?0:1),st=gt?"after":"before",Qe=xt?Te.left:Te.right}else{!N&&(ze==L||ze==O)&&ze++,st=ze==0?"after":ze==c.text.length?"before":Ws(s,x,ze-(N?1:0)).bottom+k<=f==N?"after":"before";var Mt=fs(s,nt(p,ze,st),"line",c,x);Qe=Mt.left,mt=f<Mt.top?-1:f>=Mt.bottom?1:0}return ze=Aa(c.text,ze,1),ox(p,ze,st,mt,d-Qe)}function JV(s,c,p,d,f,x,k){var O=co(function(oe){var Ie=f[oe],Te=Ie.level!=1;return sx(fs(s,nt(p,Te?Ie.to:Ie.from,Te?"before":"after"),"line",c,d),x,k,!0)},0,f.length-1),L=f[O];if(O>0){var N=L.level!=1,te=fs(s,nt(p,N?L.from:L.to,N?"after":"before"),"line",c,d);sx(te,x,k,!0)&&te.top>k&&(L=f[O-1])}return L}function eN(s,c,p,d,f,x,k){var O=iT(s,c,d