You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
197 KiB
35 lines
197 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[235],{"7ahc":function(ut,De,g){"use strict";g.d(De,"a",function(){return ke});var J=g("k1fw"),ye=g("0Owb"),fe=g("+L6B"),Le=g("2/Rp"),B=g("y8nQ"),W=g("Vl3Y"),P=g("tJVT"),Q=g("OaEy"),$=g("2fM7"),We=g("q1tI"),L=g.n(We),E=g("VrN/"),ue=g.n(E),ae=g("p77/"),de=g.n(ae),ee=g("c5Ni"),we=g.n(ee),Ie=$.a.Option,Te={labelCol:{span:4},wrapperCol:{span:20}},Ge={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};De.b=function(V){var Ee=V.callback,Me=V.onCancel,Oe=Object(We.useState)("python"),ce=Object(P.a)(Oe,2),pe=ce[0],re=ce[1];function _(te){re(Ge[te][1])}function se(te){Ee(te)}return L.a.createElement(W.a,Object(ye.a)({},Te,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:se}),L.a.createElement(W.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},L.a.createElement($.a,{onChange:_},Object.keys(Ge).map(function(te){return L.a.createElement(Ie,{key:te,value:te},Ge[te][0])}))),L.a.createElement(W.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},L.a.createElement(ke,{mode:pe})),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(Le.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(Le.a,{type:"ghost",onClick:Me},"\u53D6\u6D88")))};function ke(V){var Ee=V.value,Me=V.onChange,Oe=V.mode,ce=V.options,pe=ce===void 0?{}:ce,re=Object(We.useRef)(),_=Object(We.useState)(),se=Object(P.a)(_,2),te=se[0],Qe=se[1];return Object(We.useEffect)(function(){if(te){function be(Y){var Re=Y.getValue();Me&&Me(Re)}return te.on("change",be),function(){te.off("change",be)}}},[te,Me]),Object(We.useEffect)(function(){te&&te.setOption("mode",Oe)},[te,Oe]),Object(We.useEffect)(function(){te&&((Ee!==te.getValue()||Ee==="")&&setTimeout(function(){te.setValue(Ee||" ")},300))},[te,Ee]),Object(We.useEffect)(function(){if(re.current&&!te){var be=ue.a.fromTextArea(re.current,Object(J.a)({mode:Oe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},pe));Qe(be)}},[re.current,te]),L.a.createElement("div",{className:"my-codemirror-container"},L.a.createElement("textarea",{ref:re}))}},"9ZNV":function(ut,De,g){"use strict";g.d(De,"a",function(){return We});var J=g("0Owb"),ye=g("+L6B"),fe=g("2/Rp"),Le=g("q1tI"),B=g.n(Le),W=g("UUDw"),P=g.n(W),Q=g("TSYQ"),$=g.n(Q),We=function(E){var ue=E.cancelText,ae=ue===void 0?"\u53D6\u6D88":ue,de=E.okText,ee=de===void 0?"\u786E\u5B9A":de,we=E.loading,Ie=we===void 0?!1:we,Te=E.hasOkBtn,Ge=Te===void 0?!0:Te,ke=E.okButtonProps,V=ke===void 0?{}:ke,Ee=E.onCancel,Me=Ee===void 0?function(){}:Ee,Oe=E.onOk,ce=Oe===void 0?function(){}:Oe,pe=E.className,re=pe===void 0?"":pe;return B.a.createElement("div",{className:$()(P.a.buttonFixed,re)},B.a.createElement("div",{className:P.a.buttonWrap},B.a.createElement(fe.a,{size:"large",className:"".concat(P.a.button," mr20"),onClick:Me},ae),Ge&&B.a.createElement(fe.a,Object(J.a)({size:"large",type:"primary",className:"".concat(P.a.button," mr20"),loading:Ie,onClick:ce},V),ee)))}},Gytx:function(ut,De){ut.exports=function(J,ye,fe,Le){var B=fe?fe.call(Le,J,ye):void 0;if(B!==void 0)return!!B;if(J===ye)return!0;if(typeof J!="object"||!J||typeof ye!="object"||!ye)return!1;var W=Object.keys(J),P=Object.keys(ye);if(W.length!==P.length)return!1;for(var Q=Object.prototype.hasOwnProperty.bind(ye),$=0;$<W.length;$++){var We=W[$];if(!Q(We))return!1;var L=J[We],E=ye[We];if(B=fe?fe.call(Le,L,E,We):void 0,B===!1||B===void 0&&L!==E)return!1}return!0}},LdHM:function(ut,De,g){"use strict";g.d(De,"b",function(){return Ge}),g.d(De,"a",function(){return V});var J=g("1OyB"),ye=g("vuIU"),fe=g("Ji7U"),Le=g("LK+K"),B=g("q1tI"),W=g("rePB"),P=g("Ff2n"),Q=g("ODXe"),$=g("4IlW"),We=g("bX4T"),L=g("YrtM"),E=g("TSYQ"),ue=g.n(E),ae=g("+nKL"),de=g("8OUc"),ee=function(M,G){var X=M.prefixCls,He=M.id,Be=M.flattenOptions,C=M.childrenAsData,D=M.values,T=M.searchValue,A=M.multiple,b=M.defaultActiveFirstOption,U=M.height,k=M.itemHeight,H=M.notFoundContent,ne=M.open,ie=M.menuItemSelectedIcon,_e=M.virtual,je=M.onSelect,xe=M.onToggleOpen,qe=M.onActiveValue,At=M.onScroll,ot=M.onMouseEnter,he="".concat(X,"-item"),Ae=Object(L.a)(function(){return Be},[ne,Be],function(q,le){return le[0]&&q[1]!==le[1]}),ct=B.useRef(null),Et=function(le){le.preventDefault()},wt=function(le){ct.current&&ct.current.scrollTo({index:le})},kt=function(le){for(var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ue=Ae.length,Ce=0;Ce<Ue;Ce+=1){var Xe=(le+Ce*oe+Ue)%Ue,Ot=Ae[Xe],_t=Ot.group,Wt=Ot.data;if(!_t&&!Wt.disabled)return Xe}return-1},yr=B.useState(function(){return kt(0)}),pt=Object(Q.a)(yr,2),Mt=pt[0],I=pt[1],Dt=function(le){I(le);var oe=Ae[le];if(!oe){qe(null,-1);return}qe(oe.data.value,le)};B.useEffect(function(){Dt(b!==!1?kt(0):-1)},[Ae.length,T]),B.useEffect(function(){var q=setTimeout(function(){if(!A&&ne&&D.size===1){var le=Array.from(D)[0],oe=Ae.findIndex(function(Ue){var Ce=Ue.data;return Ce.value===le});Dt(oe),wt(oe)}});return function(){return clearTimeout(q)}},[ne]);var at=function(le){le!==void 0&&je(le,{selected:!D.has(le)}),A||xe(!1)};if(B.useImperativeHandle(G,function(){return{onKeyDown:function(le){var oe=le.which;switch(oe){case $.a.UP:case $.a.DOWN:{var Ue=0;if(oe===$.a.UP?Ue=-1:oe===$.a.DOWN&&(Ue=1),Ue!==0){var Ce=kt(Mt+Ue,Ue);wt(Ce),Dt(Ce)}break}case $.a.ENTER:{var Xe=Ae[Mt];Xe&&!Xe.data.disabled?at(Xe.data.value):at(void 0),ne&&le.preventDefault();break}case $.a.ESC:xe(!1)}},onKeyUp:function(){},scrollTo:function(le){wt(le)}}}),Ae.length===0)return B.createElement("div",{role:"listbox",id:"".concat(He,"_list"),className:"".concat(he,"-empty"),onMouseDown:Et},H);function Ne(q){var le=Ae[q];if(!le)return null;var oe=le.data||{},Ue=oe.value,Ce=oe.label,Xe=oe.children,Ot=Object(We.a)(oe,!0),_t=C?Xe:Ce;return le?B.createElement("div",Object.assign({"aria-label":typeof _t=="string"?_t:null},Ot,{key:q,role:"option",id:"".concat(He,"_list_").concat(q),"aria-selected":D.has(Ue)}),Ue):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(He,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(Mt-1),Ne(Mt),Ne(Mt+1)),B.createElement(ae.a,{itemKey:"key",ref:ct,data:Ae,height:U,itemHeight:k,fullHeight:!1,onMouseDown:Et,onScroll:At,virtual:_e,onMouseEnter:ot},function(q,le){var oe,Ue=q.group,Ce=q.groupOption,Xe=q.data,Ot=Xe.label,_t=Xe.key;if(Ue)return B.createElement("div",{className:ue()(he,"".concat(he,"-group"))},Ot!==void 0?Ot:_t);var Wt=Xe.disabled,br=Xe.value,qn=Xe.title,Hr=Xe.children,$n=Xe.style,Br=Xe.className,ei=Object(P.a)(Xe,["disabled","value","title","children","style","className"]),It=D.has(br),Jt="".concat(he,"-option"),ti=ue()(he,Jt,Br,(oe={},Object(W.a)(oe,"".concat(Jt,"-grouped"),Ce),Object(W.a)(oe,"".concat(Jt,"-active"),Mt===le&&!Wt),Object(W.a)(oe,"".concat(Jt,"-disabled"),Wt),Object(W.a)(oe,"".concat(Jt,"-selected"),It),oe)),jr=C?Hr:Ot,ri=!ie||typeof ie=="function"||It;return B.createElement("div",Object.assign({},ei,{"aria-selected":It,className:ti,title:qn,onMouseMove:function(){if(Mt===le||Wt)return;Dt(le)},onClick:function(){Wt||at(br)},style:$n}),B.createElement("div",{className:"".concat(Jt,"-content")},jr||br),B.isValidElement(ie)||It,ri&&B.createElement(de.a,{className:"".concat(he,"-option-state"),customizeIcon:ie,customizeIconProps:{isSelected:It}},It?"\u2713":null))}))},we=B.forwardRef(ee);we.displayName="OptionList";var Ie=we,Te=function(){return null};Te.isSelectOption=!0;var Ge=Te,ke=function(){return null};ke.isSelectOptGroup=!0;var V=ke,Ee=g("VTBJ"),Me=g("Zm9Q");function Oe(z){var M=z.key,G=z.props,X=G.children,He=G.value,Be=Object(P.a)(G,["children","value"]);return Object(Ee.a)({key:M,value:He!==void 0?He:M,children:X},Be)}function ce(z){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Me.a)(z).map(function(G,X){if(!B.isValidElement(G)||!G.type)return null;var He=G.type.isSelectOptGroup,Be=G.key,C=G.props,D=C.children,T=Object(P.a)(C,["children"]);return M||!He?Oe(G):Object(Ee.a)(Object(Ee.a)({key:"__RC_SELECT_GRP__".concat(Be===null?X:Be,"__"),label:Be},T),{},{options:ce(D)})}).filter(function(G){return G})}var pe=g("2Qr1"),re=g("qNPg"),_=g("U8pU"),se=g("Kwbf"),te=g("WKfj");function Qe(z){var M=z.mode,G=z.options,X=z.children,He=z.backfill,Be=z.allowClear,C=z.placeholder,D=z.getInputElement,T=z.showSearch,A=z.onSearch,b=z.defaultOpen,U=z.autoFocus,k=z.labelInValue,H=z.value,ne=z.inputValue,ie=z.optionLabelProp,_e=M==="multiple"||M==="tags",je=T!==void 0?T:_e||M==="combobox",xe=G||ce(X);if(Object(se.a)(M!=="tags"||xe.every(function(he){return!he.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),M==="tags"||M==="combobox"){var qe=xe.some(function(he){return he.options?he.options.some(function(Ae){return typeof("value"in Ae?Ae.value:Ae.key)=="number"}):typeof("value"in he?he.value:he.key)=="number"});Object(se.a)(!qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(se.a)(M!=="combobox"||!ie,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(se.a)(M==="combobox"||!He,"`backfill` only works with `combobox` mode."),Object(se.a)(M==="combobox"||!D,"`getInputElement` only work with `combobox` mode."),Object(se.b)(M!=="combobox"||!D||!Be||!C,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),A&&!je&&M!=="combobox"&&M!=="tags"&&Object(se.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(se.b)(!b||U,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),H!=null){var At=Object(te.d)(H);Object(se.a)(!k||At.every(function(he){return Object(_.a)(he)==="object"&&("key"in he||"value"in he)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(se.a)(!_e||Array.isArray(H),"`value` should be array when `mode` is `multiple` or `tags`")}if(X){var ot=null;Object(Me.a)(X).some(function(he){if(!B.isValidElement(he)||!he.type)return!1;var Ae=he.type;if(Ae.isSelectOption)return!1;if(Ae.isSelectOptGroup){var ct=Object(Me.a)(he.props.children).every(function(Et){return!B.isValidElement(Et)||!he.type||Et.type.isSelectOption?!0:(ot=Et.type,!1)});return!ct}return ot=Ae,!0}),ot&&Object(se.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ot.displayName||ot.name||ot,"`.")),Object(se.a)(ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var be=Qe,Y=Object(re.a)({prefixCls:"rc-select",components:{optionList:Ie},convertChildrenToData:ce,flattenOptions:pe.d,getLabeledValue:pe.e,filterOptions:pe.b,isValueDisabled:pe.g,findValueOption:pe.c,warningProps:be,fillOptionsWithMissingValue:pe.a}),Re=function(z){Object(fe.a)(G,z);var M=Object(Le.a)(G);function G(){var X;return Object(J.a)(this,G),X=M.apply(this,arguments),X.selectRef=B.createRef(),X.focus=function(){X.selectRef.current.focus()},X.blur=function(){X.selectRef.current.blur()},X}return Object(ye.a)(G,[{key:"render",value:function(){return B.createElement(Y,Object.assign({ref:this.selectRef},this.props))}}]),G}(B.Component);Re.Option=Ge,Re.OptGroup=V;var dt=Re,St=De.c=dt},UUDw:function(ut,De,g){ut.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/":function(ut,De,g){(function(J,ye){ut.exports=ye()})(this,function(){"use strict";var J=navigator.userAgent,ye=navigator.platform,fe=/gecko\/\d/i.test(J),Le=/MSIE \d/.test(J),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(J),W=/Edge\/(\d+)/.exec(J),P=Le||B||W,Q=P&&(Le?document.documentMode||6:+(W||B)[1]),$=!W&&/WebKit\//.test(J),We=$&&/Qt\/\d+\.\d+/.test(J),L=!W&&/Chrome\//.test(J),E=/Opera\//.test(J),ue=/Apple Computer/.test(navigator.vendor),ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(J),de=/PhantomJS/.test(J),ee=!W&&/AppleWebKit/.test(J)&&/Mobile\/\w+/.test(J),we=/Android/.test(J),Ie=ee||we||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(J),Te=ee||/Mac/.test(ye),Ge=/\bCrOS\b/.test(J),ke=/win/i.test(ye),V=E&&J.match(/Version\/(\d*\.\d*)/);V&&(V=Number(V[1])),V&&V>=15&&(E=!1,$=!0);var Ee=Te&&(We||E&&(V==null||V<12.11)),Me=fe||P&&Q>=9;function Oe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ce=function(e,t){var n=e.className,r=Oe(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function pe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function re(e,t){return pe(e).appendChild(t)}function _(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function se(e,t,n,r){var i=_(e,t,n,r);return i.setAttribute("role","presentation"),i}var te;document.createRange?te=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:te=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function Qe(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function be(){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 Y(e,t){var n=e.className;Oe(t).test(n)||(e.className+=(n?" ":"")+t)}function Re(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Oe(n[r]).test(t)&&(t+=" "+n[r]);return t}var dt=function(e){e.select()};ee?dt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:P&&(dt=function(e){try{e.select()}catch(t){}});function St(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function z(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function M(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var s=e.indexOf(" ",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}var G=function(){this.id=null,this.f=null,this.time=0,this.handler=St(this.onTimeout,this)};G.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},G.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)};function X(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var He=50,Be={toString:function(){return"CodeMirror.Pass"}},C={scroll:!1},D={origin:"*mouse"},T={origin:"+move"};function A(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var b=[""];function U(e){for(;b.length<=e;)b.push(k(b)+" ");return b[e]}function k(e){return e[e.length-1]}function H(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ne(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ie(){}function _e(e,t){var n;return Object.create?n=Object.create(e):(ie.prototype=e,n=new ie),t&&z(t,n),n}var je=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||je.test(e))}function qe(e,t){return t?t.source.indexOf("\\w")>-1&&xe(e)?!0:t.test(e):xe(e)}function At(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ot=/[\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 he(e){return e.charCodeAt(0)>=768&&ot.test(e)}function Ae(e,t,n){for(;(n<0?t>0:t<e.length)&&he(e.charAt(t));)t+=n;return t}function ct(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function Et(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var wt=null;function kt(e,t,n){var r;wt=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:wt=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:wt=i)}return r!=null?r:wt}var yr=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(u,h,f){this.level=u,this.from=h,this.to=f}return function(u,h){var f=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var c=u.length,d=[],p=0;p<c;++p)d.push(n(u.charCodeAt(p)));for(var v=0,y=f;v<c;++v){var w=d[v];w=="m"?d[v]=y:y=w}for(var S=0,x=f;S<c;++S){var O=d[S];O=="1"&&x=="r"?d[S]="n":o.test(O)&&(x=O,O=="r"&&(d[S]="R"))}for(var F=1,N=d[0];F<c-1;++F){var Z=d[F];Z=="+"&&N=="1"&&d[F+1]=="1"?d[F]="1":Z==","&&N==d[F+1]&&(N=="1"||N=="n")&&(d[F]=N),N=Z}for(var Se=0;Se<c;++Se){var tt=d[Se];if(tt==",")d[Se]="N";else if(tt=="%"){var Fe=void 0;for(Fe=Se+1;Fe<c&&d[Fe]=="%";++Fe);for(var Ct=Se&&d[Se-1]=="!"||Fe<c&&d[Fe]=="1"?"1":"N",mt=Se;mt<Fe;++mt)d[mt]=Ct;Se=Fe-1}}for(var Ze=0,yt=f;Ze<c;++Ze){var it=d[Ze];yt=="L"&&it=="1"?d[Ze]="L":o.test(it)&&(yt=it)}for(var Ve=0;Ve<c;++Ve)if(i.test(d[Ve])){var Je=void 0;for(Je=Ve+1;Je<c&&i.test(d[Je]);++Je);for(var ze=(Ve?d[Ve-1]:f)=="L",bt=(Je<c?d[Je]:f)=="L",Ur=ze==bt?ze?"L":"R":f,ir=Ve;ir<Je;++ir)d[ir]=Ur;Ve=Je-1}for(var lt=[],jt,rt=0;rt<c;)if(a.test(d[rt])){var qi=rt;for(++rt;rt<c&&a.test(d[rt]);++rt);lt.push(new l(0,qi,rt))}else{var Zt=rt,gr=lt.length,mr=h=="rtl"?1:0;for(++rt;rt<c&&d[rt]!="L";++rt);for(var ft=Zt;ft<rt;)if(s.test(d[ft])){Zt<ft&&(lt.splice(gr,0,new l(1,Zt,ft)),gr+=mr);var zr=ft;for(++ft;ft<rt&&s.test(d[ft]);++ft);lt.splice(gr,0,new l(2,zr,ft)),gr+=mr,Zt=ft}else++ft;Zt<rt&<.splice(gr,0,new l(1,Zt,rt))}return h=="ltr"&&(lt[0].level==1&&(jt=u.match(/^\s+/))&&(lt[0].from=jt[0].length,lt.unshift(new l(0,0,jt[0].length))),k(lt).level==1&&(jt=u.match(/\s+$/))&&(k(lt).to-=jt[0].length,lt.push(new l(0,c-jt[0].length,c)))),h=="rtl"?lt.reverse():lt}}();function pt(e,t){var n=e.order;return n==null&&(n=e.order=yr(e.text,t)),n}var Mt=[],I=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Mt).concat(n)}};function Dt(e,t){return e._handlers&&e._handlers[t]||Mt}function at(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=X(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ne(e,t){var n=Dt(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function q(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ne(e,n||t.type,e,t),Ot(t)||t.codemirrorIgnore}function le(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)X(n,t[r])==-1&&n.push(t[r])}function oe(e,t){return Dt(e,t).length>0}function Ue(e){e.prototype.on=function(t,n){I(this,t,n)},e.prototype.off=function(t,n){at(this,t,n)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ot(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _t(e){Ce(e),Xe(e)}function Wt(e){return e.target||e.srcElement}function br(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Te&&e.ctrlKey&&t==1&&(t=3),t}var qn=function(){if(P&&Q<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),Hr;function $n(e){if(Hr==null){var t=_("span","\u200B");re(e,_("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Hr=t.offsetWidth<=1&&t.offsetHeight>2&&!(P&&Q<8))}var n=Hr?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Br;function ei(e){if(Br!=null)return Br;var t=re(e,document.createTextNode("A\u062EA")),n=te(t,0,1).getBoundingClientRect(),r=te(t,1,2).getBoundingClientRect();return pe(e),!n||n.left==n.right?!1:Br=r.right-n.right<3}var It=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Jt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ti=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jr=null;function ri(e){if(jr!=null)return jr;var t=re(e,_("span","x")),n=t.getBoundingClientRect(),r=te(t,0,1).getBoundingClientRect();return jr=Math.abs(n.left-r.left)>1}var Kr={},wr={};function is(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Kr[e]=t}function os(e,t){wr[e]=t}function wn(e){if(typeof e=="string"&&wr.hasOwnProperty(e))e=wr[e];else if(e&&typeof e.name=="string"&&wr.hasOwnProperty(e.name)){var t=wr[e.name];typeof t=="string"&&(t={name:t}),e=_e(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return wn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return wn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ni(e,t){t=wn(t);var n=Kr[t.name];if(!n)return ni(e,"text/plain");var r=n(e,t);if(xr.hasOwnProperty(t.name)){var i=xr[t.name];for(var o in i){if(!i.hasOwnProperty(o))continue;r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var xr={};function as(e,t){var n=xr.hasOwnProperty(e)?xr[e]:xr[e]={};z(t,n)}function or(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ii(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function eo(e,t,n){return e.startState?e.startState(t,n):!0}var Ye=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};Ye.prototype.eol=function(){return this.pos>=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ye.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Ye.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=M(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?M(this.string,this.lineStart,this.tabSize):0)},Ye.prototype.indentation=function(){return M(this.string,null,this.tabSize)-(this.lineStart?M(this.string,this.lineStart,this.tabSize):0)},Ye.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function R(e,t){if(t-=e.first,t<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 r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function ar(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function oi(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Ft(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ge(e){if(e.parent==null)return null;for(var t=e.parent,n=X(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function sr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],l=s.height;if(t<l)break;t-=l}return n+a}function Gr(e,t){return t>=e.first&&t<e.first+e.size}function ai(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function m(e,t,n){if(n===void 0&&(n=null),!(this instanceof m))return new m(e,t,n);this.line=e,this.ch=t,this.sticky=n}function j(e,t){return e.line-t.line||e.ch-t.ch}function si(e,t){return e.sticky==t.sticky&&j(e,t)==0}function li(e){return m(e.line,e.ch)}function xn(e,t){return j(e,t)<0?t:e}function Cn(e,t){return j(e,t)<0?e:t}function to(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function K(e,t){if(t.line<e.first)return m(e.first,0);var n=e.first+e.size-1;return t.line>n?m(n,R(e,n).text.length):ss(t,R(e,t.line).text.length)}function ss(e,t){var n=e.ch;return n==null||n>t?m(e.line,t):n<0?m(e.line,0):e}function ro(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=K(e,t[r]);return n}var Sn=function(e,t){this.state=e,this.lookAhead=t},Ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ut.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}},Ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ut.fromSaved=function(e,t,n){return t instanceof Sn?new Ut(e,or(e.mode,t.state),n,t.lookAhead):new Ut(e,or(e.mode,t),n)},Ut.prototype.save=function(e){var t=e!==!1?or(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Sn(t,this.maxLookAhead):t};function no(e,t,n,r){var i=[e.state.modeGen],o={};uo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,s=function(u){n.baseTokens=i;var h=e.state.overlays[u],f=1,c=0;n.state=!0,uo(e,t.text,h.mode,n,function(d,p){for(var v=f;c<d;){var y=i[f];y>d&&i.splice(f,1,d,i[f+1],y),f+=2,c=Math.min(d,y)}if(!p)return;if(h.opaque)i.splice(v,f-v,d,"overlay "+p),f=v+2;else for(;v<f;v+=2){var w=i[v+1];i[v+1]=(w?w+" ":"")+"overlay "+p}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function io(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Xr(e,ge(t)),i=t.text.length>e.options.maxHighlightLength&&or(e.doc.mode,r.state),o=no(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xr(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ut(r,!0,t);var o=ls(e,t,n),a=o>r.first&&R(r,o-1).stateAfter,s=a?Ut.fromSaved(r,a,o):new Ut(r,eo(r.mode),o);return r.iter(o,t,function(l){ui(e,l.text,s);var u=s.line;l.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function ui(e,t,n,r){var i=e.doc.mode,o=new Ye(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&oo(i,n.state);!o.eol();)hi(i,o,n.state),o.start=o.pos}function oo(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=ii(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function hi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ii(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.")}var ao=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function so(e,t,n,r){var i=e.doc,o=i.mode,a;t=K(i,t);var s=R(i,t.line),l=Xr(e,t.line,n),u=new Ye(s.text,e.options.tabSize,l),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=hi(o,u,l.state),r&&h.push(new ao(u,a,or(i.mode,l.state)));return r?h:new ao(u,a,l.state)}function lo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function uo(e,t,n,r,i,o,a){var s=n.flattenSpans;s==null&&(s=e.options.flattenSpans);var l=0,u=null,h=new Ye(t,e.options.tabSize,r),f,c=e.options.addModeClass&&[null];for(t==""&&lo(oo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,a&&ui(e,t,r,h.pos),h.pos=t.length,f=null):f=lo(hi(n,h,r.state,c),o),c){var d=c[0].name;d&&(f="m-"+(f?d+" "+f:d))}if(!s||u!=f){for(;l<h.start;)l=Math.min(h.start,l+5e3),i(l,u);u=f}h.start=h.pos}for(;l<h.pos;){var p=Math.min(h.pos,l+5e3);i(p,u),l=p}}function ls(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=R(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof Sn?u.lookAhead:0)<=o.modeFrontier))return s;var h=M(l.text,null,e.options.tabSize);(i==null||r>h)&&(i=s-1,r=h)}return i}function us(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=R(e,r).stateAfter;if(i&&(!(i instanceof Sn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var ho=!1,Kt=!1;function hs(){ho=!0}function fs(){Kt=!0}function En(e,t,n){this.marker=e,this.from=t,this.to=n}function Yr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function ds(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function cs(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ps(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new En(a,o.from,l?null:o.to))}}return r}function vs(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new En(a,l?null:o.from-t,o.to==null?null:o.to-t))}}return r}function fi(e,t){if(t.full)return null;var n=Gr(e,t.from.line)&&R(e,t.from.line).markedSpans,r=Gr(e,t.to.line)&&R(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=j(t.from,t.to)==0,s=ps(n,i,a),l=vs(r,o,a),u=t.text.length==1,h=k(t.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var c=s[f];if(c.to==null){var d=Yr(l,c.marker);d?u&&(c.to=d.to==null?null:d.to+h):c.to=i}}if(l)for(var p=0;p<l.length;++p){var v=l[p];if(v.to!=null&&(v.to+=h),v.from==null){var y=Yr(s,v.marker);y||(v.from=h,u&&(s||(s=[])).push(v))}else v.from+=h,u&&(s||(s=[])).push(v)}s&&(s=fo(s)),l&&l!=s&&(l=fo(l));var w=[s];if(!u){var S=t.text.length-2,x;if(S>0&&s)for(var O=0;O<s.length;++O)s[O].to==null&&(x||(x=[])).push(new En(s[O].marker,null,null));for(var F=0;F<S;++F)w.push(x);w.push(l)}return w}function fo(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function gs(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(d){if(d.markedSpans)for(var p=0;p<d.markedSpans.length;++p){var v=d.markedSpans[p].marker;v.readOnly&&(!r||X(r,v)==-1)&&(r||(r=[])).push(v)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(j(u.to,s.from)<0||j(u.from,s.to)>0)continue;var h=[l,1],f=j(u.from,s.from),c=j(u.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&h.push({from:u.from,to:s.from}),(c>0||!a.inclusiveRight&&!c)&&h.push({from:s.to,to:u.to}),i.splice.apply(i,h),l+=h.length-3}return i}function co(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function po(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Ln(e){return e.inclusiveLeft?-1:0}function Tn(e){return e.inclusiveRight?1:0}function di(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=j(r.from,i.from)||Ln(e)-Ln(t);if(o)return-o;var a=j(r.to,i.to)||Tn(e)-Tn(t);return a||t.id-e.id}function vo(e,t){var n=Kt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||di(r,i.marker)<0)&&(r=i.marker);return r}function go(e){return vo(e,!0)}function kn(e){return vo(e,!1)}function ms(e,t){var n=Kt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||di(r,o.marker)<0)&&(r=o.marker)}return r}function mo(e,t,n,r,i){var o=R(e,t),a=Kt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(!l.marker.collapsed)continue;var u=l.marker.find(0),h=j(u.from,n)||Ln(l.marker)-Ln(i),f=j(u.to,r)||Tn(l.marker)-Tn(i);if(h>=0&&f<=0||h<=0&&f>=0)continue;if(h<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?j(u.to,n)>=0:j(u.to,n)>0)||h>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?j(u.from,r)<=0:j(u.from,r)<0))return!0}}function zt(e){for(var t;t=go(e);)e=t.find(-1,!0).line;return e}function ys(e){for(var t;t=kn(e);)e=t.find(1,!0).line;return e}function bs(e){for(var t,n;t=kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ci(e,t){var n=R(e,t),r=zt(n);return n==r?t:ge(r)}function yo(e,t){if(t>e.lastLine())return t;var n=R(e,t),r;if(!Qt(e,n))return t;for(;r=kn(n);)n=r.find(1,!0).line;return ge(n)+1}function Qt(e,t){var n=Kt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&pi(e,t,r))return!0}}function pi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return pi(e,r.line,Yr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&pi(e,t,i))return!0}function Gt(e){e=zt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Mn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=go(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function vi(e){var t=e.display,n=e.doc;t.maxLine=R(n,n.first),t.maxLineLength=Mn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Mn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Cr=function(e,t,n){this.text=e,po(this,t),this.height=n?n(this):1};Cr.prototype.lineNo=function(){return ge(this)},Ue(Cr);function ws(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),co(e),po(e,n);var i=r?r(e):1;i!=e.height&&Ft(e,i)}function xs(e){e.parent=null,co(e)}var Cs={},Ss={};function bo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ss:Cs;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function wo(e,t){var n=se("span",null,null,$?"padding-right: .1px":null),r={pre:se("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Ls,ei(e.display.measure)&&(a=pt(o,e.doc.direction))&&(r.addToken=ks(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&ge(o);Ms(o,r,io(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Re(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Re(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild($n(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if($){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Re(r.pre.className,r.textClass||"")),r}function Es(e){var t=_("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ls(e,t,n,r,i,o,a){if(!t)return;var s=e.splitSpaces?Ts(t,e.trailingSpace):t,l=e.cm.state.specialChars,u=!1,h;if(!l.test(t))e.col+=t.length,h=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,h),P&&Q<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var f=0;;){l.lastIndex=f;var c=l.exec(t),d=c?c.index-f:t.length-f;if(d){var p=document.createTextNode(s.slice(f,f+d));P&&Q<9?h.appendChild(_("span",[p])):h.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!c)break;f+=d+1;var v=void 0;if(c[0]==" "){var y=e.cm.options.tabSize,w=y-e.col%y;v=h.appendChild(_("span",U(w),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text"," "),e.col+=w}else c[0]=="\r"||c[0]==`
|
|
`?(v=h.appendChild(_("span",c[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),v.setAttribute("cm-text",c[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(c[0]),v.setAttribute("cm-text",c[0]),P&&Q<9?h.appendChild(_("span",[v])):h.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var S=n||"";r&&(S+=r),i&&(S+=i);var x=_("span",[h],S,o);if(a)for(var O in a)a.hasOwnProperty(O)&&O!="style"&&O!="class"&&x.setAttribute(O,a[O]);return e.content.appendChild(x)}e.content.appendChild(h)}function Ts(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="\xA0"),r+=o,n=o==" "}return r}function ks(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+r.length;;){for(var f=void 0,c=0;c<t.length&&!(f=t[c],f.to>u&&f.from<=u);c++);if(f.to>=h)return e(n,r,i,o,a,s,l);e(n,r.slice(0,f.to-u),i,o,null,s,l),o=null,r=r.slice(f.to-u),u=f.to}}}function xo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ms(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),bo(n[a+1],t.cm.options));return}for(var s=i.length,l=0,u=1,h="",f,c,d=0,p,v,y,w,S;;){if(d==l){p=v=y=c="",S=null,w=null,d=Infinity;for(var x=[],O=void 0,F=0;F<r.length;++F){var N=r[F],Z=N.marker;if(Z.type=="bookmark"&&N.from==l&&Z.widgetNode)x.push(Z);else if(N.from<=l&&(N.to==null||N.to>l||Z.collapsed&&N.to==l&&N.from==l)){if(N.to!=null&&N.to!=l&&d>N.to&&(d=N.to,v=""),Z.className&&(p+=" "+Z.className),Z.css&&(c=(c?c+";":"")+Z.css),Z.startStyle&&N.from==l&&(y+=" "+Z.startStyle),Z.endStyle&&N.to==d&&(O||(O=[])).push(Z.endStyle,N.to),Z.title&&((S||(S={})).title=Z.title),Z.attributes)for(var Se in Z.attributes)(S||(S={}))[Se]=Z.attributes[Se];Z.collapsed&&(!w||di(w.marker,Z)<0)&&(w=N)}else N.from>l&&d>N.from&&(d=N.from)}if(O)for(var tt=0;tt<O.length;tt+=2)O[tt+1]==d&&(v+=" "+O[tt]);if(!w||w.from==l)for(var Fe=0;Fe<x.length;++Fe)xo(t,0,x[Fe]);if(w&&(w.from||0)==l){if(xo(t,(w.to==null?s+1:w.to)-l,w.marker,w.from==null),w.to==null)return;w.to==l&&(w=!1)}}if(l>=s)break;for(var Ct=Math.min(s,d);;){if(h){var mt=l+h.length;if(!w){var Ze=mt>Ct?h.slice(0,Ct-l):h;t.addToken(t,Ze,f?f+p:p,y,l+Ze.length==d?v:"",c,S)}if(mt>=Ct){h=h.slice(Ct-l),l=Ct;break}l=mt,y=""}h=i.slice(o,o=n[u++]),f=bo(n[u++],t.cm.options)}}}function Co(e,t,n){this.line=t,this.rest=bs(t),this.size=this.rest?ge(k(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Qt(e,t)}function On(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Co(e.doc,R(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Sr=null;function Os(e){Sr?Sr.ops.push(e):e.ownsGroup=Sr={ops:[e],delayedCallbacks:[]}}function _s(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function As(e,t){var n=e.ownsGroup;if(!n)return;try{_s(n)}finally{Sr=null,t(n)}}var Zr=null;function nt(e,t){var n=Dt(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;Sr?i=Sr.delayedCallbacks:Zr?i=Zr:(i=Zr=[],setTimeout(Ds,0));for(var o=function(s){i.push(function(){return n[s].apply(null,r)})},a=0;a<n.length;++a)o(a)}function Ds(){var e=Zr;Zr=null;for(var t=0;t<e.length;++t)e[t]()}function So(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ns(e,t):o=="gutter"?Lo(e,t,n,r):o=="class"?gi(e,t):o=="widget"&&Ps(e,t,r)}t.changes=null}function Jr(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),P&&Q<8&&(e.node.style.zIndex=2)),e.node}function Rs(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Jr(t);t.background=r.insertBefore(_("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Eo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):wo(e,t)}function Ns(e,t){var n=t.text.className,r=Eo(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,gi(e,t)):n&&(t.text.className=n)}function gi(e,t){Rs(e,t),t.line.wrapClass?Jr(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 Lo(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Jr(t);t.gutterBackground=_("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Jr(t),s=t.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=s.appendChild(_("div",ai(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.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,h=o.hasOwnProperty(u)&&o[u];h&&s.appendChild(_("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ps(e,t,n){t.alignable&&(t.alignable=null);for(var r=Oe("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);To(e,t,n)}function Ws(e,t,n,r){var i=Eo(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),gi(e,t),Lo(e,t,n,r),To(e,t,r),t.node}function To(e,t,n){if(ko(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)ko(e,t.rest[r],t,n,!1)}function ko(e,t,n,r,i){if(!t.widgets)return;for(var o=Jr(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],u=_("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Is(l,u,n,r),e.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),nt(l,"redraw")}}function Is(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Qr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Qe(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;"),re(t.display.measure,_("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Xt(e,t){for(var n=Wt(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function _n(e){return e.lineSpace.offsetTop}function mi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Mo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=re(e.measure,_("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Ht(e){return He-e.display.nativeBarWidth}function lr(e){return e.display.scroller.clientWidth-Ht(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-Ht(e)-e.display.barHeight}function Fs(e,t,n){var r=e.options.lineWrapping,i=r&&lr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Oo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ge(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Us(e,t){t=zt(t);var n=ge(t),r=e.display.externalMeasured=new Co(e.doc,t,n);r.lineN=n;var i=r.built=wo(e,r);return r.text=i.pre,re(e.display.lineMeasure,i.pre),r}function _o(e,t,n,r){return Bt(e,Er(e,t),n,r)}function bi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[fr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Er(e,t){var n=ge(t),r=bi(e,n);r&&!r.text?r=null:r&&r.changes&&(So(e,r,n,Li(e)),e.curOp.forceUpdate=!0),r||(r=Us(e,t));var i=Oo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Bt(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Fs(e,t.view,t.rect),t.hasHeights=!0),a=Hs(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Ao={left:0,right:0,top:0,bottom:0};function Do(e,t,n){for(var r,i,o,a,s,l,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(i=0,o=1,a="left"):t<l?(i=t-s,o=i+1):(u==e.length-3||t==l&&e[u+3]>t)&&(o=l-s,i=o-1,t>=l&&(a="right")),i!=null){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function zs(e,t){var n=Ao;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function Hs(e,t,n,r){var i=Do(t.map,n,r),o=i.node,a=i.start,s=i.end,l=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&he(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+s<i.coverEnd&&he(t.line.text.charAt(i.coverStart+s));)++s;if(P&&Q<9&&a==0&&s==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=zs(te(o,a,s).getClientRects(),r),u.left||u.right||a==0)break;s=a,a=a-1,l="right"}P&&Q<11&&(u=Bs(e.display.measure,u))}else{a>0&&(l=r="right");var f;e.options.lineWrapping&&(f=o.getClientRects()).length>1?u=f[r=="right"?f.length-1:0]:u=o.getBoundingClientRect()}if(P&&Q<9&&!a&&(!u||!u.left&&!u.right)){var c=o.parentNode.getClientRects()[0];c?u={left:c.left,right:c.left+Tr(e.display),top:c.top,bottom:c.bottom}:u=Ao}for(var d=u.top-t.rect.top,p=u.bottom-t.rect.top,v=(d+p)/2,y=t.view.measure.heights,w=0;w<y.length-1&&!(v<y[w]);w++);var S=w?y[w-1]:0,x=y[w],O={left:(l=="right"?u.right:u.left)-t.rect.left,right:(l=="left"?u.left:u.right)-t.rect.left,top:S,bottom:x};return!u.left&&!u.right&&(O.bogus=!0),e.options.singleCursorHeightPerLine||(O.rtop=d,O.rbottom=p),O}function Bs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ri(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Ro(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 No(e){e.display.externalMeasure=null,pe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ro(e.display.view[t])}function Vr(e){No(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Po(){return L&&we?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Wo(){return L&&we?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wi(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Qr(e.widgets[n]));return t}function An(e,t,n,r,i){if(!i){var o=wi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=Gt(t);if(r=="local"?a+=_n(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+(r=="window"?0:Wo());var l=s.left+(r=="window"?0:Po());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Io(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Po(),i-=Wo();else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function xi(e,t,n,r,i){return r||(r=R(e.doc,t.line)),An(e,r,_o(e,r,t.ch,i),n)}function Rt(e,t,n,r,i,o){r=r||R(e.doc,t.line),i||(i=Er(e,r));function a(p,v){var y=Bt(e,i,p,v?"right":"left",o);return v?y.left=y.right:y.right=y.left,An(e,r,y,n)}var s=pt(r,e.doc.direction),l=t.ch,u=t.sticky;if(l>=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a(u=="before"?l-1:l,u=="before");function h(p,v,y){var w=s[v],S=w.level==1;return a(y?p-1:p,S!=y)}var f=kt(s,l,u),c=wt,d=h(l,f,u=="before");return c!=null&&(d.other=h(l,c,u!="before")),d}function Fo(e,t){var n=0;t=K(e.doc,t),e.options.lineWrapping||(n=Tr(e.display)*t.ch);var r=R(e.doc,t.line),i=Gt(r)+_n(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ci(e,t,n,r,i){var o=m(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Si(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ci(r.first,0,null,-1,-1);var i=sr(r,n),o=r.first+r.size-1;if(i>o)return Ci(r.first+r.size-1,R(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=R(r,i);;){var s=js(e,a,i,t,n),l=ms(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=R(r,i=u.line)}}function Uo(e,t,n,r){r-=wi(t);var i=t.text.length,o=ct(function(a){return Bt(e,n,a-1).bottom<=r},i,0);return i=ct(function(a){return Bt(e,n,a).top>r},o,i),{begin:o,end:i}}function zo(e,t,n,r){n||(n=Er(e,t));var i=An(e,t,Bt(e,n,r),"line").top;return Uo(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function js(e,t,n,r,i){i-=Gt(t);var o=Er(e,t),a=wi(t),s=0,l=t.text.length,u=!0,h=pt(t,e.doc.direction);if(h){var f=(e.options.lineWrapping?Gs:Ks)(e,t,n,o,h,r,i);u=f.level!=1,s=u?f.from:f.to-1,l=u?f.to:f.from-1}var c=null,d=null,p=ct(function(F){var N=Bt(e,o,F);return N.top+=a,N.bottom+=a,Ei(N,r,i,!1)?(N.top<=i&&N.left<=r&&(c=F,d=N),!0):!1},s,l),v,y,w=!1;if(d){var S=r-d.left<d.right-r,x=S==u;p=c+(x?0:1),y=x?"after":"before",v=S?d.left:d.right}else{!u&&(p==l||p==s)&&p++,y=p==0?"after":p==t.text.length?"before":Bt(e,o,p-(u?1:0)).bottom+a<=i==u?"after":"before";var O=Rt(e,m(n,p,y),"line",t,o);v=O.left,w=i<O.top?-1:i>=O.bottom?1:0}return p=Ae(t.text,p,1),Ci(n,p,y,w,r-v)}function Ks(e,t,n,r,i,o,a){var s=ct(function(f){var c=i[f],d=c.level!=1;return Ei(Rt(e,m(n,d?c.to:c.from,d?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var u=l.level!=1,h=Rt(e,m(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Ei(h,o,a,!0)&&h.top>a&&(l=i[s-1])}return l}function Gs(e,t,n,r,i,o,a){var s=Uo(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,f=null,c=0;c<i.length;c++){var d=i[c];if(d.from>=u||d.to<=l)continue;var p=d.level!=1,v=Bt(e,r,p?Math.min(u,d.to)-1:Math.max(l,d.from)).right,y=v<o?o-v+1e9:v-o;(!h||f>y)&&(h=d,f=y)}return h||(h=i[i.length-1]),h.from<l&&(h={from:l,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var ur;function Lr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ur==null){ur=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ur.appendChild(document.createTextNode("x")),ur.appendChild(_("br"));ur.appendChild(document.createTextNode("x"))}re(e.measure,ur);var n=ur.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),pe(e.measure),n||1}function Tr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),n=_("pre",[t],"CodeMirror-line-like");re(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Li(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Ti(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ti(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ho(e){var t=Lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Tr(e.display)-3);return function(i){if(Qt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function ki(e){var t=e.doc,n=Ho(e);t.iter(function(r){var i=n(r);i!=r.height&&Ft(r,i)})}function hr(e,t,n,r){var i=e.display;if(!n&&Wt(t).getAttribute("cm-not-content")=="true")return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(f){return null}var l=Si(e,o,a),u;if(r&&l.xRel>0&&(u=R(e.doc,l.line).text).length==l.ch){var h=M(u,u.length,e.options.tabSize)-u.length;l=m(l.line,Math.max(0,Math.round((o-Mo(e.display).left)/Tr(e.display))-h))}return l}function fr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function vt(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Kt&&ci(e.doc,t)<i.viewTo&&qt(e);else if(n<=i.viewFrom)Kt&&yo(e.doc,n+r)>i.viewFrom?qt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)qt(e);else if(t<=i.viewFrom){var o=Dn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):qt(e)}else if(n>=i.viewTo){var a=Dn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):qt(e)}else{var s=Dn(e,t,t,-1),l=Dn(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(On(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):qt(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Vt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var o=r.view[fr(e,t)];if(o.node==null)return;var a=o.changes||(o.changes=[]);X(a,n)==-1&&a.push(n)}function qt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Dn(e,t,n,r){var i=fr(e,t),o,a=e.display.view;if(!Kt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(r>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,n+=o}for(;ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Xs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=On(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=On(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(fr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(On(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,fr(e,n)))),r.viewTo=n}function Bo(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function qr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function jo(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){if(!t&&a==n.sel.primIndex)continue;var s=n.sel.ranges[a];if(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)continue;var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Ko(e,s.head,i),l||Ys(e,s,o)}return r}function Ko(e,t,n){var r=Rt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(_("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(_("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Rn(e,t){return e.top-t.top||e.left-t.left}function Ys(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Mo(e.display),s=a.left,l=Math.max(r.sizerWidth,lr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(x,O,F,N){O<0&&(O=0),O=Math.round(O),N=Math.round(N),o.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+x+`px;
|
|
top: `+O+"px; width: "+(F==null?l-x:F)+`px;
|
|
height: `+(N-O)+"px"))}function f(x,O,F){var N=R(i,x),Z=N.text.length,Se,tt;function Fe(Ze,yt){return xi(e,m(x,Ze),"div",N,yt)}function Ct(Ze,yt,it){var Ve=zo(e,N,null,Ze),Je=yt=="ltr"==(it=="after")?"left":"right",ze=it=="after"?Ve.begin:Ve.end-(/\s/.test(N.text.charAt(Ve.end-1))?2:1);return Fe(ze,Je)[Je]}var mt=pt(N,i.direction);return Et(mt,O||0,F==null?Z:F,function(Ze,yt,it,Ve){var Je=it=="ltr",ze=Fe(Ze,Je?"left":"right"),bt=Fe(yt-1,Je?"right":"left"),Ur=O==null&&Ze==0,ir=F==null&&yt==Z,lt=Ve==0,jt=!mt||Ve==mt.length-1;if(bt.top-ze.top<=3){var rt=(u?Ur:ir)&<,qi=(u?ir:Ur)&&jt,Zt=rt?s:(Je?ze:bt).left,gr=qi?l:(Je?bt:ze).right;h(Zt,ze.top,gr-Zt,ze.bottom)}else{var mr,ft,zr,$i;Je?(mr=u&&Ur&<?s:ze.left,ft=u?l:Ct(Ze,it,"before"),zr=u?s:Ct(yt,it,"after"),$i=u&&ir&&jt?l:bt.right):(mr=u?Ct(Ze,it,"before"):s,ft=!u&&Ur&<?l:ze.right,zr=!u&&ir&&jt?s:bt.left,$i=u?Ct(yt,it,"after"):l),h(mr,ze.top,ft-mr,ze.bottom),ze.bottom<bt.top&&h(s,ze.bottom,null,bt.top),h(zr,bt.top,$i-zr,bt.bottom)}(!Se||Rn(ze,Se)<0)&&(Se=ze),Rn(bt,Se)<0&&(Se=bt),(!tt||Rn(ze,tt)<0)&&(tt=ze),Rn(bt,tt)<0&&(tt=bt)}),{start:Se,end:tt}}var c=t.from(),d=t.to();if(c.line==d.line)f(c.line,c.ch,d.ch);else{var p=R(i,c.line),v=R(i,d.line),y=zt(p)==zt(v),w=f(c.line,c.ch,y?p.text.length+1:null).end,S=f(d.line,y?0:null,d.ch).start;y&&(w.top<S.top-2?(h(w.right,w.top,null,w.bottom),h(s,S.top,S.left,S.bottom)):h(w.right,w.top,S.left-w.right,w.bottom)),w.bottom<S.top&&h(s,w.bottom,null,S.top)}n.appendChild(o)}function Mi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Go(e){e.state.focused||(e.display.input.focus(),Oi(e))}function Xo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,kr(e))},100)}function Oi(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,Y(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),$&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Mi(e)}function kr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(e,"blur",e,t),e.state.focused=!1,ce(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Nn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,a=void 0,s=0;if(i.hidden)continue;if(P&&Q<8){var l=i.node.offsetTop+i.node.offsetHeight;a=l-n,n=l}else{var u=i.node.getBoundingClientRect();a=u.bottom-u.top,!o&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var h=i.line.height-a;if((h>.005||h<-.005)&&(Ft(i.line,a),Yo(i.line),i.rest))for(var f=0;f<i.rest.length;f++)Yo(i.rest[f]);if(s>e.display.sizerWidth){var c=Math.ceil(s/Tr(e.display));c>e.display.maxLineLength&&(e.display.maxLineLength=c,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Yo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Pn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-_n(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=sr(t,r),a=sr(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=sr(t,Gt(R(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=sr(t,Gt(R(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Zs(e,t){if(q(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!de){var o=_("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-_n(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Ht(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}function Js(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?m(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?m(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Rt(e,t),l=!n||n==t?s:Rt(e,n);i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r};var u=_i(e,i),h=e.doc.scrollTop,f=e.doc.scrollLeft;if(u.scrollTop!=null&&(en(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(dr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}function Qs(e,t){var n=_i(e,t);n.scrollTop!=null&&en(e,n.scrollTop),n.scrollLeft!=null&&dr(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=yi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+mi(n),l=t.top<r,u=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?s:t.bottom)-o);h!=i&&(a.scrollTop=h)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,c=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-f,d=lr(e)-n.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<c?a.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>d+c-3&&(a.scrollLeft=t.right+(p?0:10)-d),a}function Ai(e,t){if(t==null)return;Wn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Mr(e){Wn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function $r(e,t,n){(t!=null||n!=null)&&Wn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Vs(e,t){Wn(e),e.curOp.scrollToPos=t}function Wn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Fo(e,t.from),r=Fo(e,t.to);Zo(e,n,r,t.margin)}}function Zo(e,t,n,r){var i=_i(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});$r(e,i.scrollLeft,i.scrollTop)}function en(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;fe||Ri(e,{top:t}),Jo(e,t,!0),fe&&Ri(e),nn(e,100)}function Jo(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function dr(e,t,n,r){if(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)&&!r)return;e.doc.scrollLeft=t,ea(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function tn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+mi(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:r,scrollHeight:r+Ht(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var cr=function(e,t,n){this.cm=n;var r=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),I(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),I(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,P&&Q<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};cr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r: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&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},cr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},cr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},cr.prototype.zeroWidthHack=function(){var e=Te&&!ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new G,this.disableVert=new G},cr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},cr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var rn=function(){};rn.prototype.update=function(){return{bottom:0,right:0}},rn.prototype.setScrollLeft=function(){},rn.prototype.setScrollTop=function(){},rn.prototype.clear=function(){};function Or(e,t){t||(t=tn(e));var n=e.display.barWidth,r=e.display.barHeight;Qo(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Nn(e),Qo(e,tn(e)),n=e.display.barWidth,r=e.display.barHeight}function Qo(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Vo={native:cr,null:rn};function qo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ce(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),I(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?dr(e,t):en(e,t)},e),e.display.scrollbars.addClass&&Y(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function pr(e){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:++qs},Os(e.curOp)}function vr(e){var t=e.curOp;t&&As(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;$s(n)})}function $s(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var i=0;i<t.length;i++)rl(t[i]);for(var o=0;o<t.length;o++)nl(t[o]);for(var a=0;a<t.length;a++)il(t[a])}function el(e){var t=e.cm,n=t.display;al(t),e.updateMaxLine&&vi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new In(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Di(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&Nn(t),e.barMeasure=tn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_o(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+Ht(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-lr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&dr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==be();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Or(t,e.barMeasure),e.updatedDisplay&&Pi(t,e.barMeasure),e.selectionChanged&&Mi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Go(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&$o(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Jo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&dr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Js(t,K(r,e.scrollToPos.from),K(r,e.scrollToPos.to),e.scrollToPos.margin);Zs(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||Ne(o[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&Ne(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function xt(e,t){if(e.curOp)return t();pr(e);try{return t()}finally{vr(e)}}function $e(e,t){return function(){if(e.curOp)return t.apply(e,arguments);pr(e);try{return t.apply(e,arguments)}finally{vr(e)}}}function ht(e){return function(){if(this.curOp)return e.apply(this,arguments);pr(this);try{return e.apply(this,arguments)}finally{vr(this)}}}function et(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);pr(t);try{return e.apply(this,arguments)}finally{vr(t)}}}function nn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,St(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=Xr(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?or(t.mode,r.state):null,l=no(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,h=l.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),c=0;!f&&c<a.length;++c)f=a[c]!=o.styles[c];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&ui(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return nn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&xt(e,function(){for(var o=0;o<i.length;o++)Vt(e,i[o],"text")})}var In=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Pn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=lr(e),this.force=n,this.dims=Li(e),this.events=[]};In.prototype.signal=function(e,t){oe(e,t)&&this.events.push(arguments)},In.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ht(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ht(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=be();if(!t||!Qe(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&Qe(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==be())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&Qe(document.body,e.anchorNode)&&Qe(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)}}function Di(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return qt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Bo(e)==0)return!1;ta(e)&&(qt(e),t.dims=Li(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Kt&&(o=ci(e.doc,o),a=yo(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Xs(e,o,a),n.viewOffset=Gt(R(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Bo(e);if(!s&&l==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=sl(e);return l>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(u),pe(n.cursorDiv),pe(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,nn(e,400)),n.updateLineNumbers=null,!0}function $o(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==lr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+mi(e.display)-yi(e),n.top)}),t.visible=Pn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Pn(e.display,e.doc,n));if(!Di(e,t))break;Nn(e);var i=tn(e);qr(e),Or(e,i),Pi(e,i),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 Ri(e,t){var n=new In(e,t);if(Di(e,n)){Nn(e),$o(e,n);var r=tn(e);qr(e),Or(e,r),Pi(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(p){var v=p.nextSibling;return $&&Te&&e.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p),v}for(var l=r.view,u=r.viewFrom,h=0;h<l.length;h++){var f=l[h];if(!f.hidden)if(!f.node||f.node.parentNode!=o){var c=Ws(e,f,u,n);o.insertBefore(c,a)}else{for(;a!=f.node;)a=s(a);var d=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(X(f.changes,"gutter")>-1&&(d=!1),So(e,f,u,n)),d&&(pe(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ai(e.options,u)))),a=f.node.nextSibling}u+=f.size}for(;a;)a=s(a)}function Ni(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Pi(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+Ht(e)+"px"}function ea(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ti(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function ta(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ai(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(_("div",[_("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ni(e.display),!0}return!1}function Wi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ra(e){var t=e.gutters,n=e.gutterSpecs;pe(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(_("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ni(e)}function on(e){ra(e.display),vt(e),ea(e)}function hl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=se("div",null,"CodeMirror-code"),i.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=_("div",null,"CodeMirror-cursors"),i.measure=_("div",null,"CodeMirror-measure"),i.lineMeasure=_("div",null,"CodeMirror-measure"),i.lineSpace=se("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=se("div",[i.lineSpace],"CodeMirror-lines");i.mover=_("div",[o],null,"position: relative"),i.sizer=_("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=_("div",null,null,"position: absolute; height: "+He+"px; width: 1px;"),i.gutters=_("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=_("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=_("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),P&&Q<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!$&&!(fe&&Ie)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Wi(r.gutters,r.lineNumbers),ra(i),n.init(i)}var Fn=0,Lt=null;P?Lt=-.53:fe?Lt=15:L?Lt=-.7:ue&&(Lt=-1/3);function na(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function fl(e){var t=na(e);return t.x*=Lt,t.y*=Lt,t}function ia(e,t){var n=na(t),r=n.x,i=n.y,o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(!(r&&s||i&&l))return;if(i&&Te&&$){e:for(var u=t.target,h=o.view;u!=a;u=u.parentNode)for(var f=0;f<h.length;f++)if(h[f].node==u){e.display.currentWheelTarget=u;break e}}if(r&&!fe&&!E&&Lt!=null){i&&l&&en(e,Math.max(0,a.scrollTop+i*Lt)),dr(e,Math.max(0,a.scrollLeft+r*Lt)),(!i||i&&l)&&Ce(t),o.wheelStartX=null;return}if(i&&Lt!=null){var c=i*Lt,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;c<0?d=Math.max(0,d+c-50):p=Math.min(e.doc.height,p+c+50),Ri(e,{top:d,bottom:p})}Fn<20&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(o.wheelStartX==null)return;var v=a.scrollLeft-o.wheelStartX,y=a.scrollTop-o.wheelStartY,w=y&&o.wheelDY&&y/o.wheelDY||v&&o.wheelDX&&v/o.wheelDX;if(o.wheelStartX=o.wheelStartY=null,!w)return;Lt=(Lt*Fn+w)/(Fn+1),++Fn},200)):(o.wheelDX+=r,o.wheelDY+=i))}var Tt=function(e,t){this.ranges=e,this.primIndex=t};Tt.prototype.primary=function(){return this.ranges[this.primIndex]},Tt.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],r=e.ranges[t];if(!si(n.anchor,r.anchor)||!si(n.head,r.head))return!1}return!0},Tt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ve(li(this.ranges[t].anchor),li(this.ranges[t].head));return new Tt(e,this.primIndex)},Tt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Tt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(j(t,r.from())>=0&&j(e,r.to())<=0)return n}return-1};var ve=function(e,t){this.anchor=e,this.head=t};ve.prototype.from=function(){return Cn(this.anchor,this.head)},ve.prototype.to=function(){return xn(this.anchor,this.head)},ve.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Nt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(c,d){return j(c.from(),d.from())}),n=X(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=j(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var u=Cn(s.from(),a.from()),h=xn(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new ve(f?h:u,f?u:h))}}return new Tt(t,n)}function $t(e,t){return new Tt([new ve(e,t||e)],0)}function er(e){return e.text?m(e.from.line+e.text.length-1,k(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function oa(e,t){if(j(e,t.from)<0)return e;if(j(e,t.to)<=0)return er(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=er(t).ch-t.to.ch),m(n,r)}function Ii(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new ve(oa(i.anchor,t),oa(i.head,t)))}return Nt(e.cm,n,e.sel.primIndex)}function aa(e,t,n){return e.line==t.line?m(n.line,e.ch-t.ch+n.ch):m(n.line+(e.line-t.line),e.ch)}function dl(e,t,n){for(var r=[],i=m(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=aa(s.from,i,o),u=aa(er(s),i,o);if(i=s.to,o=u,n=="around"){var h=e.sel.ranges[a],f=j(h.head,h.anchor)<0;r[a]=new ve(f?u:l,f?l:u)}else r[a]=new ve(l,l)}return new Tt(r,e.sel.primIndex)}function Fi(e){e.doc.mode=ni(e.options,e.doc.modeOption),an(e)}function an(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,nn(e,100),e.state.modeGen++,e.curOp&&vt(e)}function sa(e,t){return t.from.ch==0&&t.to.ch==0&&k(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ui(e,t,n,r){function i(S){return n?n[S]:null}function o(S,x,O){ws(S,x,O,r),nt(S,"change",S,t)}function a(S,x){for(var O=[],F=S;F<x;++F)O.push(new Cr(u[F],i(F),r));return O}var s=t.from,l=t.to,u=t.text,h=R(e,s.line),f=R(e,l.line),c=k(u),d=i(u.length-1),p=l.line-s.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(sa(e,t)){var v=a(0,u.length-1);o(f,f.text,d),p&&e.remove(s.line,p),v.length&&e.insert(s.line,v)}else if(h==f)if(u.length==1)o(h,h.text.slice(0,s.ch)+c+h.text.slice(l.ch),d);else{var y=a(1,u.length-1);y.push(new Cr(c+h.text.slice(l.ch),d,r)),o(h,h.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,y)}else if(u.length==1)o(h,h.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0)),e.remove(s.line+1,p);else{o(h,h.text.slice(0,s.ch)+u[0],i(0)),o(f,c+f.text.slice(l.ch),d);var w=a(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,w)}nt(e,"change",e,t)}function tr(e,t,n){function r(i,o,a){if(i.linked)for(var s=0;s<i.linked.length;++s){var l=i.linked[s];if(l.doc==o)continue;var u=a&&l.sharedHist;if(n&&!u)continue;t(l.doc,u),r(l.doc,i,u)}}r(e,null,!0)}function la(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ki(e),Fi(e),ua(e),e.options.lineWrapping||vi(e),e.options.mode=t.modeOption,vt(e)}function ua(e){(e.doc.direction=="rtl"?Y:ce)(e.display.lineDiv,"CodeMirror-rtl")}function cl(e){xt(e,function(){ua(e),vt(e)})}function Un(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function zi(e,t){var n={from:li(t.from),to:er(t),text:ar(e,t.from,t.to)};return da(e,n,t.from.line,t.to.line+1),tr(e,function(r){return da(r,n,t.from.line,t.to.line+1)},!0),n}function ha(e){for(;e.length;){var t=k(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ha(e.done),k(e.done);if(e.done.length&&!k(e.done).ranges)return k(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),k(e.done)}function fa(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=pl(i,i.lastOp==r)))s=k(a.changes),j(t.from,t.to)==0&&j(t.from,s.to)==0?s.to=er(t):a.changes.push(zi(e,t));else{var l=k(i.done);for((!l||!l.ranges)&&zn(e.sel,i.done),a={changes:[zi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Ne(e,"historyAdded")}function vl(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||vl(e,o,k(i.done),t))?i.done[i.done.length-1]=t:zn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ha(i.undone)}function zn(e,t){var n=k(t);n&&n.ranges&&n.equals(e)||t.push(e)}function da(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function ml(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 yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(ml(n[i]));return r}function ca(e,t){var n=yl(e,t),r=fi(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a){e:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}}else a&&(n[i]=a)}return n}function _r(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Tt.prototype.deepCopy.call(o):o);continue}var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],h=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(h=f.match(/^spans_(\d+)$/))&&(X(t,Number(h[1]))>-1&&(k(s)[f]=u[f],delete u[f]))}}return r}function Hi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=j(t,i)<0;o!=j(n,i)<0?(i=t,t=n):o!=j(t,n)<0&&(t=n)}return new ve(i,t)}else return new ve(n||t,t)}function Hn(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),st(e,new Tt([Hi(e.sel.primary(),t,n,i)],0),r)}function pa(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Hi(e.sel.ranges[o],t[o],null,i);var a=Nt(e.cm,r,e.sel.primIndex);st(e,a,n)}function Bi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,st(e,Nt(e.cm,i,e.sel.primIndex),r)}function va(e,t,n,r){st(e,$t(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new ve(K(e,i[o].anchor),K(e,i[o].head))},origin:n&&n.origin};return Ne(e,"beforeSelectionChange",e,r),e.cm&&Ne(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Nt(e.cm,r.ranges,r.ranges.length-1):t}function ga(e,t,n){var r=e.history.done,i=k(r);i&&i.ranges?(r[r.length-1]=t,Bn(e,t,n)):st(e,t,n)}function st(e,t,n){Bn(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Bn(e,t,n){(oe(e,"beforeSelectionChange")||e.cm&&oe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(j(t.primary().head,e.sel.primary().head)<0?-1:1);ma(e,ba(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Mr(e.cm)}function ma(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,le(e.cm)),nt(e,"cursorActivity",e)}function ya(e){ma(e,ba(e,e.sel,null,!1))}function ba(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=jn(e,a.anchor,s&&s.anchor,n,r),u=jn(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ve(l,u))}return i?Nt(e.cm,i,t.primIndex):t}function Ar(e,t,n,r,i){var o=R(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,h="selectRight"in l?!l.selectRight:l.inclusiveRight;if((s.from==null||(u?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(h?s.to>=t.ch:s.to>t.ch))){if(i&&(Ne(l,"beforeCursorEnter"),l.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),c=void 0;if((r<0?h:u)&&(f=wa(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(c=j(f,n))&&(r<0?c<0:c>0))return Ar(e,f,t,r,i)}var d=l.find(r<0?-1:1);return(r<0?u:h)&&(d=wa(e,d,r,d.line==t.line?o:null)),d?Ar(e,d,t,r,i):null}}return t}function jn(e,t,n,r,i){var o=r||1,a=Ar(e,t,n,o,i)||!i&&Ar(e,t,n,o,!0)||Ar(e,t,n,-o,i)||!i&&Ar(e,t,n,-o,!0);return a||(e.cantEdit=!0,m(e.first,0))}function wa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?K(e,m(t.line-1)):null:n>0&&t.ch==(r||R(e,t.line)).text.length?t.line<e.first+e.size-1?m(t.line+1,0):null:new m(t.line,t.ch+n)}function xa(e){e.setSelection(m(e.firstLine(),0),m(e.lastLine()),C)}function Ca(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,s){i&&(r.from=K(e,i)),o&&(r.to=K(e,o)),a&&(r.text=a),s!==void 0&&(r.origin=s)}),Ne(e,"beforeChange",e,r),e.cm&&Ne(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Dr(e,t,n){if(e.cm){if(!e.cm.curOp)return $e(e.cm,Dr)(e,t,n);if(e.cm.state.suppressEdits)return}if((oe(e,"beforeChange")||e.cm&&oe(e.cm,"beforeChange"))&&(t=Ca(e,t,!0),!t))return;var r=ho&&!n&&gs(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Sa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Sa(e,t)}function Sa(e,t){if(t.text.length==1&&t.text[0]==""&&j(t.from,t.to)==0)return;var n=Ii(e,t);fa(e,t,n,e.cm?e.cm.curOp.id:NaN),sn(e,t,n,fi(e,t));var r=[];tr(e,function(i,o){!o&&X(r,i.history)==-1&&(ka(i.history,t),r.push(i.history)),sn(i,t,null,fi(i,t))})}function Kn(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,o,a=e.sel,s=t=="undo"?i.done:i.undone,l=t=="undo"?i.undone:i.done,u=0;u<s.length&&!(o=s[u],n?o.ranges&&!o.equals(e.sel):!o.ranges);u++);if(u==s.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=s.pop(),o.ranges){if(zn(o,l),n&&!o.equals(e.sel)){st(e,o,{clearRedo:!1});return}a=o}else if(r){s.push(o);return}else break;var h=[];zn(a,l),l.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var f=oe(e,"beforeChange")||e.cm&&oe(e.cm,"beforeChange"),c=function(v){var y=o.changes[v];if(y.origin=t,f&&!Ca(e,y,!1))return s.length=0,{};h.push(zi(e,y));var w=v?Ii(e,y):k(s);sn(e,y,w,ca(e,y)),!v&&e.cm&&e.cm.scrollIntoView({from:y.from,to:er(y)});var S=[];tr(e,function(x,O){!O&&X(S,x.history)==-1&&(ka(x.history,y),S.push(x.history)),sn(x,y,null,ca(x,y))})},d=o.changes.length-1;d>=0;--d){var p=c(d);if(p)return p.v}}function Ea(e,t){if(t==0)return;if(e.first+=t,e.sel=new Tt(H(e.sel.ranges,function(i){return new ve(m(i.anchor.line+t,i.anchor.ch),m(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){vt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Vt(e.cm,r,"gutter")}}function sn(e,t,n,r){if(e.cm&&!e.cm.curOp)return $e(e.cm,sn)(e,t,n,r);if(t.to.line<e.first){Ea(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ea(e,i),t={from:m(e.first,0),to:m(t.to.line+i,t.to.ch),text:[k(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:m(o,R(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ar(e,t.from,t.to),n||(n=Ii(e,t)),e.cm?wl(e.cm,t,r):Ui(e,t,r),Bn(e,n,C),e.cantEdit&&jn(e,m(e.firstLine(),0))&&(e.cantEdit=!1)}function wl(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=ge(zt(R(r,o.line))),r.iter(l,a.line+1,function(d){if(d==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&le(e),Ui(r,t,n,Ho(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(d){var p=Mn(d);p>i.maxLineLength&&(i.maxLine=d,i.maxLineLength=p,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),us(r,o.line),nn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?vt(e):o.line==a.line&&t.text.length==1&&!sa(e.doc,t)?Vt(e,o.line,"text"):vt(e,o.line,a.line+1,u);var h=oe(e,"changes"),f=oe(e,"change");if(f||h){var c={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&nt(e,"change",e,c),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(c)}e.display.selForContextMenu=null}function Rr(e,t,n,r,i){var o;r||(r=n),j(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Dr(e,{from:n,to:r,text:t,origin:i})}function La(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ta(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)La(o.ranges[s].anchor,t,n,r),La(o.ranges[s].head,t,n,r);continue}for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=m(u.from.line+r,u.from.ch),u.to=m(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function ka(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ta(e.done,n,r,i),Ta(e.undone,n,r,i)}function ln(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=R(e,to(e,t)):i=ge(t),i==null?null:(r(o,i)&&e.cm&&Vt(e.cm,i,n),o)}function un(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}un.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,xs(i),nt(i,"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 r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function hn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}hn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof un))){var s=[];this.collapse(s),this.children=[new un(s)],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 r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new un(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new hn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=X(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new hn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var fn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};fn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ge(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Qr(this);Ft(n,Math.max(0,n.height-o)),e&&(xt(e,function(){Ma(e,n,-o),Vt(e,r,"widget")}),nt(e,"lineWidgetCleared",e,this,r))},fn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Qr(this)-t;if(!i)return;Qt(this.doc,r)||Ft(r,r.height+i),n&&xt(n,function(){n.curOp.forceUpdate=!0,Ma(n,r,i),nt(n,"lineWidgetChanged",n,e,ge(r))})},Ue(fn);function Ma(e,t,n){Gt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ai(e,n)}function xl(e,t,n,r){var i=new fn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ln(e,t,"widget",function(a){var s=a.widgets||(a.widgets=[]);if(i.insertAt==null?s.push(i):s.splice(Math.min(s.length-1,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!Qt(e,a)){var l=Gt(a)<e.scrollTop;Ft(a,a.height+Qr(i)),l&&Ai(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&nt(o,"lineWidgetAdded",o,i,typeof t=="number"?t:ge(t)),i}var Oa=0,rr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Oa};rr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&pr(e),oe(this,"clear")){var n=this.find();n&&nt(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Yr(a.markedSpans,this);e&&!this.collapsed?Vt(e,ge(a),"text"):e&&(s.to!=null&&(i=ge(a)),s.from!=null&&(r=ge(a))),a.markedSpans=ds(a.markedSpans,s),s.from==null&&this.collapsed&&!Qt(this.doc,a)&&e&&Ft(a,Lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=zt(this.lines[l]),h=Mn(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&vt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ya(e.doc)),e&&nt(e,"markerCleared",e,this,r,i),t&&vr(e),this.parent&&this.parent.clear()},rr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Yr(o.markedSpans,this);if(a.from!=null&&(n=m(t?o:ge(o),a.from),e==-1))return n;if(a.to!=null&&(r=m(t?o:ge(o),a.to),e==1))return r}return n&&{from:n,to:r}},rr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;xt(r,function(){var i=t.line,o=ge(t.line),a=bi(r,o);if(a&&(Ro(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Qt(n.doc,i)&&n.height!=null){var s=n.height;n.height=null;var l=Qr(n)-s;l&&Ft(i,i.height+l)}nt(r,"markerChanged",r,e)})},rr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||X(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},rr.prototype.detachLine=function(e){if(this.lines.splice(X(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ue(rr);function Nr(e,t,n,r,i){if(r&&r.shared)return Cl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return $e(e.cm,Nr)(e,t,n,r,i);var o=new rr(e,i),a=j(t,n);if(r&&z(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=se("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mo(e,t.line,t,n,o)||t.line!=n.line&&mo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");fs()}o.addToHistory&&fa(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s=t.line,l=e.cm,u;if(e.iter(s,n.line+1,function(f){l&&o.collapsed&&!l.options.lineWrapping&&zt(f)==l.display.maxLine&&(u=!0),o.collapsed&&s!=t.line&&Ft(f,0),cs(f,new En(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(f){Qt(e,f)&&Ft(f,0)}),o.clearOnEnter&&I(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(hs(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Oa,o.atomic=!0),l){if(u&&(l.curOp.updateMaxLine=!0),o.collapsed)vt(l,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)Vt(l,h,"text");o.atomic&&ya(l.doc),nt(l,"markerAdded",l,o)}return o}var dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};dn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();nt(this,"clear")},dn.prototype.find=function(e,t){return this.primary.find(e,t)},Ue(dn);function Cl(e,t,n,r,i){r=z(r),r.shared=!1;var o=[Nr(e,t,n,r,i)],a=o[0],s=r.widgetNode;return tr(e,function(l){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Nr(l,K(l,t),K(l,n),r,i));for(var u=0;u<l.linked.length;++u)if(l.linked[u].isParent)return;a=k(o)}),new dn(o,a)}function _a(e){return e.findMarks(m(e.first,0),e.clipPos(m(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(j(o,a)){var s=Nr(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function El(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];tr(i.primary.doc,function(l){return o.push(l)});for(var a=0;a<i.markers.length;a++){var s=i.markers[a];X(o,s.doc)==-1&&(s.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Ll=0,gt=function(e,t,n,r,i){if(!(this instanceof gt))return new gt(e,t,n,r,i);n==null&&(n=0),hn.call(this,[new un([new Cr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=m(n,0);this.sel=$t(o),this.history=new Un(null),this.id=++Ll,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ui(this,{from:o,to:o,text:e}),st(this,$t(o),C)};gt.prototype=_e(hn.prototype,{constructor:gt,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,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=oi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:et(function(e){var t=m(this.first,0),n=this.first+this.size-1;Dr(this,{from:t,to:m(n,R(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&$r(this.cm,0,0),st(this,$t(t),C)}),replaceRange:function(e,t,n,r){t=K(this,t),n=n?K(this,n):t,Rr(this,e,t,n,r)},getRange:function(e,t,n){var r=ar(this,K(this,e),K(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Gr(this,e))return R(this,e)},getLineNumber:function(e){return ge(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=R(this,e)),zt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return K(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:et(function(e,t,n){va(this,K(this,typeof e=="number"?m(e,t||0):e),null,n)}),setSelection:et(function(e,t,n){va(this,K(this,e),K(this,t||e),n)}),extendSelection:et(function(e,t,n){Hn(this,K(this,e),t&&K(this,t),n)}),extendSelections:et(function(e,t){pa(this,ro(this,e),t)}),extendSelectionsBy:et(function(e,t){var n=H(this.sel.ranges,e);pa(this,ro(this,n),t)}),setSelections:et(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new ve(K(this,e[i].anchor),K(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),st(this,Nt(this.cm,r,t),n)}),addSelection:et(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new ve(K(this,e),K(this,t||e))),st(this,Nt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=ar(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ar(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:et(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&t!="end"&&dl(this,r,t),l=r.length-1;l>=0;l--)Dr(this,r[l]);s?ga(this,s):this.cm&&Mr(this.cm)}),undo:et(function(){Kn(this,"undo")}),redo:et(function(){Kn(this,"redo")}),undoSelection:et(function(){Kn(this,"undo",!0)}),redoSelection:et(function(){Kn(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,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Un(this.history.maxGeneration),tr(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:_r(this.history.done),undone:_r(this.history.undone)}},setHistory:function(e){var t=this.history=new Un(this.history.maxGeneration);t.done=_r(e.done.slice(0),null,!0),t.undone=_r(e.undone.slice(0),null,!0)},setGutterMarker:et(function(e,t,n){return ln(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&At(i)&&(r.gutterMarkers=null),!0})}),clearGutter:et(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ln(t,n,"gutter",function(){return n.gutterMarkers[e]=null,At(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Gr(this,e))return null;if(t=e,e=R(this,e),!e)return null}else if(t=ge(e),t==null)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:et(function(e,t,n){return ln(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(Oe(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:et(function(e,t,n){return ln(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(Oe(n));if(!a)return!1;var s=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||s==o.length?"":" ")+o.slice(s)||null}else return!1;return!0})}),addLineWidget:et(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Nr(this,K(this,e),K(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=K(this,e),Nr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=K(this,e);var t=[],n=R(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=K(this,e),t=K(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];!(l.to!=null&&i==e.line&&e.ch>=l.to||l.from==null&&i!=e.line||l.from!=null&&i==t.line&&l.from>=t.ch)&&(!n||n(l.marker))&&r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),K(this,m(n,t))},indexFromPos:function(e){e=K(this,e);var t=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(r){t+=r.text.length+n}),t},copy:function(e){var t=new gt(oi(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;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new gt(oi(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,_a(this)),r},unlinkDoc:function(e){if(e instanceof Pe&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),El(_a(this));break}if(e.history==this.history){var r=[e.id];tr(e,function(i){return r.push(i.id)},!0),e.history=new Un(null),e.history.done=_r(this.history.done,r),e.history.undone=_r(this.history.undone,r)}},iterLinkedDocs:function(e){tr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):It(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:et(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&cl(this.cm)})}),gt.prototype.eachLine=gt.prototype.iter;var Aa=0;function Tl(e){var t=this;if(Da(t),q(t,e)||Xt(t.display,e))return;Ce(e),P&&(Aa=+new Date);var n=hr(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(){++a==i&&$e(t,function(){n=K(t.doc,n);var d={from:n,to:n,text:t.doc.splitLines(o.filter(function(p){return p!=null}).join(t.doc.lineSeparator())),origin:"paste"};Dr(t.doc,d),ga(t.doc,$t(K(t.doc,n),K(t.doc,er(d))))})()},l=function(d,p){if(t.options.allowDropFileTypes&&X(t.options.allowDropFileTypes,d.type)==-1){s();return}var v=new FileReader;v.onerror=function(){return s()},v.onload=function(){var y=v.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(y)){s();return}o[p]=y,s()},v.readAsText(d)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Bn(t.doc,$t(n,n)),f)for(var c=0;c<f.length;++c)Rr(t.doc,"",f[c].anchor,f[c].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(d){}}}function kl(e,t){if(P&&(!e.state.draggingText||+new Date-Aa<100)){_t(t);return}if(q(e,t)||Xt(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ue){var n=_("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",E&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),E&&n.parentNode.removeChild(n)}}function Ml(e,t){var n=hr(e,t);if(!n)return;var r=document.createDocumentFragment();Ko(e,n,r),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),re(e.display.dragCursor,r)}function Da(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ra(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}var Na=!1;function Ol(){if(Na)return;_l(),Na=!0}function _l(){var e;I(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ra(Al)},100))}),I(window,"blur",function(){return Ra(kr)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var nr={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"},cn=0;cn<10;cn++)nr[cn+48]=nr[cn+96]=String(cn);for(var Gn=65;Gn<=90;Gn++)nr[Gn]=String.fromCharCode(Gn);for(var pn=1;pn<=12;pn++)nr[pn+111]=nr[pn+63235]="F"+pn;var Yt={};Yt.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"},Yt.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"},Yt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Yt.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"]},Yt.default=Te?Yt.macDefault:Yt.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var s=t[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Rl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=H(n.split(" "),Dl),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(!l)t[s]=a;else if(l!=a)throw new Error("Inconsistent bindings for "+s)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Pr(e,t,n,r){t=Xn(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Pr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Pr(e,t.fallthrough[o],n,r);if(a)return a}}}function Pa(e){var t=typeof e=="string"?e:nr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Wa(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Ee?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Ee?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Ia(e,t){if(E&&e.keyCode==34&&e.char)return!1;var n=nr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Wa(n,e,t))}function Xn(e){return typeof e=="string"?Yt[e]:e}function Wr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&j(o.from,k(r).to)<=0;){var a=r.pop();if(j(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}xt(e,function(){for(var s=r.length-1;s>=0;s--)Rr(e.doc,"",r[s].from,r[s].to,"+delete");Mr(e)})}function ji(e,t,n){var r=Ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ki(e,t,n){var r=ji(e,t.ch,n);return r==null?null:new m(t.line,r,n<0?"after":"before")}function Gi(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=pt(n,t.doc.direction);if(o){var a=i<0?k(o):o[0],s=i<0==(a.level==1),l=s?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Er(t,n);u=i<0?n.text.length-1:0;var f=Bt(t,h,u).top;u=ct(function(c){return Bt(t,h,c).top==f},i<0==(a.level==1)?a.from:a.to-1,u),l=="before"&&(u=ji(n,u,1))}else u=i<0?a.to:a.from;return new m(r,u,l)}}return new m(r,i<0?n.text.length:0,i<0?"before":"after")}function Nl(e,t,n,r){var i=pt(t,e.doc.direction);if(!i)return Ki(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=kt(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ki(t,n,r);var s=function(w,S){return ji(t,w instanceof m?w.ch:w,S)},l,u=function(w){return e.options.lineWrapping?(l=l||Er(e,t),zo(e,t,l,w)):{begin:0,end:t.text.length}},h=u(n.sticky=="before"?s(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var f=a.level==1==r<0,c=s(n,f?1:-1);if(c!=null&&(f?c<=a.to&&c<=h.end:c>=a.from&&c>=h.begin)){var d=f?"before":"after";return new m(n.line,c,d)}}var p=function(w,S,x){for(var O=function(Se,tt){return tt?new m(n.line,s(Se,1),"before"):new m(n.line,Se,"after")};w>=0&&w<i.length;w+=S){var F=i[w],N=S>0==(F.level!=1),Z=N?x.begin:s(x.end,-1);if(F.from<=Z&&Z<F.to)return O(Z,N);if(Z=N?F.from:s(F.to,-1),x.begin<=Z&&Z<x.end)return O(Z,N)}},v=p(o+r,r,h);if(v)return v;var y=r>0?h.end:s(h.begin,-1);return y!=null&&!(r>0&&y==t.text.length)&&(v=p(r>0?0:i.length-1,r,u(y)),v)?v:null}var vn={selectAll:xa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),C)},killLine:function(e){return Wr(e,function(t){if(t.empty()){var n=R(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:m(t.head.line+1,0)}:{from:t.head,to:m(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Wr(e,function(t){return{from:m(t.from().line,0),to:K(e.doc,m(t.to().line+1,0))}})},delLineLeft:function(e){return Wr(e,function(t){return{from:m(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Wr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Wr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},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(m(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(m(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Fa(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ua(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(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")},T)},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")},T)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ua(e,t.head):r},T)},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(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=M(e.getLine(o.line),o.ch,r);t.push(U(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return xt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,o=R(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new m(i.line,i.ch-1)),i.ch>0)i=new m(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),m(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=R(e.doc,i.line-1).text;a&&(i=new m(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),m(i.line-1,a.length-1),i,"+transpose"))}}n.push(new ve(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return xt(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 r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Mr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Fa(e,t){var n=R(e.doc,t),r=zt(n);return r!=n&&(t=ge(r)),Gi(!0,e,r,t,1)}function Pl(e,t){var n=R(e.doc,t),r=ys(n);return r!=n&&(t=ge(r)),Gi(!0,e,n,t,-1)}function Ua(e,t){var n=Fa(e,t.line),r=R(e.doc,n.line),i=pt(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return m(n.line,a?0:o,n.sticky)}return n}function Yn(e,t,n){if(typeof t=="string"&&(t=vn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Be}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Wl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Pr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Pr(t,e.options.extraKeys,n,e)||Pr(t,e.options.keyMap,n,e)}var Il=new G;function gn(e,t,n,r){var i=e.state.keySeq;if(i){if(Pa(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Il.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),za(e,i+" "+t,n,r))return!0}return za(e,t,n,r)}function za(e,t,n,r){var i=Wl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&nt(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Ce(n),Mi(e)),!!i}function Ha(e,t){var n=Ia(t,!0);return n?t.shiftKey&&!e.state.keySeq?gn(e,"Shift-"+n,t,function(r){return Yn(e,r,!0)})||gn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Yn(e,r)}):gn(e,n,t,function(r){return Yn(e,r)}):!1}function Fl(e,t,n){return gn(e,"'"+n+"'",t,function(r){return Yn(e,r,!0)})}var Xi=null;function Ba(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=be(),q(t,e))return;P&&Q<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Ha(t,e);E&&(Xi=r?n:null,!r&&n==88&&!ti&&(Te?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),fe&&!Te&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;Y(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(ce(t,"CodeMirror-crosshair"),at(document,"keyup",n),at(document,"mouseover",n))}I(document,"keyup",n),I(document,"mouseover",n)}function ja(e){e.keyCode==16&&(this.doc.sel.shift=!1),q(this,e)}function Ka(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Xt(t.display,e)||q(t,e)||e.ctrlKey&&!e.altKey||Te&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(E&&n==Xi){Xi=null,Ce(e);return}if(E&&(!e.which||e.which<10)&&Ha(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Fl(t,e,i))return;t.display.input.onKeyPress(e)}var zl=400,Yi=function(e,t,n){this.time=e,this.pos=t,this.button=n};Yi.prototype.compare=function(e,t,n){return this.time+zl>e&&j(t,this.pos)==0&&n==this.button};var mn,yn;function Hl(e,t){var n=+new Date;return yn&&yn.compare(n,e,t)?(mn=yn=null,"triple"):mn&&mn.compare(n,e,t)?(yn=new Yi(n,e,t),mn=null,"double"):(mn=new Yi(n,e,t),yn=null,"single")}function Ga(e){var t=this,n=t.display;if(q(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Xt(n,e)){$||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Zi(t,e))return;var r=hr(t,e),i=br(e),o=r?Hl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Bl(t,i,r,o,e))return;i==1?r?Kl(t,r,o,e):Wt(e)==n.scroller&&Ce(e):i==2?(r&&Hn(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(Me?t.display.input.onContextMenu(e):Xo(t))}function Bl(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,gn(e,Wa(o,i),i,function(a){if(typeof a=="string"&&(a=vn[a]),!a)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=a(e,n)!=Be}finally{e.state.suppressEdits=!1}return s})}function jl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Ge?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=Te?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(Te?n.altKey:n.ctrlKey)),i}function Kl(e,t,n,r){P?setTimeout(St(Go,e),0):e.curOp.focus=be();var i=jl(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&qn&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(j((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(j(a.to(),t)>0||t.xRel<0)?Gl(e,r,t,i):Xl(e,r,t,i)}function Gl(e,t,n,r){var i=e.display,o=!1,a=$e(e,function(u){$&&(i.scroller.draggable=!1),e.state.draggingText=!1,at(i.wrapper.ownerDocument,"mouseup",a),at(i.wrapper.ownerDocument,"mousemove",s),at(i.scroller,"dragstart",l),at(i.scroller,"drop",a),o||(Ce(u),r.addNew||Hn(e.doc,n,null,null,r.extend),$&&!ue||P&&Q==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},l=function(){return o=!0};$&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),I(i.wrapper.ownerDocument,"mouseup",a),I(i.wrapper.ownerDocument,"mousemove",s),I(i.scroller,"dragstart",l),I(i.scroller,"drop",a),Xo(e),setTimeout(function(){return i.input.focus()},20)}function Xa(e,t,n){if(n=="char")return new ve(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new ve(m(t.line,0),K(e.doc,m(t.line+1,0)));var r=n(e,t);return new ve(r.from,r.to)}function Xl(e,t,n,r){var i=e.display,o=e.doc;Ce(t);var a,s,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),s>-1?a=u[s]:a=new ve(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new ve(n,n)),n=hr(e,t,!0,!0),s=-1;else{var h=Xa(e,n,r.unit);r.extend?a=Hi(a,h.anchor,h.head,r.extend):a=h}r.addNew?s==-1?(s=u.length,st(o,Nt(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&r.unit=="char"&&!r.extend?(st(o,Nt(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Bi(o,s,a,D):(s=0,st(o,new Tt([a],0),D),l=o.sel);var f=n;function c(x){if(j(f,x)==0)return;if(f=x,r.unit=="rectangle"){for(var O=[],F=e.options.tabSize,N=M(R(o,n.line).text,n.ch,F),Z=M(R(o,x.line).text,x.ch,F),Se=Math.min(N,Z),tt=Math.max(N,Z),Fe=Math.min(n.line,x.line),Ct=Math.min(e.lastLine(),Math.max(n.line,x.line));Fe<=Ct;Fe++){var mt=R(o,Fe).text,Ze=A(mt,Se,F);Se==tt?O.push(new ve(m(Fe,Ze),m(Fe,Ze))):mt.length>Ze&&O.push(new ve(m(Fe,Ze),m(Fe,A(mt,tt,F))))}O.length||O.push(new ve(n,n)),st(o,Nt(e,l.ranges.slice(0,s).concat(O),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(x)}else{var yt=a,it=Xa(e,x,r.unit),Ve=yt.anchor,Je;j(it.anchor,Ve)>0?(Je=it.head,Ve=Cn(yt.from(),it.anchor)):(Je=it.anchor,Ve=xn(yt.to(),it.head));var ze=l.ranges.slice(0);ze[s]=Yl(e,new ve(K(o,Ve),Je)),st(o,Nt(e,ze,s),D)}}var d=i.wrapper.getBoundingClientRect(),p=0;function v(x){var O=++p,F=hr(e,x,!0,r.unit=="rectangle");if(!F)return;if(j(F,f)!=0){e.curOp.focus=be(),c(F);var N=Pn(i,o);(F.line>=N.to||F.line<N.from)&&setTimeout($e(e,function(){p==O&&v(x)}),150)}else{var Z=x.clientY<d.top?-20:x.clientY>d.bottom?20:0;Z&&setTimeout($e(e,function(){if(p!=O)return;i.scroller.scrollTop+=Z,v(x)}),50)}}function y(x){e.state.selectingText=!1,p=Infinity,x&&(Ce(x),i.input.focus()),at(i.wrapper.ownerDocument,"mousemove",w),at(i.wrapper.ownerDocument,"mouseup",S),o.history.lastSelOrigin=null}var w=$e(e,function(x){x.buttons===0||!br(x)?y(x):v(x)}),S=$e(e,y);e.state.selectingText=S,I(i.wrapper.ownerDocument,"mousemove",w),I(i.wrapper.ownerDocument,"mouseup",S)}function Yl(e,t){var n=t.anchor,r=t.head,i=R(e.doc,n.line);if(j(n,r)==0&&n.sticky==r.sticky)return t;var o=pt(i);if(!o)return t;var a=kt(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l=a+(s.from==n.ch==(s.level!=1)?0:1);if(l==0||l==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=kt(o,r.ch,r.sticky),f=h-a||(r.ch-n.ch)*(s.level==1?-1:1);h==l-1||h==l?u=f<0:u=f>0}var c=o[l+(u?-1:0)],d=u==(c.level==1),p=d?c.from:c.to,v=d?"after":"before";return n.ch==p&&n.sticky==v?t:new ve(new m(n.line,p,v),r)}function Ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(c){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ce(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!oe(e,n))return Ot(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i){var h=sr(e.doc,o),f=e.display.gutterSpecs[l];return Ne(e,n,e,h,f.className,t),Ot(t)}}}function Zi(e,t){return Ya(e,t,"gutterClick",!0)}function Za(e,t){if(Xt(e.display,t)||Zl(e,t))return;if(q(e,t,"contextmenu"))return;Me||e.display.input.onContextMenu(t)}function Zl(e,t){return oe(e,"gutterContextMenu")?Ya(e,t,"gutterContextMenu",!1):!1}function Ja(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vr(e)}var Ir={toString:function(){return"CodeMirror.Init"}},Qa={},Zn={};function Jl(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(s,l,u){u!=Ir&&o(s,l,u)}:o)}e.defineOption=n,e.Init=Ir,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Fi(r)},!0),n("indentUnit",2,Fi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){an(r),Vr(r),vt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var o=[],a=r.doc.first;r.doc.iter(function(l){for(var u=0;;){var h=l.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(m(a,h))}a++});for(var s=o.length-1;s>=0;s--)Rr(r.doc,i,o[s],m(o[s].line,o[s].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Ir&&r.refresh()}),n("specialCharPlaceholder",Es,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",Ie?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!ke),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Ja(r),on(r)},!0),n("keyMap","default",function(r,i,o){var a=Xn(i),s=o!=Ir&&Xn(o);s&&s.detach&&s.detach(r,a),a.attach&&a.attach(r,s||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Vl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Wi(i,r.options.lineNumbers),on(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ti(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Or(r)},!0),n("scrollbarStyle","native",function(r){qo(r),Or(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Wi(r.options.gutters,i),on(r)},!0),n("firstLineNumber",1,on,!0),n("lineNumberFormatter",function(r){return r},on,!0),n("showCursorWhenSelecting",!1,qr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(kr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Ql),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,qr,!0),n("singleCursorHeightPerLine",!0,qr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,an,!0),n("addModeClass",!1,an,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,an,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Ql(e,t,n){var r=n&&n!=Ir;if(!t!=!r){var i=e.display.dragFunctions,o=t?I:at;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Vl(e){e.options.lineWrapping?(Y(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ce(e.display.wrapper,"CodeMirror-wrap"),vi(e)),ki(e),vt(e),Vr(e),setTimeout(function(){return Or(e)},100)}function Pe(e,t){var n=this;if(!(this instanceof Pe))return new Pe(e,t);this.options=t=t?z(t):{},z(Qa,t,!1);var r=t.value;typeof r=="string"?r=new gt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Pe.inputStyles[t.inputStyle](this),o=this.display=new hl(e,r,i,t);o.wrapper.CodeMirror=this,Ja(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qo(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 G,keySeq:null,specialChars:null},t.autofocus&&!Ie&&o.input.focus(),P&&Q<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Ol(),pr(this),this.curOp.forceUpdate=!0,la(this,r),t.autofocus&&!Ie||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Oi(n)},20):kr(this);for(var a in Zn)Zn.hasOwnProperty(a)&&Zn[a](this,t[a],Ir);ta(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Ji.length;++s)Ji[s](this);vr(this),$&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Pe.defaults=Qa,Pe.optionHandlers=Zn;function ql(e){var t=e.display;I(t.scroller,"mousedown",$e(e,Ga)),P&&Q<11?I(t.scroller,"dblclick",$e(e,function(l){if(q(e,l))return;var u=hr(e,l);if(!u||Zi(e,l)||Xt(e.display,l))return;Ce(l);var h=e.findWordAt(u);Hn(e.doc,h.anchor,h.head)})):I(t.scroller,"dblclick",function(l){return q(e,l)||Ce(l)}),I(t.scroller,"contextmenu",function(l){return Za(e,l)}),I(t.input.getField(),"contextmenu",function(l){t.scroller.contains(l.target)||Za(e,l)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(l){if(l.touches.length!=1)return!1;var u=l.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(l,u){if(u.left==null)return!0;var h=u.left-l.left,f=u.top-l.top;return h*h+f*f>20*20}I(t.scroller,"touchstart",function(l){if(!q(e,l)&&!o(l)&&!Zi(e,l)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},l.touches.length==1&&(t.activeTouch.left=l.touches[0].pageX,t.activeTouch.top=l.touches[0].pageY)}}),I(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),I(t.scroller,"touchend",function(l){var u=t.activeTouch;if(u&&!Xt(t,l)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),f;!u.prev||a(u,u.prev)?f=new ve(h,h):!u.prev.prev||a(u,u.prev.prev)?f=e.findWordAt(h):f=new ve(m(h.line,0),K(e.doc,m(h.line+1,0))),e.setSelection(f.anchor,f.head),e.focus(),Ce(l)}i()}),I(t.scroller,"touchcancel",i),I(t.scroller,"scroll",function(){t.scroller.clientHeight&&(en(e,t.scroller.scrollTop),dr(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),I(t.scroller,"mousewheel",function(l){return ia(e,l)}),I(t.scroller,"DOMMouseScroll",function(l){return ia(e,l)}),I(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(l){q(e,l)||_t(l)},over:function(l){q(e,l)||(Ml(e,l),_t(l))},start:function(l){return kl(e,l)},drop:$e(e,Tl),leave:function(l){q(e,l)||Da(e)}};var s=t.input.getField();I(s,"keyup",function(l){return ja.call(e,l)}),I(s,"keydown",$e(e,Ba)),I(s,"keypress",$e(e,Ka)),I(s,"focus",function(l){return Oi(e,l)}),I(s,"blur",function(l){return kr(e,l)})}var Ji=[];Pe.defineInitHook=function(e){return Ji.push(e)};function bn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=Xr(e,t).state:n="prev");var a=e.options.tabSize,s=R(i,t),l=M(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u=s.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(s.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,s.text.slice(u.length),s.text),h==Be||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=M(R(i,t-1).text,null,a):h=0:n=="add"?h=l+e.options.indentUnit:n=="subtract"?h=l-e.options.indentUnit:typeof n=="number"&&(h=l+n),h=Math.max(0,h);var f="",c=0;if(e.options.indentWithTabs)for(var d=Math.floor(h/a);d;--d)c+=a,f+=" ";if(c<h&&(f+=U(h-c)),f!=u)return Rr(i,f,m(t,0),m(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<i.sel.ranges.length;p++){var v=i.sel.ranges[p];if(v.head.line==t&&v.head.ch<u.length){var y=m(t,u.length);Bi(i,p,new ve(y,y));break}}}var Pt=null;function Jn(e){Pt=e}function Qi(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s=i=="paste"||e.state.pasteIncoming>a,l=It(t),u=null;if(s&&r.ranges.length>1)if(Pt&&Pt.text.join(`
|
|
`)==t){if(r.ranges.length%Pt.text.length==0){u=[];for(var h=0;h<Pt.text.length;h++)u.push(o.splitLines(Pt.text[h]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=H(l,function(w){return[w]}));for(var f=e.curOp.updateInput,c=r.ranges.length-1;c>=0;c--){var d=r.ranges[c],p=d.from(),v=d.to();d.empty()&&(n&&n>0?p=m(p.line,p.ch-n):e.state.overwrite&&!s?v=m(v.line,Math.min(R(o,v.line).text.length,v.ch+k(l).length)):s&&Pt&&Pt.lineWise&&Pt.text.join(`
|
|
`)==l.join(`
|
|
`)&&(p=v=m(p.line,0)));var y={from:p,to:v,text:u?u[c%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Dr(e.doc,y),nt(e,"inputRead",e,y)}t&&!s&&qa(e,t),Mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Va(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&xt(t,function(){return Qi(t,n,0,null,"paste")}),!0}function qa(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=bn(e,i.head.line,"smart");break}}else o.electricInput&&(o.electricInput.test(R(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=bn(e,i.head.line,"smart")));a&&nt(e,"electricInput",e,i.head.line)}}function $a(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:m(i,0),head:m(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function es(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function ts(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return $?e.style.width="1000px":e.setAttribute("wrap","off"),ee&&(e.style.border="1px solid black"),es(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];if(o[r]==i&&r!="mode")return;o[r]=i,t.hasOwnProperty(r)&&$e(this,t[r])(this,i,a),Ne(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Xn(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:ht(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");ne(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,vt(this)}),removeOverlay:ht(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,vt(this);return}}}),indentLine:ht(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Gr(this.doc,r)&&bn(this,r,i,o)}),indentSelection:ht(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var s=i[a];if(s.empty())s.head.line>o&&(bn(this,s.head.line,r,!0),o=s.head.line,a==this.doc.sel.primIndex&&Mr(this));else{var l=s.from(),u=s.to(),h=Math.max(o,l.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var f=h;f<o;++f)bn(this,f,r);var c=this.doc.sel.ranges;l.ch==0&&i.length==c.length&&c[a].from().ch>0&&Bi(this.doc,a,new ve(l,c[a].to()),C)}}}),getTokenAt:function(r,i){return so(this,r,i)},getLineTokens:function(r,i){return so(this,m(r),i,!0)},getTokenTypeAt:function(r){r=K(this.doc,r);var i=io(this,R(this.doc,r.line)),o=0,a=(i.length-1)/2,s=r.ch,l;if(s==0)l=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=s)a=u;else if(i[u*2+1]<s)o=u+1;else{l=i[u*2+2];break}}var h=l?l.indexOf("overlay "):-1;return h<0?l:h==0?null:l.slice(0,h-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],s=this.getModeAt(r);if(typeof s[i]=="string")a[s[i]]&&o.push(a[s[i]]);else if(s[i])for(var l=0;l<s[i].length;l++){var u=a[s[i][l]];u&&o.push(u)}else s.helperType&&a[s.helperType]?o.push(a[s.helperType]):a[s.name]&&o.push(a[s.name]);for(var h=0;h<a._global.length;h++){var f=a._global[h];f.pred(s,this)&&X(o,f.val)==-1&&o.push(f.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=to(o,r==null?o.first+o.size-1:r),Xr(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=K(this.doc,r):o=r?a.from():a.to(),Rt(this,o,i||"page")},charCoords:function(r,i){return xi(this,K(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Io(this,r,i||"page"),Si(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Io(this,{top:r,left:0},i||"page").top,sr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,s;if(typeof r=="number"){var l=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>l&&(r=l,a=!0),s=R(this.doc,r)}else s=r;return An(this,s,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Gt(s):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,s){var l=this.display;r=Rt(this,K(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),l.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var f=Math.max(l.wrapper.clientHeight,this.doc.height),c=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>f)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=f&&(u=r.bottom),h+i.offsetWidth>c&&(h=c-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",s=="right"?(h=l.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?h=0:s=="middle"&&(h=(l.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&Qs(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:ht(Ba),triggerOnKeyPress:ht(Ka),triggerOnKeyUp:ja,triggerOnMouseDown:ht(Ga),execCommand:function(r){if(vn.hasOwnProperty(r))return vn[r].call(null,this)},triggerElectric:ht(function(r){qa(this,r)}),findPosH:function(r,i,o,a){var s=1;i<0&&(s=-1,i=-i);for(var l=K(this.doc,r),u=0;u<i&&!(l=Vi(this.doc,l,s,o,a),l.hitSide);++u);return l},moveH:ht(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?Vi(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},T)}),deleteH:ht(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):Wr(this,function(s){var l=Vi(a,s.head,r,i,!1);return r<0?{from:l,to:s.head}:{from:s.head,to:l}})}),findPosV:function(r,i,o,a){var s=1,l=a;i<0&&(s=-1,i=-i);for(var u=K(this.doc,r),h=0;h<i;++h){var f=Rt(this,u,"div");if(l==null?l=f.left:f.left=l,u=rs(this,f,s,o),u.hitSide)break}return u},moveV:ht(function(r,i){var o=this,a=this.doc,s=[],l=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(h){if(l)return r<0?h.from():h.to();var f=Rt(o,h.head,"div");h.goalColumn!=null&&(f.left=h.goalColumn),s.push(f.left);var c=rs(o,f,r,i);return i=="page"&&h==a.sel.primary()&&Ai(o,xi(o,c,"div").top-f.top),c},T),s.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=s[u]}),findWordAt:function(r){var i=this.doc,o=R(i,r.line).text,a=r.ch,s=r.ch;if(o){var l=this.getHelper(r,"wordChars");(r.sticky=="before"||s==o.length)&&a?--a:++s;for(var u=o.charAt(a),h=qe(u,l)?function(f){return qe(f,l)}:/\s/.test(u)?function(f){return/\s/.test(f)}:function(f){return!/\s/.test(f)&&!qe(f)};a>0&&h(o.charAt(a-1));)--a;for(;s<o.length&&h(o.charAt(s));)++s}return new ve(m(r.line,a),m(r.line,s))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?Y(this.display.cursorDiv,"CodeMirror-overwrite"):ce(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==be()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ht(function(r,i){$r(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ht(this)-this.display.barHeight,width:r.scrollWidth-Ht(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:lr(this)}},scrollIntoView:ht(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:m(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Vs(this,r):Zo(this,r.from,r.to,r.margin)}),setSize:ht(function(r,i){var o=this,a=function(l){return typeof l=="number"||/^\d+$/.test(String(l))?l+"px":l};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&No(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(l){if(l.widgets){for(var u=0;u<l.widgets.length;u++)if(l.widgets[u].noHScroll){Vt(o,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,Ne(this,"refresh",this)}),operation:function(r){return xt(this,r)},startOperation:function(){return pr(this)},endOperation:function(){return vr(this)},refresh:ht(function(){var r=this.display.cachedTextHeight;vt(this),this.curOp.forceUpdate=!0,Vr(this),$r(this,this.doc.scrollLeft,this.doc.scrollTop),Ni(this.display),(r==null||Math.abs(r-Lr(this.display))>.5||this.options.lineWrapping)&&ki(this),Ne(this,"refresh",this)}),swapDoc:ht(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),la(this,r),Vr(this),this.display.input.reset(),$r(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,nt(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},Ue(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function Vi(e,t,n,r,i){var o=t,a=n,s=R(e,t.line),l=i&&e.direction=="rtl"?-n:n;function u(){var S=t.line+l;return S<e.first||S>=e.first+e.size?!1:(t=new m(S,t.ch,t.sticky),s=R(e,S))}function h(S){var x;if(r=="codepoint"){var O=s.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(O)?x=null:x=new m(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(O>=55296&&O<56320?2:1))),-n)}else i?x=Nl(e.cm,s,t,n):x=Ki(s,t,n);if(x==null)if(!S&&u())t=Gi(i,e.cm,s,t.line,l);else return!1;else t=x;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var f=null,c=r=="group",d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0&&!h(!p));p=!1){var v=s.text.charAt(t.ch)||`
|
|
`,y=qe(v,d)?"w":c&&v==`
|
|
`?"n":!c||/\s/.test(v)?null:"p";if(c&&!p&&!y&&(y="s"),f&&f!=y){n<0&&(n=1,h(),t.sticky="after");break}if(y&&(f=y),n>0&&!h(!p))break}var w=jn(e,t,o,a,!0);return si(o,w)&&(w.hitSide=!0),w}function rs(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*Lr(e.display),3);a=(n>0?t.bottom:t.top)+n*l}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;!(u=Si(e,o,a),!u.outside);){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var me=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new G,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};me.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;es(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(s){for(var l=s.target;l;l=l.parentNode){if(l==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(l.className))break}return!1}I(i,"paste",function(s){if(!o(s)||q(r,s)||Va(s,r))return;Q<=11&&setTimeout($e(r,function(){return t.updateFromDOM()}),20)}),I(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),I(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),I(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),I(i,"touchstart",function(){return n.forceCompositionEnd()}),I(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(s){if(!o(s)||q(r,s))return;if(r.somethingSelected())Jn({lineWise:!1,text:r.getSelections()}),s.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var l=$a(r);Jn({lineWise:!0,text:l.text}),s.type=="cut"&&r.operation(function(){r.setSelections(l.ranges,0,C),r.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var u=Pt.text.join(`
|
|
`);if(s.clipboardData.setData("Text",u),s.clipboardData.getData("Text")==u){s.preventDefault();return}}var h=ts(),f=h.firstChild;r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),f.value=Pt.text.join(`
|
|
`);var c=document.activeElement;dt(f),setTimeout(function(){r.display.lineSpace.removeChild(h),c.focus(),c==i&&n.showPrimarySelection()},50)}I(i,"copy",a),I(i,"cut",a)},me.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},me.prototype.prepareSelection=function(){var e=jo(this.cm,!1);return e.focus=document.activeElement==this.div,e},me.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},me.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},me.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=Qn(t,e.anchorNode,e.anchorOffset),a=Qn(t,e.focusNode,e.focusOffset);if(o&&!o.bad&&a&&!a.bad&&j(Cn(o,a),r)==0&&j(xn(o,a),i)==0)return;var s=t.display.view,l=r.line>=t.display.viewFrom&&ns(t,r)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ns(t,i);if(!u){var h=s[s.length-1].measure,f=h.maps?h.maps[h.maps.length-1]:h.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!l||!u){e.removeAllRanges();return}var c=e.rangeCount&&e.getRangeAt(0),d;try{d=te(l.node,l.offset,u.offset,u.node)}catch(p){}d&&(!fe&&t.state.focused?(e.collapse(l.node,l.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),c&&e.anchorNode==null?e.addRange(c):fe&&this.startGracePeriod()),this.rememberSelection()},me.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)},me.prototype.showMultipleSelections=function(e){re(this.cm.display.cursorDiv,e.cursors),re(this.cm.display.selectionDiv,e.selection)},me.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},me.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Qe(this.div,t)},me.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},me.prototype.blur=function(){this.div.blur()},me.prototype.getField=function(){return this.div},me.prototype.supportsTouch=function(){return!0},me.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():xt(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},me.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},me.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(we&&L&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=Qn(t,e.anchorNode,e.anchorOffset),r=Qn(t,e.focusNode,e.focusOffset);n&&r&&xt(t,function(){st(t.doc,$t(n,r),C),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},me.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=m(r.line-1,R(e.doc,r.line-1).length)),i.ch==R(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=m(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,s;r.line==t.viewFrom||(o=fr(e,r.line))==0?(a=ge(t.view[0].line),s=t.view[0].node):(a=ge(t.view[o].line),s=t.view[o-1].node.nextSibling);var l=fr(e,i.line),u,h;if(l==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=ge(t.view[l+1].line)-1,h=t.view[l+1].node.previousSibling),!s)return!1;for(var f=e.doc.splitLines(tu(e,s,h,a,u)),c=ar(e.doc,m(a,0),m(u,R(e.doc,u).text.length));f.length>1&&c.length>1;)if(k(f)==k(c))f.pop(),c.pop(),u--;else if(f[0]==c[0])f.shift(),c.shift(),a++;else break;for(var d=0,p=0,v=f[0],y=c[0],w=Math.min(v.length,y.length);d<w&&v.charCodeAt(d)==y.charCodeAt(d);)++d;for(var S=k(f),x=k(c),O=Math.min(S.length-(f.length==1?d:0),x.length-(c.length==1?d:0));p<O&&S.charCodeAt(S.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(f.length==1&&c.length==1&&a==r.line)for(;d&&d>r.ch&&S.charCodeAt(S.length-p-1)==x.charCodeAt(x.length-p-1);)d--,p++;f[f.length-1]=S.slice(0,S.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var F=m(a,d),N=m(u,c.length?k(c).length-p:0);if(f.length>1||f[0]||j(F,N))return Rr(e.doc,f,F,N,"+input"),!0},me.prototype.ensurePolled=function(){this.forceCompositionEnd()},me.prototype.reset=function(){this.forceCompositionEnd()},me.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},me.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},me.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&xt(this.cm,function(){return vt(e.cm)})},me.prototype.setUneditable=function(e){e.contentEditable="false"},me.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||$e(this.cm,Qi)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},me.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},me.prototype.onContextMenu=function(){},me.prototype.resetPosition=function(){},me.prototype.needsContentAttribute=!0;function ns(e,t){var n=bi(e,t.line);if(!n||n.hidden)return null;var r=R(e.doc,t.line),i=Oo(n,r,t.line),o=pt(r,e.doc.direction),a="left";if(o){var s=kt(o,t.ch);a=s%2?"right":"left"}var l=Do(i.map,t.ch,a);return l.offset=l.collapse=="right"?l.end:l.start,l}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fr(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(d){return function(p){return p.id==d}}function h(){a&&(o+=s,l&&(o+=s),a=l=!1)}function f(d){d&&(h(),o+=d)}function c(d){if(d.nodeType==1){var p=d.getAttribute("cm-text");if(p){f(p);return}var v=d.getAttribute("cm-marker"),y;if(v){var w=e.findMarks(m(r,0),m(i+1,0),u(+v));w.length&&(y=w[0].find(0))&&f(ar(e.doc,y.from,y.to).join(s));return}if(d.getAttribute("contenteditable")=="false")return;var S=/^(pre|div|p|li|table|br)$/i.test(d.nodeName);if(!/^br$/i.test(d.nodeName)&&d.textContent.length==0)return;S&&h();for(var x=0;x<d.childNodes.length;x++)c(d.childNodes[x]);/^(pre|p)$/i.test(d.nodeName)&&(l=!0),S&&(a=!0)}else d.nodeType==3&&f(d.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(c(t),t==n);)t=t.nextSibling,l=!1;return o}function Qn(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Fr(e.clipPos(m(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ru(o,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!Qe(r,t))return Fr(m(ge(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?k(e.rest):e.line;return Fr(m(ge(o),o.text.length),i)}var a=t.nodeType==3?t:null,s=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,u=l.maps;function h(y,w,S){for(var x=-1;x<(u?u.length:0);x++)for(var O=x<0?l.map:u[x],F=0;F<O.length;F+=3){var N=O[F+2];if(N==y||N==w){var Z=ge(x<0?e.line:e.rest[x]),Se=O[F]+S;return(S<0||N!=y)&&(Se=O[F+(S?1:0)]),m(Z,Se)}}}var f=h(a,s,n);if(f)return Fr(f,i);for(var c=s.nextSibling,d=a?a.nodeValue.length-n:0;c;c=c.nextSibling){if(f=h(c,c.firstChild,0),f)return Fr(m(f.line,f.ch-d),i);d+=c.textContent.length}for(var p=s.previousSibling,v=n;p;p=p.previousSibling){if(f=h(p,p.firstChild,-1),f)return Fr(m(f.line,f.ch+v),i);v+=p.textContent.length}}var Ke=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new G,this.hasSelection=!1,this.composing=null};Ke.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),ee&&(i.style.width="0px"),I(i,"input",function(){P&&Q>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),I(i,"paste",function(a){if(q(r,a)||Va(a,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function o(a){if(q(r,a))return;if(r.somethingSelected())Jn({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var s=$a(r);Jn({lineWise:!0,text:s.text}),a.type=="cut"?r.setSelections(s.ranges,null,C):(n.prevInput="",i.value=s.text.join(`
|
|
`),dt(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}I(i,"cut",o),I(i,"copy",o),I(e.scroller,"paste",function(a){if(Xt(e,a)||q(r,a))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var s=new Event("paste");s.clipboardData=a.clipboardData,i.dispatchEvent(s)}),I(e.lineSpace,"selectstart",function(a){Xt(e,a)||Ce(a)}),I(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),I(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ke.prototype.createField=function(e){this.wrapper=ts(),this.textarea=this.wrapper.firstChild},Ke.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ke.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=jo(e);if(e.options.moveInputWithCursor){var i=Rt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ke.prototype.showSelection=function(e){var t=this.cm,n=t.display;re(n.cursorDiv,e.cursors),re(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ke.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&dt(this.textarea),P&&Q>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",P&&Q>=9&&(this.hasSelection=null))},Ke.prototype.getField=function(){return this.textarea},Ke.prototype.supportsTouch=function(){return!1},Ke.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Ie||be()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ke.prototype.blur=function(){this.textarea.blur()},Ke.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ke.prototype.receivedFocus=function(){this.slowPoll()},Ke.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ke.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Ke.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Jt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(P&&Q>=9&&this.hasSelection===i||Te&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(r.length,i.length);a<s&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return xt(t,function(){Qi(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ke.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ke.prototype.onKeyPress=function(){P&&Q>=9&&(this.hasSelection=null),this.fastPoll()},Ke.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=hr(n,e),a=r.scroller.scrollTop;if(!o||E)return;var s=n.options.resetSelectionOnContextMenu;s&&n.doc.sel.contains(o)==-1&&$e(n,st)(n.doc,$t(o),C);var l=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
|
|
z-index: 1000; background: `+(P?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var f;$&&(f=window.scrollY),r.input.focus(),$&&window.scrollTo(null,f),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=d,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function c(){if(i.selectionStart!=null){var v=n.somethingSelected(),y="\u200B"+(v?i.value:"");i.value="\u21DA",i.value=y,t.prevInput=v?"":"\u200B",i.selectionStart=1,i.selectionEnd=y.length,r.selForContextMenu=n.doc.sel}}function d(){if(t.contextMenuPending!=d)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=l,P&&Q<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null){(!P||P&&Q<9)&&c();var v=0,y=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?$e(n,xa)(n):v++<10?r.detectingSelectAll=setTimeout(y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(y,200)}}if(P&&Q>=9&&c(),Me){_t(e);var p=function(){at(window,"mouseup",p),setTimeout(d,20)};I(window,"mouseup",p)}else setTimeout(d,50)},Ke.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ke.prototype.setUneditable=function(){},Ke.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?z(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=be();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(I(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(l){l.save=r,l.getTextArea=function(){return e},l.toTextArea=function(){l.toTextArea=isNaN,r(),e.parentNode.removeChild(l.getWrapperElement()),e.style.display="",e.form&&(at(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=Pe(function(l){return e.parentNode.insertBefore(l,e.nextSibling)},t);return s}function iu(e){e.off=at,e.on=I,e.wheelEventPixels=fl,e.Doc=gt,e.splitLines=It,e.countColumn=M,e.findColumn=A,e.isWordChar=xe,e.Pass=Be,e.signal=Ne,e.Line=Cr,e.changeEnd=er,e.scrollbarModel=Vo,e.Pos=m,e.cmpPos=j,e.modes=Kr,e.mimeModes=wr,e.resolveMode=wn,e.getMode=ni,e.modeExtensions=xr,e.extendMode=as,e.copyState=or,e.startState=eo,e.innerMode=ii,e.commands=vn,e.keyMap=Yt,e.keyName=Ia,e.isModifierKey=Pa,e.lookupKey=Pr,e.normalizeKeyMap=Rl,e.StringStream=Ye,e.SharedTextMarker=dn,e.TextMarker=rr,e.LineWidget=fn,e.e_preventDefault=Ce,e.e_stopPropagation=Xe,e.e_stop=_t,e.addClass=Y,e.contains=Qe,e.rmClass=ce,e.keyNames=nr}Jl(Pe),$l(Pe);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Vn in gt.prototype)gt.prototype.hasOwnProperty(Vn)&&X(ou,Vn)<0&&(Pe.prototype[Vn]=function(e){return function(){return e.apply(this.doc,arguments)}}(gt.prototype[Vn]));return Ue(gt),Pe.inputStyles={textarea:Ke,contenteditable:me},Pe.defineMode=function(e){!Pe.defaults.mode&&e!="null"&&(Pe.defaults.mode=e),is.apply(this,arguments)},Pe.defineMIME=os,Pe.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pe.defineMIME("text/plain","null"),Pe.defineExtension=function(e,t){Pe.prototype[e]=t},Pe.defineDocExtension=function(e,t){gt.prototype[e]=t},Pe.fromTextArea=nu,iu(Pe),Pe.version="5.58.2",Pe})},Y1PL:function(ut,De,g){"use strict";g.r(De),g.d(De,"ResizableTextArea",function(){return X});var J=g("wx14"),ye=g("1OyB"),fe=g("vuIU"),Le=g("Ji7U"),B=g("LK+K"),W=g("q1tI"),P=g("VTBJ"),Q=g("rePB"),$=g("Zm9Q"),We=g("Kwbf"),L=g("c+Xe"),E=g("m+aA"),ue=g("bdgK"),ae=new Map;function de(C){C.forEach(function(D){var T,A=D.target;(T=ae.get(A))===null||T===void 0||T.forEach(function(b){return b(A)})})}var ee=new ue.default(de),we=null,Ie=null;function Te(C,D){ae.has(C)||(ae.set(C,new Set),ee.observe(C)),ae.get(C).add(D)}function Ge(C,D){ae.has(C)&&(ae.get(C).delete(D),ae.get(C).size||(ee.unobserve(C),ae.delete(C)))}var ke=function(C){Object(Le.a)(T,C);var D=Object(B.a)(T);function T(){return Object(ye.a)(this,T),D.apply(this,arguments)}return Object(fe.a)(T,[{key:"render",value:function(){return this.props.children}}]),T}(W.Component),V=W.createContext(null);function Ee(C){var D=C.children,T=C.onBatchResize,A=W.useRef(0),b=W.useRef([]),U=W.useContext(V),k=W.useCallback(function(H,ne,ie){A.current+=1;var _e=A.current;b.current.push({size:H,element:ne,data:ie}),Promise.resolve().then(function(){_e===A.current&&(T==null||T(b.current),b.current=[])}),U==null||U(H,ne,ie)},[T,U]);return W.createElement(V.Provider,{value:k},D)}function Me(C){var D=C.children,T=C.disabled,A=W.useRef(null),b=W.useRef(null),U=W.useContext(V),k=W.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),H=W.isValidElement(D)&&Object(L.c)(D),ne=H?D.ref:null,ie=W.useMemo(function(){return Object(L.a)(ne,A)},[ne,A]),_e=W.useRef(C);_e.current=C;var je=W.useCallback(function(xe){var qe=_e.current,At=qe.onResize,ot=qe.data,he=xe.getBoundingClientRect(),Ae=he.width,ct=he.height,Et=xe.offsetWidth,wt=xe.offsetHeight,kt=Math.floor(Ae),yr=Math.floor(ct);if(k.current.width!==kt||k.current.height!==yr||k.current.offsetWidth!==Et||k.current.offsetHeight!==wt){var pt={width:kt,height:yr,offsetWidth:Et,offsetHeight:wt};k.current=pt;var Mt=Et===Math.round(Ae)?Ae:Et,I=wt===Math.round(ct)?ct:wt,Dt=Object(P.a)(Object(P.a)({},pt),{},{offsetWidth:Mt,offsetHeight:I});U==null||U(Dt,xe,ot),At&&Promise.resolve().then(function(){At(Dt,xe)})}},[]);return W.useEffect(function(){var xe=Object(E.a)(A.current)||Object(E.a)(b.current);return xe&&!T&&Te(xe,je),function(){return Ge(xe,je)}},[A.current,T]),W.createElement(ke,{ref:b},H?W.cloneElement(D,{ref:ie}):D)}var Oe="rc-observer-key";function ce(C){var D=C.children,T=Object($.a)(D);return T.map(function(A,b){var U=(A==null?void 0:A.key)||"".concat(Oe,"-").concat(b);return W.createElement(Me,Object(J.a)({},C,{key:U}),A)})}ce.Collection=Ee;var pe=ce,re=g("bT9E"),_=g("TSYQ"),se=g.n(_),te=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,Qe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],be={},Y;function Re(C){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=C.getAttribute("id")||C.getAttribute("data-reactid")||C.getAttribute("name");if(D&&be[T])return be[T];var A=window.getComputedStyle(C),b=A.getPropertyValue("box-sizing")||A.getPropertyValue("-moz-box-sizing")||A.getPropertyValue("-webkit-box-sizing"),U=parseFloat(A.getPropertyValue("padding-bottom"))+parseFloat(A.getPropertyValue("padding-top")),k=parseFloat(A.getPropertyValue("border-bottom-width"))+parseFloat(A.getPropertyValue("border-top-width")),H=Qe.map(function(ie){return"".concat(ie,":").concat(A.getPropertyValue(ie))}).join(";"),ne={sizingStyle:H,paddingSize:U,borderSize:k,boxSizing:b};return D&&T&&(be[T]=ne),ne}function dt(C){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Y||(Y=document.createElement("textarea"),Y.setAttribute("tab-index","-1"),Y.setAttribute("aria-hidden","true"),document.body.appendChild(Y)),C.getAttribute("wrap")?Y.setAttribute("wrap",C.getAttribute("wrap")):Y.removeAttribute("wrap");var b=Re(C,D),U=b.paddingSize,k=b.borderSize,H=b.boxSizing,ne=b.sizingStyle;Y.setAttribute("style","".concat(ne,";").concat(te)),Y.value=C.value||C.placeholder||"";var ie=Number.MIN_SAFE_INTEGER,_e=Number.MAX_SAFE_INTEGER,je=Y.scrollHeight,xe;if(H==="border-box"?je+=k:H==="content-box"&&(je-=U),T!==null||A!==null){Y.value=" ";var qe=Y.scrollHeight-U;T!==null&&(ie=qe*T,H==="border-box"&&(ie=ie+U+k),je=Math.max(ie,je)),A!==null&&(_e=qe*A,H==="border-box"&&(_e=_e+U+k),xe=je>_e?"":"hidden",je=Math.min(_e,je))}return{height:je,minHeight:ie,maxHeight:_e,overflowY:xe,resize:"none"}}var St=g("Gytx"),z=g.n(St),M;(function(C){C[C.NONE=0]="NONE",C[C.RESIZING=1]="RESIZING",C[C.RESIZED=2]="RESIZED"})(M||(M={}));var G=function(C){Object(Le.a)(T,C);var D=Object(B.a)(T);function T(A){var b;return Object(ye.a)(this,T),b=D.call(this,A),b.nextFrameActionId=void 0,b.resizeFrameId=void 0,b.textArea=void 0,b.saveTextArea=function(U){b.textArea=U},b.handleResize=function(U){var k=b.state.resizeStatus,H=b.props,ne=H.autoSize,ie=H.onResize;if(k!==M.NONE)return;typeof ie=="function"&&ie(U),ne&&b.resizeOnNextFrame()},b.resizeOnNextFrame=function(){cancelAnimationFrame(b.nextFrameActionId),b.nextFrameActionId=requestAnimationFrame(b.resizeTextarea)},b.resizeTextarea=function(){var U=b.props.autoSize;if(!U||!b.textArea)return;var k=U.minRows,H=U.maxRows,ne=dt(b.textArea,!1,k,H);b.setState({textareaStyles:ne,resizeStatus:M.RESIZING},function(){cancelAnimationFrame(b.resizeFrameId),b.resizeFrameId=requestAnimationFrame(function(){b.setState({resizeStatus:M.RESIZED},function(){b.resizeFrameId=requestAnimationFrame(function(){b.setState({resizeStatus:M.NONE}),b.fixFirefoxAutoScroll()})})})})},b.renderTextArea=function(){var U=b.props,k=U.prefixCls,H=k===void 0?"rc-textarea":k,ne=U.autoSize,ie=U.onResize,_e=U.className,je=U.disabled,xe=b.state,qe=xe.textareaStyles,At=xe.resizeStatus,ot=Object(re.a)(b.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),he=se()(H,_e,Object(Q.a)({},"".concat(H,"-disabled"),je));"value"in ot&&(ot.value=ot.value||"");var Ae=Object(P.a)(Object(P.a)(Object(P.a)({},b.props.style),qe),At===M.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return W.createElement(pe,{onResize:b.handleResize,disabled:!(ne||ie)},W.createElement("textarea",Object(J.a)({},ot,{className:he,style:Ae,ref:b.saveTextArea})))},b.state={textareaStyles:{},resizeStatus:M.NONE},b}return Object(fe.a)(T,[{key:"componentDidUpdate",value:function(b){(b.value!==this.props.value||!z()(b.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var b=this.textArea.selectionStart,U=this.textArea.selectionEnd;this.textArea.setSelectionRange(b,U)}}catch(k){}}},{key:"render",value:function(){return this.renderTextArea()}}]),T}(W.Component),X=G,He=function(C){Object(Le.a)(T,C);var D=Object(B.a)(T);function T(A){var b;Object(ye.a)(this,T),b=D.call(this,A),b.resizableTextArea=void 0,b.focus=function(){b.resizableTextArea.textArea.focus()},b.saveTextArea=function(k){b.resizableTextArea=k},b.handleChange=function(k){var H=b.props.onChange;b.setValue(k.target.value,function(){b.resizableTextArea.resizeTextarea()}),H&&H(k)},b.handleKeyDown=function(k){var H=b.props,ne=H.onPressEnter,ie=H.onKeyDown;k.keyCode===13&&ne&&ne(k),ie&&ie(k)};var U=typeof A.value=="undefined"||A.value===null?A.defaultValue:A.value;return b.state={value:U},b}return Object(fe.a)(T,[{key:"setValue",value:function(b,U){"value"in this.props||this.setState({value:b},U)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return W.createElement(X,Object(J.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(b){return"value"in b?{value:b.value}:null}}]),T}(W.Component),Be=De.default=He},ZpRC:function(ut,De,g){"use strict";function J(L){return typeof L=="object"&&L!=null&&L.nodeType===1}function ye(L,E){return(!E||L!=="hidden")&&L!=="visible"&&L!=="clip"}function fe(L,E){if(L.clientHeight<L.scrollHeight||L.clientWidth<L.scrollWidth){var ue=getComputedStyle(L,null);return ye(ue.overflowY,E)||ye(ue.overflowX,E)||function(ae){var de=function(ee){if(!ee.ownerDocument||!ee.ownerDocument.defaultView)return null;try{return ee.ownerDocument.defaultView.frameElement}catch(we){return null}}(ae);return!!de&&(de.clientHeight<ae.scrollHeight||de.clientWidth<ae.scrollWidth)}(L)}return!1}function Le(L,E,ue,ae,de,ee,we,Ie){return ee<L&&we>E||ee>L&&we<E?0:ee<=L&&Ie<=ue||we>=E&&Ie>=ue?ee-L-ae:we>E&&Ie<ue||ee<L&&Ie>ue?we-E+de:0}var B=function(L,E){var ue=window,ae=E.scrollMode,de=E.block,ee=E.inline,we=E.boundary,Ie=E.skipOverflowHiddenElements,Te=typeof we=="function"?we:function(qe){return qe!==we};if(!J(L))throw new TypeError("Invalid target");for(var Ge=document.scrollingElement||document.documentElement,ke=[],V=L;J(V)&&Te(V);){if((V=V.parentElement)===Ge){ke.push(V);break}V!=null&&V===document.body&&fe(V)&&!fe(document.documentElement)||V!=null&&fe(V,Ie)&&ke.push(V)}for(var Ee=ue.visualViewport?ue.visualViewport.width:innerWidth,Me=ue.visualViewport?ue.visualViewport.height:innerHeight,Oe=window.scrollX||pageXOffset,ce=window.scrollY||pageYOffset,pe=L.getBoundingClientRect(),re=pe.height,_=pe.width,se=pe.top,te=pe.right,Qe=pe.bottom,be=pe.left,Y=de==="start"||de==="nearest"?se:de==="end"?Qe:se+re/2,Re=ee==="center"?be+_/2:ee==="end"?te:be,dt=[],St=0;St<ke.length;St++){var z=ke[St],M=z.getBoundingClientRect(),G=M.height,X=M.width,He=M.top,Be=M.right,C=M.bottom,D=M.left;if(ae==="if-needed"&&se>=0&&be>=0&&Qe<=Me&&te<=Ee&&se>=He&&Qe<=C&&be>=D&&te<=Be)return dt;var T=getComputedStyle(z),A=parseInt(T.borderLeftWidth,10),b=parseInt(T.borderTopWidth,10),U=parseInt(T.borderRightWidth,10),k=parseInt(T.borderBottomWidth,10),H=0,ne=0,ie="offsetWidth"in z?z.offsetWidth-z.clientWidth-A-U:0,_e="offsetHeight"in z?z.offsetHeight-z.clientHeight-b-k:0;if(Ge===z)H=de==="start"?Y:de==="end"?Y-Me:de==="nearest"?Le(ce,ce+Me,Me,b,k,ce+Y,ce+Y+re,re):Y-Me/2,ne=ee==="start"?Re:ee==="center"?Re-Ee/2:ee==="end"?Re-Ee:Le(Oe,Oe+Ee,Ee,A,U,Oe+Re,Oe+Re+_,_),H=Math.max(0,H+ce),ne=Math.max(0,ne+Oe);else{H=de==="start"?Y-He-b:de==="end"?Y-C+k+_e:de==="nearest"?Le(He,C,G,b,k+_e,Y,Y+re,re):Y-(He+G/2)+_e/2,ne=ee==="start"?Re-D-A:ee==="center"?Re-(D+X/2)+ie/2:ee==="end"?Re-Be+U+ie:Le(D,Be,X,A,U+ie,Re,Re+_,_);var je=z.scrollLeft,xe=z.scrollTop;Y+=xe-(H=Math.max(0,Math.min(xe+H,z.scrollHeight-G+_e))),Re+=je-(ne=Math.max(0,Math.min(je+ne,z.scrollWidth-X+ie)))}dt.push({el:z,top:H,left:ne})}return dt};function W(L){return L===Object(L)&&Object.keys(L).length!==0}function P(L,E){E===void 0&&(E="auto");var ue="scrollBehavior"in document.body.style;L.forEach(function(ae){var de=ae.el,ee=ae.top,we=ae.left;de.scroll&&ue?de.scroll({top:ee,left:we,behavior:E}):(de.scrollTop=ee,de.scrollLeft=we)})}function Q(L){return L===!1?{block:"end",inline:"nearest"}:W(L)?L:{block:"start",inline:"nearest"}}function $(L,E){var ue=!L.ownerDocument.documentElement.contains(L);if(W(E)&&typeof E.behavior=="function")return E.behavior(ue?[]:B(L,E));if(ue)return;var ae=Q(E);return P(B(L,ae),ae.behavior)}var We=De.a=$},bT9E:function(ut,De,g){"use strict";g.d(De,"a",function(){return ye});var J=g("VTBJ");function ye(fe,Le){var B=Object(J.a)({},fe);return Array.isArray(Le)&&Le.forEach(function(W){delete B[W]}),B}},baNF:function(ut,De,g){"use strict";g.r(De);var J=g("5NDa"),ye=g("5rEg"),fe=g("k1fw"),Le=g("9og8"),B=g("y8nQ"),W=g("Vl3Y"),P=g("tJVT"),Q=g("PpiC"),$=g("WmNS"),We=g.n($),L=g("q1tI"),E=g.n(L),ue=g("Ty5D"),ae=g("9kvl"),de=g("7ahc"),ee=g("9ZNV"),we=g("y37m"),Ie=g.n(we),Te=function(ke){var V=ke.shixunsDetail,Ee=ke.globalSetting,Me=ke.loading,Oe=ke.user,ce=ke.dispatch,pe=Object(Q.a)(ke,["shixunsDetail","globalSetting","loading","user","dispatch"]),re=Object(ue.h)(),_=Object(L.useState)({}),se=Object(P.a)(_,2),te=se[0],Qe=se[1],be=Object(L.useRef)(),Y=Object(L.useRef)(),Re=W.a.useForm(),dt=Object(P.a)(Re,1),St=dt[0],z=Object(L.useState)(""),M=Object(P.a)(z,2),G=M[0],X=M[1];Object(L.useEffect)(function(){return ce({type:"globalSetting/footerToggle",payload:!1}),function(){ce({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(L.useEffect)(function(){var C=sessionStorage.getItem("pathArray");if(C){var D=C.split(",").join("/"),T=D.indexOf("/")===0?D.substr(1):D;X(T)}},[]),Object(L.useEffect)(function(){var C,D,T,A;Y.current=(C=re.pathname)===null||C===void 0||((D=C.split("/"))===null||D===void 0)?void 0:D[2],be.current=((T=re.pathname)===null||T===void 0||((A=T.split("/"))===null||A===void 0)?void 0:A[3])==="repository"},[]);var He=function(){var C=Object(Le.a)(We.a.mark(function D(){var T,A,b,U=arguments;return We.a.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:return T=U.length>0&&U[0]!==void 0?U[0]:{},H.next=3,ce({type:"shixunsDetail/addRepositoryFile",payload:{id:Y.current,message:T.commitMessage,content:T.codeMirror,path:"".concat(G?"".concat(G,"/"):"").concat(T.path||""),secret_repository:be.current?void 0:!0}});case 3:A=H.sent,A&&(b=be.current?"/shixuns/".concat(Y.current,"/repository").concat(G?"/master/shixun_show/".concat(G):""):"/shixuns/".concat(Y.current,"/secret_repository"),ae.d.replace(b));case 5:case"end":return H.stop()}},D)}));return function(){return C.apply(this,arguments)}}(),Be=function(){var D,T;ae.d.push("/shixuns/".concat(Y.current,"/").concat((D=re.pathname)===null||D===void 0||((T=D.split("/"))===null||T===void 0)?void 0:T[3]).concat(G?"/master/shixun_show/".concat(G):""))};return E.a.createElement("section",{className:Ie.a.bg},E.a.createElement("div",{className:Ie.a.wrap},E.a.createElement("div",{className:Ie.a.title},"\u65B0\u5EFA\u6587\u4EF6"),E.a.createElement(W.a,{className:"mt10",form:St,scrollToFirstError:!0,layout:"vertical",onFinish:He,onValuesChange:function(){return Qe(Object(fe.a)({},St.getFieldsValue()))}},E.a.createElement(W.a.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},E.a.createElement(W.a.Item,{name:"path",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}],noStyle:!0},E.a.createElement("span",null,E.a.createElement("span",{className:"mr5"},G?"".concat(G,"/"):""),E.a.createElement(ye.a,{className:Ie.a.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),E.a.createElement("span",{className:"ml5"},"\u63D0\u793A\uFF1A1.\u8F93\u5165\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6\uFF1B2.\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u65B0\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u65B0\u6587\u4EF6\u5939\u548C\u65B0\u6587\u4EF6\u3002\uFF08\u5982\uFF1Astep1/HelloWorld.java\uFF09")),E.a.createElement(W.a.Item,{label:"\u63D0\u4EA4\u4FE1\u606F\uFF1A",name:"commitMessage",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63D0\u4EA4\u4FE1\u606F"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},E.a.createElement(ye.a,{placeholder:"\u8BF7\u8F93\u5165\u672C\u6B21\u63D0\u4EA4\u7684\u4E3B\u8981\u4FE1\u606F\uFF0C\u5408\u7406\u7684\u63CF\u8FF0\u4FE1\u606F\u6709\u5229\u4E8E\u4EE3\u7801\u5386\u53F2\u8BB0\u5F55\u7684\u7BA1\u7406"})),E.a.createElement("div",{className:"mt10 mb20"},E.a.createElement(W.a.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},E.a.createElement(de.a,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),E.a.createElement(W.a.Item,{noStyle:!0},E.a.createElement(ee.a,{okButtonProps:{htmlType:"submit"},onCancel:Be})))))};De.default=Object(ae.a)(function(Ge){var ke=Ge.shixunsDetail,V=Ge.loading,Ee=Ge.globalSetting,Me=Ge.user;return{shixunsDetail:ke,globalSetting:Ee,user:Me,loading:V.models.index}})(Te)},c5Ni:function(ut,De,g){},"p77/":function(ut,De,g){},y37m:function(ut,De,g){ut.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]);
|