ratchet_design 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/ratchet/favicon.ico +0 -0
- data/app/assets/images/ratchet/safari-pinned-tab.svg +1 -0
- data/app/assets/javascripts/ratchet/core.js +2 -0
- data/app/assets/javascripts/ratchet/enhancement/_swap.js +71 -64
- data/app/assets/javascripts/ratchet/enhancement/lightbox.js +256 -0
- data/app/assets/javascripts/ratchet/enhancement/loader.js +4 -4
- data/app/assets/javascripts/ratchet/shim/classlist.js +1 -1
- data/app/assets/javascripts/ratchet/shim/scope.js +94 -0
- data/app/assets/stylesheets/ratchet/_core.scss +2 -1
- data/app/assets/stylesheets/ratchet/base/_button.scss +1 -1
- data/app/assets/stylesheets/ratchet/base/_form.scss +58 -38
- data/app/assets/stylesheets/ratchet/base/_text.scss +8 -8
- data/app/assets/stylesheets/ratchet/enhancement/_lightbox.scss +93 -0
- data/app/assets/stylesheets/ratchet/enhancement/_loader.scss +1 -1
- data/app/assets/stylesheets/ratchet/enhancement/_tooltip.scss +6 -1
- data/app/assets/stylesheets/ratchet/utility/_global.scss +1 -2
- data/app/helpers/ratchet/application_helper.rb +5 -0
- data/app/helpers/ratchet/form_helper.rb +140 -0
- data/app/views/layouts/ratchet/default.html.slim +2 -1
- data/app/views/shared/ratchet/_footer.html.slim +1 -1
- data/lib/ratchet_design/version.rb +1 -1
- data/lib/ratchet_design.rb +1 -0
- data/public/assets/ratchet/core-0.1.8.js +107 -0
- data/public/assets/ratchet/core-0.1.8.js.gz +0 -0
- data/public/assets/ratchet/core-0.1.8.map.json +1 -0
- data/public/assets/ratchet/{fonts-woff-0.1.7.css → fonts-woff-0.1.8.css} +0 -0
- data/public/assets/ratchet/{fonts-woff-0.1.7.css.gz → fonts-woff-0.1.8.css.gz} +0 -0
- data/public/assets/ratchet/{fonts-woff2-0.1.7.css → fonts-woff2-0.1.8.css} +0 -0
- data/public/assets/ratchet/{fonts-woff2-0.1.7.css.gz → fonts-woff2-0.1.8.css.gz} +0 -0
- metadata +42 -10
- data/app/assets/javascripts/ratchet/enhancement/_lightbox.js +0 -93
- data/public/assets/ratchet/core-0.1.7.js +0 -105
- data/public/assets/ratchet/core-0.1.7.js.gz +0 -0
- data/public/assets/ratchet/core-0.1.7.map.json +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","app/assets/javascripts/ratchet/core.js","app/assets/javascripts/ratchet/_svg.js","app/assets/javascripts/ratchet/shim/classlist.js","app/assets/javascripts/ratchet/shim/object.assign.js","app/assets/javascripts/ratchet/utility/unhover.js","app/assets/javascripts/ratchet/utility/full_stop.js","app/assets/javascripts/ratchet/utility/load_font.js","app/assets/javascripts/ratchet/utility/throttle.js","app/assets/javascripts/ratchet/utility/load_script.js","app/assets/javascripts/ratchet/utility/from_top.js","app/assets/javascripts/ratchet/utility/scroll_to.js","app/assets/javascripts/ratchet/utility/matches.js","app/assets/javascripts/ratchet/utility/get_closest.js","app/assets/javascripts/ratchet/utility/get_next.js","app/assets/javascripts/ratchet/utility/timeout.js","app/assets/javascripts/ratchet/utility/word_count.js","app/assets/javascripts/ratchet/utility/compile_data.js","app/assets/javascripts/ratchet/base/mobilemenu.js","app/assets/javascripts/ratchet/utility/ajax.js","app/assets/javascripts/ratchet/base/form.js","app/assets/javascripts/ratchet/enhancement/loader.js","app/assets/javascripts/ratchet/enhancement/notice.js","app/assets/javascripts/ratchet/enhancement/waypoints.js","app/assets/javascripts/ratchet/base/validation.js","app/assets/javascripts/ratchet/enhancement/sticky.js","node_modules/compose-event/index.js","node_modules/compose-code-highlighter/index.js","node_modules/compose-event/lib/animation-events.js","node_modules/compose-event/lib/page-events.js","node_modules/compose-event/lib/tap-events.js","node_modules/compose-event/node_modules/bean/bean.js","node_modules/compose-event/node_modules/keymaster/keymaster.js","node_modules/codemirror/lib/codemirror.js","node_modules/codemirror/addon/runmode/runmode.js","node_modules/codemirror/mode/htmlmixed/htmlmixed.js","node_modules/codemirror/mode/slim/slim.js","node_modules/codemirror/mode/javascript/javascript.js","node_modules/codemirror/mode/css/css.js","node_modules/codemirror/mode/php/php.js","node_modules/codemirror/mode/sql/sql.js","node_modules/codemirror/mode/ruby/ruby.js","node_modules/codemirror/mode/shell/shell.js","node_modules/codemirror/mode/go/go.js","node_modules/codemirror/mode/python/python.js","node_modules/codemirror/mode/yaml/yaml.js","node_modules/codemirror/mode/clike/clike.js","node_modules/codemirror/addon/edit/matchbrackets.js","node_modules/codemirror/mode/xml/xml.js"],"names":["require","loadFont","fullStop","unhover","throttle","loadScript","fromTop","scrollTo","matches","getClosest","getNext","wordCount","compileData","timeout","ajax","mobileMenu","form","validation","loader","waypoints","notice","sticky","esvg","event","highlighter","window","ratchet","module","exports","change","highlight","embed","document","querySelector","insertAdjacentHTML","icon","name","classnames","svgName","this","iconName","element","dimensions","console","error","before","dasherize","el","getAttribute","input","replace","load","readyState","addEventListener","bind","aliases","alias","aliased","self","createElement","testElement","classList","add","contains","createMethod","method","original","DOMTokenList","prototype","token","i","len","arguments","length","call","toggle","_toggle","force","view","classListProp","protoProp","elemCtrProto","Element","objCtr","Object","strTrim","String","trim","arrIndexOf","Array","indexOf","item","DOMEx","type","message","code","DOMException","checkTokenAndGetIndex","test","ClassList","elem","trimmedClasses","classes","split","push","_updateClassName","setAttribute","toString","classListProto","classListGetter","Error","tokens","iter","updated","remove","index","splice","result","join","defineProperty","classListPropDesc","get","enumerable","configurable","ex","number","__defineGetter__","assign","target","undefined","TypeError","output","source","nextKey","hasOwnProperty","settings","scrollHandler","scrollTimer","clear","docElem","style","pointerEvents","set","options","scrollDelay","defaults","documentElement","resizeHandler","resizeTimer","docBody","resizeClass","resizeDelay","body","supportsWoff2","win","f","FontFace","status","fontName","woffUrl","woff2Url","onlyLoadFontOnSecondPageload","nua","navigator","userAgent","nope","match","loSto","localStorage","loStoPrefix","loStoUrlKey","loStoCssKey","storedFontUrl","storedFontCss","styleElement","rel","head","appendChild","cssUrl","request","XMLHttpRequest","open","onload","responseText","textContent","send","obj","running","func","requestAnimationFrame","dispatchEvent","CustomEvent","url","callback","script","async","src","Math","round","getBoundingClientRect","top","pageYOffset","to","duration","easeInOutQuad","t","b","c","d","position","scrollTop","parentNode","move","amount","animateScroll","currTime","increment","val","start","selector","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","fn","delay","args","loop","current","Date","now","delta","handle","value","cancelAnimationFrame","str","parent","debug","formData","FormData","allFields","querySelectorAll","field","log","append","clickHandler","toggleSelector","menuButton","openClass","queryHandler","condition","removeEventListener","initWidth","widthQuery","matchMedia","addListener","maybeData","data","xhrConnection","returnMethods","promiseMethods","reduce","promise","xhr","withCredentials","setHeaders","headers","ready","objectToQueryString","abort","hasContentType","keys","forEach","setRequestHeader","some","toLowerCase","handleReady","DONE","always","apply","parseResponse","then","JSON","parse","e","isObject","getQueryString","object","acc","prefix","encode","encodeURIComponent","methods","baseUrl","evt","tickHandler","labelParent","tagName","previousSibling","insertAdjacentElement","keyHandler","which","preventDefault","rangeHandler","percValue","max","backgroundImage","rangeTouch","size","getDecimalPlaces","roundToStep","step","places","parseInt","parseFloat","toFixed","getValue","percent","touch","changedTouches","min","clientRect","thumbWidth","width","thumbSize","clientX","left","setValue","fire","rangeInputs","touchAction","webkitUserSelect","rangeEls","tickEls","rangeIndex","tickIndex","loaderClass","loadingMessage","loadingClass","successMessage","successClass","failureMessage","failureClass","show","state","hide","dismissNotice","noticeElem","noticeClass","removeChild","cookie","cookieName","getCookie","parts","pop","shift","noticeName","noticeMessage","html","elements","hashHandler","docHeight","scrollHeight","winHeight","innerHeight","selectors","coordinate","offset","coordinates","newActiveItem","activeLink","landmark","newScrollY","rockBottom","firstWaypoint","currWaypoint","nextWaypoint","lastWaypoint","id","elemOffset","oldActiveItem","activate","activeAnchor","showLandmarks","landmarkSelector","activeLandmark","travel","location","hash","hashAnchor","destination","trigger","targetOffset","targetAnchor","href","targetElement","history","pushState","cls","windowHash","replaceState","blurHandler","validity","minWords","dataset","maxWords","indicator","messageHandler","validateWords","checkValidity","submissionHandler","invalidForm","invalidElem","display","focus","nextSibling","action","parentForm","oldMessage","newMessage","validationMessage","hideMessage","showMessage","childNodes","goal","verbiage","setCustomValidity","pastOffset","topOffset","anchored","anchorInit","elemHeight","topPadding","stickyClass","anchorPoint","getComputedStyle","getPropertyValue","offsetHeight","on","setEvent","slice","off","one","events","animationEvent","transform","isEmpty","bean","registerType","transformArgs","arg","keyOne","scope","key","unbind","transformedArgs","newEvents","delegate","objEvents","touchstart","tap","a","concat","page","clone","keyOn","keyOff","CodeMirror","Highlighter","bash","js","json","java","markup","sass","scss","sh","addAlias","newAliases","aliasLang","lang","process","runMode","highlightEl","language","classMatch","className","innerHTML","camelCaseEventTypes","animationstart","animationend","animationiteration","lowerCaseEventTypes","getAnimationEventTypes","prefixes","animationName","transformAnimationEvents","cssAnimEventTypes","env","supported","readyAlready","onReady","onChange","pageReady","Turbolinks","pageChange","Tap","listener","e1","done","e2","cleanup","defaultPrevented","stopPropagation","context","clearTimeout","timeout_id","endEvents","touches","setTimeout","handler","definition","define","amd","selectorEngine","old","namespaceRegex","nameRegex","addEvent","removeEvent","doc","root","W3C_MODEL","eventSupport","ONE","str2arr","s","isString","o","isFunction","standardNativeEvents","w3cNativeEvents","nativeEvents","customEvents","isAncestor","container","compareDocumentPosition","nodeType","check","related","relatedTarget","mouseenter","base","mouseleave","mousewheel","Event","commonProps","mouseProps","mouseWheelProps","keyProps","textProps","touchProps","messageProps","stateProps","overOutRegex","typeFixers","reg","fix","newEvent","keyCode","rightClick","button","pos","x","y","pageX","pageY","clientY","scrollLeft","typeFixerMap","isNative","ownerDocument","parentWindow","originalEvent","isBean","l","p","props","fixer","srcElement","returnValue","cancelBubble","stop","stopped","stopImmediatePropagation","isImmediatePropagationStopped","currentTarget","ne","RegEntry","wrappedHandler","eargs","findTarget","eventElement","__beanDel","ft","namespaces","customType","once","removeListener","eventType","inNamespaces","checkNamespaces","j","checkElement","checkOriginal","checkHandler","registry","map","forAll","pfx","list","all","charAt","substr","has","entries","entry","put","del","removed","setSelectorEngine","r","rootListener","propertyName","listeners","custom","attachEvent","detachEvent","rm","originalFn","orgType","handlers","array","fireListener","createEvent","fireEvent","createEventObject","typeSpec","k","isTypeStr","types","first","delfn","names","from","beanDel","noConflict","CollectGarbage","global","compareArray","a1","a2","updateModifierKey","_mods","modifierMap","dispatch","modifiersMatch","_downKeys","_MODIFIERS","assignKey","filter","_handlers","getScope","mods","clearModifier","resetModifiers","getKeys","getMods","shortcut","unbindKey","multipleKeys","isPressed","getPressedKeyCodes","setScope","_scope","deleteScope","mi","previousKey","16","18","17","91","⇧","⌥","alt","option","⌃","ctrl","control","⌘","command","_MAP","backspace","tab","enter","return","esc","escape","space","up","right","down","delete","home","end","pageup","pagedown",",",".","/","`","-","=",";","'","[","]","\\","toUpperCase","charCodeAt","mod","place","copyObj","setGuttersForLineNumbers","Doc","mode","lineSeparator","inputStyles","inputStyle","Display","wrapper","updateGutters","themeChanged","lineWrapping","autofocus","mobile","initScrollbars","keyMaps","overlays","modeGen","overwrite","delayingBlurEvent","focused","suppressEdits","pasteIncoming","cutIncoming","selectingText","draggingText","Delayed","keySeq","specialChars","cm","ie","ie_version","reset","registerEventHandlers","ensureGlobalHandlers","startOperation","curOp","forceUpdate","attachDoc","hasFocus","onFocus","onBlur","opt","optionHandlers","Init","maybeUpdateLineNumberWidth","finishInit","initHooks","endOperation","webkit","lineDiv","textRendering","scrollbarFiller","elt","gutterFiller","selectionDiv","cursorDiv","measure","lineMeasure","lineSpace","mover","sizer","sizerWidth","heightForcer","scrollerGap","gutters","lineGutter","scroller","zIndex","paddingRight","gecko","draggable","viewFrom","viewTo","reportedViewFrom","reportedViewTo","renderedView","externalMeasured","viewOffset","lastWrapHeight","lastWrapWidth","updateLineNumbers","nativeBarWidth","barHeight","barWidth","scrollbarsClipped","lineNumWidth","lineNumInnerWidth","lineNumChars","alignWidgets","cachedCharWidth","cachedTextHeight","cachedPaddingH","maxLine","maxLineLength","maxLineChanged","wheelDX","wheelDY","wheelStartX","wheelStartY","selForContextMenu","activeTouch","init","loadMode","getMode","modeOption","resetModeState","line","stateAfter","styles","frontier","startWorker","regChange","wrappingChanged","addClass","minWidth","rmClass","findMaxLine","estimateLineHeights","clearCaches","updateScrollbars","estimateHeight","th","textHeight","wrapping","perLine","clientWidth","charWidth","lineIsHidden","widgetsHeight","widgets","height","ceil","text","est","estHeight","updateLineHeight","theme","guttersChanged","alignHorizontally","specs","removeChildren","gutterClass","gElt","updateGutterSpace","offsetWidth","marginLeft","lineLength","merged","cur","collapsedSpanAtStart","found","find","ch","collapsedSpanAtEnd","getLine","lineNumbers","measureForScrollbars","gutterW","docH","paddingVert","clientHeight","viewHeight","scrollWidth","viewWidth","barLeft","fixedGutter","scrollGap","gutterWidth","NativeScrollbars","scroll","vert","horiz","checkedZeroWidth","minHeight","NullScrollbars","scrollbars","scrollbarModel","scrollbarStyle","node","insertBefore","axis","setScrollLeft","setScrollTop","startWidth","startHeight","updateScrollbarsInner","updateHeightsInViewport","sizes","update","paddingBottom","bottom","borderBottom","coverGutterNextToScrollbar","visibleLines","viewport","floor","paddingTop","lineAtHeight","ensure","ensureFrom","ensureTo","heightAtLine","lastLine","firstChild","comp","compensateForHScroll","hidden","gutter","align","alignable","last","lineNumberFor","innerW","padding","lineNumberFormatter","firstLineNumber","DisplayUpdate","visible","editorIsHidden","wrapperHeight","wrapperWidth","oldDisplayWidth","displayWidth","dims","getDimensions","maybeClipScrollbars","marginBottom","borderRightWidth","updateDisplayIfNeeded","resetView","countDirtyView","viewportMargin","sawCollapsedSpans","visualLineNo","visualLineEndNo","different","adjustView","toUpdate","activeElt","patchDisplay","postUpdateDisplay","displayHeight","barMeasure","updateSelection","setDocumentHeight","signal","updateDisplaySimple","finish","prevBottom","offsetTop","bot","box","diff","updateWidgetHeight","rest","gutterLeft","clientLeft","n","offsetLeft","fixedPos","gutterTotalWidth","updateNumbersFrom","next","mac","currentWheelTarget","lineN","lineView","updateNumber","lineNumber","changes","updateLineForChanges","createTextNode","buildLineElement","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","updateLineBackground","bgClass","background","wrap","getLineContent","ext","built","buildLineContent","pre","textClass","wrapClass","gutterBackground","markers","gutterMarkers","gutterWrap","setUneditable","insertLineWidgets","insertLineWidgetsFor","allowAbove","ws","widget","handleMouseEvents","positionLineWidget","above","signalLater","noHScroll","coverGutter","paddingLeft","copyPos","Pos","maxPos","cmp","minPos","ensureFocus","applyTextInput","inserted","deleted","sel","origin","paste","textLines","splitLines","multiPaste","ranges","lastCopied","range","empty","lst","lineWise","updateInput","changeEvent","makeChange","triggerElectric","ensureCursorVisible","typing","handlePaste","pasted","clipboardData","getData","isReadOnly","disableInput","runInOp","electricChars","smartIndent","getModeAt","indented","indentLine","electricInput","copyableRanges","lineRange","anchor","getRange","disableBrowserMagic","TextareaInput","prevInput","pollingFast","polling","inaccurateSelection","hasSelection","composing","hiddenTextarea","te","div","ios","border","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","gracePeriod","posToDOM","findViewForLine","info","mapFromLineView","order","getOrder","side","partPos","getBidiPartAt","nodeAndOffsetInLineMap","collapse","badPos","bad","domToPos","lineNode","clipPos","locateNodeInLineView","textNode","topNode","maps","curNode","lineNo","nodeValue","after","dist","domTextBetween","fromLine","toLine","recognizeMarker","marker","walk","cmText","markerID","findMarks","getBetween","lineSep","nodeName","closing","Selection","primIndex","Range","normalizeSelection","prim","sort","prev","inv","simpleSelection","clipLine","clipToLen","linelen","isLine","clipPosArray","out","extendRange","other","extend","posBefore","extendSelection","setSelection","primary","extendSelections","heads","newSel","replaceOneSelection","setSimpleSelection","filterSelectionChange","setSelectionReplaceHistory","setSelectionNoUndo","addSelectionToHistory","NaN","hasHandler","bias","setSelectionInner","skipAtomicInSelection","equals","selectionChanged","signalCursorActivity","reCheckSelection","sel_dontScroll","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","dir","markedSpans","sp","m","inclusiveLeft","inclusiveRight","explicitlyCleared","atomic","near","movePos","far","cantEdit","showSelection","prepareSelection","curFragment","cursors","createDocumentFragment","selFragment","selection","collapsed","showCursorWhenSelecting","drawSelectionCursor","drawSelectionRange","cursorCoords","singleCursorHeightPerLine","cursor","cursorHeight","otherCursor","fragment","rightSide","drawForLine","fromArg","toArg","coords","charCoords","lineObj","lineLen","iterateBidiSections","rightPos","leftPos","tmp","leftSide","paddingH","sFrom","sTo","singleVLine","visualLine","leftEnd","rightStart","restartBlink","clearInterval","blinker","visibility","cursorBlinkRate","setInterval","time","startState","highlightWorker","workTime","copyState","getStateBefore","changedLines","oldStyles","tooLong","maxHighlightLength","highlighted","highlightLine","oldCls","styleClasses","newCls","ischange","processLine","workDelay","regLineChange","findStartLine","precise","minindent","minline","lim","innerMode","search","countColumn","tabSize","save","removeChildrenAndAdd","currentStyle","isNaN","ensureLineHeights","rect","curWidth","heights","rects","getClientRects","abs","cache","caches","updateExternalMeasurement","LineView","measureChar","measureCharPrepared","prepareMeasureForLine","findViewIndex","hasHeights","prepared","varHeight","measureCharInner","bogus","rtop","rbottom","mStart","mEnd","insertLeft","coverStart","coverEnd","getUsefulRect","nullRect","isExtendingChar","maybeUpdateRectForZooming","rSpan","rbot","mid","screen","logicalXDPI","deviceXDPI","hasBadZoomedRects","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","pageScrollX","pageXOffset","pageScrollY","intoCoordSystem","widgetHeight","yOff","lOff","xOff","fromCoordSystem","localBox","lineSpaceBox","preparedMeasure","getBidi","part","level","bidiLeft","bidiRight","bidiOther","estimateCoords","PosWithInfo","outside","xRel","coordsChar","coordsCharInner","mergedPos","getX","wrongLine","innerOff","adjust","bidi","lineLeft","lineRight","fromX","fromOutside","toX","toOutside","moveVisually","xDiff","charSize","middle","middleX","measureText","viewChanged","changeObjs","cursorActivityHandlers","cursorActivityCalled","updateMaxLine","scrollToPos","nextOpId","operationGroup","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","op","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","endOperation_finish","mustUpdate","updatedDisplay","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","forceScroll","scrollPosIntoView","margin","isCursor","maybeScrollWindow","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","lines","operation","methodOp","docMethodOp","visualLineContinued","buildViewArray","nextPos","lendiff","cut","viewCuttingPoint","cutTop","cutBot","arr","oldN","newN","dirty","finishTouch","touchFinished","prevTouch","isMouseLikeTouchEvent","radiusX","radiusY","farAway","dx","dy","onMouseDown","signalDOMEvent","posFromMouse","clickInGutter","eventInWidget","e_preventDefault","word","findWordAt","captureRightClick","onContextMenu","moved","onScrollWheel","dragFunctions","e_stop","over","onDragOver","onDragStart","drop","onDrop","leave","clearDragCursor","inp","getField","onKeyUp","onKeyDown","onKeyPress","dragDropChanged","wasOn","funcs","onResize","setSize","e_target","liberal","forRect","colDiff","supportsTouch","shiftKey","e_button","leftButtonDown","lastMiddleDown","delayBlurEvent","lastDoubleClick","lastClick","contained","modifier","metaKey","ctrlKey","dragDrop","dragAndDrop","leftButtonStartDrag","leftButtonSelect","startTime","dragEnd","copy","altKey","addNew","extendTo","lastPos","startCol","posCol","findColumn","startSel","ourIndex","scrollIntoView","oldRange","ourRange","sel_mouse","curCount","counter","editorSize","Infinity","lastSelOrigin","chromeOS","gutterEvent","prevent","mX","mY","lineBox","e_defaultPrevented","g","lastDrop","files","dataTransfer","FileReader","File","read","loadFile","file","allowDropFileTypes","reader","content","changeEnd","readAsText","selected","listSelections","replaceRange","replaceSelection","setData","getSelection","effectAllowed","setDragImage","safari","img","presto","_top","frag","dragCursor","isScroller","wheelEventDelta","canScrollX","canScrollY","outer","wheelPixelsPerUnit","pixels","wheelSamples","movedX","movedY","sample","doHandleBinding","bound","dropShift","commands","ensurePolled","prevShift","Pass","lookupKeyForEditor","lookupKey","extraKeys","keyMap","dispatchKey","seq","isModifierKey","stopSeq","handleKeyBinding","keyName","motion","handleCharBinding","handled","lastStoppedKey","hasCopyEvent","showCrossHair","charCode","fromCharCode","readOnly","receivedFocus","contextMenuInGutter","adjustForChange","computeSelAfterChange","offsetPos","nw","computeReplacedSel","hint","oldPrev","newPrev","filterChange","canceled","cancel","ignoreReadOnly","sawReadOnlySpans","removeReadOnlyRanges","makeChangeInner","selAfter","addChangeToHistory","makeChangeSingleDoc","stretchSpansOverChange","rebased","linkedDocs","sharedHist","rebaseHist","makeChangeFromHistory","allowSelectionOnly","hist","undone","dest","lastOrigin","pushSelectionToHistory","clearRedo","antiChanges","generation","maxGeneration","historyChangeFromChange","mergeOldSpans","shiftDoc","distance","spans","makeChangeSingleDocInEditor","updateDoc","recomputeMaxLength","checkWidthStart","full","isWholeLineUpdate","changesHandler","changeHandler","doScroll","phantom","scrollNode","limit","changed","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","x1","y1","x2","y2","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollPos","resolveScrollToPos","getCursor","cursorScrollMargin","sPos","how","aggressive","indent","curSpace","indentation","curSpaceString","indentUnit","indentString","indentWithTabs","spaceStr","changeLine","changeType","no","deleteNearSelection","compute","kill","toKill","replaced","findPosH","unit","visually","findNextLine","moveOnce","boundToLine","moveLogically","origDir","sawType","helper","getHelper","isWordChar","hitSide","findPosV","pageSize","deflt","notOnInit","normalizeKeyName","cmd","getKeyMap","markText","shared","markTextShared","TextMarker","clearWhenEmpty","replacedWith","widgetNode","conflictingCollapsedRange","addToHistory","curLine","addMarkedSpan","MarkedSpan","clearOnEnter","clearHistory","nextMarkerId","title","startStyle","endStyle","css","cloneNode","linked","isParent","SharedTextMarker","findSharedMarkers","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","getMarkedSpanFor","span","removeMarkedSpan","attachLine","markedSpansBefore","startCh","isInsert","startsBefore","endsAfter","markedSpansAfter","endCh","oldFirst","oldLast","sameLine","clearEmptySpans","newMarkers","gapMarkers","gap","getOldSpans","stretched","oldCur","stretchCur","mark","mk","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","vis","lineIsHiddenInner","adjustScrollWhenAboveVisible","parentStyle","addLineWidget","LineWidget","insertAt","aboveVisible","updateLine","cleanUpLine","extractLineClasses","lineClass","prop","RegExp","callBlankLine","blankLine","inner","readToken","stream","takeToken","asArray","getObj","string","StringStream","eol","lineClasses","forceToEnd","flattenSpans","curStart","curStyle","addModeClass","mName","st","overlay","at","i_end","opaque","getLineStyles","updateFrontier","startAt","interpretTokenStyle","styleToClassCacheWithMode","styleToClassCache","builder","col","trailingSpace","splitSpaces","getOption","addToken","buildToken","hasBadBidiRects","buildTokenBadBidi","allowFrontierUpdate","insertLineContent","joinClasses","zeroWidthElement","lastChild","defaultSpecialCharPlaceholder","displayText","special","mustWrap","lastIndex","exec","skipped","txt","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","needsContentAttribute","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","endStyles","foundBookmarks","upto","tokenText","wholeLineUpdateBefore","spansFor","linesFor","Line","firstLine","lastText","lastSpans","nlines","insert","added","LeafChunk","BranchChunk","children","chunkSize","sharedHistOnly","propagate","skip","chunk","child","sz","getLines","h","lh","bidiOrdering","History","startGen","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","histChange","attachLocalSpans","clearSelectionEvents","lastChangeEvent","opId","historyEventDelay","selectionEventCanBeMerged","somethingSelected","existing","removeClearedSpans","copyHistoryArray","newGroup","instantiateSel","deepCopy","newChanges","Number","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","getHandlers","emitter","noHandlers","bnd","orphanDelayedCallbacks","fireOrphanDelayed","delayed","override","codemirrorIgnore","cursorActivity","eventMixin","ctor","spaceStrs","nothing","createObj","inst","create","isWordCharBasic","extendingChars","tag","cssText","count","activeElement","classTest","as","forEachCodeMirror","getElementsByClassName","byClass","globalsRegistered","registerGlobalHandlers","zwspSupported","badBidiRects","r0","r1","badZoomedRects","normal","fromRange","lineStart","visual","lineEnd","lineStartSmart","firstNonWS","inWS","compareBidiLevel","linedir","moveInLine","byUnit","platform","ie_upto10","ie_11up","documentMode","qtwebkit","chrome","vendor","mac_geMountainLion","windows","presto_version","flipCtrlCmd","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","w","bar","maybeDisable","elementFromPoint","native","null","cmpPos","prepareCopyCut","getSelections","selectInput","lineWiseCopyCut","setSelections","textarea","poll","fastPoll","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","minimal","blur","resetPosition","slowPoll","pollInterval","missed","execCommand","same","prepareSelectAllHack","selectionStart","extval","selectionEnd","rehide","oldWrapperCSS","oldCSS","selectAll","detectingSelectAll","resetSelectionOnContextMenu","wrapperBox","oldScrollY","scrollY","mouseup","readOnlyChanged","onCopyCut","clearData","kludge","hadFocus","startData","ours","applyComposition","forceCompositionEnd","pollContent","showPrimarySelection","showMultipleSelections","curAnchor","anchorNode","anchorOffset","curFocus","focusNode","focusOffset","rangeCount","getRangeAt","rng","addRange","removeAllRanges","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","pollSelection","fromIndex","fromNode","toIndex","toNode","newText","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","contenteditable","here","there","wheelDeltaX","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","constructor","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","spec","modeSpec","removeOverlay","indentSelection","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelpers","helpers","help","helperType","_global","pred","getStateAfter","defaultTextHeight","defaultCharWidth","setGutterMarker","gutterID","clearGutter","lineInfo","getViewport","addWidget","vspace","hspace","triggerOnKeyDown","triggerOnKeyPress","triggerOnKeyUp","moveH","extendSelectionsBy","rtlMoveVisually","sel_move","deleteH","goalColumn","moveV","goals","startChar","toggleOverwrite","getScrollInfo","interpret","refresh","oldHeight","swapDoc","getInputField","getWrapperElement","getScrollerElement","getGutterElement","newBreaks","detach","attach","integer","disabled","tabIndex","modes","mimeModes","defineMode","dependencies","defineMIME","mime","resolveMode","mfactory","modeObj","modeExtensions","exts","modeProps","skipToEnd","extendMode","properties","defineExtension","defineDocExtension","defineOption","defineInitHook","registerHelper","registerGlobalHelper","predicate","nstate","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","undo","redo","undoSelection","redoSelection","goDocStart","goDocEnd","goLineStart","goLineStartSmart","goLineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","goLineDown","goPageUp","goPageDown","goCharLeft","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentMore","indentLess","insertTab","insertSoftTab","spaces","replaceSelections","defaultTab","transposeChars","newlineAndIndent","openLine","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","fallthrough","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","normalizeKeyMap","keymap","keyname","keyNames","noShift","altGraphKey","fromTextArea","tabindex","placeholder","leaveSubmitMethodAlone","realSubmit","submit","wrappedSubmit","getTextArea","toTextArea","lastColumnPos","lastColumnValue","sol","peek","eat","eatWhile","eatSpace","skipTo","backUp","column","pattern","consume","caseInsensitive","cased","hideFirstChars","withOp","dHeight","oldH","removeInner","insertInner","iterN","remaining","leaf","maybeSpill","me","spilled","sibling","myIndex","used","nextDocId","cleanGeneration","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","setCursor","addSelection","dup","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","addLineClass","where","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","link","splitIds","iterLinkedDocs","getEditor","splitLinesAuto","eachLine","dontDelegate","e_stopPropagation","ms","startIndex","startValue","nextTab","select","_e","nonASCIISingleCaseWordChar","createRange","endNode","setEnd","setStart","createTextRange","moveToElementText","moveEnd","moveStart","host","nl","rt","parentElement","compareEndPoints","oncopy","3","8","9","13","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","92","93","106","107","109","110","111","127","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","charType","lowTypes","arabicTypes","BidiSpan","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","outerType","nstart","unshift","version","modespec","ie_lt9","idx","maybeBackup","pat","close","getAttrRegexp","attr","regexp","attrRegexpCache","getAttrValue","getTagRegexp","addTags","findMatchingMode","tagInfo","tagText","defaultTags","config","parserConfig","htmlMode","htmlState","tags","inTag","endTagA","endTag","localState","localMode","multilineTagIndentFactor","multilineTagIndentPastTag","configTags","configScript","scriptTypes","local","textAfter","backup","tokenize","restore","continueLine","stack","finishContinue","lineContinuable","commaContinuable","rubyInQuote","endQuote","rubyState","ruby","startRubySplat","runSplat","rubyMode","htmlLine","startHtmlLine","lastTokenize","startHtmlMode","comment","commentMode","attributeWrapper","wrappedAttributeNameRegexp","attributeWrapperAssign","attributeWrapperValue","readQuoted","startAttributeWrapperMode","subStream","subMode","subState","firstSub","createMode","query","embedded","factory","startSubMode","doctypeLine","_state","startLine","embeddedRegexp","slimTag","slim","startOfLine","slimTagExtras","nameRegexp","slimClass","classIdRegexp","classNameRegexp","slimAttribute","$1","attributeNameRegexp","slimAttributeAssign","slimContent","slimAttributeValue","slimAttributeSymbols","quote","unescaped","nextTokenize","fresh","escaped","javascript","less","styl","coffee","asciidoc","markdown","textile","creole","wiki","mediawiki","rdoc","nokogiri","erb","styleMap","commentLine","slimSwitch","slimId","slimSubmode","closeAttributeTag","slimDoctype","lineContinuation","{","(","nameStartChar","nameChar","expressionAllowed","lastType","readRegexp","inSet","ret","tp","cont","tokenBase","tokenString","tokenComment","isOperatorChar","tokenQuasi","wordRE","known","keywords","propertyIsEnumerable","jsonldMode","isJsonldKeyword","maybeEnd","findFatArrow","fatArrowAt","arrow","depth","sawSomething","bracket","brackets","JSLexical","inScope","varname","v","localVars","cx","vars","parseJS","cc","marked","lexical","combinator","jsonMode","expression","statement","lex","pass","register","inList","globalVars","pushcontext","defaultVars","popcontext","pushlex","poplex","expect","wanted","exp","vardef","block","maybeelse","functiondef","forspec","maybelabel","funarg","afterExport","afterImport","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","atomicTypes","maybeexpressionNoComma","maybeexpression","arrayLiteral","contCommasep","objprop","quasi","maybeTarget","expr","property","continueQuasi","targetNoComma","_","getterSetter","afterprop","what","proceed","maybetype","isTS","typeexpr","maybedefault","afterType","maybeAssign","vardefCont","proppattern","_type","forspec1","forspec2","formaybeinof","forspec3","classNameAfter","classBody","classGetterSetter","maybeFrom","importSpec","maybeAs","isContinuedStatement","statementIndent","jsonld","typescript","wordCharacters","kw","A","B","C","operator","atom","jsKeywords","if","while","with","else","do","try","finally","break","continue","new","throw","debugger","var","const","let","function","catch","for","switch","case","default","in","typeof","instanceof","true","false","class","super","yield","export","import","extends","await","tsKeywords","interface","implements","namespace","enum","public","private","protected","abstract","boolean","any","variable","jsonld-keyword","basecolumn","firstChar","doubleIndentSwitch","blockCommentStart","blockCommentEnd","lineComment","fold","closeBrackets","skipExpression","keySet","tokenCComment","tokenHooks","tokenParenthesized","Context","pushContext","popContext","states","popAndPass","wordAsValue","valueKeywords","colorKeywords","inline","propertyKeywords","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","allowNested","supportsAtComponent","stateArg","maybeprop","propBlock","_stream","parens","pseudo","atBlock","atComponentBlock","atBlock_parens","restricted_atBlock_before","restricted_atBlock","keyframes","interpolation","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","fontProperties_","counterDescriptors_","colorKeywords_","valueKeywords_","allWords",":","$","#","@","&","words","matchSequence","escapes","phpString","patterns","phpString_","tokStack","phpKeywords","phpAtoms","phpBuiltin","phpConfig","blockKeywords","defKeywords","atoms","builtin","multiLineStrings","hooks","<","quoted","delim","\"","}","isPHP","curMode","phpMode","pending","php","curState","openPHP","startOpen","htmlNew","phpNew","support","hexNumber","binaryNumber","decimallessFloat","doubleQuote","tokenLiteral","nCharCast","charsetCast","commentSlashSlash","commentHash","commentSpaceRequired","operatorChars","dateSQL","client","zerolessFloat","ODBCdotTable","date","timestamp","tok","hookIdentifier","hookVar","hookClient","sqlKeywords","wordObj","chain","newtok","readBlockComment","currentIndex","search_till","balance","chchr","matching","readHereDoc","varList","lastTok","curPunc","more","tokenBaseUntilBrace","tokenBaseOnce","alreadyCalled","phrase","indentWords","dedentWords","continuedLine","kwtype","thisTok","ct","tokenDollar","hungry","chan","defer","go","goto","package","struct","bool","byte","complex64","complex128","float32","float64","int8","int16","int32","int64","uint8","uint16","uint32","uint64","int","uint","uintptr","iota","nil","cap","complex","imag","make","panic","print","println","real","recover","ctx","wordRegexp","scopes","wordOperators","commonKeywords","commonBuiltins","conf","parserConf","scopeOffset","lineOffset","pushPyScope","dedent","errorToken","tokenBaseInner","ERRORCLASS","floatLiteral","intLiteral","stringPrefixes","tokenStringFactory","tripleDelimiters","doubleDelimiters","doubleOperators","singleOperators","singleDelimiters","lastToken","identifiers","builtins","delimiter","singleline","OUTCLASS","singleLineStringErrors","pushBracketScope","hangingIndent","tokenLexer","beginningOfLine","py3","lambda","delimiter_index","myKeywords","myBuiltins","extra_keywords","extra_builtins","external","addErr","triples","cons","keywordRegex","literal","keyCol","pair","pairStart","inlinePairs","inlineList","typeBefore","prevToken","typeAtEndOfLine","isTopScope","cppHook","pointerHook","cpp14Literal","cpp11StringHook","cpp11RawStringDelim","tokenRawString","cppLooksLikeConstructor","lastTwo","tokenAtString","def","mimes","tokenTripleString","tokenKotlinString","tripleString","tokenCeylonString","stringTokenizer","isPunctuationChar","numberStart","namespaceSeparator","isDefKeyword","maybeEOL","typeFirstDefinitions","statementIndentUnit","dontAlignCalls","indentStatements","indentSwitch","endStatement","styleDefs","dontIndentStatements","hook","switchBlock","allmanIndentation","cKeywords","cTypes","*","u","U","L","R","0","1","2","4","5","6","7","intendSwitch","findMatchingBracket","strict","scanForBracket","forward","maxScanLen","maxScanLineLength","maxScanLines","re","bracketRegex","matchBrackets","autoclear","maxHighlightLen","maxHighlightLineLength","marks","ie_lt8","doMatchBrackets","currentlyHighlighted",")","htmlConfig","autoSelfClosers","area","br","frame","hr","keygen","meta","param","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","menu","nav","ol","section","table","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","editorConf","config_","inText","parser","inBlock","doctype","baseState","tagStart","inAttribute","stringStartCol","closure","isInAttribute","terminator","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","setStyle","attrState","matchClosing","closeState","closeStateErr","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","configuration","skipAttribute"],"mappings":"AAAA;YEAA,IAAIsB,OACFS,MAAO,WACAC,SAASC,cAAc,kBAC1BD,SAASC,cAAc,QAAQC,mBAAmB,aAAc,4sKAGpEC,KAAM,SAASC,EAAMC,GACnB,GAAIC,GAAUC,KAAKC,SAASJ,GACxBK,EAAUT,SAASC,cAAc,IAAIK,EAEzC,OAAIG,GACK,wBAAwBH,EAAQ,KAAKD,GAAc,IAAI,KAAKE,KAAKG,WAAWD,GAAS,sBAAsBH,EAAQ,gBAE1HK,SAAQC,MAAM,oBAAoBR,EAAK,sCAG3CI,SAAU,SAASJ,GACjB,GAAIS,IAAS,CACb,OAAIA,GACK,QAAQN,KAAKO,UAAUV,GAEvBA,EAAK,SAGhBM,WAAY,SAASK,GACnB,MAAO,YAAYA,EAAGC,aAAa,WAAW,YAAYD,EAAGC,aAAa,SAAS,aAAaD,EAAGC,aAAa,UAAU,KAE5HF,UAAW,SAASG,GAClB,MAAOA,GAAMC,QAAQ,SAAU,KAAKA,QAAQ,SAAU,MAExDC,KAAM,WAEuB,eAAvBnB,SAASoB,YAA+Bb,KAAK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,IAAIyN,OAASA,EACpBZ,EAAO7M,IAAIoO,UAAYA,EACvBvB,EAAO7M,IAAIqO,mBAAqBA,EAChCxB,EAAO7M,IAAI2M,WAAaA,EACxBE,EAAO7M,IAAIC,OAASiO,EAEC,mBAAX7oB,UAAwBA,OAAOC,QAAUkoB,IAElDvnB","file":"bundle.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","// Shim modules\nrequire( './shim/classlist' );\nrequire( './shim/object.assign' );\n\n// Utility modules\nvar loadFont = require( './utility/load_font' );\nvar fullStop = require( './utility/full_stop' );\nvar unhover = require( './utility/unhover' );\nvar throttle = require( './utility/throttle' );\nvar loadScript = require( './utility/load_script' );\nvar fromTop = require( './utility/from_top' );\nvar scrollTo = require( './utility/scroll_to' );\nvar matches = require( './utility/matches' );\nvar getClosest = require( './utility/get_closest' );\nvar getNext = require( './utility/get_next' );\nvar wordCount = require( './utility/word_count' );\nvar compileData = require( './utility/compile_data' );\nvar timeout = require( './utility/timeout' );\nvar ajax = require( './utility/ajax' );\n\n// Base modules\nvar mobileMenu = require( './base/mobilemenu' );\nvar form = require( './base/form' );\nvar validation = require( './base/validation' );\n\n// Enhancement modules\nvar loader = require( './enhancement/loader' );\nvar waypoints = require( './enhancement/waypoints' );\nvar notice = require( './enhancement/notice' );\nvar sticky = require( './enhancement/sticky' );\nvar esvg = require( './_svg' );\n// var swap = require( './enhancement/swap' );\n\n// Vendor modules\nvar event = require( 'compose-event' );\nvar highlighter = require( 'compose-code-highlighter' );\nrequire( 'codemirror/mode/htmlmixed/htmlmixed' );\nrequire( 'codemirror/mode/slim/slim' );\nrequire( 'codemirror/mode/javascript/javascript' );\nrequire( 'codemirror/mode/css/css' );\nrequire( 'codemirror/mode/sql/sql' );\nrequire( 'codemirror/mode/php/php' );\nrequire( 'codemirror/mode/ruby/ruby' );\nrequire( 'codemirror/mode/shell/shell' );\nrequire( 'codemirror/mode/go/go' );\nrequire( 'codemirror/mode/python/python' );\nrequire( 'codemirror/mode/yaml/yaml' );\nrequire( 'codemirror/mode/clike/clike' );\nrequire( 'codemirror/addon/runmode/runmode' );\nrequire( 'codemirror/addon/edit/matchbrackets' );\n\n// Public API object\nwindow.ratchet = module.exports = {\n loadFont : loadFont,\n fullStop : fullStop,\n unhover : unhover,\n throttle : throttle,\n loadScript : loadScript,\n fromTop : fromTop,\n scrollTo : scrollTo,\n matches : matches,\n getClosest : getClosest,\n getNext : getNext,\n wordCount : wordCount,\n compileData : compileData,\n timeout : timeout,\n ajax : ajax,\n mobileMenu : mobileMenu,\n form : form,\n validation : validation,\n loader : loader,\n waypoints : waypoints,\n notice : notice,\n sticky : sticky,\n esvg : esvg,\n event : event\n}\n\n// Default events instantiation\nevent.change( function() {\n\n // Unhover module\n unhover();\n\n // FullStop module\n fullStop();\n\n // Form module\n form();\n\n // Validation module\n validation();\n\n // Syntax highlighting\n highlighter.highlight();\n\n}, false );\n","var esvg = {\n embed: function(){\n if (!document.querySelector('#esvg-symbols')) {\n document.querySelector('body').insertAdjacentHTML('afterbegin', '<svg id=\"esvg-symbols\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"display:none\"><symbol id=\"icon-facebook\" viewBox=\"0 0 38 38\" width=\"38\" height=\"38\"><path d=\"M21.4 12.8h2.1V9.4h-2.7c-2.9 0-4.2 1.3-4.2 3.7v2.6h-2V19h2v9.6h3.9v-9.7h2.7l.3-3.2h-3v-1.8c0-.8.2-1.1.9-1.1z\"/></symbol><symbol id=\"icon-github\" viewBox=\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"30\"><path d=\"M0 0v2h14.6V0H0zm16.7 0v2h20.8s-2.1-2-4.9-2H16.7zm24.8 0v2h12.6l-.8-2H41.5zm21.7 0l-.8 2h12.5V0H63.2zM0 4v2h14.6V4H0zm16.7 0v2h23.2s-.3-1.6-.8-2H16.7zm24.8 0v2h14l-.7-2H41.5zm20.2 0L61 6h13.9V4H61.7zM4.2 8v2.1h6.3V8H4.2zm16.7 0v2.1h6.3V8h-6.3zm12.4 0v2.1h6.3S40 9 40 8h-6.7zm12.5 0v2.1H57L56.2 8H45.8zm14.5 0l-.8 2.1h11.3V8H60.3zM4.2 12v2h6.3v-2H4.2zm16.7 0v2H37s1.4-1.1 1.8-2H20.9zm24.9 0v2h6.3v-1.1l.4 1.1H64l.4-1.1V14h6.3v-2H58.9l-.6 1.7-.6-1.7H45.8zM4.2 16v2h6.3v-2H4.2zm16.7 0v2h17.9c-.4-1-1.8-2-1.8-2H20.9zm24.9 0v2h6.3v-2h-6.3zm7.4 0l.8 2h8.7l.7-2H53.2zm11.3 0v2h6.3v-2h-6.3zM4.2 20v2h6.3v-2H4.2zm16.7 0v2h6.3v-2h-6.3zm12.4 0v2H40c0-1-.4-2-.4-2h-6.3zm12.5 0v2h6.3v-2h-6.3zm8.9 0l.8 2h5.8l.8-2h-7.4zm9.8 0v2h6.3v-2h-6.3zM.1 23.9V26h14.6v-2.1H.1zm16.6 0V26h22.5c.5-.5.8-2.1.8-2.1H16.7zm25 0V26h10.4v-2.1H41.7zm14.4 0l.8 2.1h2.9l.7-2.1h-4.4zm8.4 0V26H75v-2.1H64.5zM.1 28v2h14.6v-2H.1zm16.6 0v2h15.9c2.8 0 4.9-2 4.9-2H16.7zm25 0v2h10.4v-2H41.7zm15.8 0l.7 2h.1l.8-2h-1.6zm7 0v2H75v-2H64.5z\"/></symbol><symbol id=\"icon-inbox\" viewBox=\"0 0 76 54\" width=\"76\" height=\"54\"><path d=\"M74 7S38.66 31 38 31C37.34 31 2 7 2 7V2.63h72V7zm0 6.24v38.33H2V13.24s34.59 22.9 36 22.9c1.41 0 36-22.9 36-22.9z\"/></symbol><symbol id=\"icon-linkedin\" viewBox=\"0 0 38 38\" width=\"38\" height=\"38\"><path d=\"M11.6 15.5H15v10.8h-3.4z\"/><ellipse cx=\"13.3\" cy=\"12.1\" rx=\"2\" ry=\"2\"/><path d=\"M27.5 26.4v-6.9c0-2.9-1.6-4.3-3.9-4.3S20.3 17 20.3 17v-1.5h-3.2v10.8h3.2v-5.7c0-1.5.7-2.4 2-2.4 1.2 0 1.8.9 1.8 2.4v5.7h3.4z\"/></symbol><symbol id=\"icon-ratchet\" viewBox=\"0 0 600 120\" width=\"600\" height=\"120\"><path d=\"M502.1 2.5H397v39h-20v-39h-37v101.8l-16.8-30.2c-4.5 7.4-12.6 12.4-21.9 12.4-14.2 0-25.7-11.5-25.7-25.7s11.5-25.7 25.7-25.7c8.2 0 15.5 3.8 20.2 9.8l.6-1 18-31.7c-3.1-2.2-6.7-4.2-11-6-3.7-1.6-8-3-13.1-4.3C311 .6 305.2 0 298.7 0c-8.2 0-16 1.4-23.3 4.2C268 7 261.6 11 256.2 16.3c-4.3 4.2-8 9-10.9 14.5 2.2-5.5 5.8-12.5 11.5-18.1 3.8-3.8 8.2-7.2 12.9-9.2H113.5L82.8 83.6l13.7 32.9h9.6l2.9-8h36.4l2.9 8H222v-77h19.5c-2.1 6.3-3.2 13.1-3.2 20.5 0 8.9 1.5 17.1 4.6 24.4 3.1 7.4 7.4 13.7 12.9 18.9 5.5 5.3 12 9.3 19.5 12.3 7.5 2.9 15.8 4.4 24.7 4.4 6.6 0 12.5-.7 17.7-2.1 5.1-1.4 9.3-2.9 13-4.5 3.6-1.7 7.3-3.5 9.3-5.6v9.6h37v-43h20v43h32l5.8-107.9.6 107.9H503v-37h-32v-7h19v-28h-19v-6h31V3.2l6.3 36.3H532v78h38v-78h23.7l6.3-37h-97.9zm-379 71l4.2-10.9 4.2 10.9h-8.4zm19.3-66.4l18.4 32.4H184v76.1L142.4 7.1zM92 43.5c0-22.9-18.5-41-41.4-41H0v114h37V87.6l16.7 28.9h42.9L74.2 77.1C84.9 69.7 92 57.6 92 43.5zm-50.1 13H37v-21h4.9c5.4 0 9.7 4.7 9.8 10.5-.1 5.1-4.5 10.5-9.8 10.5zm251.9 17.2l-7.6-13.2 7.6-13.1h15l7.5 13.1-7.5 13.2h-15z\"/></symbol><symbol id=\"icon-search\" viewBox=\"0 0 38 38\" width=\"38\" height=\"38\"><path d=\"M26.7 25.1L23 21.3c.7-1.1 1.2-2.4 1.2-3.8-.1-3.6-3-6.5-6.7-6.5-3.6 0-6.6 2.9-6.6 6.6s3 6.6 6.6 6.6c1.4 0 2.7-.5 3.8-1.2l3.7 3.7c.2.2.5.3.9.3.3 0 .6-.1.9-.3.3-.4.3-1.2-.1-1.6m-9.1-2.6c-2.7 0-4.9-2.2-4.9-4.9s2.2-4.9 4.9-4.9 4.9 2.2 4.9 4.9-2.2 4.9-4.9 4.9\"/></symbol><symbol id=\"icon-subscribe\" viewBox=\"0 0 38 38\" width=\"38\" height=\"38\"><path d=\"M21.6 26.9c0-5.8-4.7-10.5-10.5-10.5v3.2c4 0 7.3 3.3 7.3 7.3h3.2zm-6.2-2.2c0-1.2-1-2.2-2.2-2.2-1.2 0-2.2 1-2.2 2.2s1 2.2 2.2 2.2c1.2 0 2.2-.9 2.2-2.2zM27 27c0-8.8-7.1-16-15.9-16v3.2c3.4 0 6.6 1.3 9 3.7s3.7 5.6 3.7 9l3.2.1z\"/></symbol><symbol id=\"icon-twitter\" viewBox=\"0 0 38 38\" width=\"38\" height=\"38\"><path d=\"M27 12.4c-.7.4-1.4.6-2.2.8-.6-.7-1.5-1.1-2.5-1.1-2.3 0-3.9 2.1-3.4 4.3-2.9-.1-5.5-1.5-7.2-3.6-.9 1.5-.4 3.6 1.1 4.6-.6 0-1.1-.1-1.6-.4 0 1.7 1.1 3.2 2.8 3.5-.5.2-1.1.2-1.6.1.4 1.4 1.7 2.4 3.2 2.4-1.5 1.1-3.4 1.6-5.2 1.4 1.5 1 3.3 1.6 5.3 1.6 6.5 0 10.1-5.4 9.9-10.3.7-.5 1.3-1.1 1.9-1.9-.6.2-1.3.4-2 .5.7-.4 1.3-1.2 1.5-1.9z\"/></symbol><symbol id=\"icon-y-combinator\" viewBox=\"0 0 38 38\" width=\"38\" height=\"38\"><path d=\"M22.4 10.9h3.8l-5.3 10v6h-3.3v-6l-5.5-10H16l3.3 7 3.1-7z\"/></symbol></svg>')\n }\n },\n icon: function(name, classnames) {\n var svgName = this.iconName(name)\n var element = document.querySelector('#'+svgName)\n\n if (element) {\n return '<svg class=\"svg-icon '+svgName+' '+(classnames || '')+'\" '+this.dimensions(element)+'><use xlink:href=\"#'+svgName+'\"/></svg>'\n } else {\n console.error('File not found: \"'+name+'.svg\" at app/assets/svgs/ratchet/')\n }\n },\n iconName: function(name) {\n var before = true\n if (before) {\n return \"icon-\"+this.dasherize(name)\n } else {\n return name+\"-icon\"\n }\n },\n dimensions: function(el) {\n return 'viewBox=\"'+el.getAttribute('viewBox')+'\" width=\"'+el.getAttribute('width')+'\" height=\"'+el.getAttribute('height')+'\"'\n },\n dasherize: function(input) {\n return input.replace(/[W,_]/g, '-').replace(/-{2,}/g, '-')\n },\n load: function(){\n // If DOM is already ready, embed SVGs\n if (document.readyState == 'interactive') { this.embed() }\n\n // Handle Turbolinks (or other things that fire page change events)\n document.addEventListener(\"page:change\", function(event) { this.embed() }.bind(this))\n\n // Handle standard DOM ready events\n document.addEventListener(\"DOMContentLoaded\", function(event) { this.embed() }.bind(this))\n },\n aliases: {},\n alias: function(name) {\n var aliased = this.aliases[name]\n if (typeof(aliased) != \"undefined\") {\n return aliased\n } else {\n return name\n }\n }\n}\n\nesvg.load()\n\n// Work with module exports:\nif(typeof(module) != 'undefined') { module.exports = esvg }\n","/**\n * ClassList\n * Cross-browser full element.classList implementation\n * @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js\n * @author Eli Grey - http://eligrey.com\n * @license MIT\n **/\n\nif ( 'document' in self ) {\n\n // Full polyfill for browsers with no classList support\n if ( !( 'classList' in document.createElement( '_' ) ) ) {\n\n ( function( view ) {\n\n 'use strict';\n\n if ( !( 'Element' in view ) ) return;\n\n var\n classListProp = 'classList',\n protoProp = 'prototype',\n elemCtrProto = view.Element[ protoProp ],\n objCtr = Object,\n\n strTrim = String[ protoProp ].trim || function() {\n return this.replace( /^\\s+|\\s+$/g, '' );\n },\n\n arrIndexOf = Array[ protoProp ].indexOf || function( item ) {\n for ( var i = 0; i < this.length; i++ ) {\n if ( i in this && this[ i ] === item ) {\n return i;\n }\n }\n return -1;\n },\n\n DOMEx = function( type, message ) {\n this.name = type;\n this.code = DOMException[ type ];\n this.message = message;\n },\n\n checkTokenAndGetIndex = function( classList, token ) {\n if ( token === '' ) {\n throw new DOMEx(\n 'SYNTAX_ERR',\n 'An invalid or illegal string was specified'\n );\n }\n if ( /\\s/.test( token ) ) {\n throw new DOMEx(\n 'INVALID_CHARACTER_ERR',\n 'String contains an invalid character'\n );\n }\n return arrIndexOf.call( classList, token );\n },\n\n ClassList = function( elem ) {\n var trimmedClasses = strTrim.call( elem.getAttribute( 'class' ) || '' ),\n classes = trimmedClasses ? trimmedClasses.split( /\\s+/ ) : [];\n\n for ( var i = 0; i < classes.length; i++ ) {\n this.push( classes[ i ] );\n }\n\n this._updateClassName = function() {\n elem.setAttribute( 'class', this.toString() );\n };\n },\n\n classListProto = ClassList[ protoProp ] = [],\n\n classListGetter = function() {\n return new ClassList( this );\n };\n\n DOMEx[ protoProp ] = Error[ protoProp ];\n\n classListProto.item = function( i ) {\n return this[ i ] || null;\n };\n\n classListProto.contains = function( token ) {\n token += '';\n return checkTokenAndGetIndex( this, token ) !== -1;\n };\n\n classListProto.add = function() {\n var\n tokens = arguments,\n iter = 0,\n len = tokens.length,\n updated = false,\n token;\n\n do {\n token = tokens[ iter ] + '';\n if ( checkTokenAndGetIndex( this, token ) === -1 ) {\n this.push( token );\n updated = true;\n }\n }\n\n while ( ++iter < len );\n\n if ( updated ) {\n this._updateClassName();\n }\n };\n\n classListProto.remove = function() {\n var\n tokens = arguments,\n iter = 0,\n len = tokens.length,\n updated = false,\n token,\n index;\n\n do {\n token = tokens[ iter ] + '';\n index = checkTokenAndGetIndex( this, token );\n\n while ( index !== -1 ) {\n this.splice( index, 1 );\n updated = true;\n index = checkTokenAndGetIndex( this, token );\n }\n }\n\n while ( ++iter < len );\n\n if ( updated ) {\n this._updateClassName();\n }\n };\n\n classListProto.toggle = function( token, force ) {\n token += '';\n\n var\n result = this.contains( token ),\n method = result ? force !== true && 'remove' : force !== false && 'add';\n\n if ( method ) {\n this[ method ]( token );\n }\n\n if ( force === true || force === false ) {\n return force;\n } else {\n return !result;\n }\n };\n\n classListProto.toString = function() {\n return this.join( ' ' );\n };\n\n if ( objCtr.defineProperty ) {\n var classListPropDesc = {\n get : classListGetter,\n enumerable : true,\n configurable : true\n };\n\n try {\n objCtr.defineProperty( elemCtrProto, classListProp, classListPropDesc );\n }\n\n catch ( ex ) {\n if ( ex.number === -0x7FF5EC54 ) {\n classListPropDesc.enumerable = false;\n objCtr.defineProperty( elemCtrProto, classListProp, classListPropDesc );\n }\n }\n\n } else if ( objCtr[ protoProp ].__defineGetter__ ) {\n elemCtrProto.__defineGetter__( classListProp, classListGetter );\n }\n\n }( self ));\n\n } else {\n\n ( function() {\n\n 'use strict';\n\n var testElement = document.createElement( '_' );\n\n testElement.classList.add( 'c1', 'c2' );\n\n if ( !testElement.classList.contains( 'c2' ) ) {\n var createMethod = function( method ) {\n var original = DOMTokenList.prototype[ method ];\n\n DOMTokenList.prototype[ method ] = function( token ) {\n var i, len = arguments.length;\n\n for ( i = 0; i < len; i++ ) {\n token = arguments[ i ];\n original.call( this, token );\n }\n };\n };\n createMethod( 'add' );\n createMethod( 'remove' );\n }\n\n testElement.classList.toggle( 'c3', false );\n\n if ( testElement.classList.contains( 'c3' ) ) {\n var _toggle = DOMTokenList.prototype.toggle;\n\n DOMTokenList.prototype.toggle = function( token, force ) {\n if ( 1 in arguments && !this.contains( token ) === !force ) {\n return force;\n } else {\n return _toggle.call( this, token );\n }\n };\n\n }\n\n testElement = null;\n\n }());\n\n }\n}\n","/**\n * Object.assign polyfill\n * Cross-browser full Object.assign implementation\n * @source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill\n * @license MIT\n **/\n\nif ( typeof Object.assign != 'function' ) {\n ( function() {\n Object.assign = function( target ) {\n 'use strict';\n if ( target === undefined || target === null ) {\n throw new TypeError( 'Cannot convert undefined or null to object' );\n }\n\n var output = Object( target );\n for ( var index = 1; index < arguments.length; index++ ) {\n var source = arguments[ index ];\n if ( source !== undefined && source !== null ) {\n for ( var nextKey in source ) {\n if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) {\n output[ nextKey ] = source[ nextKey ];\n }\n }\n }\n }\n return output;\n };\n })();\n}\n","/**\n * Unhover 0.0.1\n * Disable hover events on scroll\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar throttle = require( '../utility/throttle' ),\n timeout = require( '../utility/timeout' );\n\n// Public API function\nvar unhover = function( settings ) {\n\n // Overridable defaults\n var defaults = {\n scrollDelay : 150\n };\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n docElem = document.documentElement,\n scrollTimer;\n\n // Scroll handler function\n function scrollHandler() {\n\n // Clear timer (if it exists)\n if ( scrollTimer ) timeout.clear( scrollTimer );\n\n // Turn off pointer events\n if ( !docElem.style.pointerEvents ) {\n docElem.style.pointerEvents = 'none';\n }\n\n // Check to see if scroll is over\n scrollTimer = timeout.set( function() {\n\n // And reset pointer events upon completion\n docElem.style.pointerEvents = '';\n\n // Delay firing function based on argument passed\n }, options.scrollDelay );\n\n }\n\n // Scroll throttle function init\n throttle( 'scroll', 'optimizedscroll' );\n\n // Scroll function listener\n window.addEventListener( 'optimizedscroll', scrollHandler, false );\n\n};\n\n// Public API\nmodule.exports = unhover;\n","/**\n * FullStop 0.0.2\n * Prevent CSS transitions from occurring during a window resize\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar throttle = require( '../utility/throttle' ),\n timeout = require( '../utility/timeout' );\n\n// Public API function\nvar fullStop = function( settings ) {\n\n // Overridable defaults\n var defaults = {\n resizeDelay : 250,\n resizeClass : 'no-transitions'\n };\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n docBody = document.body,\n resizeTimer;\n\n // Resize handler function\n function resizeHandler() {\n\n // Clear timer (if it exists)\n if ( resizeTimer ) timeout.clear( resizeTimer );\n\n // Add body class while resizing\n docBody.classList.add( options.resizeClass );\n\n // Check to see if resize is over\n resizeTimer = timeout.set( function() {\n\n // And remove body class upon completion\n docBody.classList.remove( options.resizeClass );\n\n // Delay firing function based on argument passed\n }, options.resizeDelay );\n\n }\n\n // Resize throttle function init\n throttle( 'resize', 'optimizedResize' );\n\n // Resize function listener\n window.addEventListener( 'optimizedResize', resizeHandler, false );\n\n};\n\n// Public API\nmodule.exports = fullStop;\n","/**\n * LoadFont 0.0.1\n * A font loader that leverages LocalStorage\n * @author Adam Beres-Deak (@bdadam) & Kyle Foster (@hkfoster)\n * @source https://github.com/bdadam/OptimizedWebfontLoading\n * @license MIT\n **/\n\n// Dependencies - https://github.com/filamentgroup/woff2-feature-test\nvar supportsWoff2 = ( function( win ) {\n if ( !( \"FontFace\" in win ) ) return false;\n var f = new FontFace( 't', 'url( \"data:application/font-woff2;base64,d09GMgABAAAAAAIkAAoAAAAABVwAAAHcAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlYAgloKLEoBNgIkAxgLDgAEIAWDcgc1G7IEyB6SJAFID5YA3nAHC6h4+H7s27nP1kTyOoQkGuJWtNGIJKYznRI3VEL7IaHq985ZUuKryZKcAtJsi5eULwUybm9KzajBBhywZ5ZwoJNuwDX5C/xBjvz5DbsoNsvG1NGQiqp0NMLZ7JlnW+5MaM3HwcHheUQeiVokekHkn/FRdefvJaTp2PczN+I1Sc3k9VuX51Tb0Tqqf1deVXGdJsDOhz0/EffMOPOzHNH06pYkDDjs+P8fb/z/8n9Iq8ITzWywkP6PBMMN9L/O7vY2FNoTAkp5PpD6g1nV9WmyQnM5uPpAMHR2fe06jbfvzPriekVTQxC6lpKr43oDtRZfCATl5OVAUKykqwm9o8R/kg37cxa6eZikS7cjK4aIwoyh6jOFplhFrz2b833G3Jii9AjDUiAZ9AxZtxdEYV6imvRF0+0Nej3wu6nPZrTLh81AVcV3kmMVdQj6Qbe9qetzbuDZ7vXOlRrqooFSxCv6SfrDICA6rnHZXQPVcUHJYGcoqa3jVH7ATrjWBNYYkEqF3RFpVIl0q2JvMOJd7/TyjXHw2NyAuJpNaEbz8RTEVtCbSH7JrwQQOqwGl7sTUOtdBZIY2DKqKlvOmPvUxJaURAZZcviTT0SKHCXqzwc=\" ) format( \"woff2\" )', {} );\n f.load()[ 'catch' ]( function() {} );\n return f.status == 'loading' || f.status == 'loaded';\n})( window );\n\n// Public API function -\nvar loadFont = function( fontName, woffUrl, woff2Url, onlyLoadFontOnSecondPageload ){\n\n // Many unsupported browsers should stop here\n var nua = navigator.userAgent,\n nope = !window.addEventListener || ( nua.match( /(Android (2|3|4.0|4.1|4.2|4.3))|(Opera (Mini|Mobi))/ ) && !nua.match( /Chrome/ ) );\n\n if ( nope ) return;\n\n // Set up LocalStorage\n var loSto = {};\n\n // Set up a proxy variable to help with LocalStorage\n try { loSto = localStorage || {}; }\n catch( ex ) {}\n\n var loStoPrefix = 'x-font-' + fontName,\n loStoUrlKey = loStoPrefix + 'url',\n loStoCssKey = loStoPrefix + 'css',\n storedFontUrl = loSto[ loStoUrlKey ],\n storedFontCss = loSto[ loStoCssKey ],\n styleElement = document.createElement( 'style' );\n\n // Make <style> element & apply base64 encoded font data\n styleElement.rel = 'stylesheet';\n document.head.appendChild( styleElement );\n\n // CSS in LocalStorage & loaded from one of the current URLs\n if ( storedFontCss && ( storedFontUrl === woffUrl || storedFontUrl === woff2Url ) ) {\n\n styleElement.textContent = storedFontCss;\n\n // Data not present or loaded from an obsolete URL\n } else {\n\n // Check for WOFF2 support\n var cssUrl = ( woff2Url && supportsWoff2 ) ? woff2Url : woffUrl,\n request = new XMLHttpRequest();\n\n // Fetch font data from the server\n request.open( 'GET', cssUrl );\n request.onload = function() {\n if ( request.status >= 200 && request.status < 400 ) {\n\n // Update LocalStorage with fresh data & apply\n loSto[ loStoUrlKey ] = cssUrl;\n loSto[ loStoCssKey ] = request.responseText;\n if ( !onlyLoadFontOnSecondPageload ) styleElement.textContent = request.responseText;\n }\n };\n request.send();\n }\n};\n\n// Public API\nmodule.exports = loadFont;","/**\n * Throttle 0.0.1\n * Event throttle function\n * @author Kyle Foster (@hkfoster)\n * @reference http://www.html5rocks.com/en/tutorials/speed/animations/\n * @license MIT\n **/\n\n// Public API function\nvar throttle = function ( type, name, obj ) {\n obj = obj || window;\n var running = false;\n var func = function () {\n if ( running ) { return; }\n running = true;\n requestAnimationFrame( function () {\n obj.dispatchEvent( new CustomEvent( name ) );\n running = false;\n });\n };\n obj.addEventListener( type, func );\n};\n\n// Public API\nmodule.exports = throttle;\n","/**\n * LoadScript 0.0.1\n * Load external JavaScript function\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar loadScript = function( url, callback ) {\n\n // Create a <script> element\n var script = document.createElement( 'script' );\n\n // Make it async\n script.async = true;\n\n // Set source to passed URL\n script.src = url;\n\n // Append it to document head\n document.head.appendChild( script );\n\n // Add load event listener\n script.addEventListener( 'load', function() {\n\n // And if a callback is passed, run it\n if ( callback ) callback();\n\n }, false );\n\n};\n\n// Public API\nmodule.exports = loadScript;\n","/**\n * FromTop 0.0.1\n * Find element’s distance from top of document\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar fromTop = function( elem ) {\n return Math.round( elem.getBoundingClientRect().top + window.pageYOffset );\n};\n\n// Public API\nmodule.exports = fromTop;","/**\n * ScrollTo 0.0.1\n * Scroll to element function\n * @author James Doyle (@james2doyle) & Kyle Foster (@hkfoster)\n * @source https://goo.gl/CeY8fY\n * @license MIT\n **/\n\n// Public API function\nvar scrollTo = function( to, callback, duration ) {\n\n // Scoped variables\n var start = position(),\n change = to - start,\n currTime = 0,\n increment = 20;\n duration = ( typeof( duration ) === 'undefined' ) ? 500 : duration;\n\n // Kick off scroll animation\n animateScroll();\n\n // Easing function - http://goo.gl/5HLl8\n function easeInOutQuad( t, b, c, d ) {\n t /= d / 2;\n if ( t < 1 ) {\n return c / 2 * t * t + b;\n }\n t--;\n return -c / 2 * ( t * ( t - 2 ) - 1 ) + b;\n }\n\n // Get current scroll position\n function position() {\n return document.documentElement.scrollTop ||\n document.body.parentNode.scrollTop ||\n document.body.scrollTop;\n }\n\n // Move scroll position\n function move( amount ) {\n document.documentElement.scrollTop = amount;\n document.body.parentNode.scrollTop = amount;\n document.body.scrollTop = amount;\n }\n\n // Scroll animation function\n function animateScroll() {\n\n // Increment the time\n currTime += increment;\n\n // Find the value with the quadratic in-out easing function\n var val = easeInOutQuad( currTime, start, change, duration );\n\n // Move the document.body\n move( val );\n\n // Do the animation unless its over\n if ( currTime < duration ) {\n requestAnimationFrame( animateScroll );\n }\n\n // The animation is done so let’s callback\n else {\n if ( callback && typeof( callback ) === 'function' ) {\n callback();\n }\n }\n }\n\n};\n\n// Public API\nmodule.exports = scrollTo;\n","/**\n * Matches 0.0.1\n * Matches selector function\n * @author Kyle Foster (@hkfoster)\n * @reference https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\n * @license MIT\n **/\n\n// Public API function\nvar matches = function ( el, selector ) {\n return ( el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector ).call( el, selector );\n};\n\n// Public API\nmodule.exports = matches;\n","/**\n * GetClosest 0.0.1\n * Get closest DOM element up the tree that matches a given selector\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar matches = require( './matches' );\n\n// Public API function\nvar getClosest = function ( elem, selector ) {\n for ( ; elem && elem !== document; elem = elem.parentNode ) {\n if ( matches( elem, selector ) ) return elem;\n }\n return false;\n};\n\n// Public API\nmodule.exports = getClosest;\n","/**\n * GetNext 0.0.1\n * Get next DOM element that matches a given selector\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar getNext = function( elem, selector ) {\n for ( ; elem && elem !== document; elem = elem.parentNode ) {\n if ( elem.querySelector( selector ) ) return elem.querySelector( selector );\n }\n return false;\n};\n\n// Public API\nmodule.exports = getNext;\n","/**\n * Timeout 0.0.1\n * Just like setTimeout & clearTimeout, but with requestAnimationFrame()\n * @author Joe Lambert (@joelambert) & Kyle Foster (@hkfoster)\n * @source https://gist.github.com/joelambert/1002116#file-requesttimeout-js\n * @license MIT\n **/\n\n// Public API object\nvar timeout = {\n\n // Set timeout function\n set : function( fn, delay, args ) {\n\n var start = Date.now(),\n handle = {};\n\n function loop() {\n\n var current = Date.now(),\n delta = current - start;\n\n if ( delta >= delay ) {\n if ( args !== undefined ) {\n fn.call( fn, args );\n } else {\n fn.call( fn );\n }\n } else {\n handle.value = requestAnimationFrame( loop );\n }\n }\n\n handle.value = requestAnimationFrame( loop );\n return handle;\n },\n\n // Clear timeout function\n clear : function( handle ) {\n window.cancelAnimationFrame( handle.value );\n }\n};\n\n// Public API\nmodule.exports = timeout;\n","/**\n * WordCount 0.0.1\n * Word counter function\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar wordCount = function( str ) {\n var matches = str.match( /\\S+/g );\n return matches ? matches.length : 0;\n};\n\n// Public API\nmodule.exports = wordCount;\n","/**\n * CompileData 0.0.1\n * Compile input data from a given parent element\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar compileData = function( parent, debug ) {\n\n // Scoped variables\n var formData = new FormData(),\n allFields = parent.querySelectorAll( 'input:not([type=submit])' );\n\n // Loop over fields\n for ( var i = 0; i < allFields.length; i++ ) {\n\n // Cache current field\n var field = allFields[ i ];\n\n // If a name attribute is present\n if ( field.name ) {\n\n // Debug mode logging\n if ( debug ) console.log( 'Name: ' + field.name + '\\n' + 'Value: ' + field.value );\n\n // Append current field’s name/value to new formData object\n formData.append( field.name, field.value );\n\n }\n\n }\n\n // Then return said formData object\n return formData;\n\n};\n\n// Public API\nmodule.exports = compileData;\n","/**\n * Mobile Menu 0.0.2\n * Compose mobile menu module\n * @author Kyle Foster (@hkfoster)\n * @license MIT (http://www.opensource.org/licenses/mit-license.php/)\n **/\n\n// Dependencies\nvar matches = require( '../utility/matches' );\n\n// Public API function\nvar mobileMenu = function( element, settings ) {\n\n // Overridable defaults\n var defaults = {\n initWidth : '700px',\n openClass : 'menu-open',\n menuButton : '.mobile-menu-button'\n },\n\n // Scoped variables\n options = Object.assign( {}, defaults, settings ),\n selector = document.querySelector( element ),\n widthQuery = window.matchMedia( '(max-width: ' + options.initWidth + ')' ),\n docBody = document.body;\n\n // Attach listeners\n if ( selector ) {\n\n // Call listener function explicitly at run time\n queryHandler( widthQuery );\n\n // Attach listener function to listen in on state changes\n widthQuery.addListener( queryHandler );\n\n }\n\n // Click handler function\n function clickHandler( event ) {\n\n // Combine element selector with anchor links\n var toggleSelector = options.menuButton + ', .' + options.openClass + ' ' + element + ' a[href^=\"#\"]';\n\n // Only run on menu button\n if ( matches( event.target, toggleSelector ) ) {\n\n // Toggle body class\n docBody.classList.toggle( options.openClass );\n\n }\n\n }\n\n // Media query handler function\n function queryHandler( condition ) {\n\n // If media query matches\n if ( condition.matches ) {\n\n // Click function listener\n selector.addEventListener( 'click', clickHandler, false );\n\n } else {\n\n // Remove click listener\n selector.removeEventListener( 'click', clickHandler, false );\n\n }\n }\n\n};\n\n// Public API\nmodule.exports = mobileMenu;\n","/**\n * Ajax 0.0.1\n * Ajax module in Vanilla JS\n * @author Fernando Daciuk (@fdaciuk) & Kyle Foster (@hkfoster)\n * @source https://github.com/fdaciuk/ajax\n * @license MIT\n **/\n\n// Public API function\nvar ajax = function( options ) {\n var methods = [ 'get', 'post', 'put', 'delete' ];\n options = options || {};\n options.baseUrl = options.baseUrl || '';\n if ( options.method && options.url ) {\n return xhrConnection(\n options.method,\n options.baseUrl + options.url,\n maybeData( options.data ),\n options\n );\n }\n return methods.reduce( function( acc, method ) {\n acc[ method ] = function( url, data ) {\n return xhrConnection(\n method,\n options.baseUrl + url,\n maybeData( data ),\n options\n );\n };\n return acc;\n }, {});\n\n function maybeData( data ) {\n return data || null;\n }\n\n function xhrConnection( type, url, data, options ) {\n var returnMethods = [ 'then', 'catch', 'always' ];\n var promiseMethods = returnMethods.reduce( function( promise, method ) {\n promise[ method ] = function( callback ) {\n promise[ method ] = callback;\n return promise;\n };\n return promise;\n }, {});\n var xhr = new XMLHttpRequest();\n xhr.open( type, url, true );\n xhr.withCredentials = options.hasOwnProperty( 'withCredentials' );\n setHeaders( xhr, options.headers );\n xhr.addEventListener( 'readystatechange', ready( promiseMethods, xhr ), false );\n xhr.send( objectToQueryString( data ) );\n promiseMethods.abort = function() {\n return xhr.abort();\n };\n return promiseMethods;\n }\n\n function setHeaders( xhr, headers ) {\n headers = headers || {};\n if ( !hasContentType( headers ) ) {\n headers[ 'Content-Type' ] = 'application/x-www-form-urlencoded';\n }\n Object.keys( headers ).forEach( function( name ) {\n ( headers[ name ] && xhr.setRequestHeader( name, headers[ name ] ) );\n });\n }\n\n function hasContentType( headers ) {\n return Object.keys( headers ).some( function( name ) {\n return name.toLowerCase() === 'content-type';\n });\n }\n\n function ready( promiseMethods, xhr ) {\n return function handleReady() {\n if ( xhr.readyState === xhr.DONE ) {\n xhr.removeEventListener( 'readystatechange', handleReady, false );\n promiseMethods.always.apply( promiseMethods, parseResponse( xhr ) );\n\n if ( xhr.status >= 200 && xhr.status < 300 ) {\n promiseMethods.then.apply( promiseMethods, parseResponse( xhr ) );\n } else {\n promiseMethods.catch.apply( promiseMethods, parseResponse( xhr ) );\n }\n }\n };\n }\n\n function parseResponse( xhr ) {\n var result;\n try {\n result = JSON.parse( xhr.responseText );\n } catch ( e ) {\n result = xhr.responseText;\n }\n return [ result, xhr ];\n }\n\n function objectToQueryString( data ) {\n return isObject( data ) ? getQueryString( data ) : data;\n }\n\n function isObject( data ) {\n return Object.prototype.toString.call( data ) === '[ object Object ]';\n }\n\n function getQueryString( object ) {\n return Object.keys( object ).reduce( function( acc, item ) {\n var prefix = !acc ? '' : acc + '&';\n return prefix + encode( item ) + '=' + encode( object[ item ] );\n }, '' );\n }\n\n function encode( value ) {\n return encodeURIComponent( value );\n }\n\n};\n\n// Public API\nmodule.exports = ajax;","/**\n * Form 0.0.1\n * Ratchet forms module\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar evt = require( 'compose-event' );\n\n// Public API function\nvar form = function( element, settings ) {\n\n // Overridable defaults\n var defaults = {};\n\n // Parameter variables\n var selector = document.querySelector( element ) || document.querySelector( 'form' );\n\n // Only run if selector exists\n if ( !selector ) return false;\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n rangeEls = document.querySelectorAll( 'input[type=range]' ),\n tickEls = document.querySelectorAll( 'input[type=checkbox], input[type=radio]' ),\n docBody = document.body;\n\n // Prevent non-numeric characters in number fields\n docBody.addEventListener( 'keypress', keyHandler, false );\n\n // Run delegated `on input` listener\n docBody.addEventListener( 'input', rangeHandler, true );\n\n // Loop over any range inputs that are present\n for ( var rangeIndex = 0; rangeIndex < rangeEls.length; rangeIndex++ ) {\n\n // And run their handler function explicitly at runtime\n rangeHandler( rangeEls[ rangeIndex ] );\n\n }\n\n // Loop over any checkbox/radio inputs that are present\n for ( var tickIndex = 0; tickIndex < tickEls.length; tickIndex++ ) {\n\n // And run their handler function explicitly at runtime\n tickHandler( tickEls[ tickIndex ] );\n\n }\n\n // Checkbox/radio input hander function\n function tickHandler( elem ) {\n\n // Find element’s parent node\n var labelParent = elem.parentNode;\n\n // If parent is a label\n if ( labelParent.tagName === 'LABEL' ) {\n\n // Simply add the `tick-label` classname\n labelParent.classList.add( 'tick-label' );\n\n // Otherwise\n } else {\n\n // Wrap the element properly\n elem.insertAdjacentHTML( 'beforebegin', '<label class=\"tick-label\"></label>' );\n elem.previousSibling.insertAdjacentElement( 'afterbegin', elem );\n\n }\n\n // And add empty span to label\n elem.insertAdjacentHTML( 'afterend', '<span></span>' );\n\n }\n\n // Keydown handler function\n function keyHandler( event ) {\n\n // Only run on number inputs\n if ( event.target.type !== 'number' ) {\n return false;\n }\n\n // If user enters non-numeric characters\n if ( event.which < 48 || event.which > 57 ) {\n\n // Supress them\n event.preventDefault();\n\n }\n\n }\n\n // Range input hander function\n function rangeHandler( event ) {\n\n // Define target element\n var element = ( event.target ) ? event.target : event;\n\n // Only run on range inputs\n if ( element.type !== 'range' ) {\n return false;\n }\n\n // Calculate percentage value\n var percValue = ( element.max ) ? element.value / element.max * 100 : element.value / 100 * 100;\n\n // Style bar accordingly\n element.style.backgroundImage = 'linear-gradient(90deg, #009DDC ' + percValue + '%, #D1D1D1 ' + percValue + '%)';\n\n }\n\n // Rangetouch 0.0.9 - https://github.com/selz/rangetouch\n function rangeTouch( size ) {\n\n // Bail if not a touch device\n if ( !( 'ontouchstart' in document.documentElement ) ) {\n return;\n }\n\n // Scoped variables\n var rangeInputs = document.querySelectorAll( '[type=range]' ),\n thumbSize = size || 20;\n\n // Set touchAction to prevent delays\n for ( var i = rangeInputs.length - 1; i >= 0; i-- ) {\n rangeInputs[ i ].style.touchAction = 'manipulation';\n rangeInputs[ i ].style.webkitUserSelect = 'none';\n }\n\n // Listen for events\n docBody.addEventListener( 'touchstart', setValue, false );\n docBody.addEventListener( 'touchmove', setValue, false );\n docBody.addEventListener( 'touchend', setValue, false );\n\n // Get the number of decimal places\n function getDecimalPlaces( value ) {\n var match = ( '' + value ).match( /( ?:\\.( \\d+ ) )?( ?:[eE]( [+-]?\\d+ ) )?$/ );\n if ( !match ) {\n return 0;\n }\n return Math.max( 0, ( match[ 1 ] ? match[ 1 ].length : 0 ) - ( match[ 2 ] ? +match[ 2 ] : 0 ) );\n }\n\n // Round to the nearest step\n function roundToStep( number, step ) {\n if ( step < 1 ) {\n var places = getDecimalPlaces( parseInt( step ) );\n return parseFloat( number.toFixed( places ) );\n }\n return ( Math.round( number / step ) * step );\n }\n\n // Get the value based on touch position\n function getValue( event ) {\n\n // Scoped variables\n var input = event.target,\n touch = event.changedTouches[ 0 ],\n min = parseFloat( input.getAttribute( 'min' ) ) || 0,\n max = parseFloat( input.getAttribute( 'max' ) ) || 100,\n step = parseFloat( input.getAttribute( 'step' ) ) || 1,\n delta = max - min;\n\n // Calculate percentage\n var percent,\n clientRect = input.getBoundingClientRect(),\n thumbWidth = ( ( ( 100 / clientRect.width ) * ( thumbSize / 2 ) ) / 100 );\n\n // Determine left percentage\n percent = ( ( 100 / clientRect.width ) * ( touch.clientX - clientRect.left ) );\n\n // Don't allow outside bounds\n if ( percent < 0 ) {\n percent = 0;\n } else if ( percent > 100 ) {\n percent = 100;\n }\n\n // Factor in the thumb offset\n if ( percent < 50 ) {\n percent -= ( ( 100 - ( percent * 2 ) ) * thumbWidth );\n } else if ( percent > 50 ) {\n percent += ( ( ( percent - 50 ) * 2 ) * thumbWidth );\n }\n\n // Find the closest step to the mouse position\n return min + roundToStep( delta * ( percent / 100 ), step );\n\n }\n\n // Update range value based on position\n function setValue( event ) {\n\n // Bail if not a range slider\n if ( event.target.type !== 'range' ) {\n return;\n }\n\n // Prevent text highlight on iOS\n event.preventDefault();\n\n // Set value\n event.target.value = getValue( event );\n\n // Trigger input event\n evt.fire( event.target, ( event.type === 'touchend' ? 'change' : 'input' ) );\n\n }\n\n }\n\n // Initialize RangeTouch\n rangeTouch();\n\n};\n\n// Public API\nmodule.exports = form;\n","/**\n * Loader 0.0.1\n * Compose loader module\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar loader = function( settings ) {\n\n // Overridable defaults\n var defaults = {\n selector : document.body,\n loaderClass : 'loader',\n loadingMessage : 'Hang tight…',\n loadingClass : 'loading',\n successMessage : 'Got it!',\n successClass : 'success',\n failureMessage : 'Hold up!',\n failureClass : 'failure'\n };\n\n // Extend defaults\n var options = Object.assign( {}, defaults, settings );\n\n // Create and prepend loader element\n options.selector.insertAdjacentHTML( 'afterbegin', '<div class=\"' + options.loaderClass + '\"></div>' );\n\n // Cache loader element\n var element = document.querySelector( 'div.' + options.loaderClass );\n\n // Show loader icon function\n var show = function( state ) {\n\n // Loader pending state\n if ( state === 'pending' ) {\n\n element.textContent = options.loadingMessage;\n element.classList.remove( options.successClass, options.failureClass );\n element.classList.add( options.loadingClass );\n\n // Loader failure state\n } else if ( state === 'failure' ) {\n\n element.textContent = options.failureMessage;\n element.classList.remove( options.loadingClass );\n element.classList.add( options.failureClass );\n\n // Loader success state\n } else if ( state === 'success' ) {\n\n element.textContent = options.successMessage;\n element.classList.remove( options.loadingClass );\n element.classList.add( options.successClass );\n\n }\n\n };\n\n // Hide loader icon function\n var hide = function() {\n\n // Remove state classes altogether\n element.classList.remove( options.loadingClass, options.successClass, options.failureClass );\n\n };\n\n // Public functions\n return {\n show : show,\n hide : hide\n };\n\n};\n\n// Public API\nmodule.exports = loader;","/**\n * Notice 0.0.1\n * Compose notice module\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Public API function\nvar notice = function( element, settings ) {\n\n // Overridable defaults\n var defaults = {\n noticeName : 'notice',\n noticeClass : 'notice',\n noticeMessage : '[your notice message here]'\n };\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n selector = document.querySelector( element ),\n cookieName = 'dismiss-' + options.noticeName;\n\n // Only run if selector exists & no dismiss cookie is found\n if ( !selector || getCookie( cookieName ) ) return false;\n\n // Uncomment for development\n // deleteCookie( cookieName );\n\n // Create and append notice\n var html = '<aside class=\"' + options.noticeClass + '\">' + options.noticeMessage + '<a href=\"#?\" class=\"close-btn\"></a></aside>'\n document.querySelector( 'main' ).insertAdjacentHTML( 'afterbegin', html );\n\n // Listen for close button click\n selector.querySelector( '.' + options.noticeClass + ' > .close-btn' ).addEventListener( 'click', dismissNotice, false );\n\n // Dismiss notice on close\n function dismissNotice( event ) {\n\n // Prevent default behavior\n event.preventDefault();\n\n // Cache notice element\n var noticeElem = selector.querySelector( '.' + options.noticeClass );\n\n // Remove notice from page\n selector.removeChild( noticeElem );\n\n // Set cookie to prevent it from returning\n document.cookie = cookieName + '=true; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/';\n\n }\n\n // Check for cookie by name\n function getCookie( name ) {\n var value = '; ' + document.cookie;\n var parts = value.split( '; ' + name + '=' );\n if ( parts.length == 2 ) return parts.pop().split( ';' ).shift();\n }\n\n // Delete a cookie by setting the date of expiry to yesterday\n function deleteCookie( name ) {\n var date = new Date();\n date.setDate( date.getDate() -1 );\n document.cookie = escape( name ) + '=;expires=' + date;\n }\n\n};\n\n// Public API\nmodule.exports = notice;\n","/**\n * Waypoints 0.0.4\n * Compose waypoint navigation module\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar matches = require( '../utility/matches' ),\n fromTop = require( '../utility/from_top' ),\n scrollTo = require( '../utility/scroll_to' ),\n getClosest = require( '../utility/get_closest' ),\n throttle = require( '../utility/throttle' );\n\n// Public API function\nvar waypoints = function( elements, settings ) {\n\n // Overridable defaults\n var defaults = {\n initWidth : '700px',\n activeAnchor : 'active',\n elemOffset : 0,\n showLandmarks : false,\n landmarkSelector : '.landmark',\n activeLandmark : 'pinned',\n };\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n selectors = document.querySelectorAll( elements );\n\n // If selectors are not present\n if ( !selectors.length ) {\n\n // Abort\n return false;\n\n // Otherwise attach listeners\n } else {\n\n // Scoped variables\n var initWidth = options.initWidth ? options.initWidth : '0px',\n widthQuery = window.matchMedia( '(min-width: ' + initWidth + ')' ),\n docBody = document.body,\n coordinates = [],\n oldActiveItem,\n windowHash,\n docHeight,\n winHeight;\n\n // If hash is present\n if ( window.location.hash ) {\n\n // Cache it\n windowHash = window.location.hash.replace( '#', '' );\n\n // Then delete it to prevent default page scroll\n window.location.hash = '';\n\n // And replace it\n history.replaceState( null, '', '#' + windowHash );\n\n }\n\n // Resize throttle function init\n throttle( 'resize', 'optimizedResize' );\n\n // Scroll throttle function init\n throttle( 'scroll', 'optimizedScroll' );\n\n // Only run once the window is loaded\n window.addEventListener( 'load', function() {\n\n // Call listener function explicitly at run time\n queryHandler( widthQuery );\n\n // Attach listener function to listen in on state changes\n widthQuery.addListener( queryHandler );\n\n }, false );\n\n }\n\n // Media query handler function\n function queryHandler( condition ) {\n\n // If media query matches\n if ( condition.matches ) {\n\n // Call resize listener function explicitly at run time\n resizeHandler();\n\n // Resize throttle function init\n window.addEventListener( 'optimizedResize', resizeHandler, false );\n\n // Call scroll listener function explicitly at run time\n scrollHandler();\n\n // Scroll function listener\n window.addEventListener( 'optimizedScroll', scrollHandler, false );\n\n // Click function listener\n docBody.addEventListener( 'click', clickHandler, false );\n\n // Call hash change listener function explicitly at run time\n hashHandler();\n\n // Hash change function listener\n window.addEventListener( 'hashchange', hashHandler, false );\n\n // Otherwise…\n } else {\n\n // Remove resize listener\n window.removeEventListener( 'optimizedResize', resizeHandler, false );\n\n // Remove scroll listener\n window.removeEventListener( 'optimizedScroll', scrollHandler, false );\n\n // Remove click listener\n docBody.removeEventListener( 'click', clickHandler, false );\n\n // Remove hash change listener\n window.removeEventListener( 'hashchange', hashHandler, false );\n\n }\n\n }\n\n // Resize handler function\n function resizeHandler() {\n\n // Update document height variable\n docHeight = docBody.scrollHeight;\n\n // Update window height variable\n winHeight = window.innerHeight;\n\n // Loop through waypoints\n for ( var i = 0; i < selectors.length; i++ ) {\n\n // Construct coordinate object\n var coordinate = {\n elem : selectors[ i ],\n offset : fromTop( selectors[ i ] )\n };\n\n // And update coordinates array\n coordinates[ i ] = coordinate;\n\n }\n\n }\n\n // Scroll handler function\n function scrollHandler() {\n\n // Scoped variables\n var newScrollY = window.pageYOffset,\n rockBottom = newScrollY < 0 || newScrollY + winHeight >= docHeight,\n newActiveItem,\n activeLink,\n landmark;\n\n // Loop through coordinates\n for ( var i = 0; i < coordinates.length; i++ ) {\n\n // Scoped variables\n var firstWaypoint = coordinates[ 0 ],\n currWaypoint = coordinates[ i ],\n nextWaypoint = coordinates[ i + 1 ],\n lastWaypoint = coordinates[ coordinates.length - 1 ];\n\n // If scrolled to last waypoint\n if ( newScrollY < firstWaypoint.offset ) {\n\n // Set active item to first waypoint\n newActiveItem = firstWaypoint.elem.id;\n\n // If scrolled to bottom of page or on past the last waypoint\n } else if ( rockBottom || newScrollY > lastWaypoint.offset - options.elemOffset ) {\n\n // Set active item to last waypoint\n newActiveItem = lastWaypoint.elem.id;\n\n // Otherwise if a waypoint is in the viewport\n } else if ( newScrollY > currWaypoint.offset - options.elemOffset && newScrollY < nextWaypoint.offset - options.elemOffset ) {\n\n // Update active item to match\n newActiveItem = currWaypoint.elem.id;\n\n }\n\n }\n\n // If active item exists\n if ( newActiveItem ) {\n\n // Only run when new active item is triggered\n if ( newActiveItem === oldActiveItem ) return false;\n\n // Update active link\n activeLink = docBody.querySelector( 'a[href=\"#' + newActiveItem + '\"]' );\n\n // If no active link is found, abort\n if ( !activeLink ) return false;\n\n // And enable navigation item\n activate( activeLink, options.activeAnchor );\n\n // If landmarks are turned on\n if ( options.showLandmarks === true ) {\n\n // Set active landmark to active link’s parent\n landmark = getClosest( activeLink, options.landmarkSelector );\n\n // Enable active landmark\n activate( landmark, options.activeLandmark );\n\n }\n\n // Update old active item variable\n oldActiveItem = newActiveItem;\n\n }\n\n }\n\n // Click handler function\n function clickHandler( event ) {\n\n // Matches selector function init\n if ( matches( event.target, 'a[href^=\"#\"]' ) ) {\n\n // Prevent default behavior\n event.preventDefault();\n\n // Travel to clicked target\n travel( event.target, 'click' );\n\n }\n }\n\n // Hash change handler function\n function hashHandler() {\n\n // Only run when a hash is present\n if ( !window.location.hash ) return false;\n\n // Find the hash’s relevant navigation item\n var hashAnchor = document.querySelector( 'a[href=\"' + window.location.hash + '\"]' );\n\n // And travel to its target\n travel( hashAnchor, 'hash' );\n\n }\n\n // Window scroll travel function\n function travel( destination, trigger ) {\n\n // Define scoped variable(s)\n var targetAnchor = destination.href.split( '#' )[ 1 ],\n targetElement = document.querySelector( '#' + targetAnchor ),\n targetOffset,\n travelTime;\n\n // If a target element exists\n if ( targetElement ) {\n\n // Enable new active navigation item\n activate( destination, options.activeAnchor );\n\n // Loop through coordinates\n for ( var i = 0; i < coordinates.length; i++ ) {\n\n // If coordinate element matches target element\n if ( coordinates[ i ].elem === targetElement ) {\n\n // Assign its coordinates to target offset variable\n targetOffset = coordinates[ i ].offset;\n }\n }\n\n // If trigger was a click\n if ( trigger === 'click' ) {\n\n // Temporarily remove scroll listener function\n window.removeEventListener( 'optimizedScroll', scrollHandler, false );\n\n // Update the hash\n history.pushState( null, '', '#' + targetAnchor );\n\n // Animate scroll to appropriate element\n scrollTo( targetOffset - options.elemOffset + 1, function() {\n\n // Once scroll is complete, enable scroll listener\n window.addEventListener( 'optimizedScroll', scrollHandler, false );\n\n });\n\n // Otherwise if trigger was a hash\n } else if ( trigger === 'hash' ) {\n\n // Skip the scroll animation\n window.scrollTo( 0, targetOffset - options.elemOffset + 1 );\n\n }\n }\n }\n\n // Link activation function\n function activate( selector, cls ) {\n\n // Find currently active link\n var activeLink = docBody.querySelector( '.' + cls );\n\n // And if it exists, disable it\n if ( activeLink ) activeLink.classList.remove( cls );\n\n // Then enable the passed selector\n selector.classList.add( cls );\n\n }\n\n};\n\n// Public API\nmodule.exports = waypoints;\n","/**\n * Validation 0.0.6\n * Compose form validation module\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar matches = require( '../utility/matches' ),\n getClosest = require( '../utility/get_closest' ),\n wordCount = require( '../utility/word_count' );\n\n// Public API function\nvar validation = function( element, settings ) {\n\n // Overridable defaults\n var defaults = {};\n\n // Parameter variables\n var selector = document.querySelector( element ) || document.querySelector( '[required]' );\n\n // Only run if selector exists & validation is supported\n if ( !selector || typeof document.createElement( 'input' ).checkValidity !== 'function' ) return false;\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n docBody = document.body;\n\n // Suppress default message bubbles\n docBody.addEventListener( 'invalid', function( event ) {\n event.preventDefault();\n }, true );\n\n // Run delegated `on blur` validation checks\n docBody.addEventListener( 'blur', blurHandler, true );\n\n // Run delegated `on submit` validation checks\n docBody.addEventListener( 'click', submissionHandler, false );\n\n // Blur validation handler\n function blurHandler( event ) {\n\n // Only run on non-submit inputs\n if ( !matches( event.target, 'input:not([type=submit]), textarea' ) ) return false;\n\n // Scoped variables\n var element = event.target,\n minWords = element.dataset.minWords,\n maxWords = element.dataset.maxWords,\n indicator = getClosest( element, 'label' ) || element,\n validity;\n\n // If element only contains whitespace, strip value\n if ( element.value && !element.value.replace( /\\s/g, '' ).length ) {\n element.value = '';\n }\n\n // Remove pre-existing validation message\n messageHandler( 'hide', element );\n\n // If element has `data-min-words` attribute\n if ( minWords ) {\n\n // Run respective validation function\n validateWords( 'min', element, minWords );\n\n }\n\n // If element has `data-min-words` attribute\n if ( maxWords ) {\n\n // Run respective validation function\n validateWords( 'max', element, maxWords );\n\n }\n\n // Check validity\n validity = element.checkValidity();\n\n // If the element has a value but is invalid\n if ( element.value && !validity ) {\n\n // Set invalid state\n indicator.classList.remove( 'valid' );\n indicator.classList.add( 'invalid' );\n\n // If the element has a value and is valid\n } else if ( element.value && validity ) {\n\n // Set valid state\n indicator.classList.remove( 'invalid' );\n indicator.classList.add( 'valid' );\n\n // If the element has no value\n } else if ( !element.value ) {\n\n // Set neutral state\n indicator.classList.remove( 'valid' );\n indicator.classList.remove( 'invalid' );\n\n }\n\n }\n\n // Submission validation handler function\n function submissionHandler( event ) {\n\n // Only run on submission\n if ( !matches( event.target, 'input[type=submit], button[type=submit]' ) ) return;\n\n // Scoped variables\n var invalidForm = getClosest( event.target, 'form' ),\n invalidElem = invalidForm.querySelector( 'input:invalid, textarea:invalid' ),\n indicator;\n\n // If invalid element found\n if ( invalidElem ) {\n\n // Set indicator to parent label if it exists\n indicator = getClosest( invalidElem, 'label' ) || invalidElem;\n\n // If credit card field is invalid\n if ( matches( invalidElem, '[data-stripe=number]' ) ) {\n\n // Strip it of non-number characters\n invalidElem.value = invalidElem.value.replace( /[^0-9 -]/g, '' );\n\n // Evaluate form validity again\n invalidElem = invalidForm.querySelector( 'input:invalid, textarea:invalid' );\n\n // And return if valid\n if ( !invalidElem ) return;\n\n }\n\n // Prevent default behavior\n event.preventDefault();\n\n // If invalid is not hidden\n if ( invalidElem.style.display !== 'none' ) {\n\n // Focus it\n invalidElem.focus();\n\n // Otherwise\n } else {\n\n // Focus its immediate sibling (mostly used for upload buttons)\n invalidElem.nextSibling.focus();\n\n }\n\n // Toggle classes\n indicator.classList.remove( 'valid' );\n indicator.classList.add( 'invalid' );\n\n // Show validation message\n messageHandler( 'show', invalidElem );\n\n // Prevent Safari submission\n return false;\n\n }\n\n }\n\n // Validation message handler function\n function messageHandler( action, element ) {\n\n // Scoped variables\n var parentForm = getClosest( element, 'form' ),\n oldMessage = parentForm.querySelector( '.validation-message' ),\n newMessage = element.validationMessage,\n\n // Hide old message\n hideMessage = function() {\n oldMessage.parentNode.removeChild( oldMessage );\n },\n\n // Show new message\n showMessage = function() {\n\n // Find the element's parent label\n var labelParent = getClosest( element, 'label' );\n\n // If it doesn't exist, abort\n if ( !labelParent ) return false;\n\n // Otherwise, create and append the validation message\n labelParent.insertAdjacentHTML( 'beforeend', '<aside class=\"validation-message\"><p>' + newMessage + '</p></aside>' );\n\n };\n\n // If a `data-message` attribute exists, use it in message\n if ( element.dataset.message ) newMessage = element.dataset.message;\n\n // If hide action is passed hide old message\n if ( oldMessage && action === 'hide' ) hideMessage();\n\n // If show action is passed and no old message exists\n if ( action === 'show' && !oldMessage ) {\n\n // Show new message\n showMessage();\n\n // If show action is passed and old message exists\n } else if ( action === 'show' && oldMessage ) {\n\n // Make sure old message is not on currently invalid element\n if ( oldMessage.parentNode !== element.parentNode ) {\n\n // Hide old message\n hideMessage();\n\n // And show new message\n showMessage();\n\n // Otherwise\n } else {\n\n // Update message text on currently invalid element\n oldMessage.childNodes[ 0 ].textContent = newMessage;\n\n }\n\n }\n\n }\n\n // Min- or max-words validation function\n function validateWords( type, element, goal ) {\n\n // Defaults settings to min-words\n var value = element.value,\n condition = wordCount( value ) < goal,\n verbiage = 'at least ';\n\n // Overwrite defaults in case of max-words\n if ( type === 'max' ) {\n condition = wordCount( value ) > goal;\n verbiage = 'no more than ';\n }\n\n // If value exists and it meets invalid condition\n if ( value && condition ) {\n\n // Set a custom error message\n element.setCustomValidity( 'Please write ' + verbiage + goal + ' words.' );\n\n // Otherwise\n } else {\n\n // Default to normal error messaging\n element.setCustomValidity( '' );\n\n }\n\n }\n\n};\n\n// Public API\nmodule.exports = validation;\n","/**\n * Sticky 0.0.3\n * Compose sticky elements module\n * @author Kyle Foster (@hkfoster)\n * @license MIT\n **/\n\n// Dependencies\nvar throttle = require( '../utility/throttle' ),\n fromTop = require( '../utility/from_top' );\n\n// Public API function\nvar sticky = function( element, settings ) {\n\n // Overridable defaults\n var defaults = {\n topPadding : false,\n initWidth : '700px',\n stickyClass : 'sticky',\n anchorPoint : null\n };\n\n // Scoped variables\n var options = Object.assign( {}, defaults, settings ),\n selector = document.querySelector( element );\n\n // If selector is not present\n if ( !selector ) {\n\n // Abort\n return false;\n\n // Otherwise attach listeners\n } else {\n\n // Scoped variables\n var topPadding = ( options.topPadding === true ) ? parseInt( window.getComputedStyle( selector, null ).getPropertyValue( 'padding-top' ) ) : 0,\n widthQuery = window.matchMedia( '(min-width: ' + options.initWidth + ')' ),\n topOffset = fromTop( selector ) + topPadding,\n elemHeight = selector.offsetHeight,\n anchorInit = options.anchorPoint,\n docBody = document.body,\n docHeight,\n winHeight;\n\n // Resize throttle function init\n throttle( 'resize', 'optimizedResize' );\n\n // Scroll throttle function init\n throttle( 'scroll', 'optimizedScroll' );\n\n // Call listener function explicitly at run time\n queryHandler( widthQuery );\n\n // Attach listener function to listen in on state changes\n widthQuery.addListener( queryHandler );\n\n }\n\n // Media query handler function\n function queryHandler( condition ) {\n\n // If media query matches\n if ( condition.matches ) {\n\n // Call resize listener function explicitly at run time\n resizeHandler();\n\n // Resize function listener\n window.addEventListener( 'optimizedResize', resizeHandler, false );\n\n // Call scroll listener function explicitly at run time\n scrollHandler();\n\n // Scroll function listener\n window.addEventListener( 'optimizedScroll', scrollHandler, false );\n\n } else {\n\n // Reset styles\n docBody.classList.remove( 'sticky' );\n\n // Remove resize listener\n window.removeEventListener( 'optimizedResize', resizeHandler, false );\n\n // Remove scroll listener\n window.removeEventListener( 'optimizedScroll', scrollHandler, false );\n\n }\n\n }\n\n // Resize handler function\n function resizeHandler() {\n\n // Update document height variable\n docHeight = document.body.scrollHeight;\n\n // Update window height variable\n winHeight = window.innerHeight;\n\n }\n\n // Scroll handler function\n function scrollHandler() {\n\n // Scoped variables\n var newScrollY = window.pageYOffset,\n pastOffset = newScrollY > topOffset,\n anchored = ( anchorInit ) ? newScrollY >= docHeight - elemHeight - anchorInit + topPadding : null;\n\n // Where the magic happens\n if ( pastOffset && !anchored ) {\n docBody.classList.remove( 'anchored' );\n docBody.classList.add( 'sticky' );\n } else if ( pastOffset && anchored ) {\n docBody.classList.remove( 'sticky' );\n docBody.classList.add( 'anchored' );\n } else {\n docBody.classList.remove( 'sticky' );\n }\n\n }\n\n};\n\n// Public API\nmodule.exports = sticky;\n","var bean = require('bean')\nvar key = require('keymaster')\nvar animationEvent = require('./lib/animation-events.js')\nvar page = require('./lib/page-events.js')\nvar tap = require('./lib/tap-events.js')\nvar slice = Array.prototype.slice\n\nmodule.exports = {\n on: on,\n off: off,\n one: one,\n fire: fire,\n clone: bean.clone,\n ready: page.ready,\n change: page.change,\n key: key,\n keyOn: key,\n keyOff: key.unbind,\n keyOne: keyOne\n}\n\n// Bean doesn't account for cross-browser support on animation events\n// So rather than pass through events to bean, we process them to add\n// vendor prefixes or remove events if browsers do not suppor them\n//\nfunction on () {\n setEvent('on', slice.call(arguments))\n}\n\nfunction off () {\n setEvent('off', slice.call(arguments))\n}\n\nfunction one () {\n setEvent('one', slice.call(arguments))\n}\n\nfunction fire () {\n args = slice.call(arguments)\n var el = args[0]\n var events = []\n\n args[1].split(' ').forEach(function(event) {\n var event = animationEvent.transform(event)\n if (!isEmpty(event)) events.push(event)\n })\n\n if (!isEmpty(events)) {\n bean.fire(args[0], events.join(' '))\n }\n}\n\nfunction setEvent(registerType, args) {\n transformArgs(args).forEach(function(arg) {\n bean[registerType].apply(null, arg)\n })\n}\n\n// Add support for unbinding a key event after it is called\n//\nfunction keyOne (keys, scope, fn) {\n if (typeof scope == 'function') {\n fn = scope\n scope = 'all'\n }\n\n key(keys, scope, function(event) {\n key.unbind(keys, scope)\n fn(event)\n })\n}\n\n// Transform event arguments to handle tap event and cross-browser animation events\n// Returns an array of events to be registered individually\n//\nfunction transformArgs(args) {\n var transformedArgs = []\n var newEvents = {}\n var element = args.shift() // retrieve element\n var events = args.shift()\n\n // detect event delegate selector\n if (typeof args[0] != 'function') {\n var delegate = args.shift()\n }\n \n // convert event strings to object based events for code simplification\n // example: arguments ('hover focus', function) would become ({ 'hover focus': function })\n if (typeof events == 'string') {\n var objEvents = {}\n objEvents[events] = args.shift()\n events = objEvents\n }\n\n // Walk through each key in the events object and add vendor prefixes to 'animation' events\n // and wrap callback in the tap function for all 'tap' events.\n //\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n var callback = events[event]\n\n // Events can be registered as space separated groups like \"hover focus\"\n // This handles each event independantly\n //\n event.split(' ').forEach(function(e){\n\n // If it is an animation event, vendor prefix it, or fire the callback according to browser support\n e = animationEvent.transform(e)\n\n if (isEmpty(e)) {\n // If it's empty, it has been removed since animation events are not supported.\n // In that case, trigger the event immediately\n callback()\n\n } else if (e.match(/tap/)) {\n\n // If it's a tap event, wrap the callback and set the event to 'touchstart'\n // Tap isn't a real native event, but this wrapper lets us simulate what a\n // native tap event would be.\n //\n newEvents.touchstart = tap(callback)\n } else {\n newEvents[e] = callback\n }\n })\n }\n }\n\n for (event in newEvents) {\n var a = []\n a.push(element, event)\n if (delegate) a.push(delegate)\n a.push(newEvents[event])\n transformedArgs.push(a.concat(args))\n }\n\n return transformedArgs\n}\n\n\nfunction isEmpty(obj) {\n var hasOwnProperty = Object.prototype.hasOwnProperty\n\n if (obj == null || obj.length === 0) return true\n if (0 < obj.length) return false\n\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) return false\n }\n\n return true;\n}\n","var CodeMirror = require('codemirror')\nrequire('codemirror/addon/runmode/runmode.js')\n\n// Use CodeMirror to render static code higlighting\n//\n// Example:\n//\n// <pre class=\"lang-ruby\">\n// puts 'awesome' if true\n// </pre>\n//\n\n\nvar Highlighter = {\n\n aliases: {\n 'bash' : 'text/x-sh',\n 'c' : 'text/x-csrc',\n 'html' : 'text/html',\n 'js' : 'text/javascript',\n 'json' : 'application/json',\n 'java' : 'text/x-java',\n 'markup': 'text/html',\n 'sass' : 'text/x-sass',\n 'scss' : 'text/x-scss',\n 'sh' : 'text/x-sh'\n },\n\n addAlias: function(newAliases) {\n for (var key in newAliases) {\n self.aliases[key] = newAliases[key]\n }\n },\n\n aliasLang: function(lang) {\n return(self.aliases[lang] || lang)\n },\n\n process: function(code, lang, output) {\n var options = {'json': false}\n\n if(lang == 'json') {\n options.json = true \n }\n\n CodeMirror.runMode(code, self.aliasLang(lang), output, options)\n },\n\n highlightEl: function(element) {\n var lang = element.dataset.lang || element.dataset.language\n\n if (!lang) {\n classMatch = element.className.match(/lang.*?-(\\S+)/)\n if (classMatch){\n lang = classMatch[1]\n } else {\n // If we can't determine language, skip it.\n return\n }\n }\n\n // Standardize classes: lang-[language]\n if (element.classList.contains('language-'+lang)) {\n element.classList.remove('language-'+lang)\n }\n\n element.classList.add('lang-'+lang)\n element.classList.add('highlighted')\n\n var code = element.textContent.trim()\n\n self.process(code, lang, element)\n element.innerHTML = \"<code class='highlighted-code static-code cm-s-default'>\" + element.innerHTML + \"</code>\"\n },\n\n highlight: function(selector) {\n selector = selector || '[class*=\"language-\"], [class*=\"lang-\"], [data-lang], [data-language]'\n\n var elements = document.querySelectorAll(selector);\n Array.prototype.forEach.call(elements, function(element) {\n self.highlightEl(element)\n })\n }\n}\n\nmodule.exports = self = Highlighter\n","var cssAnimEventTypes = getAnimationEventTypes()\nvar supported = cssAnimEventTypes.animationstart !== undefined\n\nmodule.exports = {\n transform: transformAnimationEvents\n}\n\nfunction camelCaseEventTypes(prefix) {\n prefix = prefix || '';\n\n return {\n animationstart: prefix + 'AnimationStart',\n animationend: prefix + 'AnimationEnd',\n animationiteration: prefix + 'AnimationIteration'\n };\n}\n\nfunction lowerCaseEventTypes(prefix) {\n prefix = prefix || '';\n\n return {\n animationstart: prefix + 'animationstart',\n animationend: prefix + 'animationend',\n animationiteration: prefix + 'animationiteration'\n };\n}\n\n/**\n * @return {Object} Animation event types {animationstart, animationend, animationiteration}\n */\n\nfunction getAnimationEventTypes() {\n var prefixes = ['webkit', 'Moz', 'O', ''];\n var style = document.documentElement.style;\n\n // browser compliant\n if (undefined !== style.animationName) {\n return lowerCaseEventTypes();\n }\n\n for (var i = 0, len = prefixes.length, prefix; i < len; i++) {\n prefix = prefixes[i];\n\n if (undefined !== style[prefix + 'AnimationName']) {\n // Webkit\n if (0 === i) {\n return camelCaseEventTypes(prefix.toLowerCase());\n }\n // Mozilla\n else if (1 === i) {\n return lowerCaseEventTypes();\n }\n // Opera\n else if (2 === i) {\n return lowerCaseEventTypes(prefix.toLowerCase());\n }\n }\n }\n\n return {};\n}\n\n\n// Adds necessary add vendor prefixes or camelCased event names\n//\nfunction transformAnimationEvents (event) {\n if (!event.match(/animation/i)) {\n return event\n } else {\n if (cssAnimEventTypes[event]) {\n return cssAnimEventTypes[event]\n } else {\n if(window.env != 'test') {\n console.error('\"' + event + '\" is not a supported animation event')\n }\n return ''\n }\n }\n}\n","var onReady = []\nvar onChange = []\nvar bean = require('bean')\nvar readyAlready = false\n\nmodule.exports = {\n ready: ready,\n change: change\n}\n\nfunction ready(fn) {\n if (readyAlready)\n fn()\n else\n onReady.push(fn)\n}\n\nfunction change(fn) {\n onChange.push(fn)\n}\n\nfunction pageReady(){\n readyAlready = true\n onReady.forEach(function(fn) { fn() })\n\n if (!window.Turbolinks) {\n pageChange()\n }\n}\n\nfunction pageChange(){\n onChange.forEach(function(fn) { fn() })\n}\n\nbean.on(document, 'DOMContentLoaded', pageReady)\n// Support rails turbolinks page load event\nbean.on(document, 'page:change', pageChange)\n","var endEvents = [\n 'touchend'\n]\n\nmodule.exports = Tap\n\n// default tap timeout in ms\nTap.timeout = 200\n\nfunction Tap(callback, options) {\n options = options || {}\n // if the user holds his/her finger down for more than 200ms,\n // then it's not really considered a tap.\n // however, you can make this configurable.\n var timeout = options.timeout || Tap.timeout\n\n // to keep track of the original listener\n listener.handler = callback\n\n return listener\n\n // el.addEventListener('touchstart', listener)\n function listener(e1) {\n // tap should only happen with a single finger\n if (!e1.touches || e1.touches.length > 1) return\n\n var el = e1.target\n var context = this\n var args = arguments;\n\n var timeout_id = setTimeout(cleanup, timeout)\n\n el.addEventListener('touchmove', cleanup)\n\n endEvents.forEach(function (event) {\n el.addEventListener(event, done)\n })\n\n function done(e2) {\n // since touchstart is added on the same tick\n // and because of bubbling,\n // it'll execute this on the same touchstart.\n // this filters out the same touchstart event.\n if (e1 === e2) return\n\n cleanup()\n\n // already handled\n if (e2.defaultPrevented) return\n\n // overwrite these functions so that they all to both start and events.\n var preventDefault = e1.preventDefault\n var stopPropagation = e1.stopPropagation\n\n e1.stopPropagation = function () {\n stopPropagation.call(e1)\n stopPropagation.call(e2)\n }\n\n e1.preventDefault = function () {\n preventDefault.call(e1)\n preventDefault.call(e2)\n }\n\n // calls the handler with the `end` event,\n // but i don't think it matters.\n callback.apply(context, args)\n }\n\n // cleanup end events\n // to cancel the tap, just run this early\n function cleanup(e2) {\n // if it's the same event as the origin,\n // then don't actually cleanup.\n // hit issues with this - don't remember\n if (e1 === e2) return\n\n clearTimeout(timeout_id)\n\n el.removeEventListener('touchmove', cleanup)\n\n endEvents.forEach(function (event) {\n el.removeEventListener(event, done)\n })\n }\n }\n}\n","/*!\n * Bean - copyright (c) Jacob Thornton 2011-2012\n * https://github.com/fat/bean\n * MIT license\n */\n(function (name, context, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports = definition()\n else if (typeof define == 'function' && define.amd) define(definition)\n else context[name] = definition()\n})('bean', this, function (name, context) {\n name = name || 'bean'\n context = context || this\n\n var win = window\n , old = context[name]\n , namespaceRegex = /[^\\.]*(?=\\..*)\\.|.*/\n , nameRegex = /\\..*/\n , addEvent = 'addEventListener'\n , removeEvent = 'removeEventListener'\n , doc = document || {}\n , root = doc.documentElement || {}\n , W3C_MODEL = root[addEvent]\n , eventSupport = W3C_MODEL ? addEvent : 'attachEvent'\n , ONE = {} // singleton for quick matching making add() do one()\n\n , slice = Array.prototype.slice\n , str2arr = function (s, d) { return s.split(d || ' ') }\n , isString = function (o) { return typeof o == 'string' }\n , isFunction = function (o) { return typeof o == 'function' }\n\n // events that we consider to be 'native', anything not in this list will\n // be treated as a custom event\n , standardNativeEvents =\n 'click dblclick mouseup mousedown contextmenu ' + // mouse buttons\n 'mousewheel mousemultiwheel DOMMouseScroll ' + // mouse wheel\n 'mouseover mouseout mousemove selectstart selectend ' + // mouse movement\n 'keydown keypress keyup ' + // keyboard\n 'orientationchange ' + // mobile\n 'focus blur change reset select submit ' + // form elements\n 'load unload beforeunload resize move DOMContentLoaded ' + // window\n 'readystatechange message ' + // window\n 'error abort scroll ' // misc\n // element.fireEvent('onXYZ'... is not forgiving if we try to fire an event\n // that doesn't actually exist, so make sure we only do these on newer browsers\n , w3cNativeEvents =\n 'show ' + // mouse buttons\n 'input invalid ' + // form elements\n 'touchstart touchmove touchend touchcancel ' + // touch\n 'gesturestart gesturechange gestureend ' + // gesture\n 'textinput ' + // TextEvent\n 'readystatechange pageshow pagehide popstate ' + // window\n 'hashchange offline online ' + // window\n 'afterprint beforeprint ' + // printing\n 'dragstart dragenter dragover dragleave drag drop dragend ' + // dnd\n 'loadstart progress suspend emptied stalled loadmetadata ' + // media\n 'loadeddata canplay canplaythrough playing waiting seeking ' + // media\n 'seeked ended durationchange timeupdate play pause ratechange ' + // media\n 'volumechange cuechange ' + // media\n 'checking noupdate downloading cached updateready obsolete ' // appcache\n\n // convert to a hash for quick lookups\n , nativeEvents = (function (hash, events, i) {\n for (i = 0; i < events.length; i++) events[i] && (hash[events[i]] = 1)\n return hash\n }({}, str2arr(standardNativeEvents + (W3C_MODEL ? w3cNativeEvents : ''))))\n\n // custom events are events that we *fake*, they are not provided natively but\n // we can use native events to generate them\n , customEvents = (function () {\n var isAncestor = 'compareDocumentPosition' in root\n ? function (element, container) {\n return container.compareDocumentPosition && (container.compareDocumentPosition(element) & 16) === 16\n }\n : 'contains' in root\n ? function (element, container) {\n container = container.nodeType === 9 || container === window ? root : container\n return container !== element && container.contains(element)\n }\n : function (element, container) {\n while (element = element.parentNode) if (element === container) return 1\n return 0\n }\n , check = function (event) {\n var related = event.relatedTarget\n return !related\n ? related == null\n : (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString())\n && !isAncestor(related, this))\n }\n\n return {\n mouseenter: { base: 'mouseover', condition: check }\n , mouseleave: { base: 'mouseout', condition: check }\n , mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' }\n }\n }())\n\n // we provide a consistent Event object across browsers by taking the actual DOM\n // event object and generating a new one from its properties.\n , Event = (function () {\n // a whitelist of properties (for different event types) tells us what to check for and copy\n var commonProps = str2arr('altKey attrChange attrName bubbles cancelable ctrlKey currentTarget ' +\n 'detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey ' +\n 'srcElement target timeStamp type view which propertyName')\n , mouseProps = commonProps.concat(str2arr('button buttons clientX clientY dataTransfer ' +\n 'fromElement offsetX offsetY pageX pageY screenX screenY toElement'))\n , mouseWheelProps = mouseProps.concat(str2arr('wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ ' +\n 'axis')) // 'axis' is FF specific\n , keyProps = commonProps.concat(str2arr('char charCode key keyCode keyIdentifier ' +\n 'keyLocation location'))\n , textProps = commonProps.concat(str2arr('data'))\n , touchProps = commonProps.concat(str2arr('touches targetTouches changedTouches scale rotation'))\n , messageProps = commonProps.concat(str2arr('data origin source'))\n , stateProps = commonProps.concat(str2arr('state'))\n , overOutRegex = /over|out/\n // some event types need special handling and some need special properties, do that all here\n , typeFixers = [\n { // key events\n reg: /key/i\n , fix: function (event, newEvent) {\n newEvent.keyCode = event.keyCode || event.which\n return keyProps\n }\n }\n , { // mouse events\n reg: /click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i\n , fix: function (event, newEvent, type) {\n newEvent.rightClick = event.which === 3 || event.button === 2\n newEvent.pos = { x: 0, y: 0 }\n if (event.pageX || event.pageY) {\n newEvent.clientX = event.pageX\n newEvent.clientY = event.pageY\n } else if (event.clientX || event.clientY) {\n newEvent.clientX = event.clientX + doc.body.scrollLeft + root.scrollLeft\n newEvent.clientY = event.clientY + doc.body.scrollTop + root.scrollTop\n }\n if (overOutRegex.test(type)) {\n newEvent.relatedTarget = event.relatedTarget\n || event[(type == 'mouseover' ? 'from' : 'to') + 'Element']\n }\n return mouseProps\n }\n }\n , { // mouse wheel events\n reg: /mouse.*(wheel|scroll)/i\n , fix: function () { return mouseWheelProps }\n }\n , { // TextEvent\n reg: /^text/i\n , fix: function () { return textProps }\n }\n , { // touch and gesture events\n reg: /^touch|^gesture/i\n , fix: function () { return touchProps }\n }\n , { // message events\n reg: /^message$/i\n , fix: function () { return messageProps }\n }\n , { // popstate events\n reg: /^popstate$/i\n , fix: function () { return stateProps }\n }\n , { // everything else\n reg: /.*/\n , fix: function () { return commonProps }\n }\n ]\n , typeFixerMap = {} // used to map event types to fixer functions (above), a basic cache mechanism\n\n , Event = function (event, element, isNative) {\n if (!arguments.length) return\n event = event || ((element.ownerDocument || element.document || element).parentWindow || win).event\n this.originalEvent = event\n this.isNative = isNative\n this.isBean = true\n\n if (!event) return\n\n var type = event.type\n , target = event.target || event.srcElement\n , i, l, p, props, fixer\n\n this.target = target && target.nodeType === 3 ? target.parentNode : target\n\n if (isNative) { // we only need basic augmentation on custom events, the rest expensive & pointless\n fixer = typeFixerMap[type]\n if (!fixer) { // haven't encountered this event type before, map a fixer function for it\n for (i = 0, l = typeFixers.length; i < l; i++) {\n if (typeFixers[i].reg.test(type)) { // guaranteed to match at least one, last is .*\n typeFixerMap[type] = fixer = typeFixers[i].fix\n break\n }\n }\n }\n\n props = fixer(event, this, type)\n for (i = props.length; i--;) {\n if (!((p = props[i]) in this) && p in event) this[p] = event[p]\n }\n }\n }\n\n // preventDefault() and stopPropagation() are a consistent interface to those functions\n // on the DOM, stop() is an alias for both of them together\n Event.prototype.preventDefault = function () {\n if (this.originalEvent.preventDefault) this.originalEvent.preventDefault()\n else this.originalEvent.returnValue = false\n }\n Event.prototype.stopPropagation = function () {\n if (this.originalEvent.stopPropagation) this.originalEvent.stopPropagation()\n else this.originalEvent.cancelBubble = true\n }\n Event.prototype.stop = function () {\n this.preventDefault()\n this.stopPropagation()\n this.stopped = true\n }\n // stopImmediatePropagation() has to be handled internally because we manage the event list for\n // each element\n // note that originalElement may be a Bean#Event object in some situations\n Event.prototype.stopImmediatePropagation = function () {\n if (this.originalEvent.stopImmediatePropagation) this.originalEvent.stopImmediatePropagation()\n this.isImmediatePropagationStopped = function () { return true }\n }\n Event.prototype.isImmediatePropagationStopped = function () {\n return this.originalEvent.isImmediatePropagationStopped && this.originalEvent.isImmediatePropagationStopped()\n }\n Event.prototype.clone = function (currentTarget) {\n //TODO: this is ripe for optimisation, new events are *expensive*\n // improving this will speed up delegated events\n var ne = new Event(this, this.element, this.isNative)\n ne.currentTarget = currentTarget\n return ne\n }\n\n return Event\n }())\n\n // if we're in old IE we can't do onpropertychange on doc or win so we use doc.documentElement for both\n , targetElement = function (element, isNative) {\n return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element\n }\n\n /**\n * Bean maintains an internal registry for event listeners. We don't touch elements, objects\n * or functions to identify them, instead we store everything in the registry.\n * Each event listener has a RegEntry object, we have one 'registry' for the whole instance.\n */\n , RegEntry = (function () {\n // each handler is wrapped so we can handle delegation and custom events\n var wrappedHandler = function (element, fn, condition, args) {\n var call = function (event, eargs) {\n return fn.apply(element, args ? slice.call(eargs, event ? 0 : 1).concat(args) : eargs)\n }\n , findTarget = function (event, eventElement) {\n return fn.__beanDel ? fn.__beanDel.ft(event.target, element) : eventElement\n }\n , handler = condition\n ? function (event) {\n var target = findTarget(event, this) // deleated event\n if (condition.apply(target, arguments)) {\n if (event) event.currentTarget = target\n return call(event, arguments)\n }\n }\n : function (event) {\n if (fn.__beanDel) event = event.clone(findTarget(event)) // delegated event, fix the fix\n return call(event, arguments)\n }\n handler.__beanDel = fn.__beanDel\n return handler\n }\n\n , RegEntry = function (element, type, handler, original, namespaces, args, root) {\n var customType = customEvents[type]\n , isNative\n\n if (type == 'unload') {\n // self clean-up\n handler = once(removeListener, element, type, handler, original)\n }\n\n if (customType) {\n if (customType.condition) {\n handler = wrappedHandler(element, handler, customType.condition, args)\n }\n type = customType.base || type\n }\n\n this.isNative = isNative = nativeEvents[type] && !!element[eventSupport]\n this.customType = !W3C_MODEL && !isNative && type\n this.element = element\n this.type = type\n this.original = original\n this.namespaces = namespaces\n this.eventType = W3C_MODEL || isNative ? type : 'propertychange'\n this.target = targetElement(element, isNative)\n this[eventSupport] = !!this.target[eventSupport]\n this.root = root\n this.handler = wrappedHandler(element, handler, null, args)\n }\n\n // given a list of namespaces, is our entry in any of them?\n RegEntry.prototype.inNamespaces = function (checkNamespaces) {\n var i, j, c = 0\n if (!checkNamespaces) return true\n if (!this.namespaces) return false\n for (i = checkNamespaces.length; i--;) {\n for (j = this.namespaces.length; j--;) {\n if (checkNamespaces[i] == this.namespaces[j]) c++\n }\n }\n return checkNamespaces.length === c\n }\n\n // match by element, original fn (opt), handler fn (opt)\n RegEntry.prototype.matches = function (checkElement, checkOriginal, checkHandler) {\n return this.element === checkElement &&\n (!checkOriginal || this.original === checkOriginal) &&\n (!checkHandler || this.handler === checkHandler)\n }\n\n return RegEntry\n }())\n\n , registry = (function () {\n // our map stores arrays by event type, just because it's better than storing\n // everything in a single array.\n // uses '$' as a prefix for the keys for safety and 'r' as a special prefix for\n // rootListeners so we can look them up fast\n var map = {}\n\n // generic functional search of our registry for matching listeners,\n // `fn` returns false to break out of the loop\n , forAll = function (element, type, original, handler, root, fn) {\n var pfx = root ? 'r' : '$'\n if (!type || type == '*') {\n // search the whole registry\n for (var t in map) {\n if (t.charAt(0) == pfx) {\n forAll(element, t.substr(1), original, handler, root, fn)\n }\n }\n } else {\n var i = 0, l, list = map[pfx + type], all = element == '*'\n if (!list) return\n for (l = list.length; i < l; i++) {\n if ((all || list[i].matches(element, original, handler)) && !fn(list[i], list, i, type)) return\n }\n }\n }\n\n , has = function (element, type, original, root) {\n // we're not using forAll here simply because it's a bit slower and this\n // needs to be fast\n var i, list = map[(root ? 'r' : '$') + type]\n if (list) {\n for (i = list.length; i--;) {\n if (!list[i].root && list[i].matches(element, original, null)) return true\n }\n }\n return false\n }\n\n , get = function (element, type, original, root) {\n var entries = []\n forAll(element, type, original, null, root, function (entry) {\n return entries.push(entry)\n })\n return entries\n }\n\n , put = function (entry) {\n var has = !entry.root && !this.has(entry.element, entry.type, null, false)\n , key = (entry.root ? 'r' : '$') + entry.type\n ;(map[key] || (map[key] = [])).push(entry)\n return has\n }\n\n , del = function (entry) {\n forAll(entry.element, entry.type, null, entry.handler, entry.root, function (entry, list, i) {\n list.splice(i, 1)\n entry.removed = true\n if (list.length === 0) delete map[(entry.root ? 'r' : '$') + entry.type]\n return false\n })\n }\n\n // dump all entries, used for onunload\n , entries = function () {\n var t, entries = []\n for (t in map) {\n if (t.charAt(0) == '$') entries = entries.concat(map[t])\n }\n return entries\n }\n\n return { has: has, get: get, put: put, del: del, entries: entries }\n }())\n\n // we need a selector engine for delegated events, use querySelectorAll if it exists\n // but for older browsers we need Qwery, Sizzle or similar\n , selectorEngine\n , setSelectorEngine = function (e) {\n if (!arguments.length) {\n selectorEngine = doc.querySelectorAll\n ? function (s, r) {\n return r.querySelectorAll(s)\n }\n : function () {\n throw new Error('Bean: No selector engine installed') // eeek\n }\n } else {\n selectorEngine = e\n }\n }\n\n // we attach this listener to each DOM event that we need to listen to, only once\n // per event type per DOM element\n , rootListener = function (event, type) {\n if (!W3C_MODEL && type && event && event.propertyName != '_on' + type) return\n\n var listeners = registry.get(this, type || event.type, null, false)\n , l = listeners.length\n , i = 0\n\n event = new Event(event, this, true)\n if (type) event.type = type\n\n // iterate through all handlers registered for this type, calling them unless they have\n // been removed by a previous handler or stopImmediatePropagation() has been called\n for (; i < l && !event.isImmediatePropagationStopped(); i++) {\n if (!listeners[i].removed) listeners[i].handler.call(this, event)\n }\n }\n\n // add and remove listeners to DOM elements\n , listener = W3C_MODEL\n ? function (element, type, add) {\n // new browsers\n element[add ? addEvent : removeEvent](type, rootListener, false)\n }\n : function (element, type, add, custom) {\n // IE8 and below, use attachEvent/detachEvent and we have to piggy-back propertychange events\n // to simulate event bubbling etc.\n var entry\n if (add) {\n registry.put(entry = new RegEntry(\n element\n , custom || type\n , function (event) { // handler\n rootListener.call(element, event, custom)\n }\n , rootListener\n , null\n , null\n , true // is root\n ))\n if (custom && element['_on' + custom] == null) element['_on' + custom] = 0\n entry.target.attachEvent('on' + entry.eventType, entry.handler)\n } else {\n entry = registry.get(element, custom || type, rootListener, true)[0]\n if (entry) {\n entry.target.detachEvent('on' + entry.eventType, entry.handler)\n registry.del(entry)\n }\n }\n }\n\n , once = function (rm, element, type, fn, originalFn) {\n // wrap the handler in a handler that does a remove as well\n return function () {\n fn.apply(this, arguments)\n rm(element, type, originalFn)\n }\n }\n\n , removeListener = function (element, orgType, handler, namespaces) {\n var type = orgType && orgType.replace(nameRegex, '')\n , handlers = registry.get(element, type, null, false)\n , removed = {}\n , i, l\n\n for (i = 0, l = handlers.length; i < l; i++) {\n if ((!handler || handlers[i].original === handler) && handlers[i].inNamespaces(namespaces)) {\n // TODO: this is problematic, we have a registry.get() and registry.del() that\n // both do registry searches so we waste cycles doing this. Needs to be rolled into\n // a single registry.forAll(fn) that removes while finding, but the catch is that\n // we'll be splicing the arrays that we're iterating over. Needs extra tests to\n // make sure we don't screw it up. @rvagg\n registry.del(handlers[i])\n if (!removed[handlers[i].eventType] && handlers[i][eventSupport])\n removed[handlers[i].eventType] = { t: handlers[i].eventType, c: handlers[i].type }\n }\n }\n // check each type/element for removed listeners and remove the rootListener where it's no longer needed\n for (i in removed) {\n if (!registry.has(element, removed[i].t, null, false)) {\n // last listener of this type, remove the rootListener\n listener(element, removed[i].t, false, removed[i].c)\n }\n }\n }\n\n // set up a delegate helper using the given selector, wrap the handler function\n , delegate = function (selector, fn) {\n //TODO: findTarget (therefore $) is called twice, once for match and once for\n // setting e.currentTarget, fix this so it's only needed once\n var findTarget = function (target, root) {\n var i, array = isString(selector) ? selectorEngine(selector, root) : selector\n for (; target && target !== root; target = target.parentNode) {\n for (i = array.length; i--;) {\n if (array[i] === target) return target\n }\n }\n }\n , handler = function (e) {\n var match = findTarget(e.target, this)\n if (match) fn.apply(match, arguments)\n }\n\n // __beanDel isn't pleasant but it's a private function, not exposed outside of Bean\n handler.__beanDel = {\n ft : findTarget // attach it here for customEvents to use too\n , selector : selector\n }\n return handler\n }\n\n , fireListener = W3C_MODEL ? function (isNative, type, element) {\n // modern browsers, do a proper dispatchEvent()\n var evt = doc.createEvent(isNative ? 'HTMLEvents' : 'UIEvents')\n evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, win, 1)\n element.dispatchEvent(evt)\n } : function (isNative, type, element) {\n // old browser use onpropertychange, just increment a custom property to trigger the event\n element = targetElement(element, isNative)\n isNative ? element.fireEvent('on' + type, doc.createEventObject()) : element['_on' + type]++\n }\n\n /**\n * Public API: off(), on(), add(), (remove()), one(), fire(), clone()\n */\n\n /**\n * off(element[, eventType(s)[, handler ]])\n */\n , off = function (element, typeSpec, fn) {\n var isTypeStr = isString(typeSpec)\n , k, type, namespaces, i\n\n if (isTypeStr && typeSpec.indexOf(' ') > 0) {\n // off(el, 't1 t2 t3', fn) or off(el, 't1 t2 t3')\n typeSpec = str2arr(typeSpec)\n for (i = typeSpec.length; i--;)\n off(element, typeSpec[i], fn)\n return element\n }\n\n type = isTypeStr && typeSpec.replace(nameRegex, '')\n if (type && customEvents[type]) type = customEvents[type].base\n\n if (!typeSpec || isTypeStr) {\n // off(el) or off(el, t1.ns) or off(el, .ns) or off(el, .ns1.ns2.ns3)\n if (namespaces = isTypeStr && typeSpec.replace(namespaceRegex, '')) namespaces = str2arr(namespaces, '.')\n removeListener(element, type, fn, namespaces)\n } else if (isFunction(typeSpec)) {\n // off(el, fn)\n removeListener(element, null, typeSpec)\n } else {\n // off(el, { t1: fn1, t2, fn2 })\n for (k in typeSpec) {\n if (typeSpec.hasOwnProperty(k)) off(element, k, typeSpec[k])\n }\n }\n\n return element\n }\n\n /**\n * on(element, eventType(s)[, selector], handler[, args ])\n */\n , on = function(element, events, selector, fn) {\n var originalFn, type, types, i, args, entry, first\n\n //TODO: the undefined check means you can't pass an 'args' argument, fix this perhaps?\n if (selector === undefined && typeof events == 'object') {\n //TODO: this can't handle delegated events\n for (type in events) {\n if (events.hasOwnProperty(type)) {\n on.call(this, element, type, events[type])\n }\n }\n return\n }\n\n if (!isFunction(selector)) {\n // delegated event\n originalFn = fn\n args = slice.call(arguments, 4)\n fn = delegate(selector, originalFn, selectorEngine)\n } else {\n args = slice.call(arguments, 3)\n fn = originalFn = selector\n }\n\n types = str2arr(events)\n\n // special case for one(), wrap in a self-removing handler\n if (this === ONE) {\n fn = once(off, element, events, fn, originalFn)\n }\n\n for (i = types.length; i--;) {\n // add new handler to the registry and check if it's the first for this element/type\n first = registry.put(entry = new RegEntry(\n element\n , types[i].replace(nameRegex, '') // event type\n , fn\n , originalFn\n , str2arr(types[i].replace(namespaceRegex, ''), '.') // namespaces\n , args\n , false // not root\n ))\n if (entry[eventSupport] && first) {\n // first event of this type on this element, add root listener\n listener(element, entry.eventType, true, entry.customType)\n }\n }\n\n return element\n }\n\n /**\n * add(element[, selector], eventType(s), handler[, args ])\n *\n * Deprecated: kept (for now) for backward-compatibility\n */\n , add = function (element, events, fn, delfn) {\n return on.apply(\n null\n , !isString(fn)\n ? slice.call(arguments)\n : [ element, fn, events, delfn ].concat(arguments.length > 3 ? slice.call(arguments, 5) : [])\n )\n }\n\n /**\n * one(element, eventType(s)[, selector], handler[, args ])\n */\n , one = function () {\n return on.apply(ONE, arguments)\n }\n\n /**\n * fire(element, eventType(s)[, args ])\n *\n * The optional 'args' argument must be an array, if no 'args' argument is provided\n * then we can use the browser's DOM event system, otherwise we trigger handlers manually\n */\n , fire = function (element, type, args) {\n var types = str2arr(type)\n , i, j, l, names, handlers\n\n for (i = types.length; i--;) {\n type = types[i].replace(nameRegex, '')\n if (names = types[i].replace(namespaceRegex, '')) names = str2arr(names, '.')\n if (!names && !args && element[eventSupport]) {\n fireListener(nativeEvents[type], type, element)\n } else {\n // non-native event, either because of a namespace, arguments or a non DOM element\n // iterate over all listeners and manually 'fire'\n handlers = registry.get(element, type, null, false)\n args = [false].concat(args)\n for (j = 0, l = handlers.length; j < l; j++) {\n if (handlers[j].inNamespaces(names)) {\n handlers[j].handler.apply(element, args)\n }\n }\n }\n }\n return element\n }\n\n /**\n * clone(dstElement, srcElement[, eventType ])\n *\n * TODO: perhaps for consistency we should allow the same flexibility in type specifiers?\n */\n , clone = function (element, from, type) {\n var handlers = registry.get(from, type, null, false)\n , l = handlers.length\n , i = 0\n , args, beanDel\n\n for (; i < l; i++) {\n if (handlers[i].original) {\n args = [ element, handlers[i].type ]\n if (beanDel = handlers[i].handler.__beanDel) args.push(beanDel.selector)\n args.push(handlers[i].original)\n on.apply(null, args)\n }\n }\n return element\n }\n\n , bean = {\n 'on' : on\n , 'add' : add\n , 'one' : one\n , 'off' : off\n , 'remove' : off\n , 'clone' : clone\n , 'fire' : fire\n , 'Event' : Event\n , 'setSelectorEngine' : setSelectorEngine\n , 'noConflict' : function () {\n context[name] = old\n return this\n }\n }\n\n // for IE, clean up on unload to avoid leaks\n if (win.attachEvent) {\n var cleanup = function () {\n var i, entries = registry.entries()\n for (i in entries) {\n if (entries[i].type && entries[i].type !== 'unload') off(entries[i].element, entries[i].type)\n }\n win.detachEvent('onunload', cleanup)\n win.CollectGarbage && win.CollectGarbage()\n }\n win.attachEvent('onunload', cleanup)\n }\n\n // initialize selector engine to internal default (qSA or throw Error)\n setSelectorEngine()\n\n return bean\n});\n","// keymaster.js\n// (c) 2011-2013 Thomas Fuchs\n// keymaster.js may be freely distributed under the MIT license.\n\n;(function(global){\n var k,\n _handlers = {},\n _mods = { 16: false, 18: false, 17: false, 91: false },\n _scope = 'all',\n // modifier keys\n _MODIFIERS = {\n '⇧': 16, shift: 16,\n '⌥': 18, alt: 18, option: 18,\n '⌃': 17, ctrl: 17, control: 17,\n '⌘': 91, command: 91\n },\n // special keys\n _MAP = {\n backspace: 8, tab: 9, clear: 12,\n enter: 13, 'return': 13,\n esc: 27, escape: 27, space: 32,\n left: 37, up: 38,\n right: 39, down: 40,\n del: 46, 'delete': 46,\n home: 36, end: 35,\n pageup: 33, pagedown: 34,\n ',': 188, '.': 190, '/': 191,\n '`': 192, '-': 189, '=': 187,\n ';': 186, '\\'': 222,\n '[': 219, ']': 221, '\\\\': 220\n },\n code = function(x){\n return _MAP[x] || x.toUpperCase().charCodeAt(0);\n },\n _downKeys = [];\n\n for(k=1;k<20;k++) _MAP['f'+k] = 111+k;\n\n // IE doesn't support Array#indexOf, so have a simple replacement\n function index(array, item){\n var i = array.length;\n while(i--) if(array[i]===item) return i;\n return -1;\n }\n\n // for comparing mods before unassignment\n function compareArray(a1, a2) {\n if (a1.length != a2.length) return false;\n for (var i = 0; i < a1.length; i++) {\n if (a1[i] !== a2[i]) return false;\n }\n return true;\n }\n\n var modifierMap = {\n 16:'shiftKey',\n 18:'altKey',\n 17:'ctrlKey',\n 91:'metaKey'\n };\n function updateModifierKey(event) {\n for(k in _mods) _mods[k] = event[modifierMap[k]];\n };\n\n // handle keydown event\n function dispatch(event) {\n var key, handler, k, i, modifiersMatch, scope;\n key = event.keyCode;\n\n if (index(_downKeys, key) == -1) {\n _downKeys.push(key);\n }\n\n // if a modifier key, set the key.<modifierkeyname> property to true and return\n if(key == 93 || key == 224) key = 91; // right command on webkit, command on Gecko\n if(key in _mods) {\n _mods[key] = true;\n // 'assignKey' from inside this closure is exported to window.key\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = true;\n return;\n }\n updateModifierKey(event);\n\n // see if we need to ignore the keypress (filter() can can be overridden)\n // by default ignore key presses if a select, textarea, or input is focused\n if(!assignKey.filter.call(this, event)) return;\n\n // abort if no potentially matching shortcuts found\n if (!(key in _handlers)) return;\n\n scope = getScope();\n\n // for each potential shortcut\n for (i = 0; i < _handlers[key].length; i++) {\n handler = _handlers[key][i];\n\n // see if it's in the current scope\n if(handler.scope == scope || handler.scope == 'all'){\n // check if modifiers match if any\n modifiersMatch = handler.mods.length > 0;\n for(k in _mods)\n if((!_mods[k] && index(handler.mods, +k) > -1) ||\n (_mods[k] && index(handler.mods, +k) == -1)) modifiersMatch = false;\n // call the handler and stop the event if neccessary\n if((handler.mods.length == 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91]) || modifiersMatch){\n if(handler.method(event, handler)===false){\n if(event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n if(event.stopPropagation) event.stopPropagation();\n if(event.cancelBubble) event.cancelBubble = true;\n }\n }\n }\n }\n };\n\n // unset modifier keys on keyup\n function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n };\n\n function resetModifiers() {\n for(k in _mods) _mods[k] = false;\n for(k in _MODIFIERS) assignKey[k] = false;\n };\n\n // parse and assign shortcut\n function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n };\n\n // unbind all handlers for given key in current scope\n function unbindKey(key, scope) {\n var multipleKeys, keys,\n mods = [],\n i, j, obj;\n\n multipleKeys = getKeys(key);\n\n for (j = 0; j < multipleKeys.length; j++) {\n keys = multipleKeys[j].split('+');\n\n if (keys.length > 1) {\n mods = getMods(keys);\n key = keys[keys.length - 1];\n }\n\n key = code(key);\n\n if (scope === undefined) {\n scope = getScope();\n }\n if (!_handlers[key]) {\n return;\n }\n for (i = 0; i < _handlers[key].length; i++) {\n obj = _handlers[key][i];\n // only clear handlers if correct scope and mods match\n if (obj.scope === scope && compareArray(obj.mods, mods)) {\n _handlers[key][i] = {};\n }\n }\n }\n };\n\n // Returns true if the key with code 'keyCode' is currently down\n // Converts strings into key codes.\n function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }\n\n function getPressedKeyCodes() {\n return _downKeys.slice(0);\n }\n\n function filter(event){\n var tagName = (event.target || event.srcElement).tagName;\n // ignore keypressed in any elements that support keyboard data input\n return !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');\n }\n\n // initialize key.<modifier> to false\n for(k in _MODIFIERS) assignKey[k] = false;\n\n // set current scope (default 'all')\n function setScope(scope){ _scope = scope || 'all' };\n function getScope(){ return _scope || 'all' };\n\n // delete all handlers for a given scope\n function deleteScope(scope){\n var key, handlers, i;\n\n for (key in _handlers) {\n handlers = _handlers[key];\n for (i = 0; i < handlers.length; ) {\n if (handlers[i].scope === scope) handlers.splice(i, 1);\n else i++;\n }\n }\n };\n\n // abstract key logic for assign and unassign\n function getKeys(key) {\n var keys;\n key = key.replace(/\\s/g, '');\n keys = key.split(',');\n if ((keys[keys.length - 1]) == '') {\n keys[keys.length - 2] += ',';\n }\n return keys;\n }\n\n // abstract mods logic for assign and unassign\n function getMods(key) {\n var mods = key.slice(0, key.length - 1);\n for (var mi = 0; mi < mods.length; mi++)\n mods[mi] = _MODIFIERS[mods[mi]];\n return mods;\n }\n\n // cross-browser events\n function addEvent(object, event, method) {\n if (object.addEventListener)\n object.addEventListener(event, method, false);\n else if(object.attachEvent)\n object.attachEvent('on'+event, function(){ method(window.event) });\n };\n\n // set the handlers globally on document\n addEvent(document, 'keydown', function(event) { dispatch(event) }); // Passing _scope to a callback to ensure it remains the same by execution. Fixes #48\n addEvent(document, 'keyup', clearModifier);\n\n // reset modifiers to false whenever the window is (re)focused.\n addEvent(window, 'focus', resetModifiers);\n\n // store previously defined key\n var previousKey = global.key;\n\n // restore previously defined key and return reference to our key object\n function noConflict() {\n var k = global.key;\n global.key = previousKey;\n return k;\n }\n\n // set window.key and window.key.set/get/deleteScope, and the default filter\n global.key = assignKey;\n global.key.setScope = setScope;\n global.key.getScope = getScope;\n global.key.deleteScope = deleteScope;\n global.key.filter = filter;\n global.key.isPressed = isPressed;\n global.key.getPressedKeyCodes = getPressedKeyCodes;\n global.key.noConflict = noConflict;\n global.key.unbind = unbindKey;\n\n if(typeof module !== 'undefined') module.exports = assignKey;\n\n})(this);\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// This is CodeMirror (http://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n module.exports = mod();\n else if (typeof define == \"function\" && define.amd) // AMD\n return define([], mod);\n else // Plain browser env\n (this || window).CodeMirror = mod();\n})(function() {\n \"use strict\";\n\n // BROWSER SNIFFING\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]);\n var webkit = /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) presto_version = Number(presto_version[1]);\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n // EDITOR CONSTRUCTOR\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") doc = new Doc(doc, options.mode, null, options.lineSeparator);\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n this.display.wrapper.className += \" CodeMirror-wrap\";\n if (options.autofocus && !mobile) display.input.focus();\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n var cm = this;\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20);\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || cm.hasFocus())\n setTimeout(bind(onFocus, this), 20);\n else\n onBlur(this);\n\n for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt))\n optionHandlers[opt](this, options[opt], Init);\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) options.finishInit(this);\n for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n display.lineDiv.style.textRendering = \"auto\";\n }\n\n // DISPLAY CONSTRUCTOR\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) d.scroller.draggable = true;\n\n if (place) {\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // STATE UPDATES\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function(line) {\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n });\n cm.doc.frontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) regChange(cm);\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function(){updateScrollbars(cm);}, 100);\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function(line) {\n var estHeight = est(line);\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n });\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n setTimeout(function(){alignHorizontally(cm);}, 20);\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }\n\n function NativeScrollbars(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function() {\n if (vert.clientHeight) scroll(vert.scrollTop, \"vertical\");\n });\n on(horiz, \"scroll\", function() {\n if (horiz.clientWidth) scroll(horiz.scrollLeft, \"horizontal\");\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\";\n }\n\n NativeScrollbars.prototype = copyObj({\n update: function(measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) this.zeroWidthHack();\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0};\n },\n setScrollLeft: function(pos) {\n if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos;\n if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz);\n },\n setScrollTop: function(pos) {\n if (this.vert.scrollTop != pos) this.vert.scrollTop = pos;\n if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert);\n },\n zeroWidthHack: function() {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n },\n enableZeroWidthBar: function(bar, delay) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // left corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = document.elementFromPoint(box.left + 1, box.bottom - 1);\n if (elt != bar) bar.style.pointerEvents = \"none\";\n else delay.set(1000, maybeDisable);\n }\n delay.set(1000, maybeDisable);\n },\n clear: function() {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n }\n }, NativeScrollbars.prototype);\n\n function NullScrollbars() {}\n\n NullScrollbars.prototype = copyObj({\n update: function() { return {bottom: 0, right: 0}; },\n setScrollLeft: function() {},\n setScrollTop: function() {},\n clear: function() {}\n }, NullScrollbars.prototype);\n\n CodeMirror.scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n rmClass(cm.display.wrapper, cm.display.scrollbars.addClass);\n }\n\n cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function() {\n if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0);\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function(pos, axis) {\n if (axis == \"horizontal\") setScrollLeft(cm, pos);\n else setScrollTop(cm, pos);\n }, cm);\n if (cm.display.scrollbars.addClass)\n addClass(cm.display.wrapper, cm.display.scrollbars.addClass);\n }\n\n function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n updateHeightsInViewport(cm);\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }\n\n // LINE NUMBERS\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber));\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }\n\n // DISPLAY DRAWING\n\n function DisplayUpdate(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n }\n\n DisplayUpdate.prototype.signal = function(emitter, type) {\n if (hasHandler(emitter, type))\n this.events.push(arguments);\n };\n DisplayUpdate.prototype.finish = function() {\n for (var i = 0; i < this.events.length; i++)\n signal.apply(null, this.events[i]);\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)};\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n break;\n }\n if (!updateDisplayIfNeeded(cm, update)) break;\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }\n\n function updateLineBackground(lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) cls += \" CodeMirror-linebackground\";\n if (lineView.background) {\n if (cls) lineView.background.className = cls;\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(lineView) {\n updateLineBackground(lineView);\n if (lineView.line.wrapClass)\n ensureLineWrapped(lineView).className = lineView.line.wrapClass;\n else if (lineView.node != lineView.text)\n lineView.node.className = \"\";\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n \"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) +\n \"px; width: \" + dims.gutterTotalWidth + \"px\");\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", \"left: \" +\n (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\");\n cm.display.input.setUneditable(gutterWrap);\n wrap.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n gutterWrap.className += \" \" + lineView.line.gutterClass;\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n \"left: \" + dims.gutterLeft[\"CodeMirror-linenumbers\"] + \"px; width: \"\n + cm.display.lineNumInnerWidth + \"px\"));\n if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\", \"left: \" +\n dims.gutterLeft[id] + \"px; width: \" + dims.gutterWidth[id] + \"px\"));\n }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) lineView.alignable = null;\n for (var node = lineView.node.firstChild, next; node; node = next) {\n var next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n lineView.node.removeChild(node);\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) return;\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) node.setAttribute(\"cm-ignore-events\", \"true\");\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n wrap.insertBefore(node, lineView.gutter || lineView.text);\n else\n wrap.appendChild(node);\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + \"px\";\n }\n }\n\n // POSITION OBJECT\n\n // A Pos instance represents a position within the text.\n var Pos = CodeMirror.Pos = function(line, ch) {\n if (!(this instanceof Pos)) return new Pos(line, ch);\n this.line = line; this.ch = ch;\n };\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; };\n\n function copyPos(x) {return Pos(x.line, x.ch);}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b; }\n\n // INPUT HANDLING\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) sel = doc.sel;\n\n var paste = cm.state.pasteIncoming || origin == \"paste\";\n var textLines = doc.splitLines(inserted), multiPaste = null\n // When pasing N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n multiPaste.push(doc.splitLines(lastCopied.text[i]));\n }\n } else if (textLines.length == sel.ranges.length) {\n multiPaste = map(textLines, function(l) { return [l]; });\n }\n }\n\n // Normal behavior is to insert the new text into every selection\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n from = Pos(from.line, from.ch - deleted);\n else if (cm.state.overwrite && !paste) // Handle overwrite\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n else if (lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n from = to = Pos(from.line, 0)\n }\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n triggerElectric(cm, inserted);\n\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"text/plain\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, \"paste\"); });\n return true;\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) return;\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue;\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n indented = indentLine(cm, range.head.line, \"smart\");\n }\n if (indented) signalLater(cm, \"electricInput\", cm, range.head.line);\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges};\n }\n\n function disableBrowserMagic(field) {\n field.setAttribute(\"autocorrect\", \"off\");\n field.setAttribute(\"autocapitalize\", \"off\");\n field.setAttribute(\"spellcheck\", \"false\");\n }\n\n // TEXTAREA INPUT STYLE\n\n function TextareaInput(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Tracks when input.reset has punted to just putting a short\n // string into the textarea instead of the full selection.\n this.inaccurateSelection = false;\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) te.style.width = \"1000px\";\n else te.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) te.style.border = \"1px solid black\";\n disableBrowserMagic(te);\n return div;\n }\n\n TextareaInput.prototype = copyObj({\n init: function(display) {\n var input = this, cm = this.cm;\n\n // Wraps and hides input textarea\n var div = this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var te = this.textarea = div.firstChild;\n display.wrapper.insertBefore(div, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) te.style.width = \"0px\";\n\n on(te, \"input\", function() {\n if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null;\n input.poll();\n });\n\n on(te, \"paste\", function(e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return\n\n cm.state.pasteIncoming = true;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) return\n if (cm.somethingSelected()) {\n lastCopied = {lineWise: false, text: cm.getSelections()};\n if (input.inaccurateSelection) {\n input.prevInput = \"\";\n input.inaccurateSelection = false;\n te.value = lastCopied.text.join(\"\\n\");\n selectInput(te);\n }\n } else if (!cm.options.lineWiseCopyCut) {\n return;\n } else {\n var ranges = copyableRanges(cm);\n lastCopied = {lineWise: true, text: ranges.text};\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") cm.state.cutIncoming = true;\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function(e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return;\n cm.state.pasteIncoming = true;\n input.focus();\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function(e) {\n if (!eventInWidget(display, e)) e_preventDefault(e);\n });\n\n on(te, \"compositionstart\", function() {\n var start = cm.getCursor(\"from\");\n if (input.composing) input.composing.range.clear()\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function() {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n },\n\n prepareSelection: function() {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result;\n },\n\n showSelection: function(drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n },\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n reset: function(typing) {\n if (this.contextMenuPending) return;\n var minimal, selected, cm = this.cm, doc = cm.doc;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) selectInput(this.textarea);\n if (ie && ie_version >= 9) this.hasSelection = content;\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) this.hasSelection = null;\n }\n this.inaccurateSelection = minimal;\n },\n\n getField: function() { return this.textarea; },\n\n supportsTouch: function() { return false; },\n\n focus: function() {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n },\n\n blur: function() { this.textarea.blur(); },\n\n resetPosition: function() {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n },\n\n receivedFocus: function() { this.slowPoll(); },\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n slowPoll: function() {\n var input = this;\n if (input.pollingFast) return;\n input.polling.set(this.cm.options.pollInterval, function() {\n input.poll();\n if (input.cm.state.focused) input.slowPoll();\n });\n },\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n fastPoll: function() {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n },\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n poll: function() {\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n return false;\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false;\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) prevInput = \"\\u200b\";\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\"); }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n\n var self = this;\n runInOp(cm, function() {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, self.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = self.prevInput = \"\";\n else self.prevInput = text;\n\n if (self.composing) {\n self.composing.range.clear();\n self.composing.range = cm.markText(self.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true;\n },\n\n ensurePolled: function() {\n if (this.pollingFast && this.poll()) this.pollingFast = false;\n },\n\n onKeyPress: function() {\n if (ie && ie_version >= 9) this.hasSelection = null;\n this.fastPoll();\n },\n\n onContextMenu: function(e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) return; // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n input.wrapper.style.cssText = \"position: absolute\"\n var wrapperBox = input.wrapper.getBoundingClientRect()\n te.style.cssText = \"position: absolute; width: 30px; height: 30px; top: \" + (e.clientY - wrapperBox.top - 5) +\n \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px; z-index: 1000; background: \" +\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") +\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) window.scrollTo(null, oldScrollY);\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) te.value = input.prevInput = \" \";\n input.contextMenuPending = true;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos);\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) prepareSelectAllHack();\n var i = 0, poll = function() {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\")\n operation(cm, commands.selectAll)(cm);\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);\n else display.input.reset();\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) prepareSelectAllHack();\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function() {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n },\n\n readOnlyChanged: function(val) {\n if (!val) this.reset();\n },\n\n setUneditable: nothing,\n\n needsContentAttribute: false\n }, TextareaInput.prototype);\n\n // CONTENTEDITABLE INPUT STYLE\n\n function ContentEditableInput(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.gracePeriod = false;\n }\n\n ContentEditableInput.prototype = copyObj({\n init: function(display) {\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div);\n\n on(div, \"paste\", function(e) {\n if (!signalDOMEvent(cm, e)) handlePaste(e, cm);\n })\n\n on(div, \"compositionstart\", function(e) {\n var data = e.data;\n input.composing = {sel: cm.doc.sel, data: data, startData: data};\n if (!data) return;\n var prim = cm.doc.sel.primary();\n var line = cm.getLine(prim.head.line);\n var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length));\n if (found > -1 && found <= prim.head.ch)\n input.composing.sel = simpleSelection(Pos(prim.head.line, found),\n Pos(prim.head.line, found + data.length));\n });\n on(div, \"compositionupdate\", function(e) {\n input.composing.data = e.data;\n });\n on(div, \"compositionend\", function(e) {\n var ours = input.composing;\n if (!ours) return;\n if (e.data != ours.startData && !/\\u200b/.test(e.data))\n ours.data = e.data;\n // Need a small delay to prevent other code (input event,\n // selection polling) from doing damage when fired right after\n // compositionend.\n setTimeout(function() {\n if (!ours.handled)\n input.applyComposition(ours);\n if (input.composing == ours)\n input.composing = null;\n }, 50);\n });\n\n on(div, \"touchstart\", function() {\n input.forceCompositionEnd();\n });\n\n on(div, \"input\", function() {\n if (input.composing) return;\n if (cm.isReadOnly() || !input.pollContent())\n runInOp(input.cm, function() {regChange(cm);});\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) return\n if (cm.somethingSelected()) {\n lastCopied = {lineWise: false, text: cm.getSelections()};\n if (e.type == \"cut\") cm.replaceSelection(\"\", null, \"cut\");\n } else if (!cm.options.lineWiseCopyCut) {\n return;\n } else {\n var ranges = copyableRanges(cm);\n lastCopied = {lineWise: true, text: ranges.text};\n if (e.type == \"cut\") {\n cm.operation(function() {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n if (e.clipboardData && !ios) {\n e.preventDefault();\n e.clipboardData.clearData();\n e.clipboardData.setData(\"text/plain\", lastCopied.text.join(\"\\n\"));\n } else {\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function() {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n }, 50);\n }\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n },\n\n prepareSelection: function() {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result;\n },\n\n showSelection: function(info, takeFocus) {\n if (!info || !this.cm.display.view.length) return;\n if (info.focus || takeFocus) this.showPrimarySelection();\n this.showMultipleSelections(info);\n },\n\n showPrimarySelection: function() {\n var sel = window.getSelection(), prim = this.cm.doc.sel.primary();\n var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&\n cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)\n return;\n\n var start = posToDOM(this.cm, prim.from());\n var end = posToDOM(this.cm, prim.to());\n if (!start && !end) return;\n\n var view = this.cm.display.view;\n var old = sel.rangeCount && sel.getRangeAt(0);\n if (!start) {\n start = {node: view[0].measure.map[2], offset: 0};\n } else if (!end) { // FIXME dangerously hacky\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n try { var rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && this.cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) sel.addRange(rng);\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) sel.addRange(old);\n else if (gecko) this.startGracePeriod();\n }\n this.rememberSelection();\n },\n\n startGracePeriod: function() {\n var input = this;\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function() {\n input.gracePeriod = false;\n if (input.selectionChanged())\n input.cm.operation(function() { input.cm.curOp.selectionChanged = true; });\n }, 20);\n },\n\n showMultipleSelections: function(info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n },\n\n rememberSelection: function() {\n var sel = window.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n },\n\n selectionInEditor: function() {\n var sel = window.getSelection();\n if (!sel.rangeCount) return false;\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node);\n },\n\n focus: function() {\n if (this.cm.options.readOnly != \"nocursor\") this.div.focus();\n },\n blur: function() { this.div.blur(); },\n getField: function() { return this.div; },\n\n supportsTouch: function() { return true; },\n\n receivedFocus: function() {\n var input = this;\n if (this.selectionInEditor())\n this.pollSelection();\n else\n runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; });\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n },\n\n selectionChanged: function() {\n var sel = window.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset;\n },\n\n pollSelection: function() {\n if (!this.composing && !this.gracePeriod && this.selectionChanged()) {\n var sel = window.getSelection(), cm = this.cm;\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) runInOp(cm, function() {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) cm.curOp.selectionChanged = true;\n });\n }\n },\n\n pollContent: function() {\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false;\n\n var fromIndex;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n var fromLine = lineNo(display.view[0].line);\n var fromNode = display.view[0].node;\n } else {\n var fromLine = lineNo(display.view[fromIndex].line);\n var fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n if (toIndex == display.view.length - 1) {\n var toLine = display.viewTo - 1;\n var toNode = display.lineDiv.lastChild;\n } else {\n var toLine = lineNo(display.view[toIndex + 1].line) - 1;\n var toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else break;\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n ++cutFront;\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n ++cutEnd;\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd);\n newText[0] = newText[0].slice(cutFront);\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true;\n }\n },\n\n ensurePolled: function() {\n this.forceCompositionEnd();\n },\n reset: function() {\n this.forceCompositionEnd();\n },\n forceCompositionEnd: function() {\n if (!this.composing || this.composing.handled) return;\n this.applyComposition(this.composing);\n this.composing.handled = true;\n this.div.blur();\n this.div.focus();\n },\n applyComposition: function(composing) {\n if (this.cm.isReadOnly())\n operation(this.cm, regChange)(this.cm)\n else if (composing.data && composing.data != composing.startData)\n operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel);\n },\n\n setUneditable: function(node) {\n node.contentEditable = \"false\"\n },\n\n onKeyPress: function(e) {\n e.preventDefault();\n if (!this.cm.isReadOnly())\n operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0);\n },\n\n readOnlyChanged: function(val) {\n this.div.contentEditable = String(val != \"nocursor\")\n },\n\n onContextMenu: nothing,\n resetPosition: nothing,\n\n needsContentAttribute: true\n }, ContentEditableInput.prototype);\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) return null;\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result;\n }\n\n function badPos(pos, bad) { if (bad) pos.bad = true; return pos; }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true);\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) return null;\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break;\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n return locateNodeInLineView(lineView, node, offset);\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true);\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad);\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) offset = textNode.nodeValue.length;\n }\n while (topNode.parentNode != wrapper) topNode = topNode.parentNode;\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)];\n return Pos(line, ch);\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) return badPos(found, bad);\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n return badPos(Pos(found.line, found.ch - dist), bad);\n else\n dist += after.textContent.length;\n }\n for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n return badPos(Pos(found.line, found.ch + dist), bad);\n else\n dist += after.textContent.length;\n }\n }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator();\n function recognizeMarker(id) { return function(marker) { return marker.id == id; }; }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText != null) {\n if (cmText == \"\") cmText = node.textContent.replace(/\\u200b/g, \"\");\n text += cmText;\n return;\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find()))\n text += getBetween(cm.doc, range.from, range.to).join(lineSep);\n return;\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") return;\n for (var i = 0; i < node.childNodes.length; i++)\n walk(node.childNodes[i]);\n if (/^(pre|div|p)$/i.test(node.nodeName))\n closing = true;\n } else if (node.nodeType == 3) {\n var val = node.nodeValue;\n if (!val) return;\n if (closing) {\n text += lineSep;\n closing = false;\n }\n text += val;\n }\n }\n for (;;) {\n walk(from);\n if (from == to) break;\n from = from.nextSibling;\n }\n return text;\n }\n\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // SELECTION / CURSOR\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n function Selection(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n }\n\n Selection.prototype = {\n primary: function() { return this.ranges[this.primIndex]; },\n equals: function(other) {\n if (other == this) return true;\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false;\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false;\n }\n return true;\n },\n deepCopy: function() {\n for (var out = [], i = 0; i < this.ranges.length; i++)\n out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head));\n return new Selection(out, this.primIndex);\n },\n somethingSelected: function() {\n for (var i = 0; i < this.ranges.length; i++)\n if (!this.ranges[i].empty()) return true;\n return false;\n },\n contains: function(pos, end) {\n if (!end) end = pos;\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n return i;\n }\n return -1;\n }\n };\n\n function Range(anchor, head) {\n this.anchor = anchor; this.head = head;\n }\n\n Range.prototype = {\n from: function() { return minPos(this.anchor, this.head); },\n to: function() { return maxPos(this.anchor, this.head); },\n empty: function() {\n return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch;\n }\n };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(ranges, primIndex) {\n var prim = ranges[primIndex];\n ranges.sort(function(a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n if (cmp(prev.to(), cur.from()) >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) --primIndex;\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex);\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0);\n }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) return Pos(doc.first, 0);\n var last = doc.first + doc.size - 1;\n if (pos.line > last) return Pos(last, getLine(doc, last).text.length);\n return clipToLen(pos, getLine(doc, pos.line).text.length);\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) return Pos(pos.line, linelen);\n else if (ch < 0) return Pos(pos.line, 0);\n else return pos;\n }\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;}\n function clipPosArray(doc, array) {\n for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]);\n return out;\n }\n\n // SELECTION UPDATES\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(doc, range, head, other) {\n if (doc.cm && doc.cm.display.shift || doc.extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head);\n } else {\n return new Range(other || head, head);\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options) {\n setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n for (var out = [], i = 0; i < doc.sel.ranges.length; i++)\n out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null);\n var newSel = normalizeSelection(out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n sel = filterSelectionChange(doc, sel, options);\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n ensureCursorVisible(doc.cm);\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) return;\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) out = sel.ranges.slice(0, i);\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(out, sel.primIndex) : sel;\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) break;\n else {--i; continue;}\n }\n }\n if (!m.atomic) continue;\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff;\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null);\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n return skipAtomicInner(doc, near, pos, dir, mayClear);\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n far = movePos(doc, far, dir, far.line == pos.line ? line : null);\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null;\n }\n }\n return pos;\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0);\n }\n return found;\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1));\n else return null;\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) return Pos(pos.line + 1, 0);\n else return null;\n } else {\n return new Pos(pos.line, pos.ch + dir);\n }\n }\n\n // SELECTION DRAWING\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (primary === false && i == doc.sel.primIndex) continue;\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue;\n var collapsed = range.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n drawSelectionCursor(cm, range.head, curFragment);\n if (!collapsed)\n drawSelectionRange(cm, range, selFragment);\n }\n return result;\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) return;\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n display.blinker = setInterval(function() {\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate);\n else if (cm.options.cursorBlinkRate < 0)\n display.cursorDiv.style.visibility = \"hidden\";\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)\n cm.state.highlight.set(time, bind(highlightWorker, cm));\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.frontier < doc.first) doc.frontier = doc.first;\n if (doc.frontier >= cm.display.viewTo) return;\n var end = +new Date + cm.options.workTime;\n var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));\n var changedLines = [];\n\n doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) {\n if (doc.frontier >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength;\n var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true);\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) line.styleClasses = newCls;\n else if (oldCls) line.styleClasses = null;\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];\n if (ischange) changedLines.push(doc.frontier);\n line.stateAfter = tooLong ? state : copyState(doc.mode, state);\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n processLine(cm, line.text, state);\n line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;\n }\n ++doc.frontier;\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true;\n }\n });\n if (changedLines.length) runInOp(cm, function() {\n for (var i = 0; i < changedLines.length; i++)\n regLineChange(cm, changedLines[i], \"text\");\n });\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }\n\n function getStateBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) return true;\n var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;\n if (!state) state = startState(doc.mode);\n else state = copyState(doc.mode, state);\n doc.iter(pos, n, function(line) {\n processLine(cm, line.text, state);\n var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo;\n line.stateAfter = save ? copyState(doc.mode, state) : null;\n ++pos;\n });\n if (precise) doc.frontier = pos;\n return state;\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop;}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}\n function paddingH(display) {\n if (display.cachedPaddingH) return display.cachedPaddingH;\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data;\n return data;\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth;\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight;\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n var mStart = map[i], mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) collapse = \"right\";\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n collapse = bias;\n if (bias == \"left\" && start == 0)\n while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n }\n if (bias == \"right\" && start == mEnd - mStart)\n while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n }\n break;\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd};\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect\n if (bias == \"left\") for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) break\n } else for (var i = rects.length - 1; i >= 0; i--) {\n if ((rect = rects[i]).left != rect.right) break\n }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start;\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end;\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n rect = node.parentNode.getBoundingClientRect();\n else\n rect = getUsefulRect(range(node, start, end).getClientRects(), bias)\n if (rect.left || rect.right || start == 0) break;\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect);\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) collapse = bias = \"right\";\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n rect = rects[bias == \"right\" ? rects.length - 1 : 0];\n else\n rect = node.getBoundingClientRect();\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom};\n else\n rect = nullRect;\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n for (var i = 0; i < heights.length - 1; i++)\n if (mid < heights[i]) break;\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) result.bogus = true;\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result;\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n return rect;\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY};\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n lineView.measure.caches[i] = {};\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n clearLineMeasurementCacheFor(cm.display.view[i]);\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }\n function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"/null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"/null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) lineObj = getLine(cm.doc, pos.line);\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context);\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n var innerOff = y - heightAtLine(lineObj);\n var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n\n function getX(ch) {\n var sp = cursorCoords(cm, Pos(lineNo, ch), \"line\", lineObj, preparedMeasure);\n wrongLine = true;\n if (innerOff > sp.bottom) return sp.left - adjust;\n else if (innerOff < sp.top) return sp.left + adjust;\n else wrongLine = false;\n return sp.left;\n }\n\n var bidi = getOrder(lineObj), dist = lineObj.text.length;\n var from = lineLeft(lineObj), to = lineRight(lineObj);\n var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;\n\n if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);\n // Do a binary search between these bounds.\n for (;;) {\n if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {\n var ch = x < fromX || x - fromX <= toX - x ? from : to;\n var outside = ch == from ? fromOutside : toOutside\n var xDiff = x - (ch == from ? fromX : toX);\n // This is a kludge to handle the case where the coordinates\n // are after a line-wrapped line. We should replace it with a\n // more general handling of cursor positions around line\n // breaks. (Issue #4078)\n if (toOutside && !bidi && !/\\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 &&\n ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) {\n var charSize = measureCharPrepared(cm, preparedMeasure, ch, \"right\");\n if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) {\n outside = false\n ch++\n xDiff = x - charSize.right\n }\n }\n while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;\n var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0);\n return pos;\n }\n var step = Math.ceil(dist / 2), middle = from + step;\n if (bidi) {\n middle = from;\n for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);\n }\n var middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}\n else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}\n }\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }\n\n // OPERATIONS\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var operationGroup = null;\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n callbacks[i].call(null);\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm);\n }\n } while (i < callbacks.length);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp, group = op.ownsGroup;\n if (!group) return;\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n for (var i = 0; i < group.ops.length; i++)\n group.ops[i].cm.curOp = null;\n endOperations(group);\n }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) findMaxLine(cm);\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) updateHeightsInViewport(cm);\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n op.preparedSelection = display.input.prepareSelection(op.focus);\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true);\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())\n if (op.preparedSelection)\n cm.display.input.showSelection(op.preparedSelection, takeFocus);\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n updateScrollbars(cm, op.barMeasure);\n if (op.updatedDisplay)\n setDocumentHeight(cm, op.barMeasure);\n\n if (op.selectionChanged) restartBlink(cm);\n\n if (cm.state.focused && op.updateInput)\n cm.display.input.reset(op.typing);\n if (takeFocus) ensureFocus(op.cm);\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) postUpdateDisplay(cm, op.update);\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n display.wheelStartX = display.wheelStartY = null;\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {\n doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));\n display.scrollbars.setScrollTop(doc.scrollTop);\n display.scroller.scrollTop = doc.scrollTop;\n }\n if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {\n doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));\n display.scrollbars.setScrollLeft(doc.scrollLeft);\n display.scroller.scrollLeft = doc.scrollLeft;\n alignHorizontally(cm);\n }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) for (var i = 0; i < hidden.length; ++i)\n if (!hidden[i].lines.length) signal(hidden[i], \"hide\");\n if (unhidden) for (var i = 0; i < unhidden.length; ++i)\n if (unhidden[i].lines.length) signal(unhidden[i], \"unhide\");\n\n if (display.wrapper.offsetHeight)\n doc.scrollTop = cm.display.scroller.scrollTop;\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n signal(cm, \"changes\", cm, op.changeObjs);\n if (op.update)\n op.update.finish();\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) return f.apply(this, arguments);\n startOperation(cm);\n try { return f.apply(this, arguments); }\n finally { endOperation(cm); }\n };\n }\n\n // VIEW TRACKING\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) return null;\n n -= cm.display.viewFrom;\n if (n < 0) return null;\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) return i;\n }\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n return {index: index, lineN: newN};\n for (var i = 0, n = cm.display.viewFrom; i < index; i++)\n n += view[i].size;\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) return null;\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) return null;\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN};\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }\n\n // EVENT HANDLERS\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != CodeMirror.Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n return;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n // MOUSE EVENTS\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n return true;\n }\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n // #3261: make sure, that we're not starting a second selection\n if (cm.state.selectingText)\n cm.state.selectingText(e);\n else if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(function() {display.input.focus();}, 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n else delayBlurEvent(cm);\n break;\n }\n }\n\n var lastClick, lastDoubleClick;\n function leftButtonDown(cm, e, start) {\n if (ie) setTimeout(bind(ensureFocus, cm), 0);\n else cm.curOp.focus = activeElt();\n\n var now = +new Date, type;\n if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {\n type = \"triple\";\n } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {\n type = \"double\";\n lastDoubleClick = {time: now, pos: start};\n } else {\n type = \"single\";\n lastClick = {time: now, pos: start};\n }\n\n var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n type == \"single\" && (contained = sel.contains(start)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&\n (cmp(contained.to(), start) > 0 || start.xRel < 0))\n leftButtonStartDrag(cm, e, start, modifier);\n else\n leftButtonSelect(cm, e, start, type, modifier);\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, e, start, modifier) {\n var display = cm.display, startTime = +new Date;\n var dragEnd = operation(cm, function(e2) {\n if (webkit) display.scroller.draggable = false;\n cm.state.draggingText = false;\n off(document, \"mouseup\", dragEnd);\n off(display.scroller, \"drop\", dragEnd);\n if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {\n e_preventDefault(e2);\n if (!modifier && +new Date - 200 < startTime)\n extendSelection(cm.doc, start);\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n setTimeout(function() {document.body.focus(); display.input.focus();}, 20);\n else\n display.input.focus();\n }\n });\n // Let the drag handler handle this.\n if (webkit) display.scroller.draggable = true;\n cm.state.draggingText = dragEnd;\n dragEnd.copy = mac ? e.altKey : e.ctrlKey\n // IE's approach to draggable\n if (display.scroller.dragDrop) display.scroller.dragDrop();\n on(document, \"mouseup\", dragEnd);\n on(display.scroller, \"drop\", dragEnd);\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n try { var mX = e.clientX, mY = e.clientY; }\n catch(e) { return false; }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;\n if (prevent) e_preventDefault(e);\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e);\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true);\n }\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n return;\n e_preventDefault(e);\n if (ie) lastDrop = +new Date;\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) return;\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function(file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n return;\n\n var reader = new FileReader;\n reader.onload = operation(cm, function() {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) content = \"\";\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) loadFile(files[i], i);\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function() {cm.display.input.focus();}, 20);\n return;\n }\n try {\n var text = e.dataTransfer.getData(\"Text\");\n if (text) {\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n var selected = cm.listSelections();\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) for (var i = 0; i < selected.length; ++i)\n replaceRange(cm.doc, \"\", selected[i].anchor, selected[i].head, \"drag\");\n cm.replaceSelection(text, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\"\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) img.parentNode.removeChild(img);\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) return;\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // SCROLL EVENTS\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function setScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) return;\n cm.doc.scrollTop = val;\n if (!gecko) updateDisplaySimple(cm, {top: val});\n if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (gecko) updateDisplaySimple(cm);\n startWorker(cm, 100);\n }\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller) {\n if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) wheelPixelsPerUnit = -.53;\n else if (gecko) wheelPixelsPerUnit = 15;\n else if (chrome) wheelPixelsPerUnit = -.7;\n else if (safari) wheelPixelsPerUnit = -1/3;\n\n var wheelEventDelta = function(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;\n else if (dy == null) dy = e.wheelDelta;\n return {x: dx, y: dy};\n };\n CodeMirror.wheelEventPixels = function(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta;\n };\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) return;\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer;\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));\n setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n e_preventDefault(e);\n display.wheelStartX = null; // Abort measurement, if in progress\n return;\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) top = Math.max(0, top + pixels - 50);\n else bot = Math.min(cm.doc.height, bot + pixels + 50);\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function() {\n if (display.wheelStartX == null) return;\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) return;\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // KEY EVENTS\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) return false;\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) cm.state.suppressEdits = true;\n if (dropShift) cm.display.shift = false;\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done;\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) return result;\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm);\n }\n\n var stopSeq = new Delayed;\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) return \"handled\";\n stopSeq.set(50, function() {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n });\n name = seq + \" \" + name;\n }\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n cm.state.keySeq = name;\n if (result == \"handled\")\n signalLater(cm, \"keyHandled\", cm, name, e);\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n if (seq && !result && /\\'$/.test(name)) {\n e_preventDefault(e);\n return true;\n }\n return !!result;\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e,\n function(b) { return doHandleBinding(cm, b, true); });\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) return;\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false;\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n cm.replaceSelection(\"\", null, \"cut\");\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n showCrossHair(cm);\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) this.doc.sel.shift = false;\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return;\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return;\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n if (handleCharBinding(cm, e, ch)) return;\n cm.display.input.onKeyPress(e);\n }\n\n // FOCUS/BLUR EVENTS\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function() {\n if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n }\n }, 100);\n }\n\n function onFocus(cm) {\n if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false;\n\n if (cm.options.readOnly == \"nocursor\") return;\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm) {\n if (cm.state.delayingBlurEvent) return;\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150);\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n cm.display.input.onContextMenu(e);\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) return false;\n return gutterEvent(cm, e, \"gutterContextMenu\", false);\n }\n\n // UPDATING\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n var changeEnd = CodeMirror.changeEnd = function(change) {\n if (!change.text) return change.to;\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));\n };\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(out, doc.sel.primIndex);\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n return Pos(nw.line, pos.ch - old.ch + nw.ch);\n else\n return Pos(nw.line + (pos.line - old.line), pos.ch);\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex);\n }\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function() { this.canceled = true; }\n };\n if (update) obj.update = function(from, to, text, origin) {\n if (from) this.from = clipPos(doc, from);\n if (to) this.to = clipPos(doc, to);\n if (text) this.text = text;\n if (origin !== undefined) this.origin = origin;\n };\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeChange\", doc.cm, obj);\n\n if (obj.canceled) return null;\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin};\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) return;\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function(doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) return;\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n for (var i = 0; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n break;\n }\n if (i == source.length) return;\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return;\n }\n selAfter = event;\n }\n else break;\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n for (var i = event.changes.length - 1; i >= 0; --i) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return;\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function(doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) return;\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function(range) {\n return new Range(Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch));\n }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n regLineChange(doc.cm, l, \"gutter\");\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return;\n }\n if (change.from.line > doc.lastLine()) return;\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) selAfter = computeSelAfterChange(doc, change);\n if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans);\n else updateDoc(doc, change, spans);\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function(line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true;\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n signalCursorActivity(cm);\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function(line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) cm.curOp.updateMaxLine = true;\n }\n\n // Adjust frontier, schedule worker\n doc.frontier = Math.min(doc.frontier, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n regChange(cm);\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n regLineChange(cm, from.line, \"text\");\n else\n regChange(cm, from.line, to.line + 1, lendiff);\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) signalLater(cm, \"change\", cm, obj);\n if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj);\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n if (!to) to = from;\n if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }\n if (typeof code == \"string\") code = doc.splitLines(code);\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, coords) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) return;\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (coords.top + box.top < 0) doScroll = true;\n else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, \"position: absolute; top: \" +\n (coords.top - display.viewOffset - paddingTop(cm.display)) + \"px; height: \" +\n (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + \"px; left: \" +\n coords.left + \"px; width: 2px;\");\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (var limit = 0; limit < 5; limit++) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) break;\n }\n return coords;\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = x1 + screenw;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n return result;\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }\n\n // API UTILITIES\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true;\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break;\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function() {\n for (var i = kill.length - 1; i >= 0; i--)\n replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\");\n ensureCursorVisible(cm);\n });\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var line = pos.line, ch = pos.ch, origDir = dir;\n var lineObj = getLine(doc, line);\n function findNextLine() {\n var l = line + dir;\n if (l < doc.first || l >= doc.first + doc.size) return false\n line = l;\n return lineObj = getLine(doc, l);\n }\n function moveOnce(boundToLine) {\n var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);\n if (next == null) {\n if (!boundToLine && findNextLine()) {\n if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);\n else ch = dir < 0 ? lineObj.text.length : 0;\n } else return false\n } else ch = next;\n return true;\n }\n\n if (unit == \"char\") {\n moveOnce()\n } else if (unit == \"column\") {\n moveOnce(true)\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) break;\n var cur = lineObj.text.charAt(ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) type = \"s\";\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce();}\n break;\n }\n\n if (type) sawType = type;\n if (dir > 0 && !moveOnce(!first)) break;\n }\n }\n var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true);\n if (!cmp(pos, result)) result.hitSide = true;\n return result;\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n for (;;) {\n var target = coordsChar(cm, x, y);\n if (!target.outside) break;\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; }\n y += dir * 5;\n }\n return target;\n }\n\n // EDITOR METHODS\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") return;\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n operation(this, optionHandlers[option])(this, value, old);\n },\n\n getOption: function(option) {return this.options[option];},\n getDoc: function() {return this.doc;},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true;\n }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) throw new Error(\"Overlays may not be stateful.\");\n this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return;\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) dir = this.options.smartIndent ? \"smart\" : \"prev\";\n else dir = dir ? \"add\" : \"subtract\";\n }\n if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive);\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n indentLine(this, j, how);\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll);\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) ensureCursorVisible(this);\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise);\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true);\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) type = styles[2];\n else for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;\n else if (styles[mid * 2 + 1] < ch) before = mid + 1;\n else { type = styles[mid * 2 + 2]; break; }\n }\n var cut = type ? type.indexOf(\"cm-overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1);\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) return mode;\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0];\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) return found;\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) found.push(help[mode[type]]);\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) found.push(val);\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i = 0; i < help._global.length; i++) {\n var cur = help._global[i];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n found.push(cur.val);\n }\n return found;\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getStateBefore(this, line + 1, precise);\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) pos = range.head;\n else if (typeof start == \"object\") pos = clipPos(this.doc, start);\n else pos = start ? range.from() : range.to();\n return cursorCoords(this, pos, mode || \"page\");\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\");\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top);\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset);\n },\n heightAtLine: function(line, mode) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) line = this.doc.first;\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\").top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0);\n },\n\n defaultTextHeight: function() { return textHeight(this.display); },\n defaultCharWidth: function() { return charWidth(this.display); },\n\n setGutterMarker: methodOp(function(line, gutterID, value) {\n return changeLine(this.doc, line, \"gutter\", function(line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) line.gutterMarkers = null;\n return true;\n });\n }),\n\n clearGutter: methodOp(function(gutterID) {\n var cm = this, doc = cm.doc, i = doc.first;\n doc.iter(function(line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n line.gutterMarkers[gutterID] = null;\n regLineChange(cm, i, \"gutter\");\n if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;\n }\n ++i;\n });\n }),\n\n lineInfo: function(line) {\n if (typeof line == \"number\") {\n if (!isLine(this.doc, line)) return null;\n var n = line;\n line = getLine(this.doc, line);\n if (!line) return null;\n } else {\n var n = lineNo(line);\n if (n == null) return null;\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets};\n },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n top = pos.top - node.offsetHeight;\n else if (pos.bottom + node.offsetHeight <= vspace)\n top = pos.bottom;\n if (left + node.offsetWidth > hspace)\n left = hspace - node.offsetWidth;\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") left = 0;\n else if (horiz == \"middle\") left = (display.sizer.clientWidth - node.offsetWidth) / 2;\n node.style.left = left + \"px\";\n }\n if (scroll)\n scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n return commands[cmd].call(null, this);\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) break;\n }\n return cur;\n },\n\n moveH: methodOp(function(dir, unit) {\n var cm = this;\n cm.extendSelectionsBy(function(range) {\n if (cm.display.shift || cm.doc.extend || range.empty())\n return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually);\n else\n return dir < 0 ? range.from() : range.to();\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n doc.replaceSelection(\"\", null, \"+delete\");\n else\n deleteNearSelection(this, function(range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other};\n });\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) x = coords.left;\n else coords.left = x;\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) break;\n }\n return cur;\n },\n\n moveV: methodOp(function(dir, unit) {\n var cm = this, doc = this.doc, goals = [];\n var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function(range) {\n if (collapse)\n return dir < 0 ? range.from() : range.to();\n var headPos = cursorCoords(cm, range.head, \"div\");\n if (range.goalColumn != null) headPos.left = range.goalColumn;\n goals.push(headPos.left);\n var pos = findPosV(cm, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n addToScrollPos(cm, null, charCoords(cm, pos, \"div\").top - headPos.top);\n return pos;\n }, sel_move);\n if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++)\n doc.sel.ranges[i].goalColumn = goals[i];\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end;\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function(ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function(ch) {return /\\s/.test(ch);}\n : function(ch) {return !/\\s/.test(ch) && !isWordChar(ch);};\n while (start > 0 && check(line.charAt(start - 1))) --start;\n while (end < line.length && check(line.charAt(end))) ++end;\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end));\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) return;\n if (this.state.overwrite = !this.state.overwrite)\n addClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n else\n rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(); },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); },\n\n scrollTo: methodOp(function(x, y) {\n if (x != null || y != null) resolveScrollToPos(this);\n if (x != null) this.curOp.scrollLeft = x;\n if (y != null) this.curOp.scrollTop = y;\n }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)};\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) margin = this.options.cursorScrollMargin;\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) range.to = range.from;\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n resolveScrollToPos(this);\n this.curOp.scrollToPos = range;\n } else {\n var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),\n Math.min(range.from.top, range.to.top) - range.margin,\n Math.max(range.from.right, range.to.right),\n Math.max(range.from.bottom, range.to.bottom) + range.margin);\n this.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var cm = this;\n function interpret(val) {\n return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val;\n }\n if (width != null) cm.display.wrapper.style.width = interpret(width);\n if (height != null) cm.display.wrapper.style.height = interpret(height);\n if (cm.options.lineWrapping) clearLineMeasurementCache(this);\n var lineNo = cm.display.viewFrom;\n cm.doc.iter(lineNo, cm.display.viewTo, function(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++)\n if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, \"widget\"); break; }\n ++lineNo;\n });\n cm.curOp.forceUpdate = true;\n signal(cm, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f);},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n estimateLineHeights(this);\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n this.scrollTo(doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old;\n }),\n\n getInputField: function(){return this.display.input.getField();},\n getWrapperElement: function(){return this.display.wrapper;},\n getScrollerElement: function(){return this.display.scroller;},\n getGutterElement: function(){return this.display.gutters;}\n };\n eventMixin(CodeMirror);\n\n // OPTION DEFAULTS\n\n // The default configuration options.\n var defaults = CodeMirror.defaults = {};\n // Functions to run when options are changed.\n var optionHandlers = CodeMirror.optionHandlers = {};\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) optionHandlers[name] =\n notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;\n }\n\n // Passed to option handlers when there is no old value.\n var Init = CodeMirror.Init = {toString: function(){return \"CodeMirror.Init\";}};\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function(cm, val) {\n cm.setValue(val);\n }, true);\n option(\"mode\", null, function(cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function(cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n option(\"lineSeparator\", null, function(cm, val) {\n cm.doc.lineSep = val;\n if (!val) return;\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function(line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) break;\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length))\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f\\u00ad\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function(cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != CodeMirror.Init) cm.refresh();\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function() {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\"); // FIXME\n }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function(cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function(cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != CodeMirror.Init && getKeyMap(old);\n if (prev && prev.detach) prev.detach(cm, next);\n if (next.attach) next.attach(cm, prev || null);\n });\n option(\"extraKeys\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function(cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function(cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function(cm) {updateScrollbars(cm);}, true);\n option(\"scrollbarStyle\", \"native\", function(cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function(cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function(integer) {return integer;}, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n\n option(\"readOnly\", false, function(cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n cm.display.disabled = true;\n } else {\n cm.display.disabled = false;\n }\n cm.display.input.readOnlyChanged(val)\n });\n option(\"disableInput\", false, function(cm, val) {if (!val) cm.display.input.reset();}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function(cm, val){cm.doc.history.undoDepth = val;});\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function(cm){cm.refresh();}, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function(cm, val) {\n if (!val) cm.display.input.resetPosition();\n });\n\n option(\"tabindex\", null, function(cm, val) {\n cm.display.input.getField().tabIndex = val || \"\";\n });\n option(\"autofocus\", null);\n\n // MODE DEFINITION AND QUERYING\n\n // Known modes, by name and by MIME\n var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name, mode) {\n if (!CodeMirror.defaults.mode && name != \"null\") CodeMirror.defaults.mode = name;\n if (arguments.length > 2)\n mode.dependencies = Array.prototype.slice.call(arguments, 2);\n modes[name] = mode;\n };\n\n CodeMirror.defineMIME = function(mime, spec) {\n mimeModes[mime] = spec;\n };\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n CodeMirror.resolveMode = function(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") found = {name: found};\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return CodeMirror.resolveMode(\"application/xml\");\n }\n if (typeof spec == \"string\") return {name: spec};\n else return spec || {name: \"null\"};\n };\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n CodeMirror.getMode = function(options, spec) {\n var spec = CodeMirror.resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) return CodeMirror.getMode(options, \"text/plain\");\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) continue;\n if (modeObj.hasOwnProperty(prop)) modeObj[\"_\" + prop] = modeObj[prop];\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) modeObj.helperType = spec.helperType;\n if (spec.modeProps) for (var prop in spec.modeProps)\n modeObj[prop] = spec.modeProps[prop];\n\n return modeObj;\n };\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function() {\n return {token: function(stream) {stream.skipToEnd();}};\n });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = CodeMirror.modeExtensions = {};\n CodeMirror.extendMode = function(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n };\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function(name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function(name, func) {\n Doc.prototype[name] = func;\n };\n CodeMirror.defineOption = option;\n\n var initHooks = [];\n CodeMirror.defineInitHook = function(f) {initHooks.push(f);};\n\n var helpers = CodeMirror.helpers = {};\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []};\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n\n // MODE STATE HANDLING\n\n // Utility functions for working with state. Exported because nested\n // modes need to do this for their inner modes.\n\n var copyState = CodeMirror.copyState = function(mode, state) {\n if (state === true) return state;\n if (mode.copyState) return mode.copyState(state);\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) val = val.concat([]);\n nstate[n] = val;\n }\n return nstate;\n };\n\n var startState = CodeMirror.startState = function(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true;\n };\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n CodeMirror.innerMode = function(mode, state) {\n while (mode.innerMode) {\n var info = mode.innerMode(state);\n if (!info || info.mode == mode) break;\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state};\n };\n\n // STANDARD COMMANDS\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = CodeMirror.commands = {\n selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);},\n singleSelection: function(cm) {\n cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll);\n },\n killLine: function(cm) {\n deleteNearSelection(cm, function(range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n return {from: range.head, to: Pos(range.head.line + 1, 0)};\n else\n return {from: range.head, to: Pos(range.head.line, len)};\n } else {\n return {from: range.from(), to: range.to()};\n }\n });\n },\n deleteLine: function(cm) {\n deleteNearSelection(cm, function(range) {\n return {from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))};\n });\n },\n delLineLeft: function(cm) {\n deleteNearSelection(cm, function(range) {\n return {from: Pos(range.from().line, 0), to: range.from()};\n });\n },\n delWrappedLineLeft: function(cm) {\n deleteNearSelection(cm, function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()};\n });\n },\n delWrappedLineRight: function(cm) {\n deleteNearSelection(cm, function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos };\n });\n },\n undo: function(cm) {cm.undo();},\n redo: function(cm) {cm.redo();},\n undoSelection: function(cm) {cm.undoSelection();},\n redoSelection: function(cm) {cm.redoSelection();},\n goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));},\n goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));},\n goLineStart: function(cm) {\n cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1});\n },\n goLineStartSmart: function(cm) {\n cm.extendSelectionsBy(function(range) {\n return lineStartSmart(cm, range.head);\n }, {origin: \"+move\", bias: 1});\n },\n goLineEnd: function(cm) {\n cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1});\n },\n goLineRight: function(cm) {\n cm.extendSelectionsBy(function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n }, sel_move);\n },\n goLineLeft: function(cm) {\n cm.extendSelectionsBy(function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\");\n }, sel_move);\n },\n goLineLeftSmart: function(cm) {\n cm.extendSelectionsBy(function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) return lineStartSmart(cm, range.head);\n return pos;\n }, sel_move);\n },\n goLineUp: function(cm) {cm.moveV(-1, \"line\");},\n goLineDown: function(cm) {cm.moveV(1, \"line\");},\n goPageUp: function(cm) {cm.moveV(-1, \"page\");},\n goPageDown: function(cm) {cm.moveV(1, \"page\");},\n goCharLeft: function(cm) {cm.moveH(-1, \"char\");},\n goCharRight: function(cm) {cm.moveH(1, \"char\");},\n goColumnLeft: function(cm) {cm.moveH(-1, \"column\");},\n goColumnRight: function(cm) {cm.moveH(1, \"column\");},\n goWordLeft: function(cm) {cm.moveH(-1, \"word\");},\n goGroupRight: function(cm) {cm.moveH(1, \"group\");},\n goGroupLeft: function(cm) {cm.moveH(-1, \"group\");},\n goWordRight: function(cm) {cm.moveH(1, \"word\");},\n delCharBefore: function(cm) {cm.deleteH(-1, \"char\");},\n delCharAfter: function(cm) {cm.deleteH(1, \"char\");},\n delWordBefore: function(cm) {cm.deleteH(-1, \"word\");},\n delWordAfter: function(cm) {cm.deleteH(1, \"word\");},\n delGroupBefore: function(cm) {cm.deleteH(-1, \"group\");},\n delGroupAfter: function(cm) {cm.deleteH(1, \"group\");},\n indentAuto: function(cm) {cm.indentSelection(\"smart\");},\n indentMore: function(cm) {cm.indentSelection(\"add\");},\n indentLess: function(cm) {cm.indentSelection(\"subtract\");},\n insertTab: function(cm) {cm.replaceSelection(\"\\t\");},\n insertSoftTab: function(cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function(cm) {\n if (cm.somethingSelected()) cm.indentSelection(\"add\");\n else cm.execCommand(\"insertTab\");\n },\n transposeChars: function(cm) {\n runInOp(cm, function() {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1);\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev)\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), \"+transpose\");\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n });\n },\n newlineAndIndent: function(cm) {\n runInOp(cm, function() {\n var len = cm.listSelections().length;\n for (var i = 0; i < len; i++) {\n var range = cm.listSelections()[i];\n cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, \"+input\");\n cm.indentLine(range.from().line + 1, null, true);\n }\n ensureCursorVisible(cm);\n });\n },\n openLine: function(cm) {cm.replaceSelection(\"\\n\", \"start\")},\n toggleOverwrite: function(cm) {cm.toggleOverwrite();}\n };\n\n\n // STANDARD KEYMAPS\n\n var keyMap = CodeMirror.keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n fallthrough: \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n fallthrough: [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/), name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) cmd = true;\n else if (/^a(lt)?$/i.test(mod)) alt = true;\n else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true;\n else if (/^s(hift)$/i.test(mod)) shift = true;\n else throw new Error(\"Unrecognized modifier name: \" + mod);\n }\n if (alt) name = \"Alt-\" + name;\n if (ctrl) name = \"Ctrl-\" + name;\n if (cmd) name = \"Cmd-\" + name;\n if (shift) name = \"Shift-\" + name;\n return name;\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n CodeMirror.normalizeKeyMap = function(keymap) {\n var copy = {};\n for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue;\n if (value == \"...\") { delete keymap[keyname]; continue; }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val, name;\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) copy[name] = val;\n else if (prev != val) throw new Error(\"Inconsistent bindings for \" + name);\n }\n delete keymap[keyname];\n }\n for (var prop in copy) keymap[prop] = copy[prop];\n return keymap;\n };\n\n var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) return \"nothing\";\n if (found === \"...\") return \"multi\";\n if (found != null && handle(found)) return \"handled\";\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n return lookupKey(key, map.fallthrough, handle, context);\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) return result;\n }\n }\n };\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n var isModifierKey = CodeMirror.isModifierKey = function(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\";\n };\n\n // Look up the name of a key as indicated by an event object.\n var keyName = CodeMirror.keyName = function(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) return false;\n var base = keyNames[event.keyCode], name = base;\n if (name == null || event.altGraphKey) return false;\n if (event.altKey && base != \"Alt\") name = \"Alt-\" + name;\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") name = \"Ctrl-\" + name;\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") name = \"Cmd-\" + name;\n if (!noShift && event.shiftKey && base != \"Shift\") name = \"Shift-\" + name;\n return name;\n };\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val;\n }\n\n // FROMTEXTAREA\n\n CodeMirror.fromTextArea = function(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n options.tabindex = textarea.tabIndex;\n if (!options.placeholder && textarea.placeholder)\n options.placeholder = textarea.placeholder;\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form, realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function() {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function(cm) {\n cm.save = save;\n cm.getTextArea = function() { return textarea; };\n cm.toTextArea = function() {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n textarea.form.submit = realSubmit;\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function(node) {\n textarea.parentNode.insertBefore(node, textarea.nextSibling);\n }, options);\n return cm;\n };\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = CodeMirror.StringStream = function(string, tabSize) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n };\n\n StringStream.prototype = {\n eol: function() {return this.pos >= this.string.length;},\n sol: function() {return this.pos == this.lineStart;},\n peek: function() {return this.string.charAt(this.pos) || undefined;},\n next: function() {\n if (this.pos < this.string.length)\n return this.string.charAt(this.pos++);\n },\n eat: function(match) {\n var ch = this.string.charAt(this.pos);\n if (typeof match == \"string\") var ok = ch == match;\n else var ok = ch && (match.test ? match.test(ch) : match(ch));\n if (ok) {++this.pos; return ch;}\n },\n eatWhile: function(match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start;\n },\n eatSpace: function() {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;\n return this.pos > start;\n },\n skipToEnd: function() {this.pos = this.string.length;},\n skipTo: function(ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true;}\n },\n backUp: function(n) {this.pos -= n;},\n column: function() {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);\n },\n indentation: function() {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);\n },\n match: function(pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) this.pos += pattern.length;\n return true;\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) return null;\n if (match && consume !== false) this.pos += match[0].length;\n return match;\n }\n },\n current: function(){return this.string.slice(this.start, this.pos);},\n hideFirstChars: function(n, inner) {\n this.lineStart += n;\n try { return inner(); }\n finally { this.lineStart -= n; }\n }\n };\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n var nextMarkerId = 0;\n\n var TextMarker = CodeMirror.TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n eventMixin(TextMarker);\n\n // Clear the marker.\n TextMarker.prototype.clear = function() {\n if (this.explicitlyCleared) return;\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) startOperation(cm);\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) signalLater(this, \"clear\", found.from, found.to);\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) regLineChange(cm, lineNo(line), \"text\");\n else if (cm) {\n if (span.to != null) max = lineNo(line);\n if (span.from != null) min = lineNo(line);\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n updateLineHeight(line, textHeight(cm.display));\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {\n var visual = visualLine(this.lines[i]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n }\n\n if (min != null && cm && this.collapsed) regChange(cm, min, max + 1);\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) reCheckSelection(cm.doc);\n }\n if (cm) signalLater(cm, \"markerCleared\", cm, this);\n if (withOp) endOperation(cm);\n if (this.parent) this.parent.clear();\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function(side, lineObj) {\n if (side == null && this.type == \"bookmark\") side = 1;\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) return from;\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) return to;\n }\n }\n return from && {from: from, to: to};\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function() {\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) return;\n runInOp(cm, function() {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n updateLineHeight(line, line.height + dHeight);\n }\n });\n };\n\n TextMarker.prototype.attachLine = function(line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this);\n }\n this.lines.push(line);\n };\n TextMarker.prototype.detachLine = function(line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) return markTextShared(doc, from, to, options, type);\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) copyObj(options, marker, false);\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n return marker;\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = elt(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\");\n if (options.insertLeft) marker.widgetNode.insertLeft = true;\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n throw new Error(\"Inserting collapsed marker partially overlapping an existing one\");\n sawCollapsedSpans = true;\n }\n\n if (marker.addToHistory)\n addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN);\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function(line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n updateMaxLine = true;\n if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0);\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {\n if (lineIsHidden(doc, line)) updateLineHeight(line, 0);\n });\n\n if (marker.clearOnEnter) on(marker, \"beforeCursorEnter\", function() { marker.clear(); });\n\n if (marker.readOnly) {\n sawReadOnlySpans = true;\n if (doc.history.done.length || doc.history.undone.length)\n doc.clearHistory();\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) cm.curOp.updateMaxLine = true;\n if (marker.collapsed)\n regChange(cm, from.line, to.line + 1);\n else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)\n for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, \"text\");\n if (marker.atomic) reCheckSelection(cm.doc);\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker;\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n markers[i].parent = this;\n };\n eventMixin(SharedTextMarker);\n\n SharedTextMarker.prototype.clear = function() {\n if (this.explicitlyCleared) return;\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n this.markers[i].clear();\n signalLater(this, \"clear\");\n };\n SharedTextMarker.prototype.find = function(side, lineObj) {\n return this.primary.find(side, lineObj);\n };\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function(doc) {\n if (widget) options.widgetNode = widget.cloneNode(true);\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n if (doc.linked[i].isParent) return;\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary);\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())),\n function(m) { return m.parent; });\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], linked = [marker.primary.doc];;\n linkedDocs(marker.primary.doc, function(d) { linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n }\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n if (old) for (var i = 0, nw; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);\n (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n }\n return nw;\n }\n function markedSpansAfter(old, endCh, isInsert) {\n if (old) for (var i = 0, nw; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);\n (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n }\n return nw;\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.attachLine(line);\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n return true;\n }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker));\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n return true;\n for (var sp, i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) return true;\n }\n }\n\n // LINE WIDGETS\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = CodeMirror.LineWidget = function(doc, node, options) {\n if (options) for (var opt in options) if (options.hasOwnProperty(opt))\n this[opt] = options[opt];\n this.doc = doc;\n this.node = node;\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n addToScrollPos(cm, null, diff);\n }\n\n LineWidget.prototype.clear = function() {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) return;\n for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);\n if (!ws.length) line.widgets = null;\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) runInOp(cm, function() {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n };\n LineWidget.prototype.changed = function() {\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) return;\n updateLineHeight(line, line.height + diff);\n if (cm) runInOp(cm, function() {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n });\n };\n\n function widgetHeight(widget) {\n if (widget.height != null) return widget.height;\n var cm = widget.doc.cm;\n if (!cm) return 0;\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\";\n if (widget.noHScroll)\n parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\";\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight;\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) cm.display.alignWidgets = true;\n changeLine(doc, handle, \"widget\", function(line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) widgets.push(widget);\n else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) addToScrollPos(cm, null, widget.height);\n cm.curOp.forceUpdate = true;\n }\n return true;\n });\n return widget;\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n eventMixin(Line);\n Line.prototype.lineNo = function() { return lineNo(this); };\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n function extractLineClasses(type, output) {\n if (type) for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) break;\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n output[prop] = lineClass[2];\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n output[prop] += \" \" + lineClass[2];\n }\n return type;\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) return mode.blankLine(state);\n if (!mode.innerMode) return;\n var inner = CodeMirror.innerMode(mode, state);\n if (inner.mode.blankLine) return inner.mode.blankLine(inner.state);\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode;\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) return style;\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\");\n }\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n function getObj(copy) {\n return {start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state};\n }\n\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n if (asArray) tokens = [];\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, state);\n if (asArray) tokens.push(getObj(true));\n }\n return asArray ? tokens : getObj();\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 50000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var state = getStateBefore(cm, lineNo(line));\n var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state);\n line.stateAfter = state;\n line.styles = result.styles;\n if (result.classes) line.styleClasses = result.classes;\n else if (line.styleClasses) line.styleClasses = null;\n if (updateFrontier === cm.doc.frontier) cm.doc.frontier++;\n }\n return line.styles;\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol()) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) return null;\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"));\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token;\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) return;\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt.setAttribute(\"role\", \"presentation\");\n txt.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n var txt = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n txt.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }\n\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) return text\n var spaceBefore = trailingBefore, result = \"\"\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i)\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n ch = \"\\u00a0\"\n result += ch\n spaceBefore = ch == \" \"\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function(builder, text, style, startStyle, endStyle, title, css) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n for (var i = 0; i < order.length; i++) {\n var part = order[i];\n if (part.to > start && part.from <= start) break;\n }\n if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css);\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n };\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) builder.map.push(builder.pos, builder.pos + size, widget);\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n widget = builder.content.appendChild(document.createElement(\"span\"));\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n for (var i = 0, height = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length; },\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) lines[i].parent = this;\n },\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n if (op(this.lines[at])) return true;\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size; },\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) break;\n at = 0;\n } else at -= sz;\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines);\n },\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break;\n }\n at -= sz;\n }\n },\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) return;\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10);\n me.parent.maybeSpill();\n },\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) return true;\n if ((n -= used) == 0) break;\n at = 0;\n } else at -= sz;\n }\n }\n };\n\n var nextDocId = 0;\n var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) {\n if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep);\n if (firstLine == null) firstLine = 0;\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.frontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.extend = false;\n\n if (typeof text == \"string\") text = this.splitLines(text);\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) this.iterN(from - this.first, to - from, op);\n else this.iterN(this.first, this.first + this.size, from);\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) height += lines[i].height;\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) return lines;\n return lines.join(lineSep || this.lineSeparator());\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n setSelection(this, simpleSelection(top));\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) return lines;\n return lines.join(lineSep || this.lineSeparator());\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},\n\n getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},\n getLineNumber: function(line) {return lineNo(line);},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") line = getLine(this, line);\n return visualLine(line);\n },\n\n lineCount: function() {return this.size;},\n firstLine: function() {return this.first;},\n lastLine: function() {return this.first + this.size - 1;},\n\n clipPos: function(pos) {return clipPos(this, pos);},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") pos = range.head;\n else if (start == \"anchor\") pos = range.anchor;\n else if (start == \"end\" || start == \"to\" || start === false) pos = range.to();\n else pos = range.from();\n return pos;\n },\n listSelections: function() { return this.sel.ranges; },\n somethingSelected: function() {return this.sel.somethingSelected();},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) return;\n for (var i = 0, out = []; i < ranges.length; i++)\n out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head));\n if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex);\n setSelection(this, normalizeSelection(out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) return lines;\n else return lines.join(lineSep || this.lineSeparator());\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator());\n parts[i] = sel;\n }\n return parts;\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n dup[i] = code;\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i = changes.length - 1; i >= 0; i--)\n makeChange(this, changes[i]);\n if (newSel) setSelectionReplaceHistory(this, newSel);\n else if (this.cm) ensureCursorVisible(this.cm);\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend;},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done;\n for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone;\n return {undo: done, redo: undone};\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null;\n return this.history.generation;\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration);\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)};\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function(line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) line[prop] = cls;\n else if (classTest(cls).test(line[prop])) return false;\n else line[prop] += \" \" + cls;\n return true;\n });\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function(line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) return false;\n else if (cls == null) line[prop] = null;\n else {\n var found = cur.match(classTest(cls));\n if (!found) return false;\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true;\n });\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options);\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\");\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\");\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n markers.push(span.marker.parent || span.marker);\n }\n return markers;\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function(line) {\n var spans = line.markedSpans;\n if (spans) for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n found.push(span.marker.parent || span.marker);\n }\n ++lineNo;\n });\n return found;\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function(line) {\n var sps = line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i)\n if (sps[i].from != null) markers.push(sps[i].marker);\n });\n return markers;\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function(line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true; }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch));\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) return 0;\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) {\n index += line.text.length + sepSize;\n });\n return index;\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc;\n },\n\n linkedDoc: function(options) {\n if (!options) options = {};\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) from = options.from;\n if (options.to != null && options.to < to) to = options.to;\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep);\n if (options.sharedHist) copy.history = this.history;\n (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy;\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) other = other.doc;\n if (this.linked) for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) continue;\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break;\n }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode;},\n getEditor: function() {return this.cm;},\n\n splitLines: function(str) {\n if (this.lineSep) return str.split(this.lineSep);\n return splitLinesAuto(str);\n },\n lineSeparator: function() { return this.lineSep || \"\\n\"; }\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments);};\n })(Doc.prototype[prop]);\n\n eventMixin(Doc);\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) throw new Error(\"This document is already in use.\");\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n if (!cm.options.lineWrapping) findMaxLine(cm);\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n // LINE UTILITIES\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\");\n for (var chunk = doc; !chunk.lines;) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break; }\n n -= sz;\n }\n }\n return chunk.lines[n];\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }\n\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }\n\n // HISTORY\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) array.pop();\n else break;\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, ore are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n var last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n pushSelectionToHistory(doc.sel, hist.done);\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) hist.done.shift();\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) signal(doc, \"historyAdded\");\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500);\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n hist.done[hist.done.length - 1] = sel;\n else\n pushSelectionToHistory(sel, hist.done);\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n clearSelectionEvents(hist.undone);\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n dest.push(sel);\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {\n if (line.markedSpans)\n (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans;\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n for (var i = 0, copy = []; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue;\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m;\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n }\n }\n }\n return copy;\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue;\n }\n for (var j = 0; j < sub.changes.length; ++j) {\n var cur = sub.changes[j];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break;\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // EVENT UTILITIES\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n var e_preventDefault = CodeMirror.e_preventDefault = function(e) {\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n };\n var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) {\n if (e.stopPropagation) e.stopPropagation();\n else e.cancelBubble = true;\n };\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false;\n }\n var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);};\n\n function e_target(e) {return e.target || e.srcElement;}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) b = 1;\n else if (e.button & 2) b = 3;\n else if (e.button & 4) b = 2;\n }\n if (mac && e.ctrlKey && b == 1) b = 3;\n return b;\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var on = CodeMirror.on = function(emitter, type, f) {\n if (emitter.addEventListener)\n emitter.addEventListener(type, f, false);\n else if (emitter.attachEvent)\n emitter.attachEvent(\"on\" + type, f);\n else {\n var map = emitter._handlers || (emitter._handlers = {});\n var arr = map[type] || (map[type] = []);\n arr.push(f);\n }\n };\n\n var noHandlers = []\n function getHandlers(emitter, type, copy) {\n var arr = emitter._handlers && emitter._handlers[type]\n if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers\n else return arr || noHandlers\n }\n\n var off = CodeMirror.off = function(emitter, type, f) {\n if (emitter.removeEventListener)\n emitter.removeEventListener(type, f, false);\n else if (emitter.detachEvent)\n emitter.detachEvent(\"on\" + type, f);\n else {\n var handlers = getHandlers(emitter, type, false)\n for (var i = 0; i < handlers.length; ++i)\n if (handlers[i] == f) { handlers.splice(i, 1); break; }\n }\n };\n\n var signal = CodeMirror.signal = function(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type, true)\n if (!handlers.length) return;\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args);\n };\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type, false)\n if (!arr.length) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) delayed[i]();\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) return;\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1)\n set.push(arr[i]);\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // MISC UTILITIES\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = CodeMirror.Pass = {toString: function(){return \"CodeMirror.Pass\";}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n function Delayed() {this.id = null;}\n Delayed.prototype.set = function(ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n return n + (end - i);\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n };\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n var findColumn = CodeMirror.findColumn = function(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n spaceStrs.push(lst(spaceStrs) + \" \");\n return spaceStrs[n];\n }\n\n function lst(arr) { return arr[arr.length-1]; }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; };\n else if (ie) // Suppress mysterious IE10 errors\n selectInput = function(node) { try { node.select(); } catch(_e) {} };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n if (array[i] == elt) return i;\n return -1;\n }\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) out[i] = f(array[i], i);\n return out;\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) copyObj(props, inst);\n return inst;\n };\n\n function copyObj(obj, target, overwrite) {\n if (!target) target = {};\n for (var prop in obj)\n if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n target[prop] = obj[prop];\n return target;\n }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args);};\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n var isWordCharBasic = CodeMirror.isWordChar = function(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));\n };\n function isWordChar(ch, helper) {\n if (!helper) return isWordCharBasic(ch);\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) return true;\n return helper.test(ch);\n }\n\n function isEmpty(obj) {\n for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false;\n return true;\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); }\n\n // DOM UTILITIES\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) e.className = className;\n if (style) e.style.cssText = style;\n if (typeof content == \"string\") e.appendChild(document.createTextNode(content));\n else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);\n return e;\n }\n\n var range;\n if (document.createRange) range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r;\n };\n else range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r; }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r;\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n e.removeChild(e.firstChild);\n return e;\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e);\n }\n\n var contains = CodeMirror.contains = function(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n child = child.parentNode;\n if (parent.contains)\n return parent.contains(child);\n do {\n if (child.nodeType == 11) child = child.host;\n if (child == parent) return true;\n } while (child = child.parentNode);\n };\n\n function activeElt() {\n var activeElement = document.activeElement;\n while (activeElement && activeElement.root && activeElement.root.activeElement)\n activeElement = activeElement.root.activeElement;\n return activeElement;\n }\n // Older versions of IE throws unspecified error when touching\n // document.activeElement in some cases (during loading, in iframe)\n if (ie && ie_version < 11) activeElt = function() {\n try { return document.activeElement; }\n catch(e) { return document.body; }\n };\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\"); }\n var rmClass = CodeMirror.rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n var addClass = CodeMirror.addClass = function(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) node.className += (current ? \" \" : \"\") + cls;\n };\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n if (as[i] && !classTest(as[i]).test(b)) b += \" \" + as[i];\n return b;\n }\n\n // WINDOW-WIDE EVENTS\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.body.getElementsByClassName) return;\n var byClass = document.body.getElementsByClassName(\"CodeMirror\");\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) f(cm);\n }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) return;\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function() {\n if (resizeTimer == null) resizeTimer = setTimeout(function() {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100);\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function() {\n forEachCodeMirror(onBlur);\n });\n }\n\n // FEATURE DETECTION\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) return false;\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div;\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8);\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node;\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) return badBidiRects;\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3);\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = CodeMirror.splitLines = \"\\n\\nb\".split(/\\n/).length != 3 ? function(string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) nl = string.length;\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result;\n } : function(string){return string.split(/\\r\\n?|\\n/);};\n\n var hasSelection = window.getSelection ? function(te) {\n try { return te.selectionStart != te.selectionEnd; }\n catch(e) { return false; }\n } : function(te) {\n try {var range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) return false;\n return range.compareEndPoints(\"StartToEnd\", range) != 0;\n };\n\n var hasCopyEvent = (function() {\n var e = elt(\"div\");\n if (\"oncopy\" in e) return true;\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\";\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) return badZoomedRects;\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1;\n }\n\n // KEY NAMES\n\n var keyNames = CodeMirror.keyNames = {\n 3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n (function() {\n // Number keys\n for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i);\n // Alphabetic keys\n for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);\n // Function keys\n for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = \"F\" + i;\n })();\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) return f(from, to, \"ltr\");\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\");\n found = true;\n }\n }\n if (!found) f(from, to, \"ltr\");\n }\n\n function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }\n function bidiRight(part) { return part.level % 2 ? part.from : part.to; }\n\n function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }\n function lineRight(line) {\n var order = getOrder(line);\n if (!order) return line.text.length;\n return bidiRight(lst(order));\n }\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) lineN = lineNo(visual);\n var order = getOrder(visual);\n var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);\n return Pos(lineN, ch);\n }\n function lineEnd(cm, lineN) {\n var merged, line = getLine(cm.doc, lineN);\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n lineN = null;\n }\n var order = getOrder(line);\n var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);\n return Pos(lineN == null ? lineNo(line) : lineN, ch);\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS);\n }\n return start;\n }\n\n function compareBidiLevel(order, a, b) {\n var linedir = order[0].level;\n if (a == linedir) return true;\n if (b == linedir) return false;\n return a < b;\n }\n var bidiOther;\n function getBidiPartAt(order, pos) {\n bidiOther = null;\n for (var i = 0, found; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < pos && cur.to > pos) return i;\n if ((cur.from == pos || cur.to == pos)) {\n if (found == null) {\n found = i;\n } else if (compareBidiLevel(order, cur.level, order[found].level)) {\n if (cur.from != cur.to) bidiOther = found;\n return i;\n } else {\n if (cur.from != cur.to) bidiOther = i;\n return found;\n }\n }\n }\n return found;\n }\n\n function moveInLine(line, pos, dir, byUnit) {\n if (!byUnit) return pos + dir;\n do pos += dir;\n while (pos > 0 && isExtendingChar(line.text.charAt(pos)));\n return pos;\n }\n\n // This is needed in order to move 'visually' through bi-directional\n // text -- i.e., pressing left should make the cursor go left, even\n // when in RTL text. The tricky part is the 'jumps', where RTL and\n // LTR text touch each other. This often requires the cursor offset\n // to move more than one unit, in order to visually move one unit.\n function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }\n\n function moveLogically(line, start, dir, byUnit) {\n var target = start + dir;\n if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir;\n return target < 0 || target > line.text.length ? null : target;\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6ff\n var arabicTypes = \"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm\";\n function charType(code) {\n if (code <= 0xf7) return lowTypes.charAt(code);\n else if (0x590 <= code && code <= 0x5f4) return \"R\";\n else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600);\n else if (0x6ee <= code && code <= 0x8ac) return \"r\";\n else if (0x2000 <= code && code <= 0x200b) return \"w\";\n else if (code == 0x200c) return \"b\";\n else return \"L\";\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n // Browsers seem to always treat the boundaries of block elements as being L.\n var outerType = \"L\";\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str) {\n if (!bidiRE.test(str)) return false;\n var len = str.length, types = [];\n for (var i = 0, type; i < len; ++i)\n types.push(type = charType(str.charCodeAt(i)));\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i = 0, prev = outerType; i < len; ++i) {\n var type = types[i];\n if (type == \"m\") types[i] = prev;\n else prev = type;\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i = 0, cur = outerType; i < len; ++i) {\n var type = types[i];\n if (type == \"1\" && cur == \"r\") types[i] = \"n\";\n else if (isStrong.test(type)) { cur = type; if (type == \"r\") types[i] = \"R\"; }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i = 1, prev = types[0]; i < len - 1; ++i) {\n var type = types[i];\n if (type == \"+\" && prev == \"1\" && types[i+1] == \"1\") types[i] = \"1\";\n else if (type == \",\" && prev == types[i+1] &&\n (prev == \"1\" || prev == \"n\")) types[i] = prev;\n prev = type;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i = 0; i < len; ++i) {\n var type = types[i];\n if (type == \",\") types[i] = \"N\";\n else if (type == \"%\") {\n for (var end = i + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i && types[i-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i; j < end; ++j) types[j] = replace;\n i = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i = 0, cur = outerType; i < len; ++i) {\n var type = types[i];\n if (cur == \"L\" && type == \"1\") types[i] = \"L\";\n else if (isStrong.test(type)) cur = type;\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i = 0; i < len; ++i) {\n if (isNeutral.test(types[i])) {\n for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}\n var before = (i ? types[i-1] : outerType) == \"L\";\n var after = (end < len ? types[end] : outerType) == \"L\";\n var replace = before || after ? \"L\" : \"R\";\n for (var j = i; j < end; ++j) types[j] = replace;\n i = end - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i = 0; i < len;) {\n if (countsAsLeft.test(types[i])) {\n var start = i;\n for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}\n order.push(new BidiSpan(0, start, i));\n } else {\n var pos = i, at = order.length;\n for (++i; i < len && types[i] != \"L\"; ++i) {}\n for (var j = pos; j < i;) {\n if (countsAsNum.test(types[j])) {\n if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j));\n var nstart = j;\n for (++j; j < i && countsAsNum.test(types[j]); ++j) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j));\n pos = j;\n } else ++j;\n }\n if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i));\n }\n }\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n if (order[0].level == 2)\n order.unshift(new BidiSpan(1, order[0].to, order[0].to));\n if (order[0].level != lst(order).level)\n order.push(new BidiSpan(order[0].level, len, len));\n\n return order;\n };\n })();\n\n // THE END\n\n CodeMirror.version = \"5.17.0\";\n\n return CodeMirror;\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.runMode = function(string, modespec, callback, options) {\n var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);\n var ie = /MSIE \\d/.test(navigator.userAgent);\n var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);\n\n if (callback.appendChild) {\n var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;\n var node = callback, col = 0;\n node.innerHTML = \"\";\n callback = function(text, style) {\n if (text == \"\\n\") {\n // Emitting LF or CRLF on IE8 or earlier results in an incorrect display.\n // Emitting a carriage return makes everything ok.\n node.appendChild(document.createTextNode(ie_lt9 ? '\\r' : text));\n col = 0;\n return;\n }\n var content = \"\";\n // replace tabs\n for (var pos = 0;;) {\n var idx = text.indexOf(\"\\t\", pos);\n if (idx == -1) {\n content += text.slice(pos);\n col += text.length - pos;\n break;\n } else {\n col += idx - pos;\n content += text.slice(pos, idx);\n var size = tabSize - col % tabSize;\n col += size;\n for (var i = 0; i < size; ++i) content += \" \";\n pos = idx + 1;\n }\n }\n\n if (style) {\n var sp = node.appendChild(document.createElement(\"span\"));\n sp.className = \"cm-\" + style.replace(/ +/g, \" cm-\");\n sp.appendChild(document.createTextNode(content));\n } else {\n node.appendChild(document.createTextNode(content));\n }\n };\n }\n\n var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);\n for (var i = 0, e = lines.length; i < e; ++i) {\n if (i) callback(\"\\n\");\n var stream = new CodeMirror.StringStream(lines[i]);\n if (!stream.string && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n callback(stream.current(), style, i, stream.start, state);\n stream.start = stream.pos;\n }\n }\n};\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../xml/xml\"), require(\"../javascript/javascript\"), require(\"../css/css\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../xml/xml\", \"../javascript/javascript\", \"../css/css\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var defaultTags = {\n script: [\n [\"lang\", /(javascript|babel)/i, \"javascript\"],\n [\"type\", /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^$/i, \"javascript\"],\n [\"type\", /./, \"text/plain\"],\n [null, null, \"javascript\"]\n ],\n style: [\n [\"lang\", /^css$/i, \"css\"],\n [\"type\", /^(text\\/)?(x-)?(stylesheet|css)$/i, \"css\"],\n [\"type\", /./, \"text/plain\"],\n [null, null, \"css\"]\n ]\n };\n\n function maybeBackup(stream, pat, style) {\n var cur = stream.current(), close = cur.search(pat);\n if (close > -1) {\n stream.backUp(cur.length - close);\n } else if (cur.match(/<\\/?$/)) {\n stream.backUp(cur.length);\n if (!stream.match(pat, false)) stream.match(cur);\n }\n return style;\n }\n\n var attrRegexpCache = {};\n function getAttrRegexp(attr) {\n var regexp = attrRegexpCache[attr];\n if (regexp) return regexp;\n return attrRegexpCache[attr] = new RegExp(\"\\\\s+\" + attr + \"\\\\s*=\\\\s*('|\\\")?([^'\\\"]+)('|\\\")?\\\\s*\");\n }\n\n function getAttrValue(text, attr) {\n var match = text.match(getAttrRegexp(attr))\n return match ? match[2] : \"\"\n }\n\n function getTagRegexp(tagName, anchored) {\n return new RegExp((anchored ? \"^\" : \"\") + \"<\\/\\s*\" + tagName + \"\\s*>\", \"i\");\n }\n\n function addTags(from, to) {\n for (var tag in from) {\n var dest = to[tag] || (to[tag] = []);\n var source = from[tag];\n for (var i = source.length - 1; i >= 0; i--)\n dest.unshift(source[i])\n }\n }\n\n function findMatchingMode(tagInfo, tagText) {\n for (var i = 0; i < tagInfo.length; i++) {\n var spec = tagInfo[i];\n if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];\n }\n }\n\n CodeMirror.defineMode(\"htmlmixed\", function (config, parserConfig) {\n var htmlMode = CodeMirror.getMode(config, {\n name: \"xml\",\n htmlMode: true,\n multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,\n multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag\n });\n\n var tags = {};\n var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;\n addTags(defaultTags, tags);\n if (configTags) addTags(configTags, tags);\n if (configScript) for (var i = configScript.length - 1; i >= 0; i--)\n tags.script.unshift([\"type\", configScript[i].matches, configScript[i].mode])\n\n function html(stream, state) {\n var style = htmlMode.token(stream, state.htmlState), tag = /\\btag\\b/.test(style), tagName\n if (tag && !/[<>\\s\\/]/.test(stream.current()) &&\n (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&\n tags.hasOwnProperty(tagName)) {\n state.inTag = tagName + \" \"\n } else if (state.inTag && tag && />$/.test(stream.current())) {\n var inTag = /^([\\S]+) (.*)/.exec(state.inTag)\n state.inTag = null\n var modeSpec = stream.current() == \">\" && findMatchingMode(tags[inTag[1]], inTag[2])\n var mode = CodeMirror.getMode(config, modeSpec)\n var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);\n state.token = function (stream, state) {\n if (stream.match(endTagA, false)) {\n state.token = html;\n state.localState = state.localMode = null;\n return null;\n }\n return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));\n };\n state.localMode = mode;\n state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, \"\"));\n } else if (state.inTag) {\n state.inTag += stream.current()\n if (stream.eol()) state.inTag += \" \"\n }\n return style;\n };\n\n return {\n startState: function () {\n var state = CodeMirror.startState(htmlMode);\n return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};\n },\n\n copyState: function (state) {\n var local;\n if (state.localState) {\n local = CodeMirror.copyState(state.localMode, state.localState);\n }\n return {token: state.token, inTag: state.inTag,\n localMode: state.localMode, localState: local,\n htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};\n },\n\n token: function (stream, state) {\n return state.token(stream, state);\n },\n\n indent: function (state, textAfter) {\n if (!state.localMode || /^\\s*<\\//.test(textAfter))\n return htmlMode.indent(state.htmlState, textAfter);\n else if (state.localMode.indent)\n return state.localMode.indent(state.localState, textAfter);\n else\n return CodeMirror.Pass;\n },\n\n innerMode: function (state) {\n return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};\n }\n };\n }, \"xml\", \"javascript\", \"css\");\n\n CodeMirror.defineMIME(\"text/html\", \"htmlmixed\");\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../htmlmixed/htmlmixed\"), require(\"../ruby/ruby\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../htmlmixed/htmlmixed\", \"../ruby/ruby\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\n CodeMirror.defineMode(\"slim\", function(config) {\n var htmlMode = CodeMirror.getMode(config, {name: \"htmlmixed\"});\n var rubyMode = CodeMirror.getMode(config, \"ruby\");\n var modes = { html: htmlMode, ruby: rubyMode };\n var embedded = {\n ruby: \"ruby\",\n javascript: \"javascript\",\n css: \"text/css\",\n sass: \"text/x-sass\",\n scss: \"text/x-scss\",\n less: \"text/x-less\",\n styl: \"text/x-styl\", // no highlighting so far\n coffee: \"coffeescript\",\n asciidoc: \"text/x-asciidoc\",\n markdown: \"text/x-markdown\",\n textile: \"text/x-textile\", // no highlighting so far\n creole: \"text/x-creole\", // no highlighting so far\n wiki: \"text/x-wiki\", // no highlighting so far\n mediawiki: \"text/x-mediawiki\", // no highlighting so far\n rdoc: \"text/x-rdoc\", // no highlighting so far\n builder: \"text/x-builder\", // no highlighting so far\n nokogiri: \"text/x-nokogiri\", // no highlighting so far\n erb: \"application/x-erb\"\n };\n var embeddedRegexp = function(map){\n var arr = [];\n for(var key in map) arr.push(key);\n return new RegExp(\"^(\"+arr.join('|')+\"):\");\n }(embedded);\n\n var styleMap = {\n \"commentLine\": \"comment\",\n \"slimSwitch\": \"operator special\",\n \"slimTag\": \"tag\",\n \"slimId\": \"attribute def\",\n \"slimClass\": \"attribute qualifier\",\n \"slimAttribute\": \"attribute\",\n \"slimSubmode\": \"keyword special\",\n \"closeAttributeTag\": null,\n \"slimDoctype\": null,\n \"lineContinuation\": null\n };\n var closing = {\n \"{\": \"}\",\n \"[\": \"]\",\n \"(\": \")\"\n };\n\n var nameStartChar = \"_a-zA-Z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\";\n var nameChar = nameStartChar + \"\\\\-0-9\\xB7\\u0300-\\u036F\\u203F-\\u2040\";\n var nameRegexp = new RegExp(\"^[:\"+nameStartChar+\"](?::[\"+nameChar+\"]|[\"+nameChar+\"]*)\");\n var attributeNameRegexp = new RegExp(\"^[:\"+nameStartChar+\"][:\\\\.\"+nameChar+\"]*(?=\\\\s*=)\");\n var wrappedAttributeNameRegexp = new RegExp(\"^[:\"+nameStartChar+\"][:\\\\.\"+nameChar+\"]*\");\n var classNameRegexp = /^\\.-?[_a-zA-Z]+[\\w\\-]*/;\n var classIdRegexp = /^#[_a-zA-Z]+[\\w\\-]*/;\n\n function backup(pos, tokenize, style) {\n var restore = function(stream, state) {\n state.tokenize = tokenize;\n if (stream.pos < pos) {\n stream.pos = pos;\n return style;\n }\n return state.tokenize(stream, state);\n };\n return function(stream, state) {\n state.tokenize = restore;\n return tokenize(stream, state);\n };\n }\n\n function maybeBackup(stream, state, pat, offset, style) {\n var cur = stream.current();\n var idx = cur.search(pat);\n if (idx > -1) {\n state.tokenize = backup(stream.pos, state.tokenize, style);\n stream.backUp(cur.length - idx - offset);\n }\n return style;\n }\n\n function continueLine(state, column) {\n state.stack = {\n parent: state.stack,\n style: \"continuation\",\n indented: column,\n tokenize: state.line\n };\n state.line = state.tokenize;\n }\n function finishContinue(state) {\n if (state.line == state.tokenize) {\n state.line = state.stack.tokenize;\n state.stack = state.stack.parent;\n }\n }\n\n function lineContinuable(column, tokenize) {\n return function(stream, state) {\n finishContinue(state);\n if (stream.match(/^\\\\$/)) {\n continueLine(state, column);\n return \"lineContinuation\";\n }\n var style = tokenize(stream, state);\n if (stream.eol() && stream.current().match(/(?:^|[^\\\\])(?:\\\\\\\\)*\\\\$/)) {\n stream.backUp(1);\n }\n return style;\n };\n }\n function commaContinuable(column, tokenize) {\n return function(stream, state) {\n finishContinue(state);\n var style = tokenize(stream, state);\n if (stream.eol() && stream.current().match(/,$/)) {\n continueLine(state, column);\n }\n return style;\n };\n }\n\n function rubyInQuote(endQuote, tokenize) {\n // TODO: add multi line support\n return function(stream, state) {\n var ch = stream.peek();\n if (ch == endQuote && state.rubyState.tokenize.length == 1) {\n // step out of ruby context as it seems to complete processing all the braces\n stream.next();\n state.tokenize = tokenize;\n return \"closeAttributeTag\";\n } else {\n return ruby(stream, state);\n }\n };\n }\n function startRubySplat(tokenize) {\n var rubyState;\n var runSplat = function(stream, state) {\n if (state.rubyState.tokenize.length == 1 && !state.rubyState.context.prev) {\n stream.backUp(1);\n if (stream.eatSpace()) {\n state.rubyState = rubyState;\n state.tokenize = tokenize;\n return tokenize(stream, state);\n }\n stream.next();\n }\n return ruby(stream, state);\n };\n return function(stream, state) {\n rubyState = state.rubyState;\n state.rubyState = CodeMirror.startState(rubyMode);\n state.tokenize = runSplat;\n return ruby(stream, state);\n };\n }\n\n function ruby(stream, state) {\n return rubyMode.token(stream, state.rubyState);\n }\n\n function htmlLine(stream, state) {\n if (stream.match(/^\\\\$/)) {\n return \"lineContinuation\";\n }\n return html(stream, state);\n }\n function html(stream, state) {\n if (stream.match(/^#\\{/)) {\n state.tokenize = rubyInQuote(\"}\", state.tokenize);\n return null;\n }\n return maybeBackup(stream, state, /[^\\\\]#\\{/, 1, htmlMode.token(stream, state.htmlState));\n }\n\n function startHtmlLine(lastTokenize) {\n return function(stream, state) {\n var style = htmlLine(stream, state);\n if (stream.eol()) state.tokenize = lastTokenize;\n return style;\n };\n }\n\n function startHtmlMode(stream, state, offset) {\n state.stack = {\n parent: state.stack,\n style: \"html\",\n indented: stream.column() + offset, // pipe + space\n tokenize: state.line\n };\n state.line = state.tokenize = html;\n return null;\n }\n\n function comment(stream, state) {\n stream.skipToEnd();\n return state.stack.style;\n }\n\n function commentMode(stream, state) {\n state.stack = {\n parent: state.stack,\n style: \"comment\",\n indented: state.indented + 1,\n tokenize: state.line\n };\n state.line = comment;\n return comment(stream, state);\n }\n\n function attributeWrapper(stream, state) {\n if (stream.eat(state.stack.endQuote)) {\n state.line = state.stack.line;\n state.tokenize = state.stack.tokenize;\n state.stack = state.stack.parent;\n return null;\n }\n if (stream.match(wrappedAttributeNameRegexp)) {\n state.tokenize = attributeWrapperAssign;\n return \"slimAttribute\";\n }\n stream.next();\n return null;\n }\n function attributeWrapperAssign(stream, state) {\n if (stream.match(/^==?/)) {\n state.tokenize = attributeWrapperValue;\n return null;\n }\n return attributeWrapper(stream, state);\n }\n function attributeWrapperValue(stream, state) {\n var ch = stream.peek();\n if (ch == '\"' || ch == \"\\'\") {\n state.tokenize = readQuoted(ch, \"string\", true, false, attributeWrapper);\n stream.next();\n return state.tokenize(stream, state);\n }\n if (ch == '[') {\n return startRubySplat(attributeWrapper)(stream, state);\n }\n if (stream.match(/^(true|false|nil)\\b/)) {\n state.tokenize = attributeWrapper;\n return \"keyword\";\n }\n return startRubySplat(attributeWrapper)(stream, state);\n }\n\n function startAttributeWrapperMode(state, endQuote, tokenize) {\n state.stack = {\n parent: state.stack,\n style: \"wrapper\",\n indented: state.indented + 1,\n tokenize: tokenize,\n line: state.line,\n endQuote: endQuote\n };\n state.line = state.tokenize = attributeWrapper;\n return null;\n }\n\n function sub(stream, state) {\n if (stream.match(/^#\\{/)) {\n state.tokenize = rubyInQuote(\"}\", state.tokenize);\n return null;\n }\n var subStream = new CodeMirror.StringStream(stream.string.slice(state.stack.indented), stream.tabSize);\n subStream.pos = stream.pos - state.stack.indented;\n subStream.start = stream.start - state.stack.indented;\n subStream.lastColumnPos = stream.lastColumnPos - state.stack.indented;\n subStream.lastColumnValue = stream.lastColumnValue - state.stack.indented;\n var style = state.subMode.token(subStream, state.subState);\n stream.pos = subStream.pos + state.stack.indented;\n return style;\n }\n function firstSub(stream, state) {\n state.stack.indented = stream.column();\n state.line = state.tokenize = sub;\n return state.tokenize(stream, state);\n }\n\n function createMode(mode) {\n var query = embedded[mode];\n var spec = CodeMirror.mimeModes[query];\n if (spec) {\n return CodeMirror.getMode(config, spec);\n }\n var factory = CodeMirror.modes[query];\n if (factory) {\n return factory(config, {name: query});\n }\n return CodeMirror.getMode(config, \"null\");\n }\n\n function getMode(mode) {\n if (!modes.hasOwnProperty(mode)) {\n return modes[mode] = createMode(mode);\n }\n return modes[mode];\n }\n\n function startSubMode(mode, state) {\n var subMode = getMode(mode);\n var subState = CodeMirror.startState(subMode);\n\n state.subMode = subMode;\n state.subState = subState;\n\n state.stack = {\n parent: state.stack,\n style: \"sub\",\n indented: state.indented + 1,\n tokenize: state.line\n };\n state.line = state.tokenize = firstSub;\n return \"slimSubmode\";\n }\n\n function doctypeLine(stream, _state) {\n stream.skipToEnd();\n return \"slimDoctype\";\n }\n\n function startLine(stream, state) {\n var ch = stream.peek();\n if (ch == '<') {\n return (state.tokenize = startHtmlLine(state.tokenize))(stream, state);\n }\n if (stream.match(/^[|']/)) {\n return startHtmlMode(stream, state, 1);\n }\n if (stream.match(/^\\/(!|\\[\\w+])?/)) {\n return commentMode(stream, state);\n }\n if (stream.match(/^(-|==?[<>]?)/)) {\n state.tokenize = lineContinuable(stream.column(), commaContinuable(stream.column(), ruby));\n return \"slimSwitch\";\n }\n if (stream.match(/^doctype\\b/)) {\n state.tokenize = doctypeLine;\n return \"keyword\";\n }\n\n var m = stream.match(embeddedRegexp);\n if (m) {\n return startSubMode(m[1], state);\n }\n\n return slimTag(stream, state);\n }\n\n function slim(stream, state) {\n if (state.startOfLine) {\n return startLine(stream, state);\n }\n return slimTag(stream, state);\n }\n\n function slimTag(stream, state) {\n if (stream.eat('*')) {\n state.tokenize = startRubySplat(slimTagExtras);\n return null;\n }\n if (stream.match(nameRegexp)) {\n state.tokenize = slimTagExtras;\n return \"slimTag\";\n }\n return slimClass(stream, state);\n }\n function slimTagExtras(stream, state) {\n if (stream.match(/^(<>?|><?)/)) {\n state.tokenize = slimClass;\n return null;\n }\n return slimClass(stream, state);\n }\n function slimClass(stream, state) {\n if (stream.match(classIdRegexp)) {\n state.tokenize = slimClass;\n return \"slimId\";\n }\n if (stream.match(classNameRegexp)) {\n state.tokenize = slimClass;\n return \"slimClass\";\n }\n return slimAttribute(stream, state);\n }\n function slimAttribute(stream, state) {\n if (stream.match(/^([\\[\\{\\(])/)) {\n return startAttributeWrapperMode(state, closing[RegExp.$1], slimAttribute);\n }\n if (stream.match(attributeNameRegexp)) {\n state.tokenize = slimAttributeAssign;\n return \"slimAttribute\";\n }\n if (stream.peek() == '*') {\n stream.next();\n state.tokenize = startRubySplat(slimContent);\n return null;\n }\n return slimContent(stream, state);\n }\n function slimAttributeAssign(stream, state) {\n if (stream.match(/^==?/)) {\n state.tokenize = slimAttributeValue;\n return null;\n }\n // should never happen, because of forward lookup\n return slimAttribute(stream, state);\n }\n\n function slimAttributeValue(stream, state) {\n var ch = stream.peek();\n if (ch == '\"' || ch == \"\\'\") {\n state.tokenize = readQuoted(ch, \"string\", true, false, slimAttribute);\n stream.next();\n return state.tokenize(stream, state);\n }\n if (ch == '[') {\n return startRubySplat(slimAttribute)(stream, state);\n }\n if (ch == ':') {\n return startRubySplat(slimAttributeSymbols)(stream, state);\n }\n if (stream.match(/^(true|false|nil)\\b/)) {\n state.tokenize = slimAttribute;\n return \"keyword\";\n }\n return startRubySplat(slimAttribute)(stream, state);\n }\n function slimAttributeSymbols(stream, state) {\n stream.backUp(1);\n if (stream.match(/^[^\\s],(?=:)/)) {\n state.tokenize = startRubySplat(slimAttributeSymbols);\n return null;\n }\n stream.next();\n return slimAttribute(stream, state);\n }\n function readQuoted(quote, style, embed, unescaped, nextTokenize) {\n return function(stream, state) {\n finishContinue(state);\n var fresh = stream.current().length == 0;\n if (stream.match(/^\\\\$/, fresh)) {\n if (!fresh) return style;\n continueLine(state, state.indented);\n return \"lineContinuation\";\n }\n if (stream.match(/^#\\{/, fresh)) {\n if (!fresh) return style;\n state.tokenize = rubyInQuote(\"}\", state.tokenize);\n return null;\n }\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && (unescaped || !escaped)) {\n state.tokenize = nextTokenize;\n break;\n }\n if (embed && ch == \"#\" && !escaped) {\n if (stream.eat(\"{\")) {\n stream.backUp(2);\n break;\n }\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n if (stream.eol() && escaped) {\n stream.backUp(1);\n }\n return style;\n };\n }\n function slimContent(stream, state) {\n if (stream.match(/^==?/)) {\n state.tokenize = ruby;\n return \"slimSwitch\";\n }\n if (stream.match(/^\\/$/)) { // tag close hint\n state.tokenize = slim;\n return null;\n }\n if (stream.match(/^:/)) { // inline tag\n state.tokenize = slimTag;\n return \"slimSwitch\";\n }\n startHtmlMode(stream, state, 0);\n return state.tokenize(stream, state);\n }\n\n var mode = {\n // default to html mode\n startState: function() {\n var htmlState = CodeMirror.startState(htmlMode);\n var rubyState = CodeMirror.startState(rubyMode);\n return {\n htmlState: htmlState,\n rubyState: rubyState,\n stack: null,\n last: null,\n tokenize: slim,\n line: slim,\n indented: 0\n };\n },\n\n copyState: function(state) {\n return {\n htmlState : CodeMirror.copyState(htmlMode, state.htmlState),\n rubyState: CodeMirror.copyState(rubyMode, state.rubyState),\n subMode: state.subMode,\n subState: state.subMode && CodeMirror.copyState(state.subMode, state.subState),\n stack: state.stack,\n last: state.last,\n tokenize: state.tokenize,\n line: state.line\n };\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n state.indented = stream.indentation();\n state.startOfLine = true;\n state.tokenize = state.line;\n while (state.stack && state.stack.indented > state.indented && state.last != \"slimSubmode\") {\n state.line = state.tokenize = state.stack.tokenize;\n state.stack = state.stack.parent;\n state.subMode = null;\n state.subState = null;\n }\n }\n if (stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n state.startOfLine = false;\n if (style) state.last = style;\n return styleMap.hasOwnProperty(style) ? styleMap[style] : style;\n },\n\n blankLine: function(state) {\n if (state.subMode && state.subMode.blankLine) {\n return state.subMode.blankLine(state.subState);\n }\n },\n\n innerMode: function(state) {\n if (state.subMode) return {state: state.subState, mode: state.subMode};\n return {state: state, mode: mode};\n }\n\n //indent: function(state) {\n // return state.indented;\n //}\n };\n return mode;\n }, \"htmlmixed\", \"ruby\");\n\n CodeMirror.defineMIME(\"text/x-slim\", \"slim\");\n CodeMirror.defineMIME(\"application/x-slim\", \"slim\");\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// TODO actually recognize syntax of TypeScript constructs\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nfunction expressionAllowed(stream, state, backUp) {\n return /^(?:operator|sof|keyword c|case|new|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n}\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n var jsKeywords = {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": C, \"break\": C, \"continue\": C, \"new\": kw(\"new\"), \"delete\": C, \"throw\": C, \"debugger\": C,\n \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C, \"async\": kw(\"async\")\n };\n\n // Extend the 'normal' keywords with the TypeScript language extensions\n if (isTS) {\n var type = {type: \"variable\", style: \"variable-3\"};\n var tsKeywords = {\n // object-like things\n \"interface\": kw(\"class\"),\n \"implements\": C,\n \"namespace\": C,\n \"module\": kw(\"module\"),\n \"enum\": kw(\"module\"),\n\n // scope modifiers\n \"public\": kw(\"modifier\"),\n \"private\": kw(\"modifier\"),\n \"protected\": kw(\"modifier\"),\n \"abstract\": kw(\"modifier\"),\n\n // operators\n \"as\": operator,\n\n // types\n \"string\": type, \"number\": type, \"boolean\": type, \"any\": type\n };\n\n for (var attr in tsKeywords) {\n jsKeywords[attr] = tsKeywords[attr];\n }\n }\n\n return jsKeywords;\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d+(?:[eE][+\\-]?\\d+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.eat(/x/i)) {\n stream.eatWhile(/[\\da-f]/i);\n return ret(\"number\", \"number\");\n } else if (ch == \"0\" && stream.eat(/o/i)) {\n stream.eatWhile(/[0-7]/i);\n return ret(\"number\", \"number\");\n } else if (ch == \"0\" && stream.eat(/b/i)) {\n stream.eatWhile(/[01]/i);\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^\\d*(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyu])(?![gimyu]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eatWhile(isOperatorChar);\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\") {\n stream.skipToEnd();\n return ret(\"error\", \"error\");\n } else if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];\n return (known && state.lastType != \".\") ? ret(known.type, known.style, word) :\n ret(\"variable\", \"variable\", word);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) break;\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/]/.test(ch)) {\n return;\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true, \"regexp\": true, \"this\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function register(varname) {\n function inList(list) {\n for (var v = list; v; v = v.next)\n if (v.name == varname) return true;\n return false;\n }\n var state = cx.state;\n cx.marked = \"def\";\n if (state.context) {\n if (inList(state.localVars)) return;\n state.localVars = {name: varname, next: state.localVars};\n } else {\n if (inList(state.globalVars)) return;\n if (parserConfig.globalVars)\n state.globalVars = {name: varname, next: state.globalVars};\n }\n }\n\n // Combinators\n\n var defaultVars = {name: \"this\", next: {name: \"arguments\"}};\n function pushcontext() {\n cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};\n cx.state.localVars = defaultVars;\n }\n function popcontext() {\n cx.state.localVars = cx.state.context.vars;\n cx.state.context = cx.state.context.prev;\n }\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value.length), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), expression, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"{\") return cont(pushlex(\"}\"), block, poplex);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), expression, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), forspec, statement, poplex);\n if (type == \"variable\") return cont(pushlex(\"stat\"), maybelabel);\n if (type == \"switch\") return cont(pushlex(\"form\"), expression, pushlex(\"}\", \"switch\"), expect(\"{\"),\n block, poplex, poplex);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, expect(\"(\"), funarg, expect(\")\"),\n statement, poplex, popcontext);\n if (type == \"class\") return cont(pushlex(\"form\"), className, poplex);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"module\") return cont(pushlex(\"form\"), pattern, pushlex(\"}\"), expect(\"{\"), block, poplex, poplex)\n if (type == \"async\") return cont(statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function expression(type) {\n return expressionInner(type, false);\n }\n function expressionNoComma(type) {\n return expressionInner(type, true);\n }\n function expressionInner(type, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(pattern, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? maybeexpressionNoComma : maybeexpression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n function maybeexpressionNoComma(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expressionNoComma);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(expression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value)) return cont(me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(expression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") return cont(objprop);\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (type == \"modifier\") {\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expression);\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end) {\n function proceed(type, value) {\n if (type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type) {\n if (isTS && type == \":\") return cont(typeexpr);\n }\n function maybedefault(_, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function typeexpr(type) {\n if (type == \"variable\") {cx.marked = \"variable-3\"; return cont(afterType);}\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(commasep(typeexpr, \">\"), afterType)\n if (type == \"[\") return cont(expect(\"]\"), afterType)\n }\n function vardef() {\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (type == \"modifier\") return cont(pattern)\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(pattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type) {\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, expect(\")\"), poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, expect(\";\"), forspec2);\n if (type == \";\") return cont(forspec2);\n if (type == \"variable\") return cont(formaybeinof);\n return pass(expression, expect(\";\"), forspec2);\n }\n function formaybeinof(_type, value) {\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression); }\n return cont(maybeoperatorComma, forspec2);\n }\n function forspec2(type, value) {\n if (type == \";\") return cont(forspec3);\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression); }\n return pass(expression, expect(\";\"), forspec3);\n }\n function forspec3(type) {\n if (type != \")\") cont(expression);\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, maybetype, statement, popcontext);\n }\n function funarg(type) {\n if (type == \"spread\") return cont(funarg);\n return pass(pattern, maybetype, maybedefault);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"extends\") return cont(expression, classNameAfter);\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n if (value == \"static\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(classGetterSetter, functiondef, classBody);\n return cont(functiondef, classBody);\n }\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \";\") return cont(classBody);\n if (type == \"}\") return cont();\n }\n function classGetterSetter(type) {\n if (type != \"variable\") return pass();\n cx.marked = \"property\";\n return cont();\n }\n function afterExport(_type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n return pass(statement);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n return pass(importSpec, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(expressionNoComma, commasep(expressionNoComma, \"]\"));\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && {vars: parserConfig.localVars},\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse) break;\n }\n if (lexical.type == \"stat\" && firstChar == \"}\") lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n skipExpression: function(state) {\n var top = state.cc[state.cc.length - 1]\n if (top == expression || top == expressionNoComma) state.cc.pop()\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"application/x-json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"application/ld+json\", {name: \"javascript\", jsonld: true});\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"css\", function(config, parserConfig) {\n var inline = parserConfig.inline\n if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode(\"text/css\");\n\n var indentUnit = config.indentUnit,\n tokenHooks = parserConfig.tokenHooks,\n documentTypes = parserConfig.documentTypes || {},\n mediaTypes = parserConfig.mediaTypes || {},\n mediaFeatures = parserConfig.mediaFeatures || {},\n mediaValueKeywords = parserConfig.mediaValueKeywords || {},\n propertyKeywords = parserConfig.propertyKeywords || {},\n nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},\n fontProperties = parserConfig.fontProperties || {},\n counterDescriptors = parserConfig.counterDescriptors || {},\n colorKeywords = parserConfig.colorKeywords || {},\n valueKeywords = parserConfig.valueKeywords || {},\n allowNested = parserConfig.allowNested,\n supportsAtComponent = parserConfig.supportsAtComponent === true;\n\n var type, override;\n function ret(style, tp) { type = tp; return style; }\n\n // Tokenizers\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (tokenHooks[ch]) {\n var result = tokenHooks[ch](stream, state);\n if (result !== false) return result;\n }\n if (ch == \"@\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"def\", stream.current());\n } else if (ch == \"=\" || (ch == \"~\" || ch == \"|\") && stream.eat(\"=\")) {\n return ret(null, \"compare\");\n } else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \"#\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"atom\", \"hash\");\n } else if (ch == \"!\") {\n stream.match(/^\\s*\\w*/);\n return ret(\"keyword\", \"important\");\n } else if (/\\d/.test(ch) || ch == \".\" && stream.eat(/\\d/)) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (ch === \"-\") {\n if (/[\\d.]/.test(stream.peek())) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (stream.match(/^-[\\w\\\\\\-]+/)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return ret(\"variable-2\", \"variable-definition\");\n return ret(\"variable-2\", \"variable\");\n } else if (stream.match(/^\\w+-/)) {\n return ret(\"meta\", \"meta\");\n }\n } else if (/[,+>*\\/]/.test(ch)) {\n return ret(null, \"select-op\");\n } else if (ch == \".\" && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {\n return ret(\"qualifier\", \"qualifier\");\n } else if (/[:;{}\\[\\]\\(\\)]/.test(ch)) {\n return ret(null, ch);\n } else if ((ch == \"u\" && stream.match(/rl(-prefix)?\\(/)) ||\n (ch == \"d\" && stream.match(\"omain(\")) ||\n (ch == \"r\" && stream.match(\"egexp(\"))) {\n stream.backUp(1);\n state.tokenize = tokenParenthesized;\n return ret(\"property\", \"word\");\n } else if (/[\\w\\\\\\-]/.test(ch)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"property\", \"word\");\n } else {\n return ret(null, null);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n if (quote == \")\") stream.backUp(1);\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n if (ch == quote || !escaped && quote != \")\") state.tokenize = null;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenParenthesized(stream, state) {\n stream.next(); // Must be '('\n if (!stream.match(/\\s*[\\\"\\')]/, false))\n state.tokenize = tokenString(\")\");\n else\n state.tokenize = null;\n return ret(null, \"(\");\n }\n\n // Context management\n\n function Context(type, indent, prev) {\n this.type = type;\n this.indent = indent;\n this.prev = prev;\n }\n\n function pushContext(state, stream, type, indent) {\n state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);\n return type;\n }\n\n function popContext(state) {\n if (state.context.prev)\n state.context = state.context.prev;\n return state.context.type;\n }\n\n function pass(type, stream, state) {\n return states[state.context.type](type, stream, state);\n }\n function popAndPass(type, stream, state, n) {\n for (var i = n || 1; i > 0; i--)\n state.context = state.context.prev;\n return pass(type, stream, state);\n }\n\n // Parser\n\n function wordAsValue(stream) {\n var word = stream.current().toLowerCase();\n if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"variable\";\n }\n\n var states = {};\n\n states.top = function(type, stream, state) {\n if (type == \"{\") {\n return pushContext(state, stream, \"block\");\n } else if (type == \"}\" && state.context.prev) {\n return popContext(state);\n } else if (supportsAtComponent && /@component/.test(type)) {\n return pushContext(state, stream, \"atComponentBlock\");\n } else if (/^@(-moz-)?document$/.test(type)) {\n return pushContext(state, stream, \"documentTypes\");\n } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {\n return pushContext(state, stream, \"atBlock\");\n } else if (/^@(font-face|counter-style)/.test(type)) {\n state.stateArg = type;\n return \"restricted_atBlock_before\";\n } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {\n return \"keyframes\";\n } else if (type && type.charAt(0) == \"@\") {\n return pushContext(state, stream, \"at\");\n } else if (type == \"hash\") {\n override = \"builtin\";\n } else if (type == \"word\") {\n override = \"tag\";\n } else if (type == \"variable-definition\") {\n return \"maybeprop\";\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n } else if (type == \":\") {\n return \"pseudo\";\n } else if (allowNested && type == \"(\") {\n return pushContext(state, stream, \"parens\");\n }\n return state.context.type;\n };\n\n states.block = function(type, stream, state) {\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (propertyKeywords.hasOwnProperty(word)) {\n override = \"property\";\n return \"maybeprop\";\n } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {\n override = \"string-2\";\n return \"maybeprop\";\n } else if (allowNested) {\n override = stream.match(/^\\s*:(?:\\s|$)/, false) ? \"property\" : \"tag\";\n return \"block\";\n } else {\n override += \" error\";\n return \"maybeprop\";\n }\n } else if (type == \"meta\") {\n return \"block\";\n } else if (!allowNested && (type == \"hash\" || type == \"qualifier\")) {\n override = \"error\";\n return \"block\";\n } else {\n return states.top(type, stream, state);\n }\n };\n\n states.maybeprop = function(type, stream, state) {\n if (type == \":\") return pushContext(state, stream, \"prop\");\n return pass(type, stream, state);\n };\n\n states.prop = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" && allowNested) return pushContext(state, stream, \"propBlock\");\n if (type == \"}\" || type == \"{\") return popAndPass(type, stream, state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n\n if (type == \"hash\" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {\n override += \" error\";\n } else if (type == \"word\") {\n wordAsValue(stream);\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n }\n return \"prop\";\n };\n\n states.propBlock = function(type, _stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"word\") { override = \"property\"; return \"maybeprop\"; }\n return state.context.type;\n };\n\n states.parens = function(type, stream, state) {\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \")\") return popContext(state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n if (type == \"word\") wordAsValue(stream);\n return \"parens\";\n };\n\n states.pseudo = function(type, stream, state) {\n if (type == \"word\") {\n override = \"variable-3\";\n return state.context.type;\n }\n return pass(type, stream, state);\n };\n\n states.documentTypes = function(type, stream, state) {\n if (type == \"word\" && documentTypes.hasOwnProperty(stream.current())) {\n override = \"tag\";\n return state.context.type;\n } else {\n return states.atBlock(type, stream, state);\n }\n };\n\n states.atBlock = function(type, stream, state) {\n if (type == \"(\") return pushContext(state, stream, \"atBlock_parens\");\n if (type == \"}\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"{\") return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\");\n\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (word == \"only\" || word == \"not\" || word == \"and\" || word == \"or\")\n override = \"keyword\";\n else if (mediaTypes.hasOwnProperty(word))\n override = \"attribute\";\n else if (mediaFeatures.hasOwnProperty(word))\n override = \"property\";\n else if (mediaValueKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else if (propertyKeywords.hasOwnProperty(word))\n override = \"property\";\n else if (nonStandardPropertyKeywords.hasOwnProperty(word))\n override = \"string-2\";\n else if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"error\";\n }\n return state.context.type;\n };\n\n states.atComponentBlock = function(type, stream, state) {\n if (type == \"}\")\n return popAndPass(type, stream, state);\n if (type == \"{\")\n return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\", false);\n if (type == \"word\")\n override = \"error\";\n return state.context.type;\n };\n\n states.atBlock_parens = function(type, stream, state) {\n if (type == \")\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state, 2);\n return states.atBlock(type, stream, state);\n };\n\n states.restricted_atBlock_before = function(type, stream, state) {\n if (type == \"{\")\n return pushContext(state, stream, \"restricted_atBlock\");\n if (type == \"word\" && state.stateArg == \"@counter-style\") {\n override = \"variable\";\n return \"restricted_atBlock_before\";\n }\n return pass(type, stream, state);\n };\n\n states.restricted_atBlock = function(type, stream, state) {\n if (type == \"}\") {\n state.stateArg = null;\n return popContext(state);\n }\n if (type == \"word\") {\n if ((state.stateArg == \"@font-face\" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||\n (state.stateArg == \"@counter-style\" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))\n override = \"error\";\n else\n override = \"property\";\n return \"maybeprop\";\n }\n return \"restricted_atBlock\";\n };\n\n states.keyframes = function(type, stream, state) {\n if (type == \"word\") { override = \"variable\"; return \"keyframes\"; }\n if (type == \"{\") return pushContext(state, stream, \"top\");\n return pass(type, stream, state);\n };\n\n states.at = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"tag\";\n else if (type == \"hash\") override = \"builtin\";\n return \"at\";\n };\n\n states.interpolation = function(type, stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"{\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"variable\";\n else if (type != \"variable\" && type != \"(\" && type != \")\") override = \"error\";\n return \"interpolation\";\n };\n\n return {\n startState: function(base) {\n return {tokenize: null,\n state: inline ? \"block\" : \"top\",\n stateArg: null,\n context: new Context(inline ? \"block\" : \"top\", base || 0, null)};\n },\n\n token: function(stream, state) {\n if (!state.tokenize && stream.eatSpace()) return null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style && typeof style == \"object\") {\n type = style[1];\n style = style[0];\n }\n override = style;\n state.state = states[state.state](type, stream, state);\n return override;\n },\n\n indent: function(state, textAfter) {\n var cx = state.context, ch = textAfter && textAfter.charAt(0);\n var indent = cx.indent;\n if (cx.type == \"prop\" && (ch == \"}\" || ch == \")\")) cx = cx.prev;\n if (cx.prev) {\n if (ch == \"}\" && (cx.type == \"block\" || cx.type == \"top\" ||\n cx.type == \"interpolation\" || cx.type == \"restricted_atBlock\")) {\n // Resume indentation from parent context.\n cx = cx.prev;\n indent = cx.indent;\n } else if (ch == \")\" && (cx.type == \"parens\" || cx.type == \"atBlock_parens\") ||\n ch == \"{\" && (cx.type == \"at\" || cx.type == \"atBlock\")) {\n // Dedent relative to current context.\n indent = Math.max(0, cx.indent - indentUnit);\n cx = cx.prev;\n }\n }\n return indent;\n },\n\n electricChars: \"}\",\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n fold: \"brace\"\n };\n});\n\n function keySet(array) {\n var keys = {};\n for (var i = 0; i < array.length; ++i) {\n keys[array[i]] = true;\n }\n return keys;\n }\n\n var documentTypes_ = [\n \"domain\", \"regexp\", \"url\", \"url-prefix\"\n ], documentTypes = keySet(documentTypes_);\n\n var mediaTypes_ = [\n \"all\", \"aural\", \"braille\", \"handheld\", \"print\", \"projection\", \"screen\",\n \"tty\", \"tv\", \"embossed\"\n ], mediaTypes = keySet(mediaTypes_);\n\n var mediaFeatures_ = [\n \"width\", \"min-width\", \"max-width\", \"height\", \"min-height\", \"max-height\",\n \"device-width\", \"min-device-width\", \"max-device-width\", \"device-height\",\n \"min-device-height\", \"max-device-height\", \"aspect-ratio\",\n \"min-aspect-ratio\", \"max-aspect-ratio\", \"device-aspect-ratio\",\n \"min-device-aspect-ratio\", \"max-device-aspect-ratio\", \"color\", \"min-color\",\n \"max-color\", \"color-index\", \"min-color-index\", \"max-color-index\",\n \"monochrome\", \"min-monochrome\", \"max-monochrome\", \"resolution\",\n \"min-resolution\", \"max-resolution\", \"scan\", \"grid\", \"orientation\",\n \"device-pixel-ratio\", \"min-device-pixel-ratio\", \"max-device-pixel-ratio\",\n \"pointer\", \"any-pointer\", \"hover\", \"any-hover\"\n ], mediaFeatures = keySet(mediaFeatures_);\n\n var mediaValueKeywords_ = [\n \"landscape\", \"portrait\", \"none\", \"coarse\", \"fine\", \"on-demand\", \"hover\",\n \"interlace\", \"progressive\"\n ], mediaValueKeywords = keySet(mediaValueKeywords_);\n\n var propertyKeywords_ = [\n \"align-content\", \"align-items\", \"align-self\", \"alignment-adjust\",\n \"alignment-baseline\", \"anchor-point\", \"animation\", \"animation-delay\",\n \"animation-direction\", \"animation-duration\", \"animation-fill-mode\",\n \"animation-iteration-count\", \"animation-name\", \"animation-play-state\",\n \"animation-timing-function\", \"appearance\", \"azimuth\", \"backface-visibility\",\n \"background\", \"background-attachment\", \"background-blend-mode\", \"background-clip\",\n \"background-color\", \"background-image\", \"background-origin\", \"background-position\",\n \"background-repeat\", \"background-size\", \"baseline-shift\", \"binding\",\n \"bleed\", \"bookmark-label\", \"bookmark-level\", \"bookmark-state\",\n \"bookmark-target\", \"border\", \"border-bottom\", \"border-bottom-color\",\n \"border-bottom-left-radius\", \"border-bottom-right-radius\",\n \"border-bottom-style\", \"border-bottom-width\", \"border-collapse\",\n \"border-color\", \"border-image\", \"border-image-outset\",\n \"border-image-repeat\", \"border-image-slice\", \"border-image-source\",\n \"border-image-width\", \"border-left\", \"border-left-color\",\n \"border-left-style\", \"border-left-width\", \"border-radius\", \"border-right\",\n \"border-right-color\", \"border-right-style\", \"border-right-width\",\n \"border-spacing\", \"border-style\", \"border-top\", \"border-top-color\",\n \"border-top-left-radius\", \"border-top-right-radius\", \"border-top-style\",\n \"border-top-width\", \"border-width\", \"bottom\", \"box-decoration-break\",\n \"box-shadow\", \"box-sizing\", \"break-after\", \"break-before\", \"break-inside\",\n \"caption-side\", \"clear\", \"clip\", \"color\", \"color-profile\", \"column-count\",\n \"column-fill\", \"column-gap\", \"column-rule\", \"column-rule-color\",\n \"column-rule-style\", \"column-rule-width\", \"column-span\", \"column-width\",\n \"columns\", \"content\", \"counter-increment\", \"counter-reset\", \"crop\", \"cue\",\n \"cue-after\", \"cue-before\", \"cursor\", \"direction\", \"display\",\n \"dominant-baseline\", \"drop-initial-after-adjust\",\n \"drop-initial-after-align\", \"drop-initial-before-adjust\",\n \"drop-initial-before-align\", \"drop-initial-size\", \"drop-initial-value\",\n \"elevation\", \"empty-cells\", \"fit\", \"fit-position\", \"flex\", \"flex-basis\",\n \"flex-direction\", \"flex-flow\", \"flex-grow\", \"flex-shrink\", \"flex-wrap\",\n \"float\", \"float-offset\", \"flow-from\", \"flow-into\", \"font\", \"font-feature-settings\",\n \"font-family\", \"font-kerning\", \"font-language-override\", \"font-size\", \"font-size-adjust\",\n \"font-stretch\", \"font-style\", \"font-synthesis\", \"font-variant\",\n \"font-variant-alternates\", \"font-variant-caps\", \"font-variant-east-asian\",\n \"font-variant-ligatures\", \"font-variant-numeric\", \"font-variant-position\",\n \"font-weight\", \"grid\", \"grid-area\", \"grid-auto-columns\", \"grid-auto-flow\",\n \"grid-auto-rows\", \"grid-column\", \"grid-column-end\", \"grid-column-gap\",\n \"grid-column-start\", \"grid-gap\", \"grid-row\", \"grid-row-end\", \"grid-row-gap\",\n \"grid-row-start\", \"grid-template\", \"grid-template-areas\", \"grid-template-columns\",\n \"grid-template-rows\", \"hanging-punctuation\", \"height\", \"hyphens\",\n \"icon\", \"image-orientation\", \"image-rendering\", \"image-resolution\",\n \"inline-box-align\", \"justify-content\", \"left\", \"letter-spacing\",\n \"line-break\", \"line-height\", \"line-stacking\", \"line-stacking-ruby\",\n \"line-stacking-shift\", \"line-stacking-strategy\", \"list-style\",\n \"list-style-image\", \"list-style-position\", \"list-style-type\", \"margin\",\n \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\",\n \"marker-offset\", \"marks\", \"marquee-direction\", \"marquee-loop\",\n \"marquee-play-count\", \"marquee-speed\", \"marquee-style\", \"max-height\",\n \"max-width\", \"min-height\", \"min-width\", \"move-to\", \"nav-down\", \"nav-index\",\n \"nav-left\", \"nav-right\", \"nav-up\", \"object-fit\", \"object-position\",\n \"opacity\", \"order\", \"orphans\", \"outline\",\n \"outline-color\", \"outline-offset\", \"outline-style\", \"outline-width\",\n \"overflow\", \"overflow-style\", \"overflow-wrap\", \"overflow-x\", \"overflow-y\",\n \"padding\", \"padding-bottom\", \"padding-left\", \"padding-right\", \"padding-top\",\n \"page\", \"page-break-after\", \"page-break-before\", \"page-break-inside\",\n \"page-policy\", \"pause\", \"pause-after\", \"pause-before\", \"perspective\",\n \"perspective-origin\", \"pitch\", \"pitch-range\", \"play-during\", \"position\",\n \"presentation-level\", \"punctuation-trim\", \"quotes\", \"region-break-after\",\n \"region-break-before\", \"region-break-inside\", \"region-fragment\",\n \"rendering-intent\", \"resize\", \"rest\", \"rest-after\", \"rest-before\", \"richness\",\n \"right\", \"rotation\", \"rotation-point\", \"ruby-align\", \"ruby-overhang\",\n \"ruby-position\", \"ruby-span\", \"shape-image-threshold\", \"shape-inside\", \"shape-margin\",\n \"shape-outside\", \"size\", \"speak\", \"speak-as\", \"speak-header\",\n \"speak-numeral\", \"speak-punctuation\", \"speech-rate\", \"stress\", \"string-set\",\n \"tab-size\", \"table-layout\", \"target\", \"target-name\", \"target-new\",\n \"target-position\", \"text-align\", \"text-align-last\", \"text-decoration\",\n \"text-decoration-color\", \"text-decoration-line\", \"text-decoration-skip\",\n \"text-decoration-style\", \"text-emphasis\", \"text-emphasis-color\",\n \"text-emphasis-position\", \"text-emphasis-style\", \"text-height\",\n \"text-indent\", \"text-justify\", \"text-outline\", \"text-overflow\", \"text-shadow\",\n \"text-size-adjust\", \"text-space-collapse\", \"text-transform\", \"text-underline-position\",\n \"text-wrap\", \"top\", \"transform\", \"transform-origin\", \"transform-style\",\n \"transition\", \"transition-delay\", \"transition-duration\",\n \"transition-property\", \"transition-timing-function\", \"unicode-bidi\",\n \"vertical-align\", \"visibility\", \"voice-balance\", \"voice-duration\",\n \"voice-family\", \"voice-pitch\", \"voice-range\", \"voice-rate\", \"voice-stress\",\n \"voice-volume\", \"volume\", \"white-space\", \"widows\", \"width\", \"word-break\",\n \"word-spacing\", \"word-wrap\", \"z-index\",\n // SVG-specific\n \"clip-path\", \"clip-rule\", \"mask\", \"enable-background\", \"filter\", \"flood-color\",\n \"flood-opacity\", \"lighting-color\", \"stop-color\", \"stop-opacity\", \"pointer-events\",\n \"color-interpolation\", \"color-interpolation-filters\",\n \"color-rendering\", \"fill\", \"fill-opacity\", \"fill-rule\", \"image-rendering\",\n \"marker\", \"marker-end\", \"marker-mid\", \"marker-start\", \"shape-rendering\", \"stroke\",\n \"stroke-dasharray\", \"stroke-dashoffset\", \"stroke-linecap\", \"stroke-linejoin\",\n \"stroke-miterlimit\", \"stroke-opacity\", \"stroke-width\", \"text-rendering\",\n \"baseline-shift\", \"dominant-baseline\", \"glyph-orientation-horizontal\",\n \"glyph-orientation-vertical\", \"text-anchor\", \"writing-mode\"\n ], propertyKeywords = keySet(propertyKeywords_);\n\n var nonStandardPropertyKeywords_ = [\n \"scrollbar-arrow-color\", \"scrollbar-base-color\", \"scrollbar-dark-shadow-color\",\n \"scrollbar-face-color\", \"scrollbar-highlight-color\", \"scrollbar-shadow-color\",\n \"scrollbar-3d-light-color\", \"scrollbar-track-color\", \"shape-inside\",\n \"searchfield-cancel-button\", \"searchfield-decoration\", \"searchfield-results-button\",\n \"searchfield-results-decoration\", \"zoom\"\n ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);\n\n var fontProperties_ = [\n \"font-family\", \"src\", \"unicode-range\", \"font-variant\", \"font-feature-settings\",\n \"font-stretch\", \"font-weight\", \"font-style\"\n ], fontProperties = keySet(fontProperties_);\n\n var counterDescriptors_ = [\n \"additive-symbols\", \"fallback\", \"negative\", \"pad\", \"prefix\", \"range\",\n \"speak-as\", \"suffix\", \"symbols\", \"system\"\n ], counterDescriptors = keySet(counterDescriptors_);\n\n var colorKeywords_ = [\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n ], colorKeywords = keySet(colorKeywords_);\n\n var valueKeywords_ = [\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"afar\",\n \"after-white-space\", \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\",\n \"always\", \"amharic\", \"amharic-abegede\", \"antialiased\", \"appworkspace\",\n \"arabic-indic\", \"armenian\", \"asterisks\", \"attr\", \"auto\", \"avoid\", \"avoid-column\", \"avoid-page\",\n \"avoid-region\", \"background\", \"backwards\", \"baseline\", \"below\", \"bidi-override\", \"binary\",\n \"bengali\", \"blink\", \"block\", \"block-axis\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"bullets\", \"button\", \"button-bevel\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"cambodian\",\n \"capitalize\", \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\",\n \"cell\", \"center\", \"checkbox\", \"circle\", \"cjk-decimal\", \"cjk-earthly-branch\",\n \"cjk-heavenly-stem\", \"cjk-ideographic\", \"clear\", \"clip\", \"close-quote\",\n \"col-resize\", \"collapse\", \"color\", \"color-burn\", \"color-dodge\", \"column\", \"column-reverse\",\n \"compact\", \"condensed\", \"contain\", \"content\",\n \"content-box\", \"context-menu\", \"continuous\", \"copy\", \"counter\", \"counters\", \"cover\", \"crop\",\n \"cross\", \"crosshair\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\",\n \"destination-in\", \"destination-out\", \"destination-over\", \"devanagari\", \"difference\",\n \"disc\", \"discard\", \"disclosure-closed\", \"disclosure-open\", \"document\",\n \"dot-dash\", \"dot-dot-dash\",\n \"dotted\", \"double\", \"down\", \"e-resize\", \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\",\n \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\", \"ethiopic\", \"ethiopic-abegede\",\n \"ethiopic-abegede-am-et\", \"ethiopic-abegede-gez\", \"ethiopic-abegede-ti-er\",\n \"ethiopic-abegede-ti-et\", \"ethiopic-halehame-aa-er\",\n \"ethiopic-halehame-aa-et\", \"ethiopic-halehame-am-et\",\n \"ethiopic-halehame-gez\", \"ethiopic-halehame-om-et\",\n \"ethiopic-halehame-sid-et\", \"ethiopic-halehame-so-et\",\n \"ethiopic-halehame-ti-er\", \"ethiopic-halehame-ti-et\", \"ethiopic-halehame-tig\",\n \"ethiopic-numeric\", \"ew-resize\", \"exclusion\", \"expanded\", \"extends\", \"extra-condensed\",\n \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\",\n \"forwards\", \"from\", \"geometricPrecision\", \"georgian\", \"graytext\", \"grid\", \"groove\",\n \"gujarati\", \"gurmukhi\", \"hand\", \"hangul\", \"hangul-consonant\", \"hard-light\", \"hebrew\",\n \"help\", \"hidden\", \"hide\", \"higher\", \"highlight\", \"highlighttext\",\n \"hiragana\", \"hiragana-iroha\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\",\n \"infobackground\", \"infotext\", \"inherit\", \"initial\", \"inline\", \"inline-axis\",\n \"inline-block\", \"inline-flex\", \"inline-grid\", \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\",\n \"italic\", \"japanese-formal\", \"japanese-informal\", \"justify\", \"kannada\",\n \"katakana\", \"katakana-iroha\", \"keep-all\", \"khmer\",\n \"korean-hangul-formal\", \"korean-hanja-formal\", \"korean-hanja-informal\",\n \"landscape\", \"lao\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\",\n \"line-through\", \"linear\", \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\",\n \"local\", \"logical\", \"loud\", \"lower\", \"lower-alpha\", \"lower-armenian\",\n \"lower-greek\", \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\",\n \"lower-roman\", \"lowercase\", \"ltr\", \"luminosity\", \"malayalam\", \"match\", \"matrix\", \"matrix3d\",\n \"media-controls-background\", \"media-current-time-display\",\n \"media-fullscreen-button\", \"media-mute-button\", \"media-play-button\",\n \"media-return-to-realtime-button\", \"media-rewind-button\",\n \"media-seek-back-button\", \"media-seek-forward-button\", \"media-slider\",\n \"media-sliderthumb\", \"media-time-remaining-display\", \"media-volume-slider\",\n \"media-volume-slider-container\", \"media-volume-sliderthumb\", \"medium\",\n \"menu\", \"menulist\", \"menulist-button\", \"menulist-text\",\n \"menulist-textfield\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"mongolian\", \"monospace\", \"move\", \"multiple\", \"multiply\", \"myanmar\", \"n-resize\",\n \"narrower\", \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\",\n \"no-open-quote\", \"no-repeat\", \"none\", \"normal\", \"not-allowed\", \"nowrap\",\n \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\", \"oblique\", \"octal\", \"open-quote\",\n \"optimizeLegibility\", \"optimizeSpeed\", \"oriya\", \"oromo\", \"outset\",\n \"outside\", \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\",\n \"painted\", \"page\", \"paused\", \"persian\", \"perspective\", \"plus-darker\", \"plus-lighter\",\n \"pointer\", \"polygon\", \"portrait\", \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\",\n \"progress\", \"push-button\", \"radial-gradient\", \"radio\", \"read-only\",\n \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\",\n \"relative\", \"repeat\", \"repeating-linear-gradient\",\n \"repeating-radial-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\",\n \"rotateZ\", \"round\", \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\",\n \"s-resize\", \"sans-serif\", \"saturation\", \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\",\n \"scroll\", \"scrollbar\", \"se-resize\", \"searchfield\",\n \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\",\n \"semi-condensed\", \"semi-expanded\", \"separate\", \"serif\", \"show\", \"sidama\",\n \"simp-chinese-formal\", \"simp-chinese-informal\", \"single\",\n \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\",\n \"small\", \"small-caps\", \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"somali\",\n \"source-atop\", \"source-in\", \"source-out\", \"source-over\", \"space\", \"space-around\", \"space-between\", \"spell-out\", \"square\",\n \"square-button\", \"start\", \"static\", \"status-bar\", \"stretch\", \"stroke\", \"sub\",\n \"subpixel-antialiased\", \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"table\",\n \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\",\n \"table-footer-group\", \"table-header-group\", \"table-row\", \"table-row-group\",\n \"tamil\",\n \"telugu\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thai\",\n \"thick\", \"thin\", \"threeddarkshadow\", \"threedface\", \"threedhighlight\",\n \"threedlightshadow\", \"threedshadow\", \"tibetan\", \"tigre\", \"tigrinya-er\",\n \"tigrinya-er-abegede\", \"tigrinya-et\", \"tigrinya-et-abegede\", \"to\", \"top\",\n \"trad-chinese-formal\", \"trad-chinese-informal\",\n \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\",\n \"transparent\", \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"up\",\n \"upper-alpha\", \"upper-armenian\", \"upper-greek\", \"upper-hexadecimal\",\n \"upper-latin\", \"upper-norwegian\", \"upper-roman\", \"uppercase\", \"urdu\", \"url\",\n \"var\", \"vertical\", \"vertical-text\", \"visible\", \"visibleFill\", \"visiblePainted\",\n \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\",\n \"window\", \"windowframe\", \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\",\n \"xx-large\", \"xx-small\"\n ], valueKeywords = keySet(valueKeywords_);\n\n var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)\n .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)\n .concat(valueKeywords_);\n CodeMirror.registerHelper(\"hintWords\", \"css\", allWords);\n\n function tokenCComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (maybeEnd && ch == \"/\") {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return [\"comment\", \"comment\"];\n }\n\n CodeMirror.defineMIME(\"text/css\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\"\n });\n\n CodeMirror.defineMIME(\"text/x-scss\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \":\": function(stream) {\n if (stream.match(/\\s*\\{/))\n return [null, \"{\"];\n return false;\n },\n \"$\": function(stream) {\n stream.match(/^[\\w-]+/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"#\": function(stream) {\n if (!stream.eat(\"{\")) return false;\n return [null, \"interpolation\"];\n }\n },\n name: \"css\",\n helperType: \"scss\"\n });\n\n CodeMirror.defineMIME(\"text/x-less\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \"@\": function(stream) {\n if (stream.eat(\"{\")) return [null, \"interpolation\"];\n if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\\b/, false)) return false;\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"&\": function() {\n return [\"atom\", \"atom\"];\n }\n },\n name: \"css\",\n helperType: \"less\"\n });\n\n CodeMirror.defineMIME(\"text/x-gss\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n supportsAtComponent: true,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\",\n helperType: \"gss\"\n });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../htmlmixed/htmlmixed\"), require(\"../clike/clike\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../htmlmixed/htmlmixed\", \"../clike/clike\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function keywords(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n }\n\n // Helper for phpString\n function matchSequence(list, end, escapes) {\n if (list.length == 0) return phpString(end);\n return function (stream, state) {\n var patterns = list[0];\n for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) {\n state.tokenize = matchSequence(list.slice(1), end);\n return patterns[i][1];\n }\n state.tokenize = phpString(end, escapes);\n return \"string\";\n };\n }\n function phpString(closing, escapes) {\n return function(stream, state) { return phpString_(stream, state, closing, escapes); };\n }\n function phpString_(stream, state, closing, escapes) {\n // \"Complex\" syntax\n if (escapes !== false && stream.match(\"${\", false) || stream.match(\"{$\", false)) {\n state.tokenize = null;\n return \"string\";\n }\n\n // Simple syntax\n if (escapes !== false && stream.match(/^\\$[a-zA-Z_][a-zA-Z0-9_]*/)) {\n // After the variable name there may appear array or object operator.\n if (stream.match(\"[\", false)) {\n // Match array operator\n state.tokenize = matchSequence([\n [[\"[\", null]],\n [[/\\d[\\w\\.]*/, \"number\"],\n [/\\$[a-zA-Z_][a-zA-Z0-9_]*/, \"variable-2\"],\n [/[\\w\\$]+/, \"variable\"]],\n [[\"]\", null]]\n ], closing, escapes);\n }\n if (stream.match(/\\-\\>\\w/, false)) {\n // Match object operator\n state.tokenize = matchSequence([\n [[\"->\", null]],\n [[/[\\w]+/, \"variable\"]]\n ], closing, escapes);\n }\n return \"variable-2\";\n }\n\n var escaped = false;\n // Normal string\n while (!stream.eol() &&\n (escaped || escapes === false ||\n (!stream.match(\"{$\", false) &&\n !stream.match(/^(\\$[a-zA-Z_][a-zA-Z0-9_]*|\\$\\{)/, false)))) {\n if (!escaped && stream.match(closing)) {\n state.tokenize = null;\n state.tokStack.pop(); state.tokStack.pop();\n break;\n }\n escaped = stream.next() == \"\\\\\" && !escaped;\n }\n return \"string\";\n }\n\n var phpKeywords = \"abstract and array as break case catch class clone const continue declare default \" +\n \"do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final \" +\n \"for foreach function global goto if implements interface instanceof namespace \" +\n \"new or private protected public static switch throw trait try use var while xor \" +\n \"die echo empty exit eval include include_once isset list require require_once return \" +\n \"print unset __halt_compiler self static parent yield insteadof finally\";\n var phpAtoms = \"true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__\";\n var phpBuiltin = \"func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count\";\n CodeMirror.registerHelper(\"hintWords\", \"php\", [phpKeywords, phpAtoms, phpBuiltin].join(\" \").split(\" \"));\n CodeMirror.registerHelper(\"wordChars\", \"php\", /[\\w$]/);\n\n var phpConfig = {\n name: \"clike\",\n helperType: \"php\",\n keywords: keywords(phpKeywords),\n blockKeywords: keywords(\"catch do else elseif for foreach if switch try while finally\"),\n defKeywords: keywords(\"class function interface namespace trait\"),\n atoms: keywords(phpAtoms),\n builtin: keywords(phpBuiltin),\n multiLineStrings: true,\n hooks: {\n \"$\": function(stream) {\n stream.eatWhile(/[\\w\\$_]/);\n return \"variable-2\";\n },\n \"<\": function(stream, state) {\n var before;\n if (before = stream.match(/<<\\s*/)) {\n var quoted = stream.eat(/['\"]/);\n stream.eatWhile(/[\\w\\.]/);\n var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));\n if (quoted) stream.eat(quoted);\n if (delim) {\n (state.tokStack || (state.tokStack = [])).push(delim, 0);\n state.tokenize = phpString(delim, quoted != \"'\");\n return \"string\";\n }\n }\n return false;\n },\n \"#\": function(stream) {\n while (!stream.eol() && !stream.match(\"?>\", false)) stream.next();\n return \"comment\";\n },\n \"/\": function(stream) {\n if (stream.eat(\"/\")) {\n while (!stream.eol() && !stream.match(\"?>\", false)) stream.next();\n return \"comment\";\n }\n return false;\n },\n '\"': function(_stream, state) {\n (state.tokStack || (state.tokStack = [])).push('\"', 0);\n state.tokenize = phpString('\"');\n return \"string\";\n },\n \"{\": function(_stream, state) {\n if (state.tokStack && state.tokStack.length)\n state.tokStack[state.tokStack.length - 1]++;\n return false;\n },\n \"}\": function(_stream, state) {\n if (state.tokStack && state.tokStack.length > 0 &&\n !--state.tokStack[state.tokStack.length - 1]) {\n state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]);\n }\n return false;\n }\n }\n };\n\n CodeMirror.defineMode(\"php\", function(config, parserConfig) {\n var htmlMode = CodeMirror.getMode(config, \"text/html\");\n var phpMode = CodeMirror.getMode(config, phpConfig);\n\n function dispatch(stream, state) {\n var isPHP = state.curMode == phpMode;\n if (stream.sol() && state.pending && state.pending != '\"' && state.pending != \"'\") state.pending = null;\n if (!isPHP) {\n if (stream.match(/^<\\?\\w*/)) {\n state.curMode = phpMode;\n if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, \"\"))\n state.curState = state.php;\n return \"meta\";\n }\n if (state.pending == '\"' || state.pending == \"'\") {\n while (!stream.eol() && stream.next() != state.pending) {}\n var style = \"string\";\n } else if (state.pending && stream.pos < state.pending.end) {\n stream.pos = state.pending.end;\n var style = state.pending.style;\n } else {\n var style = htmlMode.token(stream, state.curState);\n }\n if (state.pending) state.pending = null;\n var cur = stream.current(), openPHP = cur.search(/<\\?/), m;\n if (openPHP != -1) {\n if (style == \"string\" && (m = cur.match(/[\\'\\\"]$/)) && !/\\?>/.test(cur)) state.pending = m[0];\n else state.pending = {end: stream.pos, style: style};\n stream.backUp(cur.length - openPHP);\n }\n return style;\n } else if (isPHP && state.php.tokenize == null && stream.match(\"?>\")) {\n state.curMode = htmlMode;\n state.curState = state.html;\n if (!state.php.context.prev) state.php = null;\n return \"meta\";\n } else {\n return phpMode.token(stream, state.curState);\n }\n }\n\n return {\n startState: function() {\n var html = CodeMirror.startState(htmlMode)\n var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null\n return {html: html,\n php: php,\n curMode: parserConfig.startOpen ? phpMode : htmlMode,\n curState: parserConfig.startOpen ? php : html,\n pending: null};\n },\n\n copyState: function(state) {\n var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html),\n php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur;\n if (state.curMode == htmlMode) cur = htmlNew;\n else cur = phpNew;\n return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur,\n pending: state.pending};\n },\n\n token: dispatch,\n\n indent: function(state, textAfter) {\n if ((state.curMode != phpMode && /^\\s*<\\//.test(textAfter)) ||\n (state.curMode == phpMode && /^\\?>/.test(textAfter)))\n return htmlMode.indent(state.html, textAfter);\n return state.curMode.indent(state.curState, textAfter);\n },\n\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n lineComment: \"//\",\n\n innerMode: function(state) { return {state: state.curState, mode: state.curMode}; }\n };\n }, \"htmlmixed\", \"clike\");\n\n CodeMirror.defineMIME(\"application/x-httpd-php\", \"php\");\n CodeMirror.defineMIME(\"application/x-httpd-php-open\", {name: \"php\", startOpen: true});\n CodeMirror.defineMIME(\"text/x-php\", phpConfig);\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"sql\", function(config, parserConfig) {\n \"use strict\";\n\n var client = parserConfig.client || {},\n atoms = parserConfig.atoms || {\"false\": true, \"true\": true, \"null\": true},\n builtin = parserConfig.builtin || {},\n keywords = parserConfig.keywords || {},\n operatorChars = parserConfig.operatorChars || /^[*+\\-%<>!=&|~^]/,\n support = parserConfig.support || {},\n hooks = parserConfig.hooks || {},\n dateSQL = parserConfig.dateSQL || {\"date\" : true, \"time\" : true, \"timestamp\" : true};\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n\n // call hooks from the mime type\n if (hooks[ch]) {\n var result = hooks[ch](stream, state);\n if (result !== false) return result;\n }\n\n if (support.hexNumber == true &&\n ((ch == \"0\" && stream.match(/^[xX][0-9a-fA-F]+/))\n || (ch == \"x\" || ch == \"X\") && stream.match(/^'[0-9a-fA-F]+'/))) {\n // hex\n // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html\n return \"number\";\n } else if (support.binaryNumber == true &&\n (((ch == \"b\" || ch == \"B\") && stream.match(/^'[01]+'/))\n || (ch == \"0\" && stream.match(/^b[01]+/)))) {\n // bitstring\n // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html\n return \"number\";\n } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) {\n // numbers\n // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html\n stream.match(/^[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?/);\n support.decimallessFloat == true && stream.eat('.');\n return \"number\";\n } else if (ch == \"?\" && (stream.eatSpace() || stream.eol() || stream.eat(\";\"))) {\n // placeholders\n return \"variable-3\";\n } else if (ch == \"'\" || (ch == '\"' && support.doubleQuote)) {\n // strings\n // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html\n state.tokenize = tokenLiteral(ch);\n return state.tokenize(stream, state);\n } else if ((((support.nCharCast == true && (ch == \"n\" || ch == \"N\"))\n || (support.charsetCast == true && ch == \"_\" && stream.match(/[a-z][a-z0-9]*/i)))\n && (stream.peek() == \"'\" || stream.peek() == '\"'))) {\n // charset casting: _utf8'str', N'str', n'str'\n // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html\n return \"keyword\";\n } else if (/^[\\(\\),\\;\\[\\]]/.test(ch)) {\n // no highlighting\n return null;\n } else if (support.commentSlashSlash && ch == \"/\" && stream.eat(\"/\")) {\n // 1-line comment\n stream.skipToEnd();\n return \"comment\";\n } else if ((support.commentHash && ch == \"#\")\n || (ch == \"-\" && stream.eat(\"-\") && (!support.commentSpaceRequired || stream.eat(\" \")))) {\n // 1-line comments\n // ref: https://kb.askmonty.org/en/comment-syntax/\n stream.skipToEnd();\n return \"comment\";\n } else if (ch == \"/\" && stream.eat(\"*\")) {\n // multi-line comments\n // ref: https://kb.askmonty.org/en/comment-syntax/\n state.tokenize = tokenComment;\n return state.tokenize(stream, state);\n } else if (ch == \".\") {\n // .1 for 0.1\n if (support.zerolessFloat == true && stream.match(/^(?:\\d+(?:e[+-]?\\d+)?)/i)) {\n return \"number\";\n }\n // .table_name (ODBC)\n // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html\n if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) {\n return \"variable-2\";\n }\n } else if (operatorChars.test(ch)) {\n // operators\n stream.eatWhile(operatorChars);\n return null;\n } else if (ch == '{' &&\n (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*\"[^\"]*\"( )*}/))) {\n // dates (weird ODBC syntax)\n // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html\n return \"number\";\n } else {\n stream.eatWhile(/^[_\\w\\d]/);\n var word = stream.current().toLowerCase();\n // dates (standard SQL syntax)\n // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html\n if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+\"[^\"]*\"/)))\n return \"number\";\n if (atoms.hasOwnProperty(word)) return \"atom\";\n if (builtin.hasOwnProperty(word)) return \"builtin\";\n if (keywords.hasOwnProperty(word)) return \"keyword\";\n if (client.hasOwnProperty(word)) return \"string-2\";\n return null;\n }\n }\n\n // 'string', with char specified in quote escaped by '\\'\n function tokenLiteral(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }\n function tokenComment(stream, state) {\n while (true) {\n if (stream.skipTo(\"*\")) {\n stream.next();\n if (stream.eat(\"/\")) {\n state.tokenize = tokenBase;\n break;\n }\n } else {\n stream.skipToEnd();\n break;\n }\n }\n return \"comment\";\n }\n\n function pushContext(stream, state, type) {\n state.context = {\n prev: state.context,\n indent: stream.indentation(),\n col: stream.column(),\n type: type\n };\n }\n\n function popContext(state) {\n state.indent = state.context.indent;\n state.context = state.context.prev;\n }\n\n return {\n startState: function() {\n return {tokenize: tokenBase, context: null};\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (state.context && state.context.align == null)\n state.context.align = false;\n }\n if (stream.eatSpace()) return null;\n\n var style = state.tokenize(stream, state);\n if (style == \"comment\") return style;\n\n if (state.context && state.context.align == null)\n state.context.align = true;\n\n var tok = stream.current();\n if (tok == \"(\")\n pushContext(stream, state, \")\");\n else if (tok == \"[\")\n pushContext(stream, state, \"]\");\n else if (state.context && state.context.type == tok)\n popContext(state);\n return style;\n },\n\n indent: function(state, textAfter) {\n var cx = state.context;\n if (!cx) return CodeMirror.Pass;\n var closing = textAfter.charAt(0) == cx.type;\n if (cx.align) return cx.col + (closing ? 0 : 1);\n else return cx.indent + (closing ? 0 : config.indentUnit);\n },\n\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n lineComment: support.commentSlashSlash ? \"//\" : support.commentHash ? \"#\" : null\n };\n});\n\n(function() {\n \"use strict\";\n\n // `identifier`\n function hookIdentifier(stream) {\n // MySQL/MariaDB identifiers\n // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"`\" && !stream.eat(\"`\")) return \"variable-2\";\n }\n stream.backUp(stream.current().length - 1);\n return stream.eatWhile(/\\w/) ? \"variable-2\" : null;\n }\n\n // variable token\n function hookVar(stream) {\n // variables\n // @@prefix.varName @varName\n // varName can be quoted with ` or ' or \"\n // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html\n if (stream.eat(\"@\")) {\n stream.match(/^session\\./);\n stream.match(/^local\\./);\n stream.match(/^global\\./);\n }\n\n if (stream.eat(\"'\")) {\n stream.match(/^.*'/);\n return \"variable-2\";\n } else if (stream.eat('\"')) {\n stream.match(/^.*\"/);\n return \"variable-2\";\n } else if (stream.eat(\"`\")) {\n stream.match(/^.*`/);\n return \"variable-2\";\n } else if (stream.match(/^[0-9a-zA-Z$\\.\\_]+/)) {\n return \"variable-2\";\n }\n return null;\n };\n\n // short client keyword token\n function hookClient(stream) {\n // \\N means NULL\n // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html\n if (stream.eat(\"N\")) {\n return \"atom\";\n }\n // \\g, etc\n // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html\n return stream.match(/^[a-zA-Z.#!?]/) ? \"variable-2\" : null;\n }\n\n // these keywords are used by all SQL dialects (however, a mode can still overwrite it)\n var sqlKeywords = \"alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit \";\n\n // turn a space-separated list into an array\n function set(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n }\n\n // A generic SQL Mode. It's not a standard, it just try to support what is generally supported\n CodeMirror.defineMIME(\"text/x-sql\", {\n name: \"sql\",\n keywords: set(sqlKeywords + \"begin\"),\n builtin: set(\"bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric\"),\n atoms: set(\"false true null unknown\"),\n operatorChars: /^[*+\\-%<>!=]/,\n dateSQL: set(\"date time timestamp\"),\n support: set(\"ODBCdotTable doubleQuote binaryNumber hexNumber\")\n });\n\n CodeMirror.defineMIME(\"text/x-mssql\", {\n name: \"sql\",\n client: set(\"charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee\"),\n keywords: set(sqlKeywords + \"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare\"),\n builtin: set(\"bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table \"),\n atoms: set(\"false true null unknown\"),\n operatorChars: /^[*+\\-%<>!=]/,\n dateSQL: set(\"date datetimeoffset datetime2 smalldatetime datetime time\"),\n hooks: {\n \"@\": hookVar\n }\n });\n\n CodeMirror.defineMIME(\"text/x-mysql\", {\n name: \"sql\",\n client: set(\"charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee\"),\n keywords: set(sqlKeywords + \"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat\"),\n builtin: set(\"bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric\"),\n atoms: set(\"false true null unknown\"),\n operatorChars: /^[*+\\-%<>!=&|^]/,\n dateSQL: set(\"date time timestamp\"),\n support: set(\"ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired\"),\n hooks: {\n \"@\": hookVar,\n \"`\": hookIdentifier,\n \"\\\\\": hookClient\n }\n });\n\n CodeMirror.defineMIME(\"text/x-mariadb\", {\n name: \"sql\",\n client: set(\"charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee\"),\n keywords: set(sqlKeywords + \"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat\"),\n builtin: set(\"bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric\"),\n atoms: set(\"false true null unknown\"),\n operatorChars: /^[*+\\-%<>!=&|^]/,\n dateSQL: set(\"date time timestamp\"),\n support: set(\"ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired\"),\n hooks: {\n \"@\": hookVar,\n \"`\": hookIdentifier,\n \"\\\\\": hookClient\n }\n });\n\n // the query language used by Apache Cassandra is called CQL, but this mime type\n // is called Cassandra to avoid confusion with Contextual Query Language\n CodeMirror.defineMIME(\"text/x-cassandra\", {\n name: \"sql\",\n client: { },\n keywords: set(\"add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime\"),\n builtin: set(\"ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint\"),\n atoms: set(\"false true infinity NaN\"),\n operatorChars: /^[<>=]/,\n dateSQL: { },\n support: set(\"commentSlashSlash decimallessFloat\"),\n hooks: { }\n });\n\n // this is based on Peter Raganitsch's 'plsql' mode\n CodeMirror.defineMIME(\"text/x-plsql\", {\n name: \"sql\",\n client: set(\"appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap\"),\n keywords: set(\"abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work\"),\n builtin: set(\"abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml\"),\n operatorChars: /^[*+\\-%<>!=~]/,\n dateSQL: set(\"date time timestamp\"),\n support: set(\"doubleQuote nCharCast zerolessFloat binaryNumber hexNumber\")\n });\n\n // Created to support specific hive keywords\n CodeMirror.defineMIME(\"text/x-hive\", {\n name: \"sql\",\n keywords: set(\"select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with\"),\n builtin: set(\"bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype\"),\n atoms: set(\"false true null unknown\"),\n operatorChars: /^[*+\\-%<>!=]/,\n dateSQL: set(\"date timestamp\"),\n support: set(\"ODBCdotTable doubleQuote binaryNumber hexNumber\")\n });\n\n CodeMirror.defineMIME(\"text/x-pgsql\", {\n name: \"sql\",\n client: set(\"source\"),\n // http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html\n keywords: set(sqlKeywords + \"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat\"),\n // http://www.postgresql.org/docs/9.5/static/datatype.html\n builtin: set(\"bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml\"),\n atoms: set(\"false true null unknown\"),\n operatorChars: /^[*+\\-%<>!=&|^\\/#@?~]/,\n dateSQL: set(\"date time timestamp\"),\n support: set(\"ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast\")\n });\n\n // Google's SQL-like query language, GQL\n CodeMirror.defineMIME(\"text/x-gql\", {\n name: \"sql\",\n keywords: set(\"ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where\"),\n atoms: set(\"false true\"),\n builtin: set(\"blob datetime first key __key__ string integer double boolean null\"),\n operatorChars: /^[*+\\-%<>!=]/\n });\n}());\n\n});\n\n/*\n How Properties of Mime Types are used by SQL Mode\n =================================================\n\n keywords:\n A list of keywords you want to be highlighted.\n builtin:\n A list of builtin types you want to be highlighted (if you want types to be of class \"builtin\" instead of \"keyword\").\n operatorChars:\n All characters that must be handled as operators.\n client:\n Commands parsed and executed by the client (not the server).\n support:\n A list of supported syntaxes which are not common, but are supported by more than 1 DBMS.\n * ODBCdotTable: .tableName\n * zerolessFloat: .1\n * doubleQuote\n * nCharCast: N'string'\n * charsetCast: _utf8'string'\n * commentHash: use # char for comments\n * commentSlashSlash: use // for comments\n * commentSpaceRequired: require a space after -- for comments\n atoms:\n Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others:\n UNKNOWN, INFINITY, UNDERFLOW, NaN...\n dateSQL:\n Used for date/time SQL standard syntax, because not all DBMS's support same temporal types.\n*/\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"ruby\", function(config) {\n function wordObj(words) {\n var o = {};\n for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;\n return o;\n }\n var keywords = wordObj([\n \"alias\", \"and\", \"BEGIN\", \"begin\", \"break\", \"case\", \"class\", \"def\", \"defined?\", \"do\", \"else\",\n \"elsif\", \"END\", \"end\", \"ensure\", \"false\", \"for\", \"if\", \"in\", \"module\", \"next\", \"not\", \"or\",\n \"redo\", \"rescue\", \"retry\", \"return\", \"self\", \"super\", \"then\", \"true\", \"undef\", \"unless\",\n \"until\", \"when\", \"while\", \"yield\", \"nil\", \"raise\", \"throw\", \"catch\", \"fail\", \"loop\", \"callcc\",\n \"caller\", \"lambda\", \"proc\", \"public\", \"protected\", \"private\", \"require\", \"load\",\n \"require_relative\", \"extend\", \"autoload\", \"__END__\", \"__FILE__\", \"__LINE__\", \"__dir__\"\n ]);\n var indentWords = wordObj([\"def\", \"class\", \"case\", \"for\", \"while\", \"until\", \"module\", \"then\",\n \"catch\", \"loop\", \"proc\", \"begin\"]);\n var dedentWords = wordObj([\"end\", \"until\"]);\n var matching = {\"[\": \"]\", \"{\": \"}\", \"(\": \")\"};\n var curPunc;\n\n function chain(newtok, stream, state) {\n state.tokenize.push(newtok);\n return newtok(stream, state);\n }\n\n function tokenBase(stream, state) {\n if (stream.sol() && stream.match(\"=begin\") && stream.eol()) {\n state.tokenize.push(readBlockComment);\n return \"comment\";\n }\n if (stream.eatSpace()) return null;\n var ch = stream.next(), m;\n if (ch == \"`\" || ch == \"'\" || ch == '\"') {\n return chain(readQuoted(ch, \"string\", ch == '\"' || ch == \"`\"), stream, state);\n } else if (ch == \"/\") {\n var currentIndex = stream.current().length;\n if (stream.skipTo(\"/\")) {\n var search_till = stream.current().length;\n stream.backUp(stream.current().length - currentIndex);\n var balance = 0; // balance brackets\n while (stream.current().length < search_till) {\n var chchr = stream.next();\n if (chchr == \"(\") balance += 1;\n else if (chchr == \")\") balance -= 1;\n if (balance < 0) break;\n }\n stream.backUp(stream.current().length - currentIndex);\n if (balance == 0)\n return chain(readQuoted(ch, \"string-2\", true), stream, state);\n }\n return \"operator\";\n } else if (ch == \"%\") {\n var style = \"string\", embed = true;\n if (stream.eat(\"s\")) style = \"atom\";\n else if (stream.eat(/[WQ]/)) style = \"string\";\n else if (stream.eat(/[r]/)) style = \"string-2\";\n else if (stream.eat(/[wxq]/)) { style = \"string\"; embed = false; }\n var delim = stream.eat(/[^\\w\\s=]/);\n if (!delim) return \"operator\";\n if (matching.propertyIsEnumerable(delim)) delim = matching[delim];\n return chain(readQuoted(delim, style, embed, true), stream, state);\n } else if (ch == \"#\") {\n stream.skipToEnd();\n return \"comment\";\n } else if (ch == \"<\" && (m = stream.match(/^<-?[\\`\\\"\\']?([a-zA-Z_?]\\w*)[\\`\\\"\\']?(?:;|$)/))) {\n return chain(readHereDoc(m[1]), stream, state);\n } else if (ch == \"0\") {\n if (stream.eat(\"x\")) stream.eatWhile(/[\\da-fA-F]/);\n else if (stream.eat(\"b\")) stream.eatWhile(/[01]/);\n else stream.eatWhile(/[0-7]/);\n return \"number\";\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:\\.[\\d_]+)?(?:[eE][+\\-]?[\\d_]+)?/);\n return \"number\";\n } else if (ch == \"?\") {\n while (stream.match(/^\\\\[CM]-/)) {}\n if (stream.eat(\"\\\\\")) stream.eatWhile(/\\w/);\n else stream.next();\n return \"string\";\n } else if (ch == \":\") {\n if (stream.eat(\"'\")) return chain(readQuoted(\"'\", \"atom\", false), stream, state);\n if (stream.eat('\"')) return chain(readQuoted('\"', \"atom\", true), stream, state);\n\n // :> :>> :< :<< are valid symbols\n if (stream.eat(/[\\<\\>]/)) {\n stream.eat(/[\\<\\>]/);\n return \"atom\";\n }\n\n // :+ :- :/ :* :| :& :! are valid symbols\n if (stream.eat(/[\\+\\-\\*\\/\\&\\|\\:\\!]/)) {\n return \"atom\";\n }\n\n // Symbols can't start by a digit\n if (stream.eat(/[a-zA-Z$@_\\xa1-\\uffff]/)) {\n stream.eatWhile(/[\\w$\\xa1-\\uffff]/);\n // Only one ? ! = is allowed and only as the last character\n stream.eat(/[\\?\\!\\=]/);\n return \"atom\";\n }\n return \"operator\";\n } else if (ch == \"@\" && stream.match(/^@?[a-zA-Z_\\xa1-\\uffff]/)) {\n stream.eat(\"@\");\n stream.eatWhile(/[\\w\\xa1-\\uffff]/);\n return \"variable-2\";\n } else if (ch == \"$\") {\n if (stream.eat(/[a-zA-Z_]/)) {\n stream.eatWhile(/[\\w]/);\n } else if (stream.eat(/\\d/)) {\n stream.eat(/\\d/);\n } else {\n stream.next(); // Must be a special global like $: or $!\n }\n return \"variable-3\";\n } else if (/[a-zA-Z_\\xa1-\\uffff]/.test(ch)) {\n stream.eatWhile(/[\\w\\xa1-\\uffff]/);\n stream.eat(/[\\?\\!]/);\n if (stream.eat(\":\")) return \"atom\";\n return \"ident\";\n } else if (ch == \"|\" && (state.varList || state.lastTok == \"{\" || state.lastTok == \"do\")) {\n curPunc = \"|\";\n return null;\n } else if (/[\\(\\)\\[\\]{}\\\\;]/.test(ch)) {\n curPunc = ch;\n return null;\n } else if (ch == \"-\" && stream.eat(\">\")) {\n return \"arrow\";\n } else if (/[=+\\-\\/*:\\.^%<>~|]/.test(ch)) {\n var more = stream.eatWhile(/[=+\\-\\/*:\\.^%<>~|]/);\n if (ch == \".\" && !more) curPunc = \".\";\n return \"operator\";\n } else {\n return null;\n }\n }\n\n function tokenBaseUntilBrace(depth) {\n if (!depth) depth = 1;\n return function(stream, state) {\n if (stream.peek() == \"}\") {\n if (depth == 1) {\n state.tokenize.pop();\n return state.tokenize[state.tokenize.length-1](stream, state);\n } else {\n state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1);\n }\n } else if (stream.peek() == \"{\") {\n state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1);\n }\n return tokenBase(stream, state);\n };\n }\n function tokenBaseOnce() {\n var alreadyCalled = false;\n return function(stream, state) {\n if (alreadyCalled) {\n state.tokenize.pop();\n return state.tokenize[state.tokenize.length-1](stream, state);\n }\n alreadyCalled = true;\n return tokenBase(stream, state);\n };\n }\n function readQuoted(quote, style, embed, unescaped) {\n return function(stream, state) {\n var escaped = false, ch;\n\n if (state.context.type === 'read-quoted-paused') {\n state.context = state.context.prev;\n stream.eat(\"}\");\n }\n\n while ((ch = stream.next()) != null) {\n if (ch == quote && (unescaped || !escaped)) {\n state.tokenize.pop();\n break;\n }\n if (embed && ch == \"#\" && !escaped) {\n if (stream.eat(\"{\")) {\n if (quote == \"}\") {\n state.context = {prev: state.context, type: 'read-quoted-paused'};\n }\n state.tokenize.push(tokenBaseUntilBrace());\n break;\n } else if (/[@\\$]/.test(stream.peek())) {\n state.tokenize.push(tokenBaseOnce());\n break;\n }\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return style;\n };\n }\n function readHereDoc(phrase) {\n return function(stream, state) {\n if (stream.match(phrase)) state.tokenize.pop();\n else stream.skipToEnd();\n return \"string\";\n };\n }\n function readBlockComment(stream, state) {\n if (stream.sol() && stream.match(\"=end\") && stream.eol())\n state.tokenize.pop();\n stream.skipToEnd();\n return \"comment\";\n }\n\n return {\n startState: function() {\n return {tokenize: [tokenBase],\n indented: 0,\n context: {type: \"top\", indented: -config.indentUnit},\n continuedLine: false,\n lastTok: null,\n varList: false};\n },\n\n token: function(stream, state) {\n curPunc = null;\n if (stream.sol()) state.indented = stream.indentation();\n var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;\n var thisTok = curPunc;\n if (style == \"ident\") {\n var word = stream.current();\n style = state.lastTok == \".\" ? \"property\"\n : keywords.propertyIsEnumerable(stream.current()) ? \"keyword\"\n : /^[A-Z]/.test(word) ? \"tag\"\n : (state.lastTok == \"def\" || state.lastTok == \"class\" || state.varList) ? \"def\"\n : \"variable\";\n if (style == \"keyword\") {\n thisTok = word;\n if (indentWords.propertyIsEnumerable(word)) kwtype = \"indent\";\n else if (dedentWords.propertyIsEnumerable(word)) kwtype = \"dedent\";\n else if ((word == \"if\" || word == \"unless\") && stream.column() == stream.indentation())\n kwtype = \"indent\";\n else if (word == \"do\" && state.context.indented < state.indented)\n kwtype = \"indent\";\n }\n }\n if (curPunc || (style && style != \"comment\")) state.lastTok = thisTok;\n if (curPunc == \"|\") state.varList = !state.varList;\n\n if (kwtype == \"indent\" || /[\\(\\[\\{]/.test(curPunc))\n state.context = {prev: state.context, type: curPunc || style, indented: state.indented};\n else if ((kwtype == \"dedent\" || /[\\)\\]\\}]/.test(curPunc)) && state.context.prev)\n state.context = state.context.prev;\n\n if (stream.eol())\n state.continuedLine = (curPunc == \"\\\\\" || style == \"operator\");\n return style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0);\n var ct = state.context;\n var closing = ct.type == matching[firstChar] ||\n ct.type == \"keyword\" && /^(?:end|until|else|elsif|when|rescue)\\b/.test(textAfter);\n return ct.indented + (closing ? 0 : config.indentUnit) +\n (state.continuedLine ? config.indentUnit : 0);\n },\n\n electricInput: /^\\s*(?:end|rescue|\\})$/,\n lineComment: \"#\"\n };\n});\n\nCodeMirror.defineMIME(\"text/x-ruby\", \"ruby\");\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, string) {\n var split = string.split(' ');\n for(var i = 0; i < split.length; i++) {\n words[split[i]] = style;\n }\n };\n\n // Atoms\n define('atom', 'true false');\n\n // Keywords\n define('keyword', 'if then do else elif while until for in esac fi fin ' +\n 'fil done exit set unset export function');\n\n // Commands\n define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' +\n 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' +\n 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' +\n 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' +\n 'touch vi vim wall wc wget who write yes zsh');\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var next, end = false, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === quote && !escaped) {\n end = true;\n break;\n }\n if (next === '$' && !escaped && quote !== '\\'') {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n if (end || !escaped) {\n state.tokens.shift();\n }\n return (quote === '`' || quote === ')' ? 'quote' : 'string');\n };\n };\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next(), hungry = /\\w/;\n if (ch === '{') hungry = /[^}]/;\n if (ch === '(') {\n state.tokens[0] = tokenString(')');\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) {\n stream.eatWhile(hungry);\n stream.eat('}');\n }\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"go\", function(config) {\n var indentUnit = config.indentUnit;\n\n var keywords = {\n \"break\":true, \"case\":true, \"chan\":true, \"const\":true, \"continue\":true,\n \"default\":true, \"defer\":true, \"else\":true, \"fallthrough\":true, \"for\":true,\n \"func\":true, \"go\":true, \"goto\":true, \"if\":true, \"import\":true,\n \"interface\":true, \"map\":true, \"package\":true, \"range\":true, \"return\":true,\n \"select\":true, \"struct\":true, \"switch\":true, \"type\":true, \"var\":true,\n \"bool\":true, \"byte\":true, \"complex64\":true, \"complex128\":true,\n \"float32\":true, \"float64\":true, \"int8\":true, \"int16\":true, \"int32\":true,\n \"int64\":true, \"string\":true, \"uint8\":true, \"uint16\":true, \"uint32\":true,\n \"uint64\":true, \"int\":true, \"uint\":true, \"uintptr\":true, \"error\": true\n };\n\n var atoms = {\n \"true\":true, \"false\":true, \"iota\":true, \"nil\":true, \"append\":true,\n \"cap\":true, \"close\":true, \"complex\":true, \"copy\":true, \"imag\":true,\n \"len\":true, \"make\":true, \"new\":true, \"panic\":true, \"print\":true,\n \"println\":true, \"real\":true, \"recover\":true\n };\n\n var isOperatorChar = /[+\\-*&^%:=<>!|\\/]/;\n\n var curPunc;\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\" || ch == \"`\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n if (/[\\d\\.]/.test(ch)) {\n if (ch == \".\") {\n stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n } else if (ch == \"0\") {\n stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n } else {\n stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n }\n return \"number\";\n }\n if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n curPunc = ch;\n return null;\n }\n if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n }\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n var cur = stream.current();\n if (keywords.propertyIsEnumerable(cur)) {\n if (cur == \"case\" || cur == \"default\") curPunc = \"case\";\n return \"keyword\";\n }\n if (atoms.propertyIsEnumerable(cur)) return \"atom\";\n return \"variable\";\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next, end = false;\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) {end = true; break;}\n escaped = !escaped && quote != \"`\" && next == \"\\\\\";\n }\n if (end || !(escaped || quote == \"`\"))\n state.tokenize = tokenBase;\n return \"string\";\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n }\n\n function Context(indented, column, type, align, prev) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.align = align;\n this.prev = prev;\n }\n function pushContext(state, col, type) {\n return state.context = new Context(state.indented, col, type, null, state.context);\n }\n function popContext(state) {\n if (!state.context.prev) return;\n var t = state.context.type;\n if (t == \")\" || t == \"]\" || t == \"}\")\n state.indented = state.context.indented;\n return state.context = state.context.prev;\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n return {\n tokenize: null,\n context: new Context((basecolumn || 0) - indentUnit, 0, \"top\", false),\n indented: 0,\n startOfLine: true\n };\n },\n\n token: function(stream, state) {\n var ctx = state.context;\n if (stream.sol()) {\n if (ctx.align == null) ctx.align = false;\n state.indented = stream.indentation();\n state.startOfLine = true;\n if (ctx.type == \"case\") ctx.type = \"}\";\n }\n if (stream.eatSpace()) return null;\n curPunc = null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style == \"comment\") return style;\n if (ctx.align == null) ctx.align = true;\n\n if (curPunc == \"{\") pushContext(state, stream.column(), \"}\");\n else if (curPunc == \"[\") pushContext(state, stream.column(), \"]\");\n else if (curPunc == \"(\") pushContext(state, stream.column(), \")\");\n else if (curPunc == \"case\") ctx.type = \"case\";\n else if (curPunc == \"}\" && ctx.type == \"}\") ctx = popContext(state);\n else if (curPunc == ctx.type) popContext(state);\n state.startOfLine = false;\n return style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase && state.tokenize != null) return 0;\n var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);\n if (ctx.type == \"case\" && /^(?:case|default)\\b/.test(textAfter)) {\n state.context.type = \"}\";\n return ctx.indented;\n }\n var closing = firstChar == ctx.type;\n if (ctx.align) return ctx.column + (closing ? 0 : 1);\n else return ctx.indented + (closing ? 0 : indentUnit);\n },\n\n electricChars: \"{}):\",\n fold: \"brace\",\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n lineComment: \"//\"\n };\n});\n\nCodeMirror.defineMIME(\"text/x-go\", \"go\");\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var singleDelimiters = parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]/;\n var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\\/\\/|\\*\\*)/;\n var doubleDelimiters = parserConf.doubleDelimiters || /^(\\+=|\\-=|\\*=|%=|\\/=|&=|\\|=|\\^=)/;\n var tripleDelimiters = parserConf.tripleDelimiters || /^(\\/\\/=|>>=|<<=|\\*\\*=)/;\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = parserConf.version && parseInt(parserConf.version, 10) == 3\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var singleOperators = parserConf.singleOperators || /^[\\+\\-\\*\\/%&|\\^~<>!@]/;\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var singleOperators = parserConf.singleOperators || /^[\\+\\-\\*\\/%&|\\^~<>!]/;\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rub]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n if (stream.sol()) state.indent = stream.indentation()\n // Handle scope changes\n if (stream.sol() && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state))\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n var ch = stream.peek();\n\n // Handle Comments\n if (ch == \"#\") {\n stream.skipToEnd();\n return \"comment\";\n }\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^\\d*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^\\d+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9]\\d*(e[\\+\\-]?\\d+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n state.tokenize = tokenStringFactory(stream.current());\n return state.tokenize(stream, state);\n }\n\n // Handle operators and Delimiters\n if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))\n return \"punctuation\";\n\n if (stream.match(doubleOperators) || stream.match(singleOperators))\n return \"operator\";\n\n if (stream.match(singleDelimiters))\n return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function tokenStringFactory(delimiter) {\n while (\"rub\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenBase;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenBase;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n var delimiter_index = current.length == 1 ? \"[({\".indexOf(current) : -1;\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except\"+\n \"extern gil include nogil property public\"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"yaml\", function() {\n\n var cons = ['true', 'false', 'on', 'off', 'yes', 'no'];\n var keywordRegex = new RegExp(\"\\\\b((\"+cons.join(\")|(\")+\"))$\", 'i');\n\n return {\n token: function(stream, state) {\n var ch = stream.peek();\n var esc = state.escaped;\n state.escaped = false;\n /* comments */\n if (ch == \"#\" && (stream.pos == 0 || /\\s/.test(stream.string.charAt(stream.pos - 1)))) {\n stream.skipToEnd();\n return \"comment\";\n }\n\n if (stream.match(/^('([^']|\\\\.)*'?|\"([^\"]|\\\\.)*\"?)/))\n return \"string\";\n\n if (state.literal && stream.indentation() > state.keyCol) {\n stream.skipToEnd(); return \"string\";\n } else if (state.literal) { state.literal = false; }\n if (stream.sol()) {\n state.keyCol = 0;\n state.pair = false;\n state.pairStart = false;\n /* document start */\n if(stream.match(/---/)) { return \"def\"; }\n /* document end */\n if (stream.match(/\\.\\.\\./)) { return \"def\"; }\n /* array list item */\n if (stream.match(/\\s*-\\s+/)) { return 'meta'; }\n }\n /* inline pairs/lists */\n if (stream.match(/^(\\{|\\}|\\[|\\])/)) {\n if (ch == '{')\n state.inlinePairs++;\n else if (ch == '}')\n state.inlinePairs--;\n else if (ch == '[')\n state.inlineList++;\n else\n state.inlineList--;\n return 'meta';\n }\n\n /* list seperator */\n if (state.inlineList > 0 && !esc && ch == ',') {\n stream.next();\n return 'meta';\n }\n /* pairs seperator */\n if (state.inlinePairs > 0 && !esc && ch == ',') {\n state.keyCol = 0;\n state.pair = false;\n state.pairStart = false;\n stream.next();\n return 'meta';\n }\n\n /* start of value of a pair */\n if (state.pairStart) {\n /* block literals */\n if (stream.match(/^\\s*(\\||\\>)\\s*/)) { state.literal = true; return 'meta'; };\n /* references */\n if (stream.match(/^\\s*(\\&|\\*)[a-z0-9\\._-]+\\b/i)) { return 'variable-2'; }\n /* numbers */\n if (state.inlinePairs == 0 && stream.match(/^\\s*-?[0-9\\.\\,]+\\s?$/)) { return 'number'; }\n if (state.inlinePairs > 0 && stream.match(/^\\s*-?[0-9\\.\\,]+\\s?(?=(,|}))/)) { return 'number'; }\n /* keywords */\n if (stream.match(keywordRegex)) { return 'keyword'; }\n }\n\n /* pairs (associative arrays) -> key */\n if (!state.pair && stream.match(/^\\s*(?:[,\\[\\]{}&*!|>'\"%@`][^\\s'\":]|[^,\\[\\]{}#&*!|>'\"%@`])[^#]*?(?=\\s*:($|\\s))/)) {\n state.pair = true;\n state.keyCol = stream.indentation();\n return \"atom\";\n }\n if (state.pair && stream.match(/^:\\s*/)) { state.pairStart = true; return 'meta'; }\n\n /* nothing found, continue */\n state.pairStart = false;\n state.escaped = (ch == '\\\\');\n stream.next();\n return null;\n },\n startState: function() {\n return {\n pair: false,\n pairStart: false,\n keyCol: 0,\n inlinePairs: 0,\n inlineList: 0,\n literal: false,\n escaped: false\n };\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/x-yaml\", \"yaml\");\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nfunction Context(indented, column, type, info, align, prev) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.info = info;\n this.align = align;\n this.prev = prev;\n}\nfunction pushContext(state, col, type, info) {\n var indent = state.indented;\n if (state.context && state.context.type != \"statement\" && type != \"statement\")\n indent = state.context.indented;\n return state.context = new Context(indent, col, type, info, null, state.context);\n}\nfunction popContext(state) {\n var t = state.context.type;\n if (t == \")\" || t == \"]\" || t == \"}\")\n state.indented = state.context.indented;\n return state.context = state.context.prev;\n}\n\nfunction typeBefore(stream, state, pos) {\n if (state.prevToken == \"variable\" || state.prevToken == \"variable-3\") return true;\n if (/\\S(?:[^- ]>|[*\\]])\\s*$|\\*$/.test(stream.string.slice(0, pos))) return true;\n if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;\n}\n\nfunction isTopScope(context) {\n for (;;) {\n if (!context || context.type == \"top\") return true;\n if (context.type == \"}\" && context.prev.info != \"namespace\") return false;\n context = context.prev;\n }\n}\n\nCodeMirror.defineMode(\"clike\", function(config, parserConfig) {\n var indentUnit = config.indentUnit,\n statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,\n dontAlignCalls = parserConfig.dontAlignCalls,\n keywords = parserConfig.keywords || {},\n types = parserConfig.types || {},\n builtin = parserConfig.builtin || {},\n blockKeywords = parserConfig.blockKeywords || {},\n defKeywords = parserConfig.defKeywords || {},\n atoms = parserConfig.atoms || {},\n hooks = parserConfig.hooks || {},\n multiLineStrings = parserConfig.multiLineStrings,\n indentStatements = parserConfig.indentStatements !== false,\n indentSwitch = parserConfig.indentSwitch !== false,\n namespaceSeparator = parserConfig.namespaceSeparator,\n isPunctuationChar = parserConfig.isPunctuationChar || /[\\[\\]{}\\(\\),;\\:\\.]/,\n numberStart = parserConfig.numberStart || /[\\d\\.]/,\n number = parserConfig.number || /^(?:0x[a-f\\d]+|0b[01]+|(?:\\d+\\.?\\d*|\\.\\d+)(?:e[-+]?\\d+)?)(u|ll?|l|f)?/i,\n isOperatorChar = parserConfig.isOperatorChar || /[+\\-*&%=<>!?|\\/]/,\n endStatement = parserConfig.endStatement || /^[;:,]$/;\n\n var curPunc, isDefKeyword;\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (hooks[ch]) {\n var result = hooks[ch](stream, state);\n if (result !== false) return result;\n }\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n }\n if (isPunctuationChar.test(ch)) {\n curPunc = ch;\n return null;\n }\n if (numberStart.test(ch)) {\n stream.backUp(1)\n if (stream.match(number)) return \"number\"\n stream.next()\n }\n if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n }\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n }\n if (isOperatorChar.test(ch)) {\n while (!stream.match(/^\\/[\\/*]/, false) && stream.eat(isOperatorChar)) {}\n return \"operator\";\n }\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n if (namespaceSeparator) while (stream.match(namespaceSeparator))\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n\n var cur = stream.current();\n if (contains(keywords, cur)) {\n if (contains(blockKeywords, cur)) curPunc = \"newstatement\";\n if (contains(defKeywords, cur)) isDefKeyword = true;\n return \"keyword\";\n }\n if (contains(types, cur)) return \"variable-3\";\n if (contains(builtin, cur)) {\n if (contains(blockKeywords, cur)) curPunc = \"newstatement\";\n return \"builtin\";\n }\n if (contains(atoms, cur)) return \"atom\";\n return \"variable\";\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next, end = false;\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) {end = true; break;}\n escaped = !escaped && next == \"\\\\\";\n }\n if (end || !(escaped || multiLineStrings))\n state.tokenize = null;\n return \"string\";\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n }\n\n function maybeEOL(stream, state) {\n if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))\n state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n return {\n tokenize: null,\n context: new Context((basecolumn || 0) - indentUnit, 0, \"top\", null, false),\n indented: 0,\n startOfLine: true,\n prevToken: null\n };\n },\n\n token: function(stream, state) {\n var ctx = state.context;\n if (stream.sol()) {\n if (ctx.align == null) ctx.align = false;\n state.indented = stream.indentation();\n state.startOfLine = true;\n }\n if (stream.eatSpace()) { maybeEOL(stream, state); return null; }\n curPunc = isDefKeyword = null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style == \"comment\" || style == \"meta\") return style;\n if (ctx.align == null) ctx.align = true;\n\n if (endStatement.test(curPunc)) while (state.context.type == \"statement\") popContext(state);\n else if (curPunc == \"{\") pushContext(state, stream.column(), \"}\");\n else if (curPunc == \"[\") pushContext(state, stream.column(), \"]\");\n else if (curPunc == \"(\") pushContext(state, stream.column(), \")\");\n else if (curPunc == \"}\") {\n while (ctx.type == \"statement\") ctx = popContext(state);\n if (ctx.type == \"}\") ctx = popContext(state);\n while (ctx.type == \"statement\") ctx = popContext(state);\n }\n else if (curPunc == ctx.type) popContext(state);\n else if (indentStatements &&\n (((ctx.type == \"}\" || ctx.type == \"top\") && curPunc != \";\") ||\n (ctx.type == \"statement\" && curPunc == \"newstatement\"))) {\n pushContext(state, stream.column(), \"statement\", stream.current());\n }\n\n if (style == \"variable\" &&\n ((state.prevToken == \"def\" ||\n (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&\n isTopScope(state.context) && stream.match(/^\\s*\\(/, false)))))\n style = \"def\";\n\n if (hooks.token) {\n var result = hooks.token(stream, state, style);\n if (result !== undefined) style = result;\n }\n\n if (style == \"def\" && parserConfig.styleDefs === false) style = \"variable\";\n\n state.startOfLine = false;\n state.prevToken = isDefKeyword ? \"def\" : style || curPunc;\n maybeEOL(stream, state);\n return style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;\n var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);\n if (ctx.type == \"statement\" && firstChar == \"}\") ctx = ctx.prev;\n if (parserConfig.dontIndentStatements)\n while (ctx.type == \"statement\" && parserConfig.dontIndentStatements.test(ctx.info))\n ctx = ctx.prev\n if (hooks.indent) {\n var hook = hooks.indent(state, ctx, textAfter);\n if (typeof hook == \"number\") return hook\n }\n var closing = firstChar == ctx.type;\n var switchBlock = ctx.prev && ctx.prev.info == \"switch\";\n if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {\n while (ctx.type != \"top\" && ctx.type != \"}\") ctx = ctx.prev\n return ctx.indented\n }\n if (ctx.type == \"statement\")\n return ctx.indented + (firstChar == \"{\" ? 0 : statementIndentUnit);\n if (ctx.align && (!dontAlignCalls || ctx.type != \")\"))\n return ctx.column + (closing ? 0 : 1);\n if (ctx.type == \")\" && !closing)\n return ctx.indented + statementIndentUnit;\n\n return ctx.indented + (closing ? 0 : indentUnit) +\n (!closing && switchBlock && !/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 0);\n },\n\n electricInput: indentSwitch ? /^\\s*(?:case .*?:|default:|\\{\\}?|\\})$/ : /^\\s*[{}]$/,\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n lineComment: \"//\",\n fold: \"brace\"\n };\n});\n\n function words(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n }\n function contains(words, word) {\n if (typeof words === \"function\") {\n return words(word);\n } else {\n return words.propertyIsEnumerable(word);\n }\n }\n var cKeywords = \"auto if break case register continue return default do sizeof \" +\n \"static else struct switch extern typedef union for goto while enum const volatile\";\n var cTypes = \"int long char short double float unsigned signed void size_t ptrdiff_t\";\n\n function cppHook(stream, state) {\n if (!state.startOfLine) return false\n for (var ch, next = null; ch = stream.peek();) {\n if (ch == \"\\\\\" && stream.match(/^.$/)) {\n next = cppHook\n break\n } else if (ch == \"/\" && stream.match(/^\\/[\\/\\*]/, false)) {\n break\n }\n stream.next()\n }\n state.tokenize = next\n return \"meta\"\n }\n\n function pointerHook(_stream, state) {\n if (state.prevToken == \"variable-3\") return \"variable-3\";\n return false;\n }\n\n function cpp14Literal(stream) {\n stream.eatWhile(/[\\w\\.']/);\n return \"number\";\n }\n\n function cpp11StringHook(stream, state) {\n stream.backUp(1);\n // Raw strings.\n if (stream.match(/(R|u8R|uR|UR|LR)/)) {\n var match = stream.match(/\"([^\\s\\\\()]{0,16})\\(/);\n if (!match) {\n return false;\n }\n state.cpp11RawStringDelim = match[1];\n state.tokenize = tokenRawString;\n return tokenRawString(stream, state);\n }\n // Unicode strings/chars.\n if (stream.match(/(u8|u|U|L)/)) {\n if (stream.match(/[\"']/, /* eat */ false)) {\n return \"string\";\n }\n return false;\n }\n // Ignore this hook.\n stream.next();\n return false;\n }\n\n function cppLooksLikeConstructor(word) {\n var lastTwo = /(\\w+)::(\\w+)$/.exec(word);\n return lastTwo && lastTwo[1] == lastTwo[2];\n }\n\n // C#-style strings where \"\" escapes a quote.\n function tokenAtString(stream, state) {\n var next;\n while ((next = stream.next()) != null) {\n if (next == '\"' && !stream.eat('\"')) {\n state.tokenize = null;\n break;\n }\n }\n return \"string\";\n }\n\n // C++11 raw string literal is <prefix>\"<delim>( anything )<delim>\", where\n // <delim> can be a string up to 16 characters long.\n function tokenRawString(stream, state) {\n // Escape characters that have special regex meanings.\n var delim = state.cpp11RawStringDelim.replace(/[^\\w\\s]/g, '\\\\$&');\n var match = stream.match(new RegExp(\".*?\\\\)\" + delim + '\"'));\n if (match)\n state.tokenize = null;\n else\n stream.skipToEnd();\n return \"string\";\n }\n\n function def(mimes, mode) {\n if (typeof mimes == \"string\") mimes = [mimes];\n var words = [];\n function add(obj) {\n if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))\n words.push(prop);\n }\n add(mode.keywords);\n add(mode.types);\n add(mode.builtin);\n add(mode.atoms);\n if (words.length) {\n mode.helperType = mimes[0];\n CodeMirror.registerHelper(\"hintWords\", mimes[0], words);\n }\n\n for (var i = 0; i < mimes.length; ++i)\n CodeMirror.defineMIME(mimes[i], mode);\n }\n\n def([\"text/x-csrc\", \"text/x-c\", \"text/x-chdr\"], {\n name: \"clike\",\n keywords: words(cKeywords),\n types: words(cTypes + \" bool _Complex _Bool float_t double_t intptr_t intmax_t \" +\n \"int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t \" +\n \"uint32_t uint64_t\"),\n blockKeywords: words(\"case do else for if switch while struct\"),\n defKeywords: words(\"struct\"),\n typeFirstDefinitions: true,\n atoms: words(\"null true false\"),\n hooks: {\"#\": cppHook, \"*\": pointerHook},\n modeProps: {fold: [\"brace\", \"include\"]}\n });\n\n def([\"text/x-c++src\", \"text/x-c++hdr\"], {\n name: \"clike\",\n keywords: words(cKeywords + \" asm dynamic_cast namespace reinterpret_cast try explicit new \" +\n \"static_cast typeid catch operator template typename class friend private \" +\n \"this using const_cast inline public throw virtual delete mutable protected \" +\n \"alignas alignof constexpr decltype nullptr noexcept thread_local final \" +\n \"static_assert override\"),\n types: words(cTypes + \" bool wchar_t\"),\n blockKeywords: words(\"catch class do else finally for if struct switch try while\"),\n defKeywords: words(\"class namespace struct enum union\"),\n typeFirstDefinitions: true,\n atoms: words(\"true false null\"),\n dontIndentStatements: /^template$/,\n hooks: {\n \"#\": cppHook,\n \"*\": pointerHook,\n \"u\": cpp11StringHook,\n \"U\": cpp11StringHook,\n \"L\": cpp11StringHook,\n \"R\": cpp11StringHook,\n \"0\": cpp14Literal,\n \"1\": cpp14Literal,\n \"2\": cpp14Literal,\n \"3\": cpp14Literal,\n \"4\": cpp14Literal,\n \"5\": cpp14Literal,\n \"6\": cpp14Literal,\n \"7\": cpp14Literal,\n \"8\": cpp14Literal,\n \"9\": cpp14Literal,\n token: function(stream, state, style) {\n if (style == \"variable\" && stream.peek() == \"(\" &&\n (state.prevToken == \";\" || state.prevToken == null ||\n state.prevToken == \"}\") &&\n cppLooksLikeConstructor(stream.current()))\n return \"def\";\n }\n },\n namespaceSeparator: \"::\",\n modeProps: {fold: [\"brace\", \"include\"]}\n });\n\n def(\"text/x-java\", {\n name: \"clike\",\n keywords: words(\"abstract assert break case catch class const continue default \" +\n \"do else enum extends final finally float for goto if implements import \" +\n \"instanceof interface native new package private protected public \" +\n \"return static strictfp super switch synchronized this throw throws transient \" +\n \"try volatile while\"),\n types: words(\"byte short int long float double boolean char void Boolean Byte Character Double Float \" +\n \"Integer Long Number Object Short String StringBuffer StringBuilder Void\"),\n blockKeywords: words(\"catch class do else finally for if switch try while\"),\n defKeywords: words(\"class interface package enum\"),\n typeFirstDefinitions: true,\n atoms: words(\"true false null\"),\n endStatement: /^[;:]$/,\n number: /^(?:0x[a-f\\d_]+|0b[01_]+|(?:[\\d_]+\\.?\\d*|\\.\\d+)(?:e[-+]?[\\d_]+)?)(u|ll?|l|f)?/i,\n hooks: {\n \"@\": function(stream) {\n stream.eatWhile(/[\\w\\$_]/);\n return \"meta\";\n }\n },\n modeProps: {fold: [\"brace\", \"import\"]}\n });\n\n def(\"text/x-csharp\", {\n name: \"clike\",\n keywords: words(\"abstract as async await base break case catch checked class const continue\" +\n \" default delegate do else enum event explicit extern finally fixed for\" +\n \" foreach goto if implicit in interface internal is lock namespace new\" +\n \" operator out override params private protected public readonly ref return sealed\" +\n \" sizeof stackalloc static struct switch this throw try typeof unchecked\" +\n \" unsafe using virtual void volatile while add alias ascending descending dynamic from get\" +\n \" global group into join let orderby partial remove select set value var yield\"),\n types: words(\"Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func\" +\n \" Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32\" +\n \" UInt64 bool byte char decimal double short int long object\" +\n \" sbyte float string ushort uint ulong\"),\n blockKeywords: words(\"catch class do else finally for foreach if struct switch try while\"),\n defKeywords: words(\"class interface namespace struct var\"),\n typeFirstDefinitions: true,\n atoms: words(\"true false null\"),\n hooks: {\n \"@\": function(stream, state) {\n if (stream.eat('\"')) {\n state.tokenize = tokenAtString;\n return tokenAtString(stream, state);\n }\n stream.eatWhile(/[\\w\\$_]/);\n return \"meta\";\n }\n }\n });\n\n function tokenTripleString(stream, state) {\n var escaped = false;\n while (!stream.eol()) {\n if (!escaped && stream.match('\"\"\"')) {\n state.tokenize = null;\n break;\n }\n escaped = stream.next() == \"\\\\\" && !escaped;\n }\n return \"string\";\n }\n\n def(\"text/x-scala\", {\n name: \"clike\",\n keywords: words(\n\n /* scala */\n \"abstract case catch class def do else extends final finally for forSome if \" +\n \"implicit import lazy match new null object override package private protected return \" +\n \"sealed super this throw trait try type val var while with yield _ : = => <- <: \" +\n \"<% >: # @ \" +\n\n /* package scala */\n \"assert assume require print println printf readLine readBoolean readByte readShort \" +\n \"readChar readInt readLong readFloat readDouble \" +\n\n \":: #:: \"\n ),\n types: words(\n \"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either \" +\n \"Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable \" +\n \"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering \" +\n \"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder \" +\n \"StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector \" +\n\n /* package java.lang */\n \"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable \" +\n \"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process \" +\n \"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String \" +\n \"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void\"\n ),\n multiLineStrings: true,\n blockKeywords: words(\"catch class do else finally for forSome if match switch try while\"),\n defKeywords: words(\"class def object package trait type val var\"),\n atoms: words(\"true false null\"),\n indentStatements: false,\n indentSwitch: false,\n hooks: {\n \"@\": function(stream) {\n stream.eatWhile(/[\\w\\$_]/);\n return \"meta\";\n },\n '\"': function(stream, state) {\n if (!stream.match('\"\"')) return false;\n state.tokenize = tokenTripleString;\n return state.tokenize(stream, state);\n },\n \"'\": function(stream) {\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n return \"atom\";\n },\n \"=\": function(stream, state) {\n var cx = state.context\n if (cx.type == \"}\" && cx.align && stream.eat(\">\")) {\n state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)\n return \"operator\"\n } else {\n return false\n }\n }\n },\n modeProps: {closeBrackets: {triples: '\"'}}\n });\n\n function tokenKotlinString(tripleString){\n return function (stream, state) {\n var escaped = false, next, end = false;\n while (!stream.eol()) {\n if (!tripleString && !escaped && stream.match('\"') ) {end = true; break;}\n if (tripleString && stream.match('\"\"\"')) {end = true; break;}\n next = stream.next();\n if(!escaped && next == \"$\" && stream.match('{'))\n stream.skipTo(\"}\");\n escaped = !escaped && next == \"\\\\\" && !tripleString;\n }\n if (end || !tripleString)\n state.tokenize = null;\n return \"string\";\n }\n }\n\n def(\"text/x-kotlin\", {\n name: \"clike\",\n keywords: words(\n /*keywords*/\n \"package as typealias class interface this super val \" +\n \"var fun for is in This throw return \" +\n \"break continue object if else while do try when !in !is as? \" +\n\n /*soft keywords*/\n \"file import where by get set abstract enum open inner override private public internal \" +\n \"protected catch finally out final vararg reified dynamic companion constructor init \" +\n \"sealed field property receiver param sparam lateinit data inline noinline tailrec \" +\n \"external annotation crossinline const operator infix\"\n ),\n types: words(\n /* package java.lang */\n \"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable \" +\n \"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process \" +\n \"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String \" +\n \"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void\"\n ),\n intendSwitch: false,\n indentStatements: false,\n multiLineStrings: true,\n blockKeywords: words(\"catch class do else finally for if where try while enum\"),\n defKeywords: words(\"class val var object package interface fun\"),\n atoms: words(\"true false null this\"),\n hooks: {\n '\"': function(stream, state) {\n state.tokenize = tokenKotlinString(stream.match('\"\"'));\n return state.tokenize(stream, state);\n }\n },\n modeProps: {closeBrackets: {triples: '\"'}}\n });\n\n def([\"x-shader/x-vertex\", \"x-shader/x-fragment\"], {\n name: \"clike\",\n keywords: words(\"sampler1D sampler2D sampler3D samplerCube \" +\n \"sampler1DShadow sampler2DShadow \" +\n \"const attribute uniform varying \" +\n \"break continue discard return \" +\n \"for while do if else struct \" +\n \"in out inout\"),\n types: words(\"float int bool void \" +\n \"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 \" +\n \"mat2 mat3 mat4\"),\n blockKeywords: words(\"for while do if else struct\"),\n builtin: words(\"radians degrees sin cos tan asin acos atan \" +\n \"pow exp log exp2 sqrt inversesqrt \" +\n \"abs sign floor ceil fract mod min max clamp mix step smoothstep \" +\n \"length distance dot cross normalize ftransform faceforward \" +\n \"reflect refract matrixCompMult \" +\n \"lessThan lessThanEqual greaterThan greaterThanEqual \" +\n \"equal notEqual any all not \" +\n \"texture1D texture1DProj texture1DLod texture1DProjLod \" +\n \"texture2D texture2DProj texture2DLod texture2DProjLod \" +\n \"texture3D texture3DProj texture3DLod texture3DProjLod \" +\n \"textureCube textureCubeLod \" +\n \"shadow1D shadow2D shadow1DProj shadow2DProj \" +\n \"shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod \" +\n \"dFdx dFdy fwidth \" +\n \"noise1 noise2 noise3 noise4\"),\n atoms: words(\"true false \" +\n \"gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex \" +\n \"gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 \" +\n \"gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 \" +\n \"gl_FogCoord gl_PointCoord \" +\n \"gl_Position gl_PointSize gl_ClipVertex \" +\n \"gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor \" +\n \"gl_TexCoord gl_FogFragCoord \" +\n \"gl_FragCoord gl_FrontFacing \" +\n \"gl_FragData gl_FragDepth \" +\n \"gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix \" +\n \"gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse \" +\n \"gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse \" +\n \"gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose \" +\n \"gl_ProjectionMatrixInverseTranspose \" +\n \"gl_ModelViewProjectionMatrixInverseTranspose \" +\n \"gl_TextureMatrixInverseTranspose \" +\n \"gl_NormalScale gl_DepthRange gl_ClipPlane \" +\n \"gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel \" +\n \"gl_FrontLightModelProduct gl_BackLightModelProduct \" +\n \"gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ \" +\n \"gl_FogParameters \" +\n \"gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords \" +\n \"gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats \" +\n \"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits \" +\n \"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits \" +\n \"gl_MaxDrawBuffers\"),\n indentSwitch: false,\n hooks: {\"#\": cppHook},\n modeProps: {fold: [\"brace\", \"include\"]}\n });\n\n def(\"text/x-nesc\", {\n name: \"clike\",\n keywords: words(cKeywords + \"as atomic async call command component components configuration event generic \" +\n \"implementation includes interface module new norace nx_struct nx_union post provides \" +\n \"signal task uses abstract extends\"),\n types: words(cTypes),\n blockKeywords: words(\"case do else for if switch while struct\"),\n atoms: words(\"null true false\"),\n hooks: {\"#\": cppHook},\n modeProps: {fold: [\"brace\", \"include\"]}\n });\n\n def(\"text/x-objectivec\", {\n name: \"clike\",\n keywords: words(cKeywords + \"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in \" +\n \"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly\"),\n types: words(cTypes),\n atoms: words(\"YES NO NULL NILL ON OFF true false\"),\n hooks: {\n \"@\": function(stream) {\n stream.eatWhile(/[\\w\\$]/);\n return \"keyword\";\n },\n \"#\": cppHook,\n indent: function(_state, ctx, textAfter) {\n if (ctx.type == \"statement\" && /^@\\w/.test(textAfter)) return ctx.indented\n }\n },\n modeProps: {fold: \"brace\"}\n });\n\n def(\"text/x-squirrel\", {\n name: \"clike\",\n keywords: words(\"base break clone continue const default delete enum extends function in class\" +\n \" foreach local resume return this throw typeof yield constructor instanceof static\"),\n types: words(cTypes),\n blockKeywords: words(\"case catch class else for foreach if switch try while\"),\n defKeywords: words(\"function local class\"),\n typeFirstDefinitions: true,\n atoms: words(\"true false null\"),\n hooks: {\"#\": cppHook},\n modeProps: {fold: [\"brace\", \"include\"]}\n });\n\n // Ceylon Strings need to deal with interpolation\n var stringTokenizer = null;\n function tokenCeylonString(type) {\n return function(stream, state) {\n var escaped = false, next, end = false;\n while (!stream.eol()) {\n if (!escaped && stream.match('\"') &&\n (type == \"single\" || stream.match('\"\"'))) {\n end = true;\n break;\n }\n if (!escaped && stream.match('``')) {\n stringTokenizer = tokenCeylonString(type);\n end = true;\n break;\n }\n next = stream.next();\n escaped = type == \"single\" && !escaped && next == \"\\\\\";\n }\n if (end)\n state.tokenize = null;\n return \"string\";\n }\n }\n\n def(\"text/x-ceylon\", {\n name: \"clike\",\n keywords: words(\"abstracts alias assembly assert assign break case catch class continue dynamic else\" +\n \" exists extends finally for function given if import in interface is let module new\" +\n \" nonempty object of out outer package return satisfies super switch then this throw\" +\n \" try value void while\"),\n types: function(word) {\n // In Ceylon all identifiers that start with an uppercase are types\n var first = word.charAt(0);\n return (first === first.toUpperCase() && first !== first.toLowerCase());\n },\n blockKeywords: words(\"case catch class dynamic else finally for function if interface module new object switch try while\"),\n defKeywords: words(\"class dynamic function interface module object package value\"),\n builtin: words(\"abstract actual aliased annotation by default deprecated doc final formal late license\" +\n \" native optional sealed see serializable shared suppressWarnings tagged throws variable\"),\n isPunctuationChar: /[\\[\\]{}\\(\\),;\\:\\.`]/,\n isOperatorChar: /[+\\-*&%=<>!?|^~:\\/]/,\n numberStart: /[\\d#$]/,\n number: /^(?:#[\\da-fA-F_]+|\\$[01_]+|[\\d_]+[kMGTPmunpf]?|[\\d_]+\\.[\\d_]+(?:[eE][-+]?\\d+|[kMGTPmunpf]|)|)/i,\n multiLineStrings: true,\n typeFirstDefinitions: true,\n atoms: words(\"true false null larger smaller equal empty finished\"),\n indentSwitch: false,\n styleDefs: false,\n hooks: {\n \"@\": function(stream) {\n stream.eatWhile(/[\\w\\$_]/);\n return \"meta\";\n },\n '\"': function(stream, state) {\n state.tokenize = tokenCeylonString(stream.match('\"\"') ? \"triple\" : \"single\");\n return state.tokenize(stream, state);\n },\n '`': function(stream, state) {\n if (!stringTokenizer || !stream.match('`')) return false;\n state.tokenize = stringTokenizer;\n stringTokenizer = null;\n return state.tokenize(stream, state);\n },\n \"'\": function(stream) {\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n return \"atom\";\n },\n token: function(_stream, state, style) {\n if ((style == \"variable\" || style == \"variable-3\") &&\n state.prevToken == \".\") {\n return \"variable-2\";\n }\n }\n },\n modeProps: {\n fold: [\"brace\", \"import\"],\n closeBrackets: {triples: '\"'}\n }\n });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\"};\n\n function findMatchingBracket(cm, where, strict, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\\]]/;\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {\n var match = matching[ch];\n if ((match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);\n if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textare whever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n var currentlyHighlighted = null;\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}\n currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init)\n cm.off(\"cursorActivity\", doMatchBrackets);\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, strict, config){\n return findMatchingBracket(this, pos, strict, config);\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n };\n }\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /<!\\[CDATA\\[/.test(textAfter)) return 0;\n var tagAfter = textAfter && /^<(\\/)?([\\w_:\\.-]*)/.exec(textAfter);\n if (tagAfter && tagAfter[1]) { // Closing tag spotted\n while (context) {\n if (context.tagName == tagAfter[2]) {\n context = context.prev;\n break;\n } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {\n context = context.prev;\n } else {\n break;\n }\n }\n } else if (tagAfter) { // Opening tag spotted\n while (context) {\n var grabbers = config.contextGrabbers[context.tagName];\n if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))\n context = context.prev;\n else\n break;\n }\n }\n while (context && context.prev && !context.startOfLine)\n context = context.prev;\n if (context) return context.indent + indentUnit;\n else return state.baseIndent || 0;\n },\n\n electricInput: /<\\/[\\s\\w:]+>$/,\n blockCommentStart: \"<!--\",\n blockCommentEnd: \"-->\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n"]}
|